tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ksyms_init considered too heavyweight for early bootstrap



Ok, after more off-list feedback, here is a most intrusive variant that:

 - makes sure we only have a single function called "init"
 - initializes the mutex in main w/o exposing it and independend
   of adding a symbol table
 - is not in danger of having people add more functions but forgetting
   the RUN_ONCE() dance
 - adapts all archs to the renamed functions, removing the now unecessary
   NULL calls to what used to be ksyms_init()

Haven't even compile tested most of this; we need to at least test one arch
that is affected by the NULL-init removals before this could be commited
[I'll try to check on my dreamcast this weekend].

Comments?

Martin
Index: arch/acorn26/acorn26/cons_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn26/acorn26/cons_machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 cons_machdep.c
--- arch/acorn26/acorn26/cons_machdep.c 12 Nov 2008 12:35:54 -0000      1.8
+++ arch/acorn26/acorn26/cons_machdep.c 21 Nov 2008 00:40:13 -0000
@@ -67,7 +67,7 @@ consinit()
        db_machine_init();
 #endif /* DDB */
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(bootconfig.esym - bootconfig.ssym,
+       ksyms_addsyms_elf(bootconfig.esym - bootconfig.ssym,
                 (char*)MEMC_PHYS_BASE + bootconfig.ssym,
                 (char*)MEMC_PHYS_BASE + bootconfig.esym);
 #endif
Index: arch/acorn32/acorn32/rpc_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/acorn32/rpc_machdep.c,v
retrieving revision 1.73
diff -u -p -r1.73 rpc_machdep.c
--- arch/acorn32/acorn32/rpc_machdep.c  12 Nov 2008 12:35:55 -0000      1.73
+++ arch/acorn32/acorn32/rpc_machdep.c  21 Nov 2008 00:40:13 -0000
@@ -1044,7 +1044,7 @@ initarm(void *cookie)
 #endif /* CPU_SA110 */
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(bootconfig.ksym_end - bootconfig.ksym_start,
+       ksyms_addsyms_elf(bootconfig.ksym_end - bootconfig.ksym_start,
                (void *) bootconfig.ksym_start, (void *) bootconfig.ksym_end);
 #endif
 
Index: arch/acorn32/eb7500atx/eb7500atx_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c,v
retrieving revision 1.11
diff -u -p -r1.11 eb7500atx_machdep.c
--- arch/acorn32/eb7500atx/eb7500atx_machdep.c  12 Nov 2008 12:35:55 -0000      
1.11
+++ arch/acorn32/eb7500atx/eb7500atx_machdep.c  21 Nov 2008 00:40:14 -0000
@@ -957,7 +957,7 @@ initarm(void *cookie)
            bootconfig.vram[0].pages * bootconfig.pagesize);
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(bootconfig.ksym_end - bootconfig.ksym_start,
+       ksyms_addsyms_elf(bootconfig.ksym_end - bootconfig.ksym_start,
                (void *) bootconfig.ksym_start, (void *) bootconfig.ksym_end);
 #endif
 
Index: arch/algor/algor/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/algor/algor/machdep.c,v
retrieving revision 1.40
diff -u -p -r1.40 machdep.c
--- arch/algor/algor/machdep.c  12 Nov 2008 12:35:55 -0000      1.40
+++ arch/algor/algor/machdep.c  21 Nov 2008 00:40:14 -0000
@@ -574,14 +574,6 @@ mach_init(int argc, char *argv[], char *
        /*
         * Initialize debuggers, and break into them, if appropriate.
         */
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /*
-        * XXX Loader doesn't give us symbols the way we like.  Need
-        * XXX dbsym(1) support for ELF.
-        */
-       ksyms_init(0, 0, 0);
-#endif
-
        if (boothowto & RB_KDB) {
 #if defined(DDB)
                Debugger();
Index: arch/alpha/alpha/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/machdep.c,v
retrieving revision 1.310
diff -u -p -r1.310 machdep.c
--- arch/alpha/alpha/machdep.c  19 Nov 2008 18:35:57 -0000      1.310
+++ arch/alpha/alpha/machdep.c  21 Nov 2008 00:40:14 -0000
@@ -767,7 +767,7 @@ nobootinfo:
         * Initialize debuggers, and break into them if appropriate.
         */
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int64_t)ksym_end - (u_int64_t)ksym_start),
+       ksyms_addsyms_elf((int)((u_int64_t)ksym_end - (u_int64_t)ksym_start),
            ksym_start, ksym_end);
 #endif
 
Index: arch/amd64/amd64/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/machdep.c,v
retrieving revision 1.112
diff -u -p -r1.112 machdep.c
--- arch/amd64/amd64/machdep.c  19 Nov 2008 18:35:58 -0000      1.112
+++ arch/amd64/amd64/machdep.c  21 Nov 2008 00:40:14 -0000
@@ -1220,15 +1220,15 @@ init_x86_64_ksyms(void)
        if (symtab) {
                tssym = (vaddr_t)symtab->ssym + KERNBASE;
                tesym = (vaddr_t)symtab->esym + KERNBASE;
-               ksyms_init(symtab->nsym, (void *)tssym, (void *)tesym);
+               ksyms_addsyms_elf(symtab->nsym, (void *)tssym, (void *)tesym);
        } else
-               ksyms_init(*(long *)(void *)&end,
+               ksyms_addsyms_elf(*(long *)(void *)&end,
                    ((long *)(void *)&end) + 1, esym);
 #else  /* XEN */
        esym = xen_start_info.mod_start ?
            (void *)xen_start_info.mod_start :
            (void *)xen_start_info.mfn_list;
-       ksyms_init(*(int *)(void *)&end,
+       ksyms_addsyms_elf(*(int *)(void *)&end,
            ((int *)(void *)&end) + 1, esym);
 #endif /* XEN */
 #endif
Index: arch/amiga/amiga/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/amiga/machdep.c,v
retrieving revision 1.210
diff -u -p -r1.210 machdep.c
--- arch/amiga/amiga/machdep.c  12 Nov 2008 12:35:56 -0000      1.210
+++ arch/amiga/amiga/machdep.c  21 Nov 2008 00:40:15 -0000
@@ -234,7 +234,7 @@ consinit()
                extern int end[];
                extern int *esym;
 
-               ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+               ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
                    (void *)&end, esym);
        }
 #endif
Index: arch/arc/arc/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arc/arc/machdep.c,v
retrieving revision 1.114
diff -u -p -r1.114 machdep.c
--- arch/arc/arc/machdep.c      12 Nov 2008 12:35:56 -0000      1.114
+++ arch/arc/arc/machdep.c      21 Nov 2008 00:40:15 -0000
@@ -416,11 +416,7 @@ mach_init(int argc, char *argv[], u_int 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* init symbols if present */
        if (esym)
-               ksyms_init(esym - ssym, ssym, esym);
-#ifdef SYMTAB_SPACE
-       else
-               ksyms_init(0, NULL, NULL);
-#endif
+               ksyms_addsyms_elf(esym - ssym, ssym, esym);
 #endif
 
        maxmem = physmem;
Index: arch/arm/at91/at91bus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/at91/at91bus.c,v
retrieving revision 1.3
diff -u -p -r1.3 at91bus.c
--- arch/arm/at91/at91bus.c     12 Nov 2008 12:35:57 -0000      1.3
+++ arch/arm/at91/at91bus.c     21 Nov 2008 00:40:15 -0000
@@ -566,7 +566,7 @@ at91bus_setup(BootConfig *mem)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/arm/ofw/ofwgencfg_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/ofw/ofwgencfg_machdep.c,v
retrieving revision 1.14
diff -u -p -r1.14 ofwgencfg_machdep.c
--- arch/arm/ofw/ofwgencfg_machdep.c    12 Nov 2008 12:35:57 -0000      1.14
+++ arch/arm/ofw/ofwgencfg_machdep.c    21 Nov 2008 00:40:15 -0000
@@ -202,10 +202,6 @@ initarm(void *cookie)
        /* Set-up the IRQ system. */
        irq_init();
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, NULL, NULL);      /* XXX */
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/atari/atari/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/atari/machdep.c,v
retrieving revision 1.152
diff -u -p -r1.152 machdep.c
--- arch/atari/atari/machdep.c  12 Nov 2008 12:35:57 -0000      1.152
+++ arch/atari/atari/machdep.c  21 Nov 2008 00:40:15 -0000
@@ -204,9 +204,9 @@ consinit(void)
                extern int *esym;
 
 #ifndef __ELF__
-               ksyms_init(*(int *)&end, ((int *)&end) + 1, esym);
+               ksyms_addsyms_elf(*(int *)&end, ((int *)&end) + 1, esym);
 #else
-               ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+               ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
                        (void *)&end, esym);
 #endif
        }
Index: arch/cats/cats/cats_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cats/cats/cats_machdep.c,v
retrieving revision 1.62
diff -u -p -r1.62 cats_machdep.c
--- arch/cats/cats/cats_machdep.c       12 Nov 2008 12:35:57 -0000      1.62
+++ arch/cats/cats/cats_machdep.c       21 Nov 2008 00:40:15 -0000
@@ -887,13 +887,13 @@ initarm(void *arm_bootargs)
        /* ok this is really rather sick, in ELF what happens is that the
         * ELF symbol table is added after the text section.
         */
-       ksyms_init(0, NULL, NULL);      /* XXX */
+       ksyms_addsyms_elf(0, NULL, NULL);       /* XXX */
 #else
        {
                extern int end;
                extern int *esym;
 
-               ksyms_init(*(int *)&end, ((int *)&end) + 1, esym);
+               ksyms_addsyms_elf(*(int *)&end, ((int *)&end) + 1, esym);
        }
 #endif /* __ELF__ */
 #endif
Index: arch/cesfic/cesfic/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cesfic/cesfic/machdep.c,v
retrieving revision 1.44
diff -u -p -r1.44 machdep.c
--- arch/cesfic/cesfic/machdep.c        12 Nov 2008 12:35:57 -0000      1.44
+++ arch/cesfic/cesfic/machdep.c        21 Nov 2008 00:40:15 -0000
@@ -272,9 +272,6 @@ consinit()
                zscons.cn_getc = zs_kgdb_cngetc;
        }
 #endif
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, 0, 0);
-#endif
 #ifdef DDB
        if (boothowto & RB_KDB)
                Debugger();
Index: arch/cobalt/cobalt/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/cobalt/machdep.c,v
retrieving revision 1.100
diff -u -p -r1.100 machdep.c
--- arch/cobalt/cobalt/machdep.c        12 Nov 2008 12:35:58 -0000      1.100
+++ arch/cobalt/cobalt/machdep.c        21 Nov 2008 00:40:15 -0000
@@ -287,9 +287,7 @@ mach_init(unsigned int memsize, u_int bi
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* init symbols if present */
        if ((bi_syms != NULL) && (esym != NULL))
-               ksyms_init(esym - ssym, ssym, esym);
-       else
-               ksyms_init(0, NULL, NULL);
+               ksyms_addsyms_elf(esym - ssym, ssym, esym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/dreamcast/dreamcast/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/dreamcast/dreamcast/machdep.c,v
retrieving revision 1.38
diff -u -p -r1.38 machdep.c
--- arch/dreamcast/dreamcast/machdep.c  12 Nov 2008 12:35:58 -0000      1.38
+++ arch/dreamcast/dreamcast/machdep.c  21 Nov 2008 00:40:16 -0000
@@ -139,9 +139,6 @@ dreamcast_startup(void)
        pmap_bootstrap();
 
        /* Debugger. */
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, NULL, NULL);
-#endif
 #if defined(KGDB) && (NSCIF > 0)
        if (scif_kgdb_init() == 0) {
                kgdb_debug_init = 1;
Index: arch/evbarm/adi_brh/brh_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/adi_brh/brh_machdep.c,v
retrieving revision 1.30
diff -u -p -r1.30 brh_machdep.c
--- arch/evbarm/adi_brh/brh_machdep.c   12 Nov 2008 12:35:58 -0000      1.30
+++ arch/evbarm/adi_brh/brh_machdep.c   21 Nov 2008 00:40:16 -0000
@@ -805,7 +805,7 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/armadillo/armadillo9_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/armadillo/armadillo9_machdep.c,v
retrieving revision 1.13
diff -u -p -r1.13 armadillo9_machdep.c
--- arch/evbarm/armadillo/armadillo9_machdep.c  12 Nov 2008 12:35:58 -0000      
1.13
+++ arch/evbarm/armadillo/armadillo9_machdep.c  21 Nov 2008 00:40:16 -0000
@@ -883,7 +883,7 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/hdl_g/hdlg_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/hdl_g/hdlg_machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 hdlg_machdep.c
--- arch/evbarm/hdl_g/hdlg_machdep.c    12 Nov 2008 12:35:59 -0000      1.8
+++ arch/evbarm/hdl_g/hdlg_machdep.c    21 Nov 2008 00:40:16 -0000
@@ -651,7 +651,7 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/integrator/integrator_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/integrator/integrator_machdep.c,v
retrieving revision 1.60
diff -u -p -r1.60 integrator_machdep.c
--- arch/evbarm/integrator/integrator_machdep.c 12 Nov 2008 12:35:59 -0000      
1.60
+++ arch/evbarm/integrator/integrator_machdep.c 21 Nov 2008 00:40:16 -0000
@@ -781,7 +781,7 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/iq80310/iq80310_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/iq80310/iq80310_machdep.c,v
retrieving revision 1.72
diff -u -p -r1.72 iq80310_machdep.c
--- arch/evbarm/iq80310/iq80310_machdep.c       12 Nov 2008 12:35:59 -0000      
1.72
+++ arch/evbarm/iq80310/iq80310_machdep.c       21 Nov 2008 00:40:16 -0000
@@ -767,7 +767,7 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/iq80321/iq80321_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/iq80321/iq80321_machdep.c,v
retrieving revision 1.41
diff -u -p -r1.41 iq80321_machdep.c
--- arch/evbarm/iq80321/iq80321_machdep.c       12 Nov 2008 12:35:59 -0000      
1.41
+++ arch/evbarm/iq80321/iq80321_machdep.c       21 Nov 2008 00:40:16 -0000
@@ -786,7 +786,7 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
+       ksyms_addsyms_elf(0, NULL, NULL);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/ixdp425/ixdp425_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/ixdp425/ixdp425_machdep.c,v
retrieving revision 1.19
diff -u -p -r1.19 ixdp425_machdep.c
--- arch/evbarm/ixdp425/ixdp425_machdep.c       12 Nov 2008 12:35:59 -0000      
1.19
+++ arch/evbarm/ixdp425/ixdp425_machdep.c       21 Nov 2008 00:40:16 -0000
@@ -765,11 +765,6 @@ initarm(void *arg)
        boothowto = BOOTHOWTO;
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/evbarm/ixm1200/ixm1200_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/ixm1200/ixm1200_machdep.c,v
retrieving revision 1.36
diff -u -p -r1.36 ixm1200_machdep.c
--- arch/evbarm/ixm1200/ixm1200_machdep.c       12 Nov 2008 12:35:59 -0000      
1.36
+++ arch/evbarm/ixm1200/ixm1200_machdep.c       21 Nov 2008 00:40:16 -0000
@@ -742,7 +742,7 @@ initarm(void *arg)
 #endif
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(symbolsize, ((int *)&end), ((char *)&end) + symbolsize);
+       ksyms_addsyms_elf(symbolsize, ((int *)&end), ((char *)&end) + 
symbolsize);
 #endif
 
 #ifdef DDB
Index: arch/evbarm/npwr_fc/npwr_fc_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 npwr_fc_machdep.c
--- arch/evbarm/npwr_fc/npwr_fc_machdep.c       12 Nov 2008 12:35:59 -0000      
1.8
+++ arch/evbarm/npwr_fc/npwr_fc_machdep.c       21 Nov 2008 00:40:16 -0000
@@ -766,11 +766,6 @@ initarm(void *arg)
        boothowto = BOOTHOWTO;
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/evbarm/nslu2/nslu2_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/nslu2/nslu2_machdep.c,v
retrieving revision 1.9
diff -u -p -r1.9 nslu2_machdep.c
--- arch/evbarm/nslu2/nslu2_machdep.c   12 Nov 2008 12:35:59 -0000      1.9
+++ arch/evbarm/nslu2/nslu2_machdep.c   21 Nov 2008 00:40:16 -0000
@@ -833,11 +833,6 @@ initarm(void *arg)
        boothowto = BOOTHOWTO;
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/evbarm/smdk2xx0/smdk2410_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c,v
retrieving revision 1.21
diff -u -p -r1.21 smdk2410_machdep.c
--- arch/evbarm/smdk2xx0/smdk2410_machdep.c     18 Nov 2008 18:20:10 -0000      
1.21
+++ arch/evbarm/smdk2xx0/smdk2410_machdep.c     21 Nov 2008 00:40:16 -0000
@@ -918,11 +918,6 @@ initarm(void *arg)
        }
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/evbarm/smdk2xx0/smdk2800_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c,v
retrieving revision 1.29
diff -u -p -r1.29 smdk2800_machdep.c
--- arch/evbarm/smdk2xx0/smdk2800_machdep.c     18 Nov 2008 18:20:10 -0000      
1.29
+++ arch/evbarm/smdk2xx0/smdk2800_machdep.c     21 Nov 2008 00:40:16 -0000
@@ -835,11 +835,6 @@ initarm(void *arg)
        }
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/evbarm/tsarm/tsarm_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/tsarm/tsarm_machdep.c,v
retrieving revision 1.9
diff -u -p -r1.9 tsarm_machdep.c
--- arch/evbarm/tsarm/tsarm_machdep.c   12 Nov 2008 12:35:59 -0000      1.9
+++ arch/evbarm/tsarm/tsarm_machdep.c   21 Nov 2008 00:40:17 -0000
@@ -801,11 +801,6 @@ initarm(void *arg)
        boothowto = BOOTHOWTO;
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/evbmips/adm5120/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/adm5120/machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 machdep.c
--- arch/evbmips/adm5120/machdep.c      12 Nov 2008 12:35:59 -0000      1.8
+++ arch/evbmips/adm5120/machdep.c      21 Nov 2008 00:40:17 -0000
@@ -447,9 +447,6 @@ mach_init(int argc, char **argv, void *a
        /*
         * Initialize debuggers, and break into them, if appropriate.
         */
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, 0, 0);
-#endif
 #ifdef DDB
        if (boothowto & RB_KDB)
                Debugger();
Index: arch/evbmips/alchemy/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/alchemy/machdep.c,v
retrieving revision 1.39
diff -u -p -r1.39 machdep.c
--- arch/evbmips/alchemy/machdep.c      12 Nov 2008 12:35:59 -0000      1.39
+++ arch/evbmips/alchemy/machdep.c      21 Nov 2008 00:40:17 -0000
@@ -373,9 +373,6 @@ mach_init(int argc, char **argv, yamon_e
        /*
         * Initialize debuggers, and break into them, if appropriate.
         */
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, 0, 0);
-#endif
 #ifdef DDB
        if (boothowto & RB_KDB)
                Debugger();
Index: arch/evbmips/atheros/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/atheros/machdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 machdep.c
--- arch/evbmips/atheros/machdep.c      12 Nov 2008 12:35:59 -0000      1.15
+++ arch/evbmips/atheros/machdep.c      21 Nov 2008 00:40:17 -0000
@@ -339,10 +339,6 @@ mach_init(void)
        /*
         * Initialize debuggers, and break into them, if appropriate.
         */
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, 0, 0);
-#endif
-
 #ifdef DDB
        if (boothowto & RB_KDB)
                Debugger();
Index: arch/evbmips/malta/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/malta/machdep.c,v
retrieving revision 1.30
diff -u -p -r1.30 machdep.c
--- arch/evbmips/malta/machdep.c        12 Nov 2008 12:35:59 -0000      1.30
+++ arch/evbmips/malta/machdep.c        21 Nov 2008 00:40:17 -0000
@@ -329,10 +329,6 @@ mach_init(int argc, char **argv, yamon_e
        /*
         * Initialize debuggers, and break into them, if appropriate.
         */
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, 0, 0);
-#endif
-
 #if defined(DDB)
        if (boothowto & RB_KDB)
                Debugger();
Index: arch/evbppc/ev64260/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/ev64260/machdep.c,v
retrieving revision 1.22
diff -u -p -r1.22 machdep.c
--- arch/evbppc/ev64260/machdep.c       12 Nov 2008 12:36:00 -0000      1.22
+++ arch/evbppc/ev64260/machdep.c       21 Nov 2008 00:40:17 -0000
@@ -234,7 +234,7 @@ initppc(startkernel, endkernel, args, bt
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        {
                extern void *startsym, *endsym;
-               ksyms_init((int)((u_int)endsym - (u_int)startsym),
+               ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym),
                    startsym, endsym);
        }
 #endif
Index: arch/evbppc/explora/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/explora/machdep.c,v
retrieving revision 1.25
diff -u -p -r1.25 machdep.c
--- arch/evbppc/explora/machdep.c       12 Nov 2008 12:36:00 -0000      1.25
+++ arch/evbppc/explora/machdep.c       21 Nov 2008 00:40:17 -0000
@@ -263,11 +263,6 @@ bootstrap(u_int startkernel, u_int endke
         * Initialize pmap module.
         */
        pmap_bootstrap(startkernel, endkernel);
-
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, NULL, NULL);
-#endif
-
        fake_mapiodev = 0;
 }
 
Index: arch/evbppc/obs405/obs200_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/obs405/obs200_machdep.c,v
retrieving revision 1.7
diff -u -p -r1.7 obs200_machdep.c
--- arch/evbppc/obs405/obs200_machdep.c 12 Nov 2008 12:36:00 -0000      1.7
+++ arch/evbppc/obs405/obs200_machdep.c 21 Nov 2008 00:40:17 -0000
@@ -162,7 +162,7 @@ initppc(u_int startkernel, u_int endkern
 #endif
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/evbppc/obs405/obs266_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/obs405/obs266_machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 obs266_machdep.c
--- arch/evbppc/obs405/obs266_machdep.c 12 Nov 2008 12:36:00 -0000      1.8
+++ arch/evbppc/obs405/obs266_machdep.c 21 Nov 2008 00:40:17 -0000
@@ -156,7 +156,7 @@ initppc(u_int startkernel, u_int endkern
 #endif
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/evbppc/pmppc/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/pmppc/machdep.c,v
retrieving revision 1.5
diff -u -p -r1.5 machdep.c
--- arch/evbppc/pmppc/machdep.c 12 Nov 2008 12:36:00 -0000      1.5
+++ arch/evbppc/pmppc/machdep.c 21 Nov 2008 00:40:17 -0000
@@ -244,13 +244,6 @@ initppc(u_int startkernel, u_int endkern
         */
        pmap_bootstrap(startkernel, endkernel);
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-#ifdef SYMTAB_SPACE
-       ksyms_init(0, NULL, NULL);
-#else
-       #error "No SYMTAB_SPACE"
-#endif
-#endif
 #ifdef IPKDB
        /*
         * Now trap to IPKDB
Index: arch/evbppc/virtex/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/virtex/machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 machdep.c
--- arch/evbppc/virtex/machdep.c        12 Nov 2008 12:36:00 -0000      1.8
+++ arch/evbppc/virtex/machdep.c        21 Nov 2008 00:40:17 -0000
@@ -247,7 +247,7 @@ initppc(u_int startkernel, u_int endkern
        pmap_bootstrap(startkernel, endkernel);
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/evbppc/walnut/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/walnut/machdep.c,v
retrieving revision 1.38
diff -u -p -r1.38 machdep.c
--- arch/evbppc/walnut/machdep.c        12 Nov 2008 12:36:00 -0000      1.38
+++ arch/evbppc/walnut/machdep.c        21 Nov 2008 00:40:17 -0000
@@ -322,7 +322,7 @@ initppc(u_int startkernel, u_int endkern
 #endif
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/evbsh3/evbsh3/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbsh3/evbsh3/machdep.c,v
retrieving revision 1.62
diff -u -p -r1.62 machdep.c
--- arch/evbsh3/evbsh3/machdep.c        12 Nov 2008 12:36:00 -0000      1.62
+++ arch/evbsh3/evbsh3/machdep.c        21 Nov 2008 00:40:17 -0000
@@ -270,11 +270,7 @@ initSH3(void *pc)  /* XXX return address 
        /* Initialize pmap and start to address translation */
        pmap_bootstrap();
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(0, NULL, NULL);
-#endif
-
-       /*
+#      /*
         * XXX We can't return here, because we change stack pointer.
         *     So jump to return address directly.
         */
Index: arch/ews4800mips/ews4800mips/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ews4800mips/ews4800mips/machdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 machdep.c
--- arch/ews4800mips/ews4800mips/machdep.c      11 Nov 2008 06:46:42 -0000      
1.15
+++ arch/ews4800mips/ews4800mips/machdep.c      21 Nov 2008 00:40:17 -0000
@@ -197,7 +197,7 @@ option(int argc, char *argv[], struct bo
 #ifdef DDB
        /* Load symbol table */
        if (bi->bi_nsym)
-               ksyms_init(bi->bi_esym - bi->bi_ssym,
+               ksyms_addsyms_elf(bi->bi_esym - bi->bi_ssym,
                    (void *)bi->bi_ssym, (void *)bi->bi_esym);
 #endif
        /* Parse option */
Index: arch/hp300/hp300/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/hp300/machdep.c,v
retrieving revision 1.202
diff -u -p -r1.202 machdep.c
--- arch/hp300/hp300/machdep.c  12 Nov 2008 12:36:00 -0000      1.202
+++ arch/hp300/hp300/machdep.c  21 Nov 2008 00:40:17 -0000
@@ -294,7 +294,7 @@ consinit(void)
                extern int end;
                extern int *esym;
 
-               ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+               ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
                    (void *)&end, esym);
        }
 #endif
Index: arch/hp700/hp700/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/hp700/machdep.c,v
retrieving revision 1.50
diff -u -p -r1.50 machdep.c
--- arch/hp700/hp700/machdep.c  12 Nov 2008 12:36:00 -0000      1.50
+++ arch/hp700/hp700/machdep.c  21 Nov 2008 00:40:18 -0000
@@ -817,12 +817,12 @@ do {                                                      
                \
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        if ((bi_sym = lookup_bootinfo(BTINFO_SYMTAB)) != NULL)
-                ksyms_init(bi_sym->nsym, (int *)bi_sym->ssym,
+                ksyms_addsyms_elf(bi_sym->nsym, (int *)bi_sym->ssym,
                     (int *)bi_sym->esym);
         else {
                extern int end;
 
-               ksyms_init(esym - (int)&end, &end, (int*)esym);
+               ksyms_addsyms_elf(esym - (int)&end, &end, (int*)esym);
        }
 #endif
 
Index: arch/hpcarm/hpcarm/hpc_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcarm/hpcarm/hpc_machdep.c,v
retrieving revision 1.88
diff -u -p -r1.88 hpc_machdep.c
--- arch/hpcarm/hpcarm/hpc_machdep.c    12 Nov 2008 12:36:01 -0000      1.88
+++ arch/hpcarm/hpcarm/hpc_machdep.c    21 Nov 2008 00:40:18 -0000
@@ -707,7 +707,7 @@ initarm(int argc, char **argv, struct bo
        db_machine_init();
 #endif
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(symbolsize, ((int *)&end), ((char *)&end) + symbolsize);
+       ksyms_addsyms_elf(symbolsize, ((int *)&end), ((char *)&end) + 
symbolsize);
 #endif
 
        printf("kernsize=0x%x", kerneldatasize);
Index: arch/hpcmips/hpcmips/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/hpcmips/machdep.c,v
retrieving revision 1.98
diff -u -p -r1.98 machdep.c
--- arch/hpcmips/hpcmips/machdep.c      12 Nov 2008 12:36:01 -0000      1.98
+++ arch/hpcmips/hpcmips/machdep.c      21 Nov 2008 00:40:18 -0000
@@ -450,7 +450,7 @@ mach_init(int argc, char *argv[], struct
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* init symbols if present */
        if (esym)
-               ksyms_init(symbolsz, &end, esym);
+               ksyms_addsyms_elf(symbolsz, &end, esym);
 #endif /* DDB */
        /*
         * Alloc u pages for lwp0 stealing KSEG0 memory.
Index: arch/hpcsh/hpcsh/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcsh/hpcsh/machdep.c,v
retrieving revision 1.64
diff -u -p -r1.64 machdep.c
--- arch/hpcsh/hpcsh/machdep.c  17 Nov 2008 02:05:13 -0000      1.64
+++ arch/hpcsh/hpcsh/machdep.c  21 Nov 2008 00:40:18 -0000
@@ -295,7 +295,7 @@ machine_startup(int argc, char *argv[], 
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        if (symbolsize) {
-               ksyms_init(symbolsize, &end, end + symbolsize);
+               ksyms_addsyms_elf(symbolsize, &end, end + symbolsize);
                _DPRINTF("symbol size = %d byte\n", symbolsize);
        }
 #endif
Index: arch/i386/i386/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.652
diff -u -p -r1.652 machdep.c
--- arch/i386/i386/machdep.c    20 Nov 2008 10:53:09 -0000      1.652
+++ arch/i386/i386/machdep.c    21 Nov 2008 00:40:18 -0000
@@ -1262,18 +1262,18 @@ init386_ksyms(void)
 #endif
 
 #if defined(MULTIBOOT)
-       if (multiboot_ksyms_init())
+       if (multiboot_ksyms_addsyms_elf())
                return;
 #endif
 
        if ((symtab = lookup_bootinfo(BTINFO_SYMTAB)) == NULL) {
-               ksyms_init(*(int *)&end, ((int *)&end) + 1, esym);
+               ksyms_addsyms_elf(*(int *)&end, ((int *)&end) + 1, esym);
                return;
        }
 
        symtab->ssym += KERNBASE;
        symtab->esym += KERNBASE;
-       ksyms_init(symtab->nsym, (int *)symtab->ssym, (int *)symtab->esym);
+       ksyms_addsyms_elf(symtab->nsym, (int *)symtab->ssym, (int 
*)symtab->esym);
 #endif
 }
 
Index: arch/ia64/ia64/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/ia64/machdep.c,v
retrieving revision 1.11
diff -u -p -r1.11 machdep.c
--- arch/ia64/ia64/machdep.c    12 Nov 2008 12:36:02 -0000      1.11
+++ arch/ia64/ia64/machdep.c    21 Nov 2008 00:40:19 -0000
@@ -750,7 +750,7 @@ ia64_init()
         * Initialize debuggers, and break into them if appropriate.
         */
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int64_t)ksym_end - (u_int64_t)ksym_start),
+       ksyms_addsyms_elf((int)((u_int64_t)ksym_end - (u_int64_t)ksym_start),
            ksym_start, ksym_end);
 #endif
 
Index: arch/iyonix/iyonix/iyonix_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/iyonix/iyonix/iyonix_machdep.c,v
retrieving revision 1.10
diff -u -p -r1.10 iyonix_machdep.c
--- arch/iyonix/iyonix/iyonix_machdep.c 12 Nov 2008 12:36:02 -0000      1.10
+++ arch/iyonix/iyonix/iyonix_machdep.c 21 Nov 2008 00:40:19 -0000
@@ -812,11 +812,6 @@ initarm(void *arg)
        boothowto = BOOTHOWTO;
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/landisk/landisk/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/landisk/landisk/machdep.c,v
retrieving revision 1.9
diff -u -p -r1.9 machdep.c
--- arch/landisk/landisk/machdep.c      17 Nov 2008 01:55:00 -0000      1.9
+++ arch/landisk/landisk/machdep.c      21 Nov 2008 00:40:19 -0000
@@ -230,7 +230,7 @@ landisk_startup(int howto, void *bi)
        /* Debugger. */
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        if (symbolsize != 0) {
-               ksyms_init(symbolsize, &end, end + symbolsize);
+               ksyms_addsyms_elf(symbolsize, &end, end + symbolsize);
        }
 #endif
 #if defined(DDB)
Index: arch/luna68k/luna68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/luna68k/luna68k/machdep.c,v
retrieving revision 1.57
diff -u -p -r1.57 machdep.c
--- arch/luna68k/luna68k/machdep.c      12 Nov 2008 12:36:02 -0000      1.57
+++ arch/luna68k/luna68k/machdep.c      21 Nov 2008 00:40:19 -0000
@@ -219,7 +219,7 @@ consinit()
                extern char end[];
                extern int *esym;
 
-               ksyms_init(*(int *)&end, ((int *)&end) + 1, esym);
+               ksyms_addsyms_elf(*(int *)&end, ((int *)&end) + 1, esym);
        }
 #endif
 #ifdef DDB
Index: arch/mac68k/mac68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mac68k/mac68k/machdep.c,v
retrieving revision 1.324
diff -u -p -r1.324 machdep.c
--- arch/mac68k/mac68k/machdep.c        12 Nov 2008 12:36:03 -0000      1.324
+++ arch/mac68k/mac68k/machdep.c        21 Nov 2008 00:40:19 -0000
@@ -382,7 +382,7 @@ consinit(void)
                 * Initialize kernel debugger, if compiled in.
                 */
 
-               ksyms_init(symsize, ssym, esym);
+               ksyms_addsyms_elf(symsize, ssym, esym);
 #endif
 
                if (boothowto & RB_KDB) {
Index: arch/mipsco/mipsco/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mipsco/mipsco/machdep.c,v
retrieving revision 1.60
diff -u -p -r1.60 machdep.c
--- arch/mipsco/mipsco/machdep.c        12 Nov 2008 12:36:04 -0000      1.60
+++ arch/mipsco/mipsco/machdep.c        21 Nov 2008 00:40:20 -0000
@@ -332,7 +332,7 @@ mach_init(argc, argv, envp, bim, bip)
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* init symbols if present */
        if (esym)
-               ksyms_init(esym - ssym, ssym, esym);
+               ksyms_addsyms_elf(esym - ssym, ssym, esym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/mmeye/mmeye/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mmeye/mmeye/machdep.c,v
retrieving revision 1.45
diff -u -p -r1.45 machdep.c
--- arch/mmeye/mmeye/machdep.c  12 Nov 2008 12:36:04 -0000      1.45
+++ arch/mmeye/mmeye/machdep.c  21 Nov 2008 00:40:20 -0000
@@ -259,7 +259,7 @@ initSH3(void *pc)   /* XXX return address 
        pmap_bootstrap();
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(1, end, end + 0x40000);                      /* XXX */
+       ksyms_addsyms_elf(1, end, end + 0x40000);                       /* XXX 
*/
 #endif
        /*
         * XXX We can't return here, because we change stack pointer.
Index: arch/mvme68k/mvme68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/mvme68k/machdep.c,v
retrieving revision 1.131
diff -u -p -r1.131 machdep.c
--- arch/mvme68k/mvme68k/machdep.c      12 Nov 2008 12:36:04 -0000      1.131
+++ arch/mvme68k/mvme68k/machdep.c      21 Nov 2008 00:40:20 -0000
@@ -443,7 +443,7 @@ consinit(void)
                extern char end[];
                extern int *esym;
 
-               ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+               ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
                    (void *)&end, esym);
        }
 #endif
Index: arch/netwinder/netwinder/netwinder_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/netwinder/netwinder/netwinder_machdep.c,v
retrieving revision 1.68
diff -u -p -r1.68 netwinder_machdep.c
--- arch/netwinder/netwinder/netwinder_machdep.c        12 Nov 2008 12:36:04 
-0000      1.68
+++ arch/netwinder/netwinder/netwinder_machdep.c        21 Nov 2008 00:40:20 
-0000
@@ -855,11 +855,6 @@ initarm(void *arg)
        if (nwbootinfo.bi_pagesize == 0xdeadbeef)
                printf("WARNING: NeTTrom boot info corrupt\n");
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-       /* Firmware doesn't load symbols. */
-       ksyms_init(0, NULL, NULL);
-#endif
-
 #ifdef DDB
        db_machine_init();
        if (boothowto & RB_KDB)
Index: arch/news68k/news68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/news68k/news68k/machdep.c,v
retrieving revision 1.74
diff -u -p -r1.74 machdep.c
--- arch/news68k/news68k/machdep.c      12 Nov 2008 12:36:04 -0000      1.74
+++ arch/news68k/news68k/machdep.c      21 Nov 2008 00:40:20 -0000
@@ -1085,7 +1085,7 @@ consinit(void)
                break;
        }
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+       ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
                    (void *)&end, esym);
 #endif
 #ifdef DDB
Index: arch/newsmips/newsmips/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/newsmips/newsmips/machdep.c,v
retrieving revision 1.100
diff -u -p -r1.100 machdep.c
--- arch/newsmips/newsmips/machdep.c    12 Nov 2008 12:36:04 -0000      1.100
+++ arch/newsmips/newsmips/machdep.c    21 Nov 2008 00:40:20 -0000
@@ -341,7 +341,7 @@ mach_init(int x_boothowto, int x_bootdev
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        if (nsym)
-               ksyms_init(esym - ssym, ssym, esym);
+               ksyms_addsyms_elf(esym - ssym, ssym, esym);
 #endif
 
 #ifdef KADB
Index: arch/next68k/next68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/next68k/next68k/machdep.c,v
retrieving revision 1.87
diff -u -p -r1.87 machdep.c
--- arch/next68k/next68k/machdep.c      12 Nov 2008 12:36:05 -0000      1.87
+++ arch/next68k/next68k/machdep.c      21 Nov 2008 00:40:20 -0000
@@ -288,7 +288,7 @@ consinit(void)
 #endif
 #if NKSYMS || defined(DDB) || defined(MODULAR)
                /* Initialize kernel symbol table, if compiled in. */
-               ksyms_init(nsym, ssym, esym);
+               ksyms_addsyms_elf(nsym, ssym, esym);
 #endif
                if (boothowto & RB_KDB) {
 #if defined(KGDB)
Index: arch/pmax/pmax/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/pmax/machdep.c,v
retrieving revision 1.225
diff -u -p -r1.225 machdep.c
--- arch/pmax/pmax/machdep.c    12 Nov 2008 12:36:05 -0000      1.225
+++ arch/pmax/pmax/machdep.c    21 Nov 2008 00:40:21 -0000
@@ -333,7 +333,7 @@ mach_init(argc, argv, code, cv, bim, bip
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* init symbols if present */
        if (esym)
-               ksyms_init((char *)esym - (char *)ssym, ssym, esym);
+               ksyms_addsyms_elf((char *)esym - (char *)ssym, ssym, esym);
 #endif
 #ifdef DDB
        if (boothowto & RB_KDB)
Index: arch/powerpc/oea/ofwoea_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/oea/ofwoea_machdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 ofwoea_machdep.c
--- arch/powerpc/oea/ofwoea_machdep.c   12 Nov 2008 12:36:05 -0000      1.15
+++ arch/powerpc/oea/ofwoea_machdep.c   21 Nov 2008 00:40:21 -0000
@@ -239,7 +239,7 @@ ofwoea_initppc(u_int startkernel, u_int 
        restore_ofmap(ofmap, ofmaplen);
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
 #endif
 
        /* CPU clock stuff */
Index: arch/powerpc/oea/prep_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/oea/prep_machdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 prep_machdep.c
--- arch/powerpc/oea/prep_machdep.c     12 Nov 2008 12:36:05 -0000      1.4
+++ arch/powerpc/oea/prep_machdep.c     21 Nov 2008 00:40:21 -0000
@@ -166,7 +166,7 @@ prep_initppc(u_long startkernel, u_long 
        pmap_bootstrap(startkernel, endkernel);
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_long)endsym - (u_long)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_long)endsym - (u_long)startsym), startsym, 
endsym);
 #endif
 
 #ifdef DDB
Index: arch/rs6000/rs6000/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/rs6000/rs6000/machdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 machdep.c
--- arch/rs6000/rs6000/machdep.c        12 Nov 2008 12:36:05 -0000      1.4
+++ arch/rs6000/rs6000/machdep.c        21 Nov 2008 00:40:21 -0000
@@ -381,7 +381,7 @@ initppc(u_long startkernel, u_long endke
        setled(0x41000000);
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)((u_long)endsym - (u_long)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_long)endsym - (u_long)startsym), startsym, 
endsym);
 #endif
 
 #ifdef DDB
Index: arch/sandpoint/sandpoint/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sandpoint/sandpoint/machdep.c,v
retrieving revision 1.44
diff -u -p -r1.44 machdep.c
--- arch/sandpoint/sandpoint/machdep.c  12 Nov 2008 12:36:05 -0000      1.44
+++ arch/sandpoint/sandpoint/machdep.c  21 Nov 2008 00:40:21 -0000
@@ -179,7 +179,7 @@ initppc(u_int startkernel, u_int endkern
        cn_tab = &kcomcons;
        (*cn_tab->cn_init)(&kcomcons);
 
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
        if (boothowto & RB_KDB)
                Debugger();
 #endif
@@ -197,7 +197,7 @@ initppc(u_int startkernel, u_int endkern
        pmap_bootstrap(startkernel, endkernel);
 
 #if 0 /* NKSYMS || defined(DDB) || defined(MODULAR) */
-       ksyms_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
+       ksyms_addsyms_elf((int)((u_int)endsym - (u_int)startsym), startsym, 
endsym);
 #endif
 #ifdef IPKDB
        /*
Index: arch/sbmips/sbmips/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sbmips/sbmips/machdep.c,v
retrieving revision 1.40
diff -u -p -r1.40 machdep.c
--- arch/sbmips/sbmips/machdep.c        12 Nov 2008 12:36:05 -0000      1.40
+++ arch/sbmips/sbmips/machdep.c        21 Nov 2008 00:40:21 -0000
@@ -331,7 +331,7 @@ mach_init(long fwhandle, long magic, lon
         * Initialize debuggers, and break into them, if appropriate.
         */
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init(((uintptr_t)ksym_end - (uintptr_t)ksym_start),
+       ksyms_addsyms_elf(((uintptr_t)ksym_end - (uintptr_t)ksym_start),
            ksym_start, ksym_end);
 #endif
 
Index: arch/sgimips/sgimips/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/sgimips/machdep.c,v
retrieving revision 1.123
diff -u -p -r1.123 machdep.c
--- arch/sgimips/sgimips/machdep.c      12 Nov 2008 12:36:06 -0000      1.123
+++ arch/sgimips/sgimips/machdep.c      21 Nov 2008 00:40:21 -0000
@@ -485,11 +485,7 @@ mach_init(int argc, char *argv[], u_int 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* init symbols if present */
        if (esym)
-               ksyms_init(nsym, ssym, esym);
-#ifdef SYMTAB_SPACE
-       else
-               ksyms_init(0, NULL, NULL);
-#endif /* SYMTAB_SPACE */
+               ksyms_addsyms_elf(nsym, ssym, esym);
 #endif /* NKSYMS || defined(DDB) || defined(MODULAR) */
 
 #if defined(KGDB) || defined(DDB)
Index: arch/shark/shark/shark_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/shark/shark_machdep.c,v
retrieving revision 1.31
diff -u -p -r1.31 shark_machdep.c
--- arch/shark/shark/shark_machdep.c    12 Nov 2008 12:36:06 -0000      1.31
+++ arch/shark/shark/shark_machdep.c    21 Nov 2008 00:40:21 -0000
@@ -301,14 +301,14 @@ initarm(void *arg)
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
 #ifdef __ELF__
-       ksyms_init(0, NULL, NULL);      /* XXX */
+       ksyms_addsyms_elf(0, NULL, NULL);       /* XXX */
 #else
        {
                struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
                extern int end;
                extern char *esym;
 
-               ksyms_init(kernexec->a_syms, &end, esym);
+               ksyms_addsyms_elf(kernexec->a_syms, &end, esym);
        }
 #endif /* __ELF__ */
 #endif /* NKSYMS || defined(DDB) || defined(MODULAR) */
Index: arch/sparc/sparc/autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/autoconf.c,v
retrieving revision 1.230
diff -u -p -r1.230 autoconf.c
--- arch/sparc/sparc/autoconf.c 12 Nov 2008 12:36:06 -0000      1.230
+++ arch/sparc/sparc/autoconf.c 21 Nov 2008 00:40:22 -0000
@@ -321,7 +321,7 @@ bootstrap(void)
                        bi_sym->ssym += KERNBASE;
                        bi_sym->esym += KERNBASE;
                }
-               ksyms_init(bi_sym->nsym, (int *)bi_sym->ssym,
+               ksyms_addsyms_elf(bi_sym->nsym, (int *)bi_sym->ssym,
                    (int *)bi_sym->esym);
        }
 #endif
Index: arch/sparc64/sparc64/autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/autoconf.c,v
retrieving revision 1.157
diff -u -p -r1.157 autoconf.c
--- arch/sparc64/sparc64/autoconf.c     12 Nov 2008 12:36:06 -0000      1.157
+++ arch/sparc64/sparc64/autoconf.c     21 Nov 2008 00:40:22 -0000
@@ -313,7 +313,7 @@ die_old_boot_loader:
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        LOOKUP_BOOTINFO(bi_sym, BTINFO_SYMTAB);
-       ksyms_init(bi_sym->nsym, (int *)(u_long)bi_sym->ssym,
+       ksyms_addsyms_elf(bi_sym->nsym, (int *)(u_long)bi_sym->ssym,
                        (int *)(u_long)bi_sym->esym);
 #ifdef DDB
 #ifdef __arch64__
Index: arch/sun2/sun2/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun2/sun2/machdep.c,v
retrieving revision 1.55
diff -u -p -r1.55 machdep.c
--- arch/sun2/sun2/machdep.c    12 Nov 2008 12:36:08 -0000      1.55
+++ arch/sun2/sun2/machdep.c    21 Nov 2008 00:40:22 -0000
@@ -301,7 +301,7 @@ cpu_startup(void)
                extern int nsym;
                extern char *ssym, *esym;
 
-               ksyms_init(nsym, ssym, esym);
+               ksyms_addsyms_elf(nsym, ssym, esym);
        }
 #endif /* DDB */
 
Index: arch/sun3/sun3/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun3/sun3/machdep.c,v
retrieving revision 1.187
diff -u -p -r1.187 machdep.c
--- arch/sun3/sun3/machdep.c    12 Nov 2008 12:36:08 -0000      1.187
+++ arch/sun3/sun3/machdep.c    21 Nov 2008 00:40:22 -0000
@@ -184,7 +184,7 @@ consinit(void)
                extern int nsym;
                extern char *ssym, *esym;
 
-               ksyms_init(nsym, ssym, esym);
+               ksyms_addsyms_elf(nsym, ssym, esym);
        }
 #endif /* DDB */
 
Index: arch/sun3/sun3x/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun3/sun3x/machdep.c,v
retrieving revision 1.113
diff -u -p -r1.113 machdep.c
--- arch/sun3/sun3x/machdep.c   12 Nov 2008 12:36:08 -0000      1.113
+++ arch/sun3/sun3x/machdep.c   21 Nov 2008 00:40:22 -0000
@@ -185,7 +185,7 @@ consinit(void)
                extern int nsym;
                extern char *ssym, *esym;
 
-               ksyms_init(nsym, ssym, esym);
+               ksyms_addsyms_elf(nsym, ssym, esym);
        }
 #endif /* DDB */
 
Index: arch/vax/vax/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/vax/machdep.c,v
retrieving revision 1.170
diff -u -p -r1.170 machdep.c
--- arch/vax/vax/machdep.c      19 Nov 2008 20:26:40 -0000      1.170
+++ arch/vax/vax/machdep.c      21 Nov 2008 00:40:22 -0000
@@ -324,7 +324,7 @@ consinit(void)
        cninit();
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        if (symtab_start != NULL && symtab_nsyms != 0 && symtab_end != NULL) {
-               ksyms_init(symtab_nsyms, symtab_start, symtab_end);
+               ksyms_addsyms_elf(symtab_nsyms, symtab_start, symtab_end);
        }
 #endif
 #ifdef DEBUG
Index: arch/x68k/x68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x68k/x68k/machdep.c,v
retrieving revision 1.152
diff -u -p -r1.152 machdep.c
--- arch/x68k/x68k/machdep.c    12 Nov 2008 12:36:09 -0000      1.152
+++ arch/x68k/x68k/machdep.c    21 Nov 2008 00:40:22 -0000
@@ -228,7 +228,7 @@ consinit(void)
        zs_kgdb_init();                 /* XXX */
 #endif
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-       ksyms_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+       ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
                 (void *)&end, esym);
 #endif
 #ifdef DDB
Index: ddb/db_sym.c
===================================================================
RCS file: /cvsroot/src/sys/ddb/db_sym.c,v
retrieving revision 1.57
diff -u -p -r1.57 db_sym.c
--- ddb/db_sym.c        24 Oct 2008 13:55:42 -0000      1.57
+++ ddb/db_sym.c        21 Nov 2008 00:40:23 -0000
@@ -72,7 +72,7 @@ ddb_init(int symsize, void *vss, void *v
                return;
        }
 #endif
-       ksyms_init(symsize, vss, vse);  /* Will complain if necessary */
+       ksyms_addsyms_elf(symsize, vss, vse);   /* Will complain if necessary */
 }
 
 bool
Index: kern/init_main.c
===================================================================
RCS file: /cvsroot/src/sys/kern/init_main.c,v
retrieving revision 1.375
diff -u -p -r1.375 init_main.c
--- kern/init_main.c    18 Nov 2008 11:36:58 -0000      1.375
+++ kern/init_main.c    21 Nov 2008 00:40:23 -0000
@@ -335,6 +335,8 @@ main(void)
 
        uvm_init();
 
+       ksyms_init();
+
        percpu_init();
 
        /* Initialize lock caches. */
Index: kern/kern_ksyms.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_ksyms.c,v
retrieving revision 1.46
diff -u -p -r1.46 kern_ksyms.c
--- kern/kern_ksyms.c   16 Nov 2008 16:15:58 -0000      1.46
+++ kern/kern_ksyms.c   21 Nov 2008 00:40:23 -0000
@@ -204,6 +204,13 @@ ksymsattach(int arg)
 
 }
 
+void
+ksyms_init()
+{
+
+       mutex_init(&ksyms_lock, MUTEX_DEFAULT, IPL_NONE);
+}
+
 /*
  * Add a symbol table.
  * This is intended for use when the symbol table and its corresponding
@@ -330,7 +337,7 @@ addsymtab(const char *name, void *symsta
  * Setup the kernel symbol table stuff.
  */
 void
-ksyms_init(int symsize, void *start, void *end)
+ksyms_addsyms_elf(int symsize, void *start, void *end)
 {
        int i, j;
        Elf_Shdr *shdr;
@@ -338,7 +345,6 @@ ksyms_init(int symsize, void *start, voi
        size_t strsize = 0;
        Elf_Ehdr *ehdr;
 
-       mutex_init(&ksyms_lock, MUTEX_DEFAULT, IPL_NONE);
 #ifdef SYMTAB_SPACE
        if (symsize <= 0 &&
            strncmp(db_symtab, SYMTAB_FILLER, sizeof(SYMTAB_FILLER))) {
@@ -411,12 +417,10 @@ ksyms_init(int symsize, void *start, voi
  * a void *rather than a pointer to avoid exposing the Elf_Ehdr type.
  */
 void
-ksyms_init_explicit(void *ehdr, void *symstart, size_t symsize,
+ksyms_addsyms_explicit(void *ehdr, void *symstart, size_t symsize,
                    void *strstart, size_t strsize)
 {
 
-       mutex_init(&ksyms_lock, MUTEX_DEFAULT, IPL_NONE);
-
        if (!ksyms_verify(symstart, strstart))
                return;
 
Index: sys/ksyms.h
===================================================================
RCS file: /cvsroot/src/sys/sys/ksyms.h,v
retrieving revision 1.20
diff -u -p -r1.20 ksyms.h
--- sys/ksyms.h 16 Nov 2008 15:28:15 -0000      1.20
+++ sys/ksyms.h 21 Nov 2008 00:40:24 -0000
@@ -105,8 +105,9 @@ int ksyms_getval(const char *, const cha
 int ksyms_getval_unlocked(const char *, const char *, unsigned long *, int);
 int ksyms_addsymtab(const char *, void *, vsize_t, char *, vsize_t);
 int ksyms_delsymtab(const char *);
-void ksyms_init(int, void *, void *);
-void ksyms_init_explicit(void *, void *, size_t, void *, size_t);
+void ksyms_init(void);
+void ksyms_addsyms_elf(int, void *, void *);
+void ksyms_addsyms_explicit(void *, void *, size_t, void *, size_t);
 int ksyms_sift(char *, char *, int);
 void ksyms_modload(const char *, void *, vsize_t, char *, vsize_t);
 void ksyms_modunload(const char *);


Home | Main Index | Thread Index | Old Index