Date: Sun, 28 Jan 2001 02:43:42 -0500 From: "Sue Wainer" <wainer@sandgate.com> To: "Freebsd-Arch" <freebsd-arch@FreeBSD.ORG> Subject: kldunload, and calling uninit function Message-ID: <NDBBLIBAPKIAHMINJJNFAEAGCEAA.wainer@sandgate.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C088D4.20638050 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0007_01C088D4.206506F0" ------=_NextPart_001_0007_01C088D4.206506F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I am having problems getting my SYSUNINIT function called when I do a kldunload. I have reduced my source file to containing nothing more than a sysinit and sysunit function, both of which only print out a diagnostic. I believe the setdef files look OK. I have traced through the loader symbol look up function, and the sysinit_set name is there, but the sysuninit_set name is not. I do get the diagnostic printed from my sysinit function. Since there is nothing to the files, I am including the source file try.c, the Makefile, the generated setdef files, and the symbol printouts. The total of everything is less than 1 1/2 pages. Thank you. Sue Wainer wainer@sandgate.com ------=_NextPart_001_0007_01C088D4.206506F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR></HEAD> <BODY> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>I am having = problems getting my=20 SYSUNINIT function called when I do a kldunload.</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>I have reduced my = source file=20 to containing nothing more than a sysinit and sysunit=20 function,</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>both of which only = print out a=20 diagnostic. I believe the setdef files look OK. I have=20 traced</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>through the loader = symbol look=20 up function, and the sysinit_set name is there, but = the</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>sysuninit_set = name is not.=20 I do get the diagnostic printed from my sysinit = function.</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN = class=3D105112207-28012001></SPAN></FONT> </DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>Since there is = nothing to the=20 files, I am including the source file try.c, the = Makefile,</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>the generated = setdef files, and=20 the symbol printouts. The total of everything is less = than</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>1 1/2=20 pages.</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN = class=3D105112207-28012001></SPAN></FONT> </DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>Thank = you.</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001>Sue = Wainer</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN=20 class=3D105112207-28012001>wainer@sandgate.com</SPAN></FONT></DIV> <DIV><FONT size=3D2><SPAN class=3D105112207-28012001> <DIV> </DIV></SPAN></FONT></DIV></BODY></HTML> ------=_NextPart_001_0007_01C088D4.206506F0-- ------=_NextPart_000_0006_01C088D4.20638050 Content-Type: application/msword; name="sue.doc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="sue.doc" try.c: #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> static void asic_init_try __P((void *)); static void asic_uninit_try __P((void *)); SYSINIT(asic_try, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, asic_init_try, = NULL) SYSUNINIT(asic_try, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, asic_uninit_try, = NULL) void asic_init_try(void *dummy) { printf("********GOT INTO INIT***********\n"); } void asic_uninit_try(void *dummy) { printf("********GOT INTO UNINIT***********\n"); } Makefile: SRCS =3D try.c LD +=3D --print-map -Map try.map KMOD =3D try .include <bsd.kmod.mk> setdefs.h: DEFINE_SET(sysinit_set, 1); DEFINE_SET(sysuninit_set, 1); setdef0.c: /* THIS FILE IS GENERATED, DO NOT EDIT. */ #define DEFINE_SET(set, count) \ __asm__(".section .set." #set ",\"aw\""); \ __asm__(".globl " #set); \ __asm__(".type " #set ",@object"); \ __asm__(".p2align 2"); \ __asm__(#set ":"); \ __asm__(".long " #count); \ __asm__(".previous") #include "setdefs.h" /* Contains a `DEFINE_SET' for each set */ setdef1.c: /* THIS FILE IS GENERATED, DO NOT EDIT. */ #define DEFINE_SET(set, count) \ __asm__(".section .set." #set ",\"aw\""); \ __asm__(".long 0"); \ __asm__(".previous") #include "setdefs.h" /* Contains a `DEFINE_SET' for each set */ Diagnostic output when calling linker_elf_symbol_lookup(): Jan 28 02:16:27 BSD2 /kernel.diag: exhaustive search = name=3Dsysuninit_set Jan 28 02:16:27 BSD2 /kernel.diag: now do search Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D Jan 28 02:16:27 BSD2 last message repeated 21 times Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dsetdef0.c Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dgcc2_compiled. Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dtry.c Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dgcc2_compiled. Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dasic_try_sys_init Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dasic_init_try Jan 28 02:16:27 BSD2 /kernel.diag: = strp=3D__set_sysinit_set_sym_asic_try_sys_init Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dasic_try_sys_uninit Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dasic_uninit_try Jan 28 02:16:27 BSD2 /kernel.diag: = strp=3D__set_sysuninit_set_sym_asic_try_sys_uninit Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dsetdef1.c Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dgcc2_compiled. Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dprintf Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dsysinit_set Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D_DYNAMIC Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D_etext Jan 28 02:16:27 BSD2 /kernel.diag: strp=3Dmaintry Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D__bss_start Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D_edata Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D_GLOBAL_OFFSET_TABLE_ Jan 28 02:16:27 BSD2 /kernel.diag: strp=3D_end ------=_NextPart_000_0006_01C088D4.20638050-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NDBBLIBAPKIAHMINJJNFAEAGCEAA.wainer>