From 015bf5947686f61426e9b27632c0e7f88994cc7b Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 31 Mar 2002 00:11:13 +0000 Subject: [PATCH] Make ddb symbol loading work for ELF as well a.out. --- sys/arch/vax/boot/common/srt0.S | 4 ++-- sys/arch/vax/include/loadfile_machdep.h | 6 +++--- sys/arch/vax/vax/machdep.c | 18 +++++++----------- sys/arch/vax/vax/subr.S | 6 +++--- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/sys/arch/vax/boot/common/srt0.S b/sys/arch/vax/boot/common/srt0.S index 359f0d1b7ce4..523bdf2381d0 100644 --- a/sys/arch/vax/boot/common/srt0.S +++ b/sys/arch/vax/boot/common/srt0.S @@ -1,4 +1,4 @@ -/* $NetBSD: srt0.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */ +/* $NetBSD: srt0.S,v 1.2 2002/03/31 00:11:14 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -73,7 +73,7 @@ ENTRY(machdep_start, 0) movl 4(%ap), %r6 movl 20(%ap), %r9 # end of symbol table pushl 8(%ap) # number of symbols - pushl 12(%ap) # start of symbols + pushl 16(%ap) # start of symbols movab _C_LABEL(bootrpb),%r10 # get RPB address pushl %r10 # argument for new boot ashl $9,76(%r10),%r8 # memory size (COMPAT) diff --git a/sys/arch/vax/include/loadfile_machdep.h b/sys/arch/vax/include/loadfile_machdep.h index 7f0e65180448..d47482261ef7 100644 --- a/sys/arch/vax/include/loadfile_machdep.h +++ b/sys/arch/vax/include/loadfile_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: loadfile_machdep.h,v 1.3 2001/10/31 17:20:49 thorpej Exp $ */ +/* $NetBSD: loadfile_machdep.h,v 1.4 2002/03/31 00:11:13 matt Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -42,8 +42,8 @@ #define BOOT_AOUT #define BOOT_ELF32 -#define LOAD_KERNEL (LOAD_ALL & ~(LOAD_HDR|LOAD_TEXTA)) -#define COUNT_KERNEL (COUNT_ALL & ~(COUNT_HDR|COUNT_TEXTA)) +#define LOAD_KERNEL LOAD_ALL +#define COUNT_KERNEL COUNT_ALL #define LOADADDR(a) (((u_long)(a)) + offset) #define ALIGNENTRY(a) ((u_long)(a) & ~0xffffff) diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 7d9047397f0f..93814b45b4cb 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.122 2002/03/06 13:10:25 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.123 2002/03/31 00:11:13 matt Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -300,18 +300,14 @@ consinit() iospace_inited = 1; #endif cninit(); -#if defined(DDB) && !defined(__ELF__) - { +#if defined(DDB) + if (symtab_start != NULL && symtab_nsyms != 0 && symtab_end != NULL) { + ddb_init(symtab_nsyms, symtab_start, symtab_end); #ifndef __ELF__ + } else { extern int end; /* Contains pointer to symsize also */ -#endif - if (symtab_start != NULL) - ddb_init(symtab_nsyms, symtab_start, symtab_end); -#ifndef __ELF__ - else { - extern paddr_t esym; - ddb_init(*(int *)&end, ((int *)&end) + 1, (void *)esym); - } + extern paddr_t esym; + ddb_init(*(int *)&end, ((int *)&end) + 1, (void *)esym); #endif } #ifdef DEBUG diff --git a/sys/arch/vax/vax/subr.S b/sys/arch/vax/vax/subr.S index 5c04cdd70134..12137d347b19 100644 --- a/sys/arch/vax/vax/subr.S +++ b/sys/arch/vax/vax/subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: subr.S,v 1.2 2002/02/24 01:04:27 matt Exp $ */ +/* $NetBSD: subr.S,v 1.3 2002/03/31 00:11:13 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -109,12 +109,12 @@ ASENTRY(start, 0) pushl $to # Address to jump to rei # change to kernel stack to: movw $0xfff,_C_LABEL(panic) # Save all regs in panic - cmpb (%ap),$4 # symbols info present? + cmpb (%ap),$3 # symbols info present? blssu 3f # nope, skip bisl3 $0x80000000,8(%ap),_C_LABEL(symtab_start) # save start of symtab movl 12(%ap),_C_LABEL(symtab_nsyms) # save number of symtab - bisl3 $0x80000000,16(%ap),_C_LABEL(symtab_end) + bisl3 $0x80000000,%r9,_C_LABEL(symtab_end) # save end of symtab 3: addl3 _C_LABEL(esym),$0x3ff,%r0 # Round symbol table end bicl3 $0x3ff,%r0,_C_LABEL(proc0paddr) # save proc0 uarea pointer