diff options
author | phk <phk@FreeBSD.org> | 1994-10-20 00:08:31 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-10-20 00:08:31 +0000 |
commit | c006d3d459bea4c55979f37246a972aa62af5074 (patch) | |
tree | d9db131bb2c95c74c890049903663fc06ceb8d34 /sys | |
parent | c5bd2be246c76a1d84e3c48edca810e6f637312e (diff) | |
download | FreeBSD-src-c006d3d459bea4c55979f37246a972aa62af5074.zip FreeBSD-src-c006d3d459bea4c55979f37246a972aa62af5074.tar.gz |
Peter Dufaults comconsole changes.
Submitted by: Peter Dufault
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/locore.S | 13 | ||||
-rw-r--r-- | sys/amd64/amd64/locore.s | 13 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 4 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 16 | ||||
-rw-r--r-- | sys/i386/i386/cons.c | 18 | ||||
-rw-r--r-- | sys/i386/i386/cons.h | 4 | ||||
-rw-r--r-- | sys/i386/i386/locore.s | 13 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/syscons.c | 16 | ||||
-rw-r--r-- | sys/i386/isa/wd.c | 6 | ||||
-rw-r--r-- | sys/isa/syscons.c | 16 | ||||
-rw-r--r-- | sys/kern/init_main.c | 7 | ||||
-rw-r--r-- | sys/kern/tty_cons.c | 18 | ||||
-rw-r--r-- | sys/scsi/sd.c | 7 | ||||
-rw-r--r-- | sys/sys/cons.h | 4 |
15 files changed, 92 insertions, 67 deletions
diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index db6e252..0a8bc9b 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.35 1994/10/08 06:20:52 rgrimes Exp $ + * $Id: locore.s,v 1.36 1994/10/10 01:10:21 phk Exp $ */ /* @@ -693,17 +693,20 @@ NON_GPROF_ENTRY(btext) ret begin: /* now running relocated at KERNBASE where the system is linked to run */ - - .globl _Crtat /* XXX - locore should not know about */ - movl _Crtat,%eax /* variables of device drivers (pccons)! */ - subl $(KERNBASE+0xA0000),%eax movl _atdevphys,%edx /* get pte PA */ subl _KPTphys,%edx /* remove base of ptes, now have phys offset */ shll $PGSHIFT-2,%edx /* corresponding to virt offset */ addl $KERNBASE,%edx /* add virtual base */ movl %edx,_atdevbase + +#if N_SC > 0 + /* XXX: can't scinit relocate Crtat relative to atdevbase itself? */ + .globl _Crtat /* XXX - locore should not know about */ + movl _Crtat,%eax /* variables of device drivers (pccons)! */ + subl $(KERNBASE+0xA0000),%eax addl %eax,%edx movl %edx,_Crtat +#endif /* set up bootstrap stack - 48 bytes */ movl $_kstack+UPAGES*NBPG-4*12,%esp /* bootstrap stack end location */ diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index db6e252..0a8bc9b 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.35 1994/10/08 06:20:52 rgrimes Exp $ + * $Id: locore.s,v 1.36 1994/10/10 01:10:21 phk Exp $ */ /* @@ -693,17 +693,20 @@ NON_GPROF_ENTRY(btext) ret begin: /* now running relocated at KERNBASE where the system is linked to run */ - - .globl _Crtat /* XXX - locore should not know about */ - movl _Crtat,%eax /* variables of device drivers (pccons)! */ - subl $(KERNBASE+0xA0000),%eax movl _atdevphys,%edx /* get pte PA */ subl _KPTphys,%edx /* remove base of ptes, now have phys offset */ shll $PGSHIFT-2,%edx /* corresponding to virt offset */ addl $KERNBASE,%edx /* add virtual base */ movl %edx,_atdevbase + +#if N_SC > 0 + /* XXX: can't scinit relocate Crtat relative to atdevbase itself? */ + .globl _Crtat /* XXX - locore should not know about */ + movl _Crtat,%eax /* variables of device drivers (pccons)! */ + subl $(KERNBASE+0xA0000),%eax addl %eax,%edx movl %edx,_Crtat +#endif /* set up bootstrap stack - 48 bytes */ movl $_kstack+UPAGES*NBPG-4*12,%esp /* bootstrap stack end location */ diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index f34e8f3..2dac4d8 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.76 1994/10/18 03:40:14 ache Exp $ + * $Id: machdep.c,v 1.77 1994/10/19 00:05:59 wollman Exp $ */ #include "npx.h" @@ -773,7 +773,7 @@ boot(arghowto) PANIC_REBOOT_WAIT_TIME); for (loop = PANIC_REBOOT_WAIT_TIME; loop > 0; --loop) { DELAY(1000 * 1000); /* one second */ - if (sgetc(1)) /* Did user type a key? */ + if (cncheckc()) /* Did user type a key? */ break; } if (!loop) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 023ea27..229b981 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: syscons.c,v 1.68 1994/10/17 22:12:06 sos Exp $ + * $Id: syscons.c,v 1.69 1994/10/18 03:34:53 ache Exp $ */ #include "sc.h" @@ -213,9 +213,9 @@ void pccnprobe(struct consdev *cp); void pccninit(struct consdev *cp); void pccnputc(dev_t dev, char c); int pccngetc(dev_t dev); +int pccncheckc(dev_t dev); void scintr(int unit); int pcmmap(dev_t dev, int offset, int nprot); -u_int sgetc(int noblock); int getchar(void); static void scinit(void); static void scput(u_char c); @@ -1184,6 +1184,12 @@ pccngetc(dev_t dev) return(c); } +int +pccncheckc(dev_t dev) +{ + return (scgetc(1) & 0xff); +} + static void none_saver(int test) { @@ -2543,12 +2549,6 @@ getchar(void) } } -u_int -sgetc(int noblock) -{ - return (scgetc(noblock) & 0xff); -} - int pcmmap(dev_t dev, int offset, int nprot) { diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c index e7da720..1ad442a 100644 --- a/sys/i386/i386/cons.c +++ b/sys/i386/i386/cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.14 1994/08/30 19:36:35 davidg Exp $ + * $Id: cons.c,v 1.15 1994/08/31 07:44:22 davidg Exp $ */ @@ -57,20 +57,20 @@ /* XXX - all this could be autoconfig()ed */ #include "sc.h" #if NSC > 0 -int pccnprobe(), pccninit(), pccngetc(), pccnputc(); +int pccnprobe(), pccninit(), pccngetc(), pccncheckc(), pccnputc(); #endif #include "sio.h" #if NSIO > 0 -int siocnprobe(), siocninit(), siocngetc(), siocnputc(); +int siocnprobe(), siocninit(), siocngetc(), siocncheckc(), siocnputc(); #endif struct consdev constab[] = { #if NSC > 0 - { pccnprobe, pccninit, pccngetc, pccnputc }, + { pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc }, #endif #if NSIO > 0 - { siocnprobe, siocninit, siocngetc, siocnputc }, + { siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc }, #endif { 0 }, }; @@ -217,6 +217,14 @@ cngetc() return ((*cn_tab->cn_getc)(cn_tab->cn_dev)); } +int +cncheckc() +{ + if (cn_tab == NULL) + return (0); + return ((*cn_tab->cn_checkc)(cn_tab->cn_dev)); +} + void cnputc(c) register int c; diff --git a/sys/i386/i386/cons.h b/sys/i386/i386/cons.h index 2766193..1e1b2f2 100644 --- a/sys/i386/i386/cons.h +++ b/sys/i386/i386/cons.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.h 7.2 (Berkeley) 5/9/91 - * $Id: cons.h,v 1.3 1993/11/07 17:41:33 wollman Exp $ + * $Id: cons.h,v 1.5 1994/05/25 08:53:05 rgrimes Exp $ */ #ifndef _MACHINE_CONS_H_ @@ -46,6 +46,7 @@ struct consdev { int (*cn_probe)(); /* probe hardware and fill in consdev info */ int (*cn_init)(); /* turn on as console */ int (*cn_getc)(); /* kernel getchar interface */ + int (*cn_checkc)(); /* kernel "return char if available" interface */ int (*cn_putc)(); /* kernel putchar interface */ struct tty *cn_tp; /* tty structure for console device */ dev_t cn_dev; /* major/minor of device */ @@ -79,6 +80,7 @@ extern int cnselect(dev_t, int, struct proc *); /* other kernel entry points */ extern void cninit(void); extern int cngetc(void); +extern int cncheckc(void); extern void cnputc(int /*char*/); extern int pg(const char *, ...); diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index db6e252..0a8bc9b 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.35 1994/10/08 06:20:52 rgrimes Exp $ + * $Id: locore.s,v 1.36 1994/10/10 01:10:21 phk Exp $ */ /* @@ -693,17 +693,20 @@ NON_GPROF_ENTRY(btext) ret begin: /* now running relocated at KERNBASE where the system is linked to run */ - - .globl _Crtat /* XXX - locore should not know about */ - movl _Crtat,%eax /* variables of device drivers (pccons)! */ - subl $(KERNBASE+0xA0000),%eax movl _atdevphys,%edx /* get pte PA */ subl _KPTphys,%edx /* remove base of ptes, now have phys offset */ shll $PGSHIFT-2,%edx /* corresponding to virt offset */ addl $KERNBASE,%edx /* add virtual base */ movl %edx,_atdevbase + +#if N_SC > 0 + /* XXX: can't scinit relocate Crtat relative to atdevbase itself? */ + .globl _Crtat /* XXX - locore should not know about */ + movl _Crtat,%eax /* variables of device drivers (pccons)! */ + subl $(KERNBASE+0xA0000),%eax addl %eax,%edx movl %edx,_Crtat +#endif /* set up bootstrap stack - 48 bytes */ movl $_kstack+UPAGES*NBPG-4*12,%esp /* bootstrap stack end location */ diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index f34e8f3..2dac4d8 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.76 1994/10/18 03:40:14 ache Exp $ + * $Id: machdep.c,v 1.77 1994/10/19 00:05:59 wollman Exp $ */ #include "npx.h" @@ -773,7 +773,7 @@ boot(arghowto) PANIC_REBOOT_WAIT_TIME); for (loop = PANIC_REBOOT_WAIT_TIME; loop > 0; --loop) { DELAY(1000 * 1000); /* one second */ - if (sgetc(1)) /* Did user type a key? */ + if (cncheckc()) /* Did user type a key? */ break; } if (!loop) diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index 023ea27..229b981 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: syscons.c,v 1.68 1994/10/17 22:12:06 sos Exp $ + * $Id: syscons.c,v 1.69 1994/10/18 03:34:53 ache Exp $ */ #include "sc.h" @@ -213,9 +213,9 @@ void pccnprobe(struct consdev *cp); void pccninit(struct consdev *cp); void pccnputc(dev_t dev, char c); int pccngetc(dev_t dev); +int pccncheckc(dev_t dev); void scintr(int unit); int pcmmap(dev_t dev, int offset, int nprot); -u_int sgetc(int noblock); int getchar(void); static void scinit(void); static void scput(u_char c); @@ -1184,6 +1184,12 @@ pccngetc(dev_t dev) return(c); } +int +pccncheckc(dev_t dev) +{ + return (scgetc(1) & 0xff); +} + static void none_saver(int test) { @@ -2543,12 +2549,6 @@ getchar(void) } } -u_int -sgetc(int noblock) -{ - return (scgetc(noblock) & 0xff); -} - int pcmmap(dev_t dev, int offset, int nprot) { diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index f52afef..6d4eeb7 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -37,7 +37,7 @@ static int wdtest = 0; * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.52 1994/10/17 23:34:21 wollman Exp $ + * $Id: wd.c,v 1.53 1994/10/19 00:08:07 wollman Exp $ */ /* TODO: @@ -1572,7 +1572,7 @@ wddump(dev_t dev) extern caddr_t CADDR1; /* Toss any characters present prior to dump. */ - while (sgetc(1)) + while (cncheckc()) ; /* Check for acceptable device. */ @@ -1753,7 +1753,7 @@ out: blknum = blknext; /* Operator aborting dump? */ - if (sgetc(1) & 0xff) /* EWS: A hack to work with syscons */ + if (cncheckc()) return (EINTR); } return (0); diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index 023ea27..229b981 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: syscons.c,v 1.68 1994/10/17 22:12:06 sos Exp $ + * $Id: syscons.c,v 1.69 1994/10/18 03:34:53 ache Exp $ */ #include "sc.h" @@ -213,9 +213,9 @@ void pccnprobe(struct consdev *cp); void pccninit(struct consdev *cp); void pccnputc(dev_t dev, char c); int pccngetc(dev_t dev); +int pccncheckc(dev_t dev); void scintr(int unit); int pcmmap(dev_t dev, int offset, int nprot); -u_int sgetc(int noblock); int getchar(void); static void scinit(void); static void scput(u_char c); @@ -1184,6 +1184,12 @@ pccngetc(dev_t dev) return(c); } +int +pccncheckc(dev_t dev) +{ + return (scgetc(1) & 0xff); +} + static void none_saver(int test) { @@ -2543,12 +2549,6 @@ getchar(void) } } -u_int -sgetc(int noblock) -{ - return (scgetc(noblock) & 0xff); -} - int pcmmap(dev_t dev, int offset, int nprot) { diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 815fac1..1883067 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.12 1994/10/02 04:45:45 davidg Exp $ + * $Id: init_main.c,v 1.13 1994/10/09 07:34:52 davidg Exp $ */ #include <sys/param.h> @@ -136,11 +136,6 @@ main(framep) */ p = &proc0; curproc = p; - /* - * Attempt to find console and initialize - * in case of early panic or other messages. - */ - consinit(); printf(copyright); vm_mem_init(); diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index e7da720..1ad442a 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.14 1994/08/30 19:36:35 davidg Exp $ + * $Id: cons.c,v 1.15 1994/08/31 07:44:22 davidg Exp $ */ @@ -57,20 +57,20 @@ /* XXX - all this could be autoconfig()ed */ #include "sc.h" #if NSC > 0 -int pccnprobe(), pccninit(), pccngetc(), pccnputc(); +int pccnprobe(), pccninit(), pccngetc(), pccncheckc(), pccnputc(); #endif #include "sio.h" #if NSIO > 0 -int siocnprobe(), siocninit(), siocngetc(), siocnputc(); +int siocnprobe(), siocninit(), siocngetc(), siocncheckc(), siocnputc(); #endif struct consdev constab[] = { #if NSC > 0 - { pccnprobe, pccninit, pccngetc, pccnputc }, + { pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc }, #endif #if NSIO > 0 - { siocnprobe, siocninit, siocngetc, siocnputc }, + { siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc }, #endif { 0 }, }; @@ -217,6 +217,14 @@ cngetc() return ((*cn_tab->cn_getc)(cn_tab->cn_dev)); } +int +cncheckc() +{ + if (cn_tab == NULL) + return (0); + return ((*cn_tab->cn_checkc)(cn_tab->cn_dev)); +} + void cnputc(c) register int c; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 2cc9614..9ef1357 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.34 1994/10/08 22:26:40 phk Exp $ + * $Id: sd.c,v 1.35 1994/10/19 00:09:45 wollman Exp $ */ #define SPLSD splbio @@ -1020,7 +1020,8 @@ sddump(dev_t dev) addr = (char *) 0; /* starting address */ /* toss any characters present prior to dump */ - while ((c = sgetc(1)) && (c != 0x100)); /*syscons and pccons differ */ + while ((c = cncheckc(1)) && (c != 0x100)); + /*syscons and pccons differ */ /* size of memory to dump */ num = Maxmem; @@ -1114,7 +1115,7 @@ sddump(dev_t dev) (int) addr += 512 * blkcnt; /* operator aborting dump? */ - if ((c = sgetc(1)) && (c != 0x100)) + if ((c = cncheckc(1)) && (c != 0x100)) return (EINTR); } return (0); diff --git a/sys/sys/cons.h b/sys/sys/cons.h index 2766193..1e1b2f2 100644 --- a/sys/sys/cons.h +++ b/sys/sys/cons.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.h 7.2 (Berkeley) 5/9/91 - * $Id: cons.h,v 1.3 1993/11/07 17:41:33 wollman Exp $ + * $Id: cons.h,v 1.5 1994/05/25 08:53:05 rgrimes Exp $ */ #ifndef _MACHINE_CONS_H_ @@ -46,6 +46,7 @@ struct consdev { int (*cn_probe)(); /* probe hardware and fill in consdev info */ int (*cn_init)(); /* turn on as console */ int (*cn_getc)(); /* kernel getchar interface */ + int (*cn_checkc)(); /* kernel "return char if available" interface */ int (*cn_putc)(); /* kernel putchar interface */ struct tty *cn_tp; /* tty structure for console device */ dev_t cn_dev; /* major/minor of device */ @@ -79,6 +80,7 @@ extern int cnselect(dev_t, int, struct proc *); /* other kernel entry points */ extern void cninit(void); extern int cngetc(void); +extern int cncheckc(void); extern void cnputc(int /*char*/); extern int pg(const char *, ...); |