diff --git a/sys/dev/syscons/scvesactl.c b/sys/dev/syscons/scvesactl.c index 39ac7ea17f6e..a1507c8191e5 100644 --- a/sys/dev/syscons/scvesactl.c +++ b/sys/dev/syscons/scvesactl.c @@ -23,14 +23,14 @@ * (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: scvesactl.c,v 1.6 1998/10/01 11:39:17 yokota Exp $ + * $Id: scvesactl.c,v 1.7 1998/12/07 21:58:22 archie Exp $ */ #include "sc.h" #include "opt_vesa.h" #include "opt_vm86.h" -#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE) +#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE) #include #include @@ -137,4 +137,4 @@ vesa_unload_ioctl(void) return 0; } -#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */ +#endif /* (NSC > 0 && VESA && VM86) || KLD_MODULE */ diff --git a/sys/i386/isa/scvesactl.c b/sys/i386/isa/scvesactl.c index 39ac7ea17f6e..a1507c8191e5 100644 --- a/sys/i386/isa/scvesactl.c +++ b/sys/i386/isa/scvesactl.c @@ -23,14 +23,14 @@ * (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: scvesactl.c,v 1.6 1998/10/01 11:39:17 yokota Exp $ + * $Id: scvesactl.c,v 1.7 1998/12/07 21:58:22 archie Exp $ */ #include "sc.h" #include "opt_vesa.h" #include "opt_vm86.h" -#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE) +#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE) #include #include @@ -137,4 +137,4 @@ vesa_unload_ioctl(void) return 0; } -#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */ +#endif /* (NSC > 0 && VESA && VM86) || KLD_MODULE */ diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c index 29f2e3d795d2..f069d1607bc0 100644 --- a/sys/i386/isa/vesa.c +++ b/sys/i386/isa/vesa.c @@ -23,18 +23,19 @@ * (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: vesa.c,v 1.8 1998/10/02 03:42:19 yokota Exp $ + * $Id: vesa.c,v 1.9 1998/12/07 21:58:24 archie Exp $ */ #include "sc.h" #include "opt_vesa.h" #include "opt_vm86.h" -#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE) +#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE) #include #include #include +#include #include #include #include @@ -47,14 +48,6 @@ #include -#ifdef VESA_MODULE -#include -#include -#include - -MOD_MISC(vesa); -#endif - /* VESA video adapter state buffer stub */ struct adp_state { int sig; @@ -759,7 +752,7 @@ vesa_diag(int level) struct vesa_mode vmode; int i; -#ifndef VESA_MODULE +#ifndef KLD_MODULE /* call the previous handler first */ (*prevvidsw.diag)(level); #endif @@ -831,17 +824,15 @@ vesa_diag(int level) /* module loading */ -#ifdef VESA_MODULE -static int -vesa_load(struct lkm_table *lkmtp, int cmd) -#else +#ifdef KLD_MODULE +static +#endif int vesa_load(void) -#endif { int adapters; int error; -#ifdef VESA_MODULE +#ifdef KLD_MODULE int s; #endif int i; @@ -878,7 +869,7 @@ vesa_load(void) V_INFO_COLOR : 0); } -#ifdef VESA_MODULE +#ifdef KLD_MODULE s = spltty(); #endif if ((error = vesa_load_ioctl()) == 0) { @@ -886,7 +877,7 @@ vesa_load(void) bcopy(&vesavidsw, &biosvidsw, sizeof(vesavidsw)); vesa_init_done = TRUE; } -#ifdef VESA_MODULE +#ifdef KLD_MODULE splx(s); if (error == 0) @@ -896,10 +887,10 @@ vesa_load(void) return error; } -#ifdef VESA_MODULE +#ifdef KLD_MODULE static int -vesa_unload(struct lkm_table *lkmtp, int cmd) +vesa_unload(void) { int error; int s; @@ -923,13 +914,28 @@ vesa_unload(struct lkm_table *lkmtp, int cmd) return error; } -int -vesa_mod(struct lkm_table *lkmtp, int cmd, int ver) +static int +vesa_mod_event(module_t mod, int type, void *data) { - MOD_DISPATCH(vesa, lkmtp, cmd, ver, - vesa_load, vesa_unload, lkm_nullcmd); + switch (type) { + case MOD_LOAD: + return vesa_load(); + case MOD_UNLOAD: + return vesa_unload(); + default: + break; + } + return 0; } -#endif /* VESA_MODULE */ +static moduledata_t vesa_mod = { + "vesa", + vesa_mod_event, + NULL, +}; -#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */ +DECLARE_MODULE(vesa, vesa_mod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE); + +#endif /* KLD_MODULE */ + +#endif /* (NSC > 0 && VESA && VM86) || KLD_MODULE */ diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 1af9a760c6c0..de542380c02e 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -1,8 +1,8 @@ -# $Id: Makefile,v 1.41 1998/12/27 19:43:28 sos Exp $ +# $Id: Makefile,v 1.42 1998/12/28 05:27:19 peter Exp $ # XXX present but broken: ip_mroute_mod # XXX not yet completed porting: pcic syscons/* -# XXX builds but not updated: atapi, wcd, maybe vesa +# XXX builds but not updated: atapi, wcd SUBDIR= ccd cd9660 coda fdesc if_disc if_ppp if_sl if_tun ipfw kernfs \ mfs msdos nfs nullfs portal procfs umapfs union vinum diff --git a/sys/modules/vesa/Makefile b/sys/modules/vesa/Makefile index 62dd4bc141e6..a44334c22ddc 100644 --- a/sys/modules/vesa/Makefile +++ b/sys/modules/vesa/Makefile @@ -1,10 +1,9 @@ -# $Id: Makefile,v 1.2 1998/09/15 20:14:11 sos Exp $ +# $Id: Makefile,v 1.3 1998/10/16 04:30:51 peter Exp $ .PATH: ${.CURDIR}/../../i386/isa KMOD = vesa SRCS = vesa.c scvesactl.c sc.h opt_vesa.h opt_vm86.h NOMAN = -CFLAGS += -DVESA_MODULE CLEANFILES += sc.h opt_vesa.h opt_vm86.h sc.h: