patch-2.2.10 linux/arch/i386/boot/setup.S

Next file: linux/arch/i386/boot/video.S
Previous file: linux/arch/alpha/mm/init.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.9/linux/arch/i386/boot/setup.S linux/arch/i386/boot/setup.S
@@ -753,19 +753,29 @@
 ! This routine checks that the keyboard command queue is empty
 ! (after emptying the output buffers)
 !
-! No timeout is used - if this hangs there is something wrong with
-! the machine, and we probably couldn't proceed anyway.
+! Some machines have delusions that the keyboard buffer is always full
+! with no keyboard attached...
+
 empty_8042:
+       push    cx
+       mov     cx,#0xFFFF
+
+empty_8042_loop:
+       dec     cx
+       jz      empty_8042_end_loop
+
 	call	delay
 	in	al,#0x64	! 8042 status port
 	test	al,#1		! output buffer?
 	jz	no_output
 	call	delay
 	in	al,#0x60	! read it
-	jmp	empty_8042
+	jmp	empty_8042_loop
 no_output:
 	test	al,#2		! is input buffer full?
-	jnz	empty_8042	! yes - loop
+	jnz	empty_8042_loop	! yes - loop
+empty_8042_end_loop:
+        pop     cx
 	ret
 
 !

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)