diff options
author | peter <peter@FreeBSD.org> | 1998-10-16 03:55:01 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-10-16 03:55:01 +0000 |
commit | 464de37ce6099f409aa233200a94ac38216aa211 (patch) | |
tree | 59ed738c6bca93117593ea63241912064597c130 /sys/gnu | |
parent | ad0030e392049cd4f887968f40988dd6cf5e5ee0 (diff) | |
download | FreeBSD-src-464de37ce6099f409aa233200a94ac38216aa211.zip FreeBSD-src-464de37ce6099f409aa233200a94ac38216aa211.tar.gz |
*gulp*. Jordan specifically OK'ed this..
This is the bulk of the support for doing kld modules. Two linker_sets
were replaced by SYSINIT()'s. VFS's and exec handlers are self registered.
kld is now a superset of lkm. I have converted most of them, they will
follow as a seperate commit as samples.
This all still works as a static a.out kernel using LKM's.
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/i386/fpemul/fpu_entry.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/sys/gnu/i386/fpemul/fpu_entry.c b/sys/gnu/i386/fpemul/fpu_entry.c index 1d8b44d..bde2ef6 100644 --- a/sys/gnu/i386/fpemul/fpu_entry.c +++ b/sys/gnu/i386/fpemul/fpu_entry.c @@ -55,7 +55,7 @@ * * W. Metzenthen June 1994. * - * $Id: fpu_entry.c,v 1.13 1997/07/20 08:46:23 bde Exp $ + * $Id: fpu_entry.c,v 1.14 1998/08/16 01:21:48 bde Exp $ * */ @@ -515,15 +515,35 @@ gnufpu_mod(struct lkm_table *lkmtp, int cmd, int ver) } #else /* !LKM */ -static void -gnufpu_init(void *unused) +static int +gnufpu_modevent(module_t mod, modeventtype_t type, void *unused) { - if (pmath_emulate) - printf("Another Math emulator already present\n"); - else - pmath_emulate = math_emulate; + switch (type) { + case MOD_LOAD: + if (pmath_emulate) { + printf("Another Math emulator already present\n"); + return EACCES; + } else + pmath_emulate = math_emulate; + break; + case MOD_UNLOAD: + if (pmath_emulate != math_emulate) { + printf("Cannot unload another math emulator\n"); + return EACCES; + } + pmath_emulate = 0; + break; + default: + break; + } + return 0; + } - -SYSINIT(gnufpu, SI_SUB_CPU, SI_ORDER_ANY, gnufpu_init, NULL); +moduledata_t gnufpumod = { + "gnufpu", + gnufpu_modevent, + 0 +}; +DECLARE_MODULE(gnufpu, gnufpu_modevent, SI_SUB_PSEUDO, SI_ORDER_ANY); #endif /* LKM */ |