Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/arch/i386/stand/lib Pull up revision 1.5 (requested...



details:   https://anonhg.NetBSD.org/src/rev/ffd744543014
branches:  netbsd-1-6
changeset: 529382:ffd744543014
user:      he <he%NetBSD.org@localhost>
date:      Mon Nov 18 00:52:29 2002 +0000

description:
Pull up revision 1.5 (requested by thorpej in ticket #665):
  There are other systems besides the PS/2 L40 that enable
  A20 via the Configuration Port, so restructure the code a
  little to allow for them, and list at least one other system
  that does (anything based on the AMD Elan SC520).

diffstat:

 sys/arch/i386/stand/lib/gatea20.c |  38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diffs (56 lines):

diff -r 60a2120ca664 -r ffd744543014 sys/arch/i386/stand/lib/gatea20.c
--- a/sys/arch/i386/stand/lib/gatea20.c Mon Nov 18 00:45:26 2002 +0000
+++ b/sys/arch/i386/stand/lib/gatea20.c Mon Nov 18 00:52:29 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gatea20.c,v 1.4 2001/05/19 18:15:14 jdolecek Exp $     */
+/*     $NetBSD: gatea20.c,v 1.4.18.1 2002/11/18 00:52:29 he Exp $      */
 
 /* extracted from freebsd:sys/i386/boot/biosboot/io.c */
 
@@ -32,27 +32,29 @@
 void gateA20()
 {
        __asm("pushfl ; cli");
-#ifdef SUPPORT_PS2
        /*
-        * Check if the machine is PS/2 L40 via biosmca_model, which is
-        * initialized before gateA20() is called.
+        * Not all systems enable A20 via the keyboard controller.
+        *      * IBM PS/2 L40
+        *      * AMD Elan SC520-based systems
         */
-       if (biosmca_ps2model == 0xf82)
-               outb(0x92, 0x2);
-       else {
+       if (
+#ifdef SUPPORT_PS2
+           biosmca_ps2model == 0xf82 ||
 #endif
-       while (inb(K_STATUS) & K_IBUF_FUL);
-       while (inb(K_STATUS) & K_OBUF_FUL)
-               (void)inb(K_RDWR);
+           /* XXX How to check for AMD Elan SC520? */
+           0) {
+               outb(0x92, 0x2);
+       } else {
+               while (inb(K_STATUS) & K_IBUF_FUL);
+               while (inb(K_STATUS) & K_OBUF_FUL)
+                       (void)inb(K_RDWR);
 
-       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);
-#ifdef SUPPORT_PS2
+               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);
        }
-#endif
        __asm("popfl");
 }



Home | Main Index | Thread Index | Old Index