mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 23:05:49 +01:00
Move the kld stuff to here.
This commit is contained in:
parent
d259be02bc
commit
a4bc95cff9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40611
@ -33,7 +33,7 @@
|
||||
* otherwise) arising in any way out of the use of this software, even if
|
||||
* advised of the possibility of such damage.
|
||||
*
|
||||
* $Id: vinum.c,v 1.19 1998/08/13 05:24:02 grog Exp grog $
|
||||
* $Id: vinum.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
|
||||
*/
|
||||
|
||||
#define STATIC /* nothing while we're testing XXX */
|
||||
@ -76,6 +76,10 @@ void vinum_scandisk(void);
|
||||
int vinum_inactive(void);
|
||||
void free_vinum(int);
|
||||
|
||||
#ifndef ACTUALLY_LKM_NOT_KERNEL
|
||||
STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
|
||||
#endif
|
||||
|
||||
#if __FreeBSD__ >= 3
|
||||
/* Why aren't these declared anywhere? XXX */
|
||||
int setjmp(jmp_buf);
|
||||
@ -161,8 +165,6 @@ vinumattach(void *dummy)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
|
||||
|
||||
/* Check if we have anything open. If so, return 0 (not inactive),
|
||||
* otherwise 1 (inactive) */
|
||||
int
|
||||
@ -228,6 +230,7 @@ free_vinum(int cleardrive)
|
||||
bzero(&vinum_conf, sizeof(vinum_conf));
|
||||
}
|
||||
|
||||
#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
|
||||
MOD_MISC(vinum);
|
||||
|
||||
/*
|
||||
@ -289,7 +292,38 @@ vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
}
|
||||
|
||||
#else /* not LKM */
|
||||
#error "This driver must be compiled as a loadable kernel module"
|
||||
|
||||
STATIC int
|
||||
vinum_modevent(module_t mod, modeventtype_t type, void *unused)
|
||||
{
|
||||
struct sync_args dummyarg = {0};
|
||||
|
||||
BROKEN_GDB;
|
||||
switch (type) {
|
||||
case MOD_LOAD:
|
||||
/* Debugger ("vinum_load"); */
|
||||
vinumattach(NULL);
|
||||
return 0; /* OK */
|
||||
case MOD_UNLOAD:
|
||||
if (!vinum_inactive()) /* is anything open? */
|
||||
return EBUSY;
|
||||
sync(curproc, &dummyarg); /* write out buffers */
|
||||
free_vinum(0); /* no: clean up */
|
||||
cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
moduledata_t vinum_mod = {
|
||||
"vinum",
|
||||
vinum_modevent,
|
||||
0
|
||||
};
|
||||
DECLARE_MODULE(vinum, vinum_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
|
||||
|
||||
#endif /* LKM */
|
||||
|
||||
/* ARGSUSED */
|
||||
|
@ -33,7 +33,7 @@
|
||||
* otherwise) arising in any way out of the use of this software, even if
|
||||
* advised of the possibility of such damage.
|
||||
*
|
||||
* $Id: vinum.c,v 1.19 1998/08/13 05:24:02 grog Exp grog $
|
||||
* $Id: vinum.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
|
||||
*/
|
||||
|
||||
#define STATIC /* nothing while we're testing XXX */
|
||||
@ -76,6 +76,10 @@ void vinum_scandisk(void);
|
||||
int vinum_inactive(void);
|
||||
void free_vinum(int);
|
||||
|
||||
#ifndef ACTUALLY_LKM_NOT_KERNEL
|
||||
STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
|
||||
#endif
|
||||
|
||||
#if __FreeBSD__ >= 3
|
||||
/* Why aren't these declared anywhere? XXX */
|
||||
int setjmp(jmp_buf);
|
||||
@ -161,8 +165,6 @@ vinumattach(void *dummy)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
|
||||
|
||||
/* Check if we have anything open. If so, return 0 (not inactive),
|
||||
* otherwise 1 (inactive) */
|
||||
int
|
||||
@ -228,6 +230,7 @@ free_vinum(int cleardrive)
|
||||
bzero(&vinum_conf, sizeof(vinum_conf));
|
||||
}
|
||||
|
||||
#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
|
||||
MOD_MISC(vinum);
|
||||
|
||||
/*
|
||||
@ -289,7 +292,38 @@ vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
}
|
||||
|
||||
#else /* not LKM */
|
||||
#error "This driver must be compiled as a loadable kernel module"
|
||||
|
||||
STATIC int
|
||||
vinum_modevent(module_t mod, modeventtype_t type, void *unused)
|
||||
{
|
||||
struct sync_args dummyarg = {0};
|
||||
|
||||
BROKEN_GDB;
|
||||
switch (type) {
|
||||
case MOD_LOAD:
|
||||
/* Debugger ("vinum_load"); */
|
||||
vinumattach(NULL);
|
||||
return 0; /* OK */
|
||||
case MOD_UNLOAD:
|
||||
if (!vinum_inactive()) /* is anything open? */
|
||||
return EBUSY;
|
||||
sync(curproc, &dummyarg); /* write out buffers */
|
||||
free_vinum(0); /* no: clean up */
|
||||
cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
moduledata_t vinum_mod = {
|
||||
"vinum",
|
||||
vinum_modevent,
|
||||
0
|
||||
};
|
||||
DECLARE_MODULE(vinum, vinum_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
|
||||
|
||||
#endif /* LKM */
|
||||
|
||||
/* ARGSUSED */
|
||||
|
Loading…
Reference in New Issue
Block a user