From owner-newconfig-jp@jp.freebsd.org  Mon Jan 11 11:42:39 1999
Received: (from daemon@localhost)
	by jaz.jp.freebsd.org (8.9.1+3.1W/8.7.3) id LAA25580;
	Mon, 11 Jan 1999 11:42:39 +0900 (JST)
	(envelope-from owner-newconfig-jp@jp.FreeBSD.org)
Received: from ann.hi-ho.ne.jp (root@ann.hi-ho.ne.jp [202.224.128.125])
	by jaz.jp.freebsd.org (8.9.1+3.1W/8.7.3) with ESMTP id LAA25570
	for <newconfig-jp@jp.freebsd.org>; Mon, 11 Jan 1999 11:42:37 +0900 (JST)
	(envelope-from kanaoka@ann.hi-ho.ne.jp)
Received: from localhost (bluerobin.mke.co.jp [210.130.252.139])
	by ann.hi-ho.ne.jp (8.9.1+3.0W/3.6W:Hi-HO) with ESMTP id LAA01925
	for <newconfig-jp@jp.freebsd.org>; Mon, 11 Jan 1999 11:42:35 +0900 (JST)
To: newconfig-jp@jp.freebsd.org
In-Reply-To: Your message of "Mon, 28 Dec 1998 03:34:35 +0900"
	<19981228033435Q.kanaoka@ann.hi-ho.ne.jp>
References: <19981228033435Q.kanaoka@ann.hi-ho.ne.jp>
X-Mailer: Mew version 1.93 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
	boundary="--Next_Part(Mon_Jan_11_11:41:44_1999_809)--"
Content-Transfer-Encoding: 7bit
Message-Id: <19990111114214I.kanaoka@ann.hi-ho.ne.jp>
Date: Mon, 11 Jan 1999 11:42:14 +0900
From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
X-Dispatcher: imput version 980905(IM100)
Lines: 156
Reply-To: newconfig-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+981115
X-Sequence: newconfig-jp 875
Subject: [newconfig-jp 875] Re: sc driver
Errors-To: owner-newconfig-jp@jp.freebsd.org
Sender: owner-newconfig-jp@jp.freebsd.org
X-Originator: kanaoka@ann.hi-ho.ne.jp

----Next_Part(Mon_Jan_11_11:41:44_1999_809)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B6b2,$G$9!#(B

$ $B<j85$GF0:n3NG'$,$G$-$k$N$,!"(Bsio,sc,npx $B$G!"$=$N$&$A(B
$ sc $B$r(B newconfig style $B$K$7$F$_$^$7$?!#(B

sc_sensitive $B$G!"(Bsc driver $B$O@h$K(B match/attach $B$5$l$k$Y$-(B
($B!V(BFreeBSD $B$N%+!<%M%kF~Lg!W$h$j(B)$B$i$7$$$N$G!"(B
$B$A$g$C$H(B sc_match $BItJ,$N$H$3$m$,0c$&$h$&$G$9!#(B

$B>e5-BP1~$r$7$?!"8=:_$N(B CVS-Repository $B$+$i$N(B patch $B$r(B
$B$D$1$^$9!#(B(PC98 $B$O$d$C$F$$$^$;$s!#(B)

---
 Masanori Kanaoka	kana@saijo.mke.mei.co.jp
			kanaoka@ann.hi-ho.ne.jp


----Next_Part(Mon_Jan_11_11:41:44_1999_809)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=sc.patch

Index: sys/i386/isa/syscons.c
===================================================================
RCS file: /home/cvs/newconfig/sys/i386/isa/syscons.c,v
retrieving revision 1.8
diff -u -r1.8 syscons.c
--- syscons.c	1999/01/06 16:10:23	1.8
+++ syscons.c	1999/01/11 02:06:29
@@ -242,9 +242,14 @@
 #define ISSIGVALID(sig)	((sig) > 0 && (sig) < NSIG)
 
 /* prototypes */
+#ifdef NEW_CONFIG
+static int sc_match	__P((struct device *,struct cfdata *,void *));
+static void sc_attach	__P((struct device *,struct device *,void *));
+#else  /* NEW_CONFIG */
 static int scattach(struct isa_device *dev);
-static int scparam(struct tty *tp, struct termios *t);
 static int scprobe(struct isa_device *dev);
+#endif /* NEW_CONFIG */
+static int scparam(struct tty *tp, struct termios *t);
 static int scvidprobe(int unit, int flags);
 static int sckbdprobe(int unit, int flags);
 static void scstart(struct tty *tp);
@@ -304,17 +309,18 @@
 #define scsplash_stick(stick)
 #endif
 
+#ifndef NEW_CONFIG
 struct  isa_driver scdriver = {
     scprobe, scattach, "sc", 1
 };
 
-#ifdef NEW_CONFIG
+#else /*  NEW_CONFIG */
 struct sc_softc {
 	struct  device sc_dev;
 };
 
 struct cfattach sc_ca = {
-	sizeof(struct sc_softc), 0, &scdriver, isa_dev_match, NULL, NULL, NULL,
+	sizeof(struct sc_softc), 1, NULL, sc_match, sc_attach, NULL, NULL,
 };
 #endif
 
@@ -422,6 +428,34 @@
 }
 
 static int
+#ifdef NEW_CONFIG
+sc_match(struct device *parent,struct cfdata *match,void *aux)
+{
+	
+    struct isa_softc *isa_sc = (struct isa_softc *) parent;
+    struct isa_attach_args *ia = (struct isa_attach_args *)aux;
+
+    if (! isa_sc->sc_sensitive)
+	return (0);
+	
+    if (!scvidprobe(match->cf_unit,ia->ia_flags)){
+	if(bootverbose)
+		printf("sc%d : no video adapter is found.\n",match->cf_unit);
+	return (0);
+    }
+#if defined(VESA) && defined(VM86)
+    if (vesa_load())
+	return FALSE;
+#endif
+    (*biosvidsw.diag)(bootverbose);
+
+    sc_port = ia->ia_iobase;
+    if (sckbdprobe(match->cf_unit,ia->ia_flags))
+	return (1);
+    else
+	return ((ia->ia_flags & DETECT_KBD) ? 0 : 1);
+}
+#else  /* NEW_CONFIG */
 scprobe(struct isa_device *dev)
 {
     if (!scvidprobe(dev->id_unit, dev->id_flags)) {
@@ -443,6 +477,7 @@
     else
         return ((dev->id_flags & DETECT_KBD) ? 0 : IO_KBDSIZE);
 }
+#endif /* NEW_CONFIG */
 
 /* probe video adapters, return TRUE if found */ 
 static int
@@ -649,9 +684,18 @@
 }
 #endif
 
+#ifdef NEW_CONFIG
+static void
+sc_attach(struct device *parent,struct device *self,void *aux)
+{
+	struct sc_softc *sc = (struct sc_softc *)self;
+	struct isa_attach_args *ia = (struct isa_attach_args *)aux;
+
+#else  /* NEW_CONFIG */
 static int
 scattach(struct isa_device *dev)
 {
+#endif /* NEW_CONFIG */
     scr_stat *scp;
     video_info_t info;
     dev_t cdev = makedev(CDEV_MAJOR, 0);
@@ -660,7 +704,11 @@
 #endif
 
     scinit();
+#ifdef NEW_CONFIG
+    sc_flags = ia->ia_flags;
+#else  /* NEW_CONFIG */
     sc_flags = dev->id_flags;
+#endif /* NEW_CONFIG */
     if (!ISFONTAVAIL(adp_flags))
 	sc_flags &= ~CHAR_CURSOR;
 
@@ -746,7 +794,9 @@
     sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
 				UID_ROOT, GID_WHEEL, 0600, "consolectl");
 #endif
+#ifndef NEW_CONFIG
     return 0;
+#endif /* NEW_CONFIG */
 }
 
 struct tty

----Next_Part(Mon_Jan_11_11:41:44_1999_809)----
