Beginnings of support for loadable pseudo-devices. bsd.kmod.mk support

and Makefiles for the more interesting ones to come on Monday.
This commit is contained in:
Garrett Wollman 1995-03-17 22:02:18 +00:00
parent c8c244128f
commit e1838a91c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7117
2 changed files with 24 additions and 3 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93
* $Id: if_loop.c,v 1.6 1994/08/08 12:07:25 davidg Exp $
* $Id: if_disc.c,v 1.1 1994/12/22 21:00:05 wollman Exp $
*/
/*
@ -105,7 +105,7 @@ discattach(void)
#endif
}
TEXT_SET(pseudo_set, discattach);
PSEUDO_SET(discattach);
static int
dsoutput(ifp, m, dst, rt)

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
* $Id: kernel.h,v 1.6 1994/10/05 21:23:38 wollman Exp $
* $Id: kernel.h,v 1.7 1995/03/16 18:16:18 bde Exp $
*/
#ifndef _SYS_KERNEL_H_
@ -83,8 +83,29 @@ extern long timedelta;
#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
#ifdef PSEUDO_LKM
#include <sys/conf.h>
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/lkm.h>
#define PSEUDO_SET(init, name) \
extern struct linker_set MODVNOPS; \
MOD_MISC(#fsname); \
int name ## _load(struct lkm_table *lkmtp, int cmd) \
{ init(); return 0; } \
int name ## _unload(struct lkm_table *lkmtp, int cmd) \
{ return EINVAL; } \
int \
name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
DISPATCH(lkmtp, cmd, ver, name ## _load, name ## _unload, \
nosys); }
#else /* PSEUDO_LKM */
#define PSEUDO_SET(sym) TEXT_SET(pseudo_set, sym)
#endif /* PSEUDO_LKM */
struct linker_set {
int ls_length;
caddr_t ls_items[1]; /* really ls_length of them, trailing NULL */