Support for pseudo-device LKMs. Note that this is restricted to only

one pseudo per module (a restriction which will eventually be lifted) and
isthus not in its final form.
This commit is contained in:
wollman 1995-03-20 19:20:44 +00:00
parent 9786661cb0
commit 1a3906ad11
6 changed files with 14 additions and 15 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93
* $Id: if_disc.c,v 1.1 1994/12/22 21:00:05 wollman Exp $
* $Id: if_disc.c,v 1.2 1995/03/17 22:02:18 wollman Exp $
*/
/*
@ -105,7 +105,7 @@ discattach(void)
#endif
}
PSEUDO_SET(discattach);
PSEUDO_SET(discattach, if_disc);
static int
dsoutput(ifp, m, dst, rt)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)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_loop.c,v 1.7 1995/03/04 04:28:50 davidg Exp $
*/
/*
@ -101,7 +101,7 @@ loopattach(void)
#endif
}
TEXT_SET(pseudo_set, loopattach);
PSEUDO_SET(loopattach, if_loop);
int
looutput(ifp, m, dst, rt)

View File

@ -69,7 +69,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
/* $Id: if_ppp.c,v 1.9 1994/11/27 15:29:56 bde Exp $ */
/* $Id: if_ppp.c,v 1.10 1995/02/13 02:09:13 ache Exp $ */
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
#include "ppp.h"
@ -1610,6 +1610,6 @@ pppdumpb(b, l)
printf("%s\n", buf);
}
TEXT_SET(pseudo_set, pppattach);
PSEUDO_SET(pppattach, if_ppp);
#endif /* NPPP > 0 */

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_sl.c 8.6 (Berkeley) 2/1/94
* $Id: if_sl.c,v 1.12 1995/02/13 02:09:14 ache Exp $
* $Id: if_sl.c,v 1.13 1995/03/16 18:14:27 bde Exp $
*/
/*
@ -220,7 +220,7 @@ slattach()
}
}
PSEUDO_SET(slattach);
PSEUDO_SET(slattach, if_sl);
static int
slinit(sc)

View File

@ -76,13 +76,12 @@ int tunwrite __P((dev_t, struct uio *));
int tunioctl __P((dev_t, int, caddr_t, int, struct proc *));
int tunifioctl __P((struct ifnet *, int, caddr_t));
int tunselect __P((dev_t, int));
void tunattach __P((int));
void tunattach __P((void));
static int tuninit __P((int));
void
tunattach(unused)
int unused;
tunattach()
{
register int i;
struct ifnet *ifp;
@ -112,7 +111,7 @@ tunattach(unused)
}
#ifdef __FreeBSD__
PSEUDO_SET(tunattach);
PSEUDO_SET(tunattach, if_tun);
#endif
/*

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
* $Id: kernel.h,v 1.7 1995/03/16 18:16:18 bde Exp $
* $Id: kernel.h,v 1.8 1995/03/17 22:02:05 wollman Exp $
*/
#ifndef _SYS_KERNEL_H_
@ -91,7 +91,7 @@ extern long timedelta;
#define PSEUDO_SET(init, name) \
extern struct linker_set MODVNOPS; \
MOD_MISC(#fsname); \
MOD_MISC(#name); \
int name ## _load(struct lkm_table *lkmtp, int cmd) \
{ init(); return 0; } \
int name ## _unload(struct lkm_table *lkmtp, int cmd) \
@ -102,7 +102,7 @@ extern long timedelta;
nosys); }
#else /* PSEUDO_LKM */
#define PSEUDO_SET(sym) TEXT_SET(pseudo_set, sym)
#define PSEUDO_SET(sym, name) TEXT_SET(pseudo_set, sym)
#endif /* PSEUDO_LKM */