Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Teach the lkm code to add loaded module symbols to ...



details:   https://anonhg.NetBSD.org/src/rev/21051afae46f
branches:  trunk
changeset: 546287:21051afae46f
user:      ragge <ragge%NetBSD.org@localhost>
date:      Thu Apr 24 20:09:43 2003 +0000

description:
Teach the lkm code to add loaded module symbols to the in-kernel symbol table.
XXX - The way this works is clumsy, at least. It will be fixed as soon as
the in-kernel linker is in place.

diffstat:

 sys/kern/kern_lkm.c |  30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diffs (69 lines):

diff -r 2026d5290315 -r 21051afae46f sys/kern/kern_lkm.c
--- a/sys/kern/kern_lkm.c       Thu Apr 24 20:08:25 2003 +0000
+++ b/sys/kern/kern_lkm.c       Thu Apr 24 20:09:43 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_lkm.c,v 1.64 2003/04/10 19:06:05 jdolecek Exp $   */
+/*     $NetBSD: kern_lkm.c,v 1.65 2003/04/24 20:09:43 ragge Exp $      */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lkm.c,v 1.64 2003/04/10 19:06:05 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lkm.c,v 1.65 2003/04/24 20:09:43 ragge Exp $");
 
 #include "opt_ddb.h"
 
@@ -60,6 +60,7 @@
 #include <sys/sa.h>
 #include <sys/syscallargs.h>
 #include <sys/conf.h>
+#include <sys/ksyms.h>
 
 #include <sys/lkm.h>
 #include <sys/syscall.h>
@@ -183,10 +184,8 @@
                return;
 
        if (curp && curp->syms) {
-#ifdef DDB
-               db_del_symbol_table(curp->private.lkm_any->lkm_name);
-#endif
-               LKM_SPACE_FREE(curp->syms, curp->sym_size);
+               ksyms_delsymtab(curp->private.lkm_any->lkm_name);
+               uvm_km_free(kernel_map, curp->syms, curp->sym_size);/**/
                curp->syms = 0;
        }
        /*
@@ -437,21 +436,18 @@
                if (lkmdebug & LKMDB_INFO)
                        printf("LKM: LMREADY\n");
 #endif /* DEBUG */
-#ifdef DDB
                if (curp->syms && curp->sym_offset >= curp->sym_size) {
-                   db_add_symbol_table((caddr_t)curp->syms,
-                                       (caddr_t)curp->syms + curp->sym_symsize,
-                                       curp->private.lkm_any->lkm_name,
-                                       (caddr_t)curp->syms);
+                       error = ksyms_addsymtab(curp->private.lkm_any->lkm_name,
+                           (char *)curp->syms, curp->sym_symsize,
+                           (char *)curp->syms + curp->sym_symsize,
+                           curp->sym_size - curp->sym_symsize);
+                       if (error)
+                               break;
 #ifdef DEBUG
-                   if (lkmdebug & LKMDB_INFO)
-                       printf( "DDB symbols added!\n" );
+                       if (lkmdebug & LKMDB_INFO)
+                               printf( "DDB symbols added!\n" );
 #endif
                }
-#endif
-
-
-
                lkm_state = LKMS_IDLE;
                break;
 



Home | Main Index | Thread Index | Old Index