Changed the first (name) arg of MOD_DEV(), MOD_EXEC() and MOD_MISC()
from a string to an identifier so that it can be used to generate declarations and strings. It's much easier to stringize an identifier than to identifize a string. A uniform naming scheme must be used for the automatically generated things to apply. This is a feature. Used the module identifer to generate prototypes for the module load, unload and stat functions. Removed the few prototypes for these that already existed. Used the module identifier to generate a unique struct tag in MOD_DEV(). This should probably be done for all the MOD_*() macros. Moved the trailing semicolon from the MOD_*() macro definitions to the macro invocations that didn't already (bogusly) have it. Staticized the module load and unload functions. Added function return types for the module load, unload and stat functions. lkm/ibcs2/ibcs2.c: Included <sys/sysproto.h> to get everything prototyped. Cleaned up #includes. lkm/ibcs2/ipfw.c: Cleaned up #includes. lkm/linux/linux.c: The module name had to change from "linux_emulator" to "linux_mod" to be automatically generated. Cleaned up #includes. lkm/syscons/*/*_saver.c: Completed delcarations of function pointers. sys/i386/isa/atapi.c: The module name had to change from "atapi" to "atapi_mod" to be automatically generated. sys/i386/isa/wcd.c: Used the fixed MOD_DEV(). This module has two devices and expanded the macro in the source instead of fixing it. The module names had to change from "wcd" and "rwcd" to "wcd_mod" and "rwcd_mod" to be automatically generated. sys/pccard/pcic.c: The module name had to change from "pcic" to "pcic_mod" to be automatically generated.
This commit is contained in:
parent
a2c9d3c290
commit
b3e24f9ce9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12276
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: coff.c,v 1.3 1995/10/28 12:34:58 peter Exp $
|
||||
* $Id: coff.c,v 1.4 1995/11/13 07:18:21 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -38,20 +38,23 @@
|
||||
|
||||
extern const struct execsw coff_execsw;
|
||||
|
||||
MOD_EXEC("ibcs2_coff_mod", -1, (struct execsw*)&coff_execsw)
|
||||
MOD_EXEC(ibcs2_coff, -1, (struct execsw*)&coff_execsw);
|
||||
|
||||
static int
|
||||
ibcs2_coff_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("coff loader installed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_coff_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("coff loader removed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_coff_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, ibcs2_coff_load, ibcs2_coff_unload,
|
||||
|
@ -25,31 +25,27 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ibcs2.c,v 1.5 1995/10/28 12:35:03 peter Exp $
|
||||
* $Id: ibcs2.c,v 1.6 1995/11/13 07:18:27 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/lkm.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
MOD_MISC("ibcs2_mod")
|
||||
MOD_MISC(ibcs2);
|
||||
|
||||
int ibcs2_load __P((struct lkm_table *, int));
|
||||
int ibcs2_unload __P((struct lkm_table *, int));
|
||||
int ibcs2_init __P((struct lkm_table *, int, int));
|
||||
|
||||
int
|
||||
static int
|
||||
ibcs2_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("ibcs2 emulator installed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ibcs2_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("ibcs2 emulator removed\n");
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <sys/domain.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/exec.h>
|
||||
@ -38,8 +36,9 @@
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/ip_fw.h>
|
||||
|
||||
MOD_MISC("ipfw_mod")
|
||||
MOD_MISC(ipfw);
|
||||
|
||||
static int
|
||||
ipfw_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
int s=splnet();
|
||||
@ -68,6 +67,7 @@ int s=splnet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipfw_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
int s=splnet();
|
||||
@ -84,6 +84,7 @@ int s=splnet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, ipfw_load, ipfw_unload, lkm_nullcmd);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux.c,v 1.2 1995/10/28 12:35:07 peter Exp $
|
||||
* $Id: linux.c,v 1.3 1995/11/13 07:18:38 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -34,24 +34,26 @@
|
||||
#include <sys/conf.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/lkm.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
extern const struct execsw linux_execsw;
|
||||
|
||||
MOD_EXEC("linux_emulator", -1, (struct execsw*)&linux_execsw)
|
||||
MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw);
|
||||
|
||||
static int
|
||||
linux_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("Linux emulator installed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
linux_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("Linux emulator removed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
linux_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, linux_load, linux_unload, lkm_nullcmd);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: blank_saver.c,v 1.3 1995/10/28 12:35:09 peter Exp $
|
||||
* $Id: blank_saver.c,v 1.4 1995/11/13 07:18:43 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("blank_saver")
|
||||
MOD_MISC(blank_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
blank_saver(int blank)
|
||||
@ -58,6 +58,7 @@ blank_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
blank_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -67,6 +68,7 @@ blank_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
blank_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -75,6 +77,7 @@ blank_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, blank_saver_load, blank_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: fade_saver.c,v 1.3 1995/10/28 12:35:10 peter Exp $
|
||||
* $Id: fade_saver.c,v 1.4 1995/11/13 07:18:48 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("fade_saver")
|
||||
MOD_MISC(fade_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
fade_saver(int blank)
|
||||
@ -73,6 +73,7 @@ fade_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
fade_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -82,6 +83,7 @@ fade_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
fade_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -90,6 +92,7 @@ fade_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, fade_saver_load, fade_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: green_saver.c,v 1.3 1995/10/28 12:35:11 peter Exp $
|
||||
* $Id: green_saver.c,v 1.4 1995/11/13 07:18:58 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("green_saver")
|
||||
MOD_MISC(green_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
green_saver(int blank)
|
||||
@ -62,6 +62,7 @@ green_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
green_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -71,6 +72,7 @@ green_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
green_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -79,6 +81,7 @@ green_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, green_saver_load, green_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: snake_saver.c,v 1.6 1995/10/28 12:35:12 peter Exp $
|
||||
* $Id: snake_saver.c,v 1.7 1995/11/13 07:19:03 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("snake_saver")
|
||||
MOD_MISC(snake_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
snake_saver(int blank)
|
||||
@ -99,6 +99,7 @@ snake_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
snake_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -108,6 +109,7 @@ snake_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
snake_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -116,6 +118,7 @@ snake_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, snake_saver_load, snake_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: star_saver.c,v 1.4 1995/10/28 12:35:14 peter Exp $
|
||||
* $Id: star_saver.c,v 1.5 1995/11/13 07:19:10 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("star_saver")
|
||||
MOD_MISC(star_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
#define NUM_STARS 50
|
||||
|
||||
@ -48,7 +48,7 @@ void (*old_saver)();
|
||||
* Alternate saver that got its inspiration from a well known utility
|
||||
* package for an inferior^H^H^H^H^H^Hfamous OS.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
star_saver(int blank)
|
||||
{
|
||||
scr_stat *scp = cur_console;
|
||||
@ -89,6 +89,7 @@ star_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
star_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -98,6 +99,7 @@ star_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
star_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -106,6 +108,7 @@ star_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
star_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, star_saver_load, star_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: blank_saver.c,v 1.3 1995/10/28 12:35:09 peter Exp $
|
||||
* $Id: blank_saver.c,v 1.4 1995/11/13 07:18:43 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("blank_saver")
|
||||
MOD_MISC(blank_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
blank_saver(int blank)
|
||||
@ -58,6 +58,7 @@ blank_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
blank_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -67,6 +68,7 @@ blank_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
blank_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -75,6 +77,7 @@ blank_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, blank_saver_load, blank_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: fade_saver.c,v 1.3 1995/10/28 12:35:10 peter Exp $
|
||||
* $Id: fade_saver.c,v 1.4 1995/11/13 07:18:48 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("fade_saver")
|
||||
MOD_MISC(fade_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
fade_saver(int blank)
|
||||
@ -73,6 +73,7 @@ fade_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
fade_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -82,6 +83,7 @@ fade_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
fade_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -90,6 +92,7 @@ fade_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, fade_saver_load, fade_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: green_saver.c,v 1.3 1995/10/28 12:35:11 peter Exp $
|
||||
* $Id: green_saver.c,v 1.4 1995/11/13 07:18:58 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("green_saver")
|
||||
MOD_MISC(green_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
green_saver(int blank)
|
||||
@ -62,6 +62,7 @@ green_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
green_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -71,6 +72,7 @@ green_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
green_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -79,6 +81,7 @@ green_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, green_saver_load, green_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: snake_saver.c,v 1.6 1995/10/28 12:35:12 peter Exp $
|
||||
* $Id: snake_saver.c,v 1.7 1995/11/13 07:19:03 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("snake_saver")
|
||||
MOD_MISC(snake_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
snake_saver(int blank)
|
||||
@ -99,6 +99,7 @@ snake_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
snake_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -108,6 +109,7 @@ snake_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
snake_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -116,6 +118,7 @@ snake_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, snake_saver_load, snake_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: star_saver.c,v 1.4 1995/10/28 12:35:14 peter Exp $
|
||||
* $Id: star_saver.c,v 1.5 1995/11/13 07:19:10 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("star_saver")
|
||||
MOD_MISC(star_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
#define NUM_STARS 50
|
||||
|
||||
@ -48,7 +48,7 @@ void (*old_saver)();
|
||||
* Alternate saver that got its inspiration from a well known utility
|
||||
* package for an inferior^H^H^H^H^H^Hfamous OS.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
star_saver(int blank)
|
||||
{
|
||||
scr_stat *scp = cur_console;
|
||||
@ -89,6 +89,7 @@ star_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
star_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -98,6 +99,7 @@ star_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
star_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -106,6 +108,7 @@ star_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
star_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, star_saver_load, star_saver_unload,
|
||||
|
@ -937,7 +937,7 @@ extern void wdintr (int);
|
||||
/*
|
||||
* Construct lkm_misc structure (see lkm.h).
|
||||
*/
|
||||
MOD_MISC("atapi")
|
||||
MOD_MISC(atapi);
|
||||
|
||||
int atapi_locked;
|
||||
|
||||
@ -951,7 +951,7 @@ int atapi_lock (int ctlr)
|
||||
/*
|
||||
* Function called when loading the driver.
|
||||
*/
|
||||
int atapi_load (struct lkm_table *lkmtp, int cmd)
|
||||
static int atapi_load (struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
struct atapidrv *d;
|
||||
int n, x;
|
||||
@ -995,7 +995,7 @@ int atapi_load (struct lkm_table *lkmtp, int cmd)
|
||||
/*
|
||||
* Function called when unloading the driver.
|
||||
*/
|
||||
int atapi_unload (struct lkm_table *lkmtp, int cmd)
|
||||
static int atapi_unload (struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
struct atapi *ata;
|
||||
int u;
|
||||
|
@ -1078,10 +1078,8 @@ struct cdevsw dev_rwcd = { wcdropen, wcdrclose, rawread, nowrite, wcdioctl,
|
||||
* Construct lkm_dev structures (see lkm.h).
|
||||
* Our bdevsw/cdevsw slot numbers are 19/69.
|
||||
*/
|
||||
static struct lkm_dev wcd_module = {
|
||||
LM_DEV, LKM_VERSION, "wcd", 19, LM_DT_BLOCK, { (void*) &dev_wcd } };
|
||||
static struct lkm_dev rwcd_module = {
|
||||
LM_DEV, LKM_VERSION, "rwcd", 69, LM_DT_CHAR, { (void*) &dev_rwcd } };
|
||||
MOD_DEV(wcd, LM_DT_BLOCK, 19, &dev_wcd);
|
||||
MOD_DEV(rwcd, LM_DT_CHAR, 69, &dev_rwcd);
|
||||
|
||||
/*
|
||||
* Function called when loading the driver.
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: coff.c,v 1.3 1995/10/28 12:34:58 peter Exp $
|
||||
* $Id: coff.c,v 1.4 1995/11/13 07:18:21 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -38,20 +38,23 @@
|
||||
|
||||
extern const struct execsw coff_execsw;
|
||||
|
||||
MOD_EXEC("ibcs2_coff_mod", -1, (struct execsw*)&coff_execsw)
|
||||
MOD_EXEC(ibcs2_coff, -1, (struct execsw*)&coff_execsw);
|
||||
|
||||
static int
|
||||
ibcs2_coff_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("coff loader installed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_coff_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("coff loader removed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_coff_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, ibcs2_coff_load, ibcs2_coff_unload,
|
||||
|
@ -25,31 +25,27 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ibcs2.c,v 1.5 1995/10/28 12:35:03 peter Exp $
|
||||
* $Id: ibcs2.c,v 1.6 1995/11/13 07:18:27 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/lkm.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
MOD_MISC("ibcs2_mod")
|
||||
MOD_MISC(ibcs2);
|
||||
|
||||
int ibcs2_load __P((struct lkm_table *, int));
|
||||
int ibcs2_unload __P((struct lkm_table *, int));
|
||||
int ibcs2_init __P((struct lkm_table *, int, int));
|
||||
|
||||
int
|
||||
static int
|
||||
ibcs2_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("ibcs2 emulator installed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ibcs2_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("ibcs2 emulator removed\n");
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux.c,v 1.2 1995/10/28 12:35:07 peter Exp $
|
||||
* $Id: linux.c,v 1.3 1995/11/13 07:18:38 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -34,24 +34,26 @@
|
||||
#include <sys/conf.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/lkm.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
extern const struct execsw linux_execsw;
|
||||
|
||||
MOD_EXEC("linux_emulator", -1, (struct execsw*)&linux_execsw)
|
||||
MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw);
|
||||
|
||||
static int
|
||||
linux_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("Linux emulator installed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
linux_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
uprintf("Linux emulator removed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
linux_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, linux_load, linux_unload, lkm_nullcmd);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: blank_saver.c,v 1.3 1995/10/28 12:35:09 peter Exp $
|
||||
* $Id: blank_saver.c,v 1.4 1995/11/13 07:18:43 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("blank_saver")
|
||||
MOD_MISC(blank_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
blank_saver(int blank)
|
||||
@ -58,6 +58,7 @@ blank_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
blank_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -67,6 +68,7 @@ blank_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
blank_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -75,6 +77,7 @@ blank_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, blank_saver_load, blank_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: fade_saver.c,v 1.3 1995/10/28 12:35:10 peter Exp $
|
||||
* $Id: fade_saver.c,v 1.4 1995/11/13 07:18:48 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("fade_saver")
|
||||
MOD_MISC(fade_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
fade_saver(int blank)
|
||||
@ -73,6 +73,7 @@ fade_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
fade_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -82,6 +83,7 @@ fade_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
fade_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -90,6 +92,7 @@ fade_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, fade_saver_load, fade_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: green_saver.c,v 1.3 1995/10/28 12:35:11 peter Exp $
|
||||
* $Id: green_saver.c,v 1.4 1995/11/13 07:18:58 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("green_saver")
|
||||
MOD_MISC(green_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
green_saver(int blank)
|
||||
@ -62,6 +62,7 @@ green_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
green_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -71,6 +72,7 @@ green_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
green_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -79,6 +81,7 @@ green_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, green_saver_load, green_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: snake_saver.c,v 1.6 1995/10/28 12:35:12 peter Exp $
|
||||
* $Id: snake_saver.c,v 1.7 1995/11/13 07:19:03 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("snake_saver")
|
||||
MOD_MISC(snake_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
static void
|
||||
snake_saver(int blank)
|
||||
@ -99,6 +99,7 @@ snake_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
snake_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -108,6 +109,7 @@ snake_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
snake_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -116,6 +118,7 @@ snake_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, snake_saver_load, snake_saver_unload,
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: star_saver.c,v 1.4 1995/10/28 12:35:14 peter Exp $
|
||||
* $Id: star_saver.c,v 1.5 1995/11/13 07:19:10 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -37,10 +37,10 @@
|
||||
#include <sys/errno.h>
|
||||
#include <saver.h>
|
||||
|
||||
MOD_MISC("star_saver")
|
||||
MOD_MISC(star_saver);
|
||||
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
void (*current_saver)(int blank);
|
||||
void (*old_saver)(int blank);
|
||||
|
||||
#define NUM_STARS 50
|
||||
|
||||
@ -48,7 +48,7 @@ void (*old_saver)();
|
||||
* Alternate saver that got its inspiration from a well known utility
|
||||
* package for an inferior^H^H^H^H^H^Hfamous OS.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
star_saver(int blank)
|
||||
{
|
||||
scr_stat *scp = cur_console;
|
||||
@ -89,6 +89,7 @@ star_saver(int blank)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
star_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -98,6 +99,7 @@ star_saver_load(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
star_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
(*current_saver)(0);
|
||||
@ -106,6 +108,7 @@ star_saver_unload(struct lkm_table *lkmtp, int cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
star_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
|
||||
{
|
||||
DISPATCH(lkmtp, cmd, ver, star_saver_load, star_saver_unload,
|
||||
|
@ -164,10 +164,8 @@ putw (struct pcic_slot *sp, int reg, unsigned short word)
|
||||
* This defines the lkm_misc module use by modload
|
||||
* to define the module name.
|
||||
*/
|
||||
MOD_MISC( "pcic")
|
||||
MOD_MISC(pcic);
|
||||
|
||||
|
||||
static int pcic_unload();
|
||||
/*
|
||||
* Module handler that processes loads and unloads.
|
||||
* Once the module is loaded, the probe routine
|
||||
|
@ -39,7 +39,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
|
||||
* $Id: kernel.h,v 1.13 1995/09/09 18:10:29 davidg Exp $
|
||||
* $Id: kernel.h,v 1.14 1995/11/13 07:18:09 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_KERNEL_H_
|
||||
@ -236,10 +236,12 @@ extern void kproc_start __P((void *udata));
|
||||
|
||||
#define PSEUDO_SET(init, name) \
|
||||
extern struct linker_set MODVNOPS; \
|
||||
MOD_MISC(#name); \
|
||||
int name ## _load(struct lkm_table *lkmtp, int cmd) \
|
||||
{ init((caddr_t)NULL /* XXX unused (?) */); return 0; } \
|
||||
int name ## _unload(struct lkm_table *lkmtp, int cmd) \
|
||||
MOD_MISC(name); \
|
||||
static int \
|
||||
name ## _load(struct lkm_table *lkmtp, int cmd) \
|
||||
{ init((void *)NULL /* XXX unused (?) */); return 0; } \
|
||||
static int \
|
||||
name ## _unload(struct lkm_table *lkmtp, int cmd) \
|
||||
{ return EINVAL; } \
|
||||
int \
|
||||
name ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
|
||||
|
@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: lkm.h,v 1.7 1995/08/05 07:39:02 davidg Exp $
|
||||
* $Id: lkm.h,v 1.8 1995/11/13 07:18:12 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_LKM_H_
|
||||
@ -207,6 +207,10 @@ struct lkm_table {
|
||||
#define LKM_E_UNLOAD 2
|
||||
#define LKM_E_STAT 3
|
||||
|
||||
#define MOD_DECL(name) \
|
||||
static int name ## _load __P((struct lkm_table *lkmtp, int cmd)); \
|
||||
static int name ## _unload __P((struct lkm_table *lkmtp, int cmd)); \
|
||||
int name ## _mod __P((struct lkm_table *lkmtp, int cmd, int ver)) \
|
||||
|
||||
#define MOD_SYSCALL(name,callslot,sysentp) \
|
||||
static struct lkm_syscall _module = { \
|
||||
@ -215,7 +219,7 @@ struct lkm_table {
|
||||
name, \
|
||||
callslot, \
|
||||
sysentp \
|
||||
};
|
||||
}
|
||||
|
||||
#define MOD_VFS(name,vfsslot,vnodeops,vfsconf) \
|
||||
static struct lkm_vfs _module = { \
|
||||
@ -225,34 +229,36 @@ struct lkm_table {
|
||||
vfsslot, \
|
||||
vnodeops, \
|
||||
vfsconf \
|
||||
};
|
||||
}
|
||||
|
||||
#define MOD_DEV(name,devtype,devslot,devp) \
|
||||
static struct lkm_dev _module = { \
|
||||
MOD_DECL(name); \
|
||||
static struct lkm_dev name ## _module = { \
|
||||
LM_DEV, \
|
||||
LKM_VERSION, \
|
||||
name, \
|
||||
#name ## "_mod", \
|
||||
devslot, \
|
||||
devtype, \
|
||||
(void *)devp \
|
||||
};
|
||||
}
|
||||
|
||||
#define MOD_EXEC(name,execslot,execsw) \
|
||||
MOD_DECL(name); \
|
||||
static struct lkm_exec _module = { \
|
||||
LM_EXEC, \
|
||||
LKM_VERSION, \
|
||||
name, \
|
||||
#name ## "_mod", \
|
||||
execslot, \
|
||||
execsw \
|
||||
};
|
||||
}
|
||||
|
||||
#define MOD_MISC(name) \
|
||||
MOD_DECL(name); \
|
||||
static struct lkm_misc _module = { \
|
||||
LM_MISC, \
|
||||
LKM_VERSION, \
|
||||
name \
|
||||
};
|
||||
|
||||
#name ## "_mod" \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user