CVS commit: [netbsd-5] src/sys/arch/i386/stand/lib

2011-10-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Oct 16 23:38:52 UTC 2011

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-5]: gatea20.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #923):
sys/arch/i386/stand/lib/gatea20.c: revision 1.12
PR# kern/39726: Soekris 5501-60 boot/bootxx 120 second delay
PR# port-i386/41162: A20 gate legacy hook cause long pxeboot delay on Soekris
net5501
Remove calls to delay() before polling KBD registers in gateA20().


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/i386/stand/lib/gatea20.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/lib/gatea20.c
diff -u src/sys/arch/i386/stand/lib/gatea20.c:1.11 src/sys/arch/i386/stand/lib/gatea20.c:1.11.4.1
--- src/sys/arch/i386/stand/lib/gatea20.c:1.11	Tue Oct 14 14:18:11 2008
+++ src/sys/arch/i386/stand/lib/gatea20.c	Sun Oct 16 23:38:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gatea20.c,v 1.11 2008/10/14 14:18:11 ad Exp $	*/
+/*	$NetBSD: gatea20.c,v 1.11.4.1 2011/10/16 23:38:52 riz Exp $	*/
 
 /* extracted from freebsd:sys/i386/boot/biosboot/io.c */
 
@@ -67,12 +67,10 @@ gateA20(void)
 
 		outb(K_CMD, KC_CMD_WOUT);
 
-		delay(100);
 		while (inb(K_STATUS)  K_IBUF_FUL);
 
 		outb(K_RDWR, x_20);
 
-		delay(100);
 		while (inb(K_STATUS)  K_IBUF_FUL);
 
 		while (inb(K_STATUS)  K_OBUF_FUL)



CVS commit: [netbsd-5] src/sys/arch/i386/stand/lib

2009-11-28 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Nov 28 15:40:47 UTC 2009

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-5]: pcio.c

Log Message:
Pull up following revision(s) (requested by mbalmer in ticket #1143):
sys/arch/i386/stand/lib/pcio.c: revision 1.26
Have the boot countdown on i386 display starting in N seconds. instead
of starting in N and eliminate a use of sprintf.  Note that on
some rare machines it can be that the BIOS does not provide the delay
function.  On such machines the countdown will almost immediately count down
to zero display starting in 0 seconds.; apparently the net4801 is such a
machine.
Feedback, ideas, and inspiration from tron, ok tron/tonnerre


To generate a diff of this commit:
cvs rdiff -u -r1.23.8.1 -r1.23.8.2 src/sys/arch/i386/stand/lib/pcio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/lib/pcio.c
diff -u src/sys/arch/i386/stand/lib/pcio.c:1.23.8.1 src/sys/arch/i386/stand/lib/pcio.c:1.23.8.2
--- src/sys/arch/i386/stand/lib/pcio.c:1.23.8.1	Sat Sep 26 18:25:46 2009
+++ src/sys/arch/i386/stand/lib/pcio.c	Sat Nov 28 15:40:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcio.c,v 1.23.8.1 2009/09/26 18:25:46 snj Exp $	 */
+/*	$NetBSD: pcio.c,v 1.23.8.2 2009/11/28 15:40:47 bouyer Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -331,15 +331,19 @@
 
 	for (;;) {
 		if (tell  (i % POLL_FREQ) == 0) {
-			char numbuf[20];
-			int len, j;
+			char numbuf[32];
+			int len;
 
-			sprintf(numbuf, %d , i/POLL_FREQ);
-			len = strlen(numbuf);
-			for (j = 0; j  len; j++)
-numbuf[len + j] = '\b';
-			numbuf[len + j] = '\0';
-			printf(numbuf);
+			len = snprintf(numbuf, sizeof(numbuf), %d seconds. ,
+			i/POLL_FREQ);
+			if (len  0  len  sizeof(numbuf)) {
+char *p = numbuf;
+
+printf(%s, numbuf);
+while (*p)
+	*p++ = '\b';
+printf(%s, numbuf);
+			}
 		}
 		if (iskey(1)) {
 			/* flush input buffer */
@@ -357,7 +361,7 @@
 
 out:
 	if (tell)
-		printf(0 \n);
+		printf(0 seconds. \n);
 
 	return c;
 }



CVS commit: [netbsd-5] src/sys/arch/i386/stand/lib

2009-09-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 26 18:25:46 UTC 2009

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-5]: pcio.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #928):
sys/arch/i386/stand/lib/pcio.c: revision 1.27
int 15h/AH=86h (WAIT) doesn't work properly on all hardware and emulators, so
for the countdown use the more coarsely grained sleep implementation based
on int 1ah/AH=00h (GET SYSTEM TIME).
ok ad@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/arch/i386/stand/lib/pcio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/lib/pcio.c
diff -u src/sys/arch/i386/stand/lib/pcio.c:1.23 src/sys/arch/i386/stand/lib/pcio.c:1.23.8.1
--- src/sys/arch/i386/stand/lib/pcio.c:1.23	Wed May 21 13:36:45 2008
+++ src/sys/arch/i386/stand/lib/pcio.c	Sat Sep 26 18:25:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcio.c,v 1.23 2008/05/21 13:36:45 ad Exp $	 */
+/*	$NetBSD: pcio.c,v 1.23.8.1 2009/09/26 18:25:46 snj Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -71,6 +71,20 @@
 
 #define POLL_FREQ 10
 
+static void
+wait(int us)
+{
+	int prev = biosgetsystime();
+	int tgt = prev + (20 * us) / 100;
+	int new;
+
+	while ((new = biosgetsystime())  tgt) {
+		if (new  prev) /* XXX timer wrapped */
+			break;
+		prev = new;
+	}
+}
+
 #ifdef SUPPORT_SERIAL
 static int
 getcomaddr(int idx)
@@ -336,7 +350,7 @@
 			goto out;
 		}
 		if (i--)
-			delay(100 / POLL_FREQ);
+			wait(100 / POLL_FREQ);
 		else
 			break;
 	}