|
@@ -27,16 +27,17 @@ enum { Disable_A20 = 0x2400, Enable_A20 = 0x2401, Query_A20_Status = 0x2402,
|
27
|
27
|
#define CF ( 1 << 0 )
|
28
|
28
|
|
29
|
29
|
#ifndef IBM_L40
|
30
|
|
-static void empty_8042 ( void )
|
31
|
|
-{
|
|
30
|
+static void empty_8042 ( void ) {
|
32
|
31
|
unsigned long time;
|
33
|
|
- char st;
|
34
|
32
|
|
35
|
33
|
time = currticks() + TICKS_PER_SEC; /* max wait of 1 second */
|
36
|
|
- while ((((st = inb(K_CMD)) & K_OBUF_FUL) ||
|
37
|
|
- (st & K_IBUF_FUL)) &&
|
38
|
|
- currticks() < time)
|
39
|
|
- inb(K_RDWR);
|
|
34
|
+ while ( ( inb ( K_CMD ) & K_IBUF_FUL ) &&
|
|
35
|
+ currticks() < time ) {
|
|
36
|
+ /* Do nothing. In particular, do *not* read from
|
|
37
|
+ * K_RDWR, because that will drain the keyboard buffer
|
|
38
|
+ * and lose keypresses.
|
|
39
|
+ */
|
|
40
|
+ }
|
40
|
41
|
}
|
41
|
42
|
#endif /* IBM_L40 */
|
42
|
43
|
|
|
@@ -66,6 +67,7 @@ void gateA20_set ( void ) {
|
66
|
67
|
: "=r" ( flags ), "=a" ( discard_a )
|
67
|
68
|
: "a" ( Enable_A20 ) );
|
68
|
69
|
|
|
70
|
+
|
69
|
71
|
if ( flags & CF ) {
|
70
|
72
|
/* INT 15 method failed, try alternatives */
|
71
|
73
|
#ifdef IBM_L40
|
|
@@ -78,7 +80,7 @@ void gateA20_set ( void ) {
|
78
|
80
|
empty_8042();
|
79
|
81
|
#endif /* IBM_L40 */
|
80
|
82
|
}
|
81
|
|
-
|
|
83
|
+
|
82
|
84
|
reentry_guard = 0;
|
83
|
85
|
}
|
84
|
86
|
|