From: H. Peter Anvin Date: Mon, 18 May 2009 21:57:37 +0000 (-0700) Subject: core/conio.inc: when reading the serial port, drop read of IIR X-Git-Tag: syslinux-3.81-pre5^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f00d3393230752919ba1f850d0e79901a67e64c;p=profile%2Fivi%2Fsyslinux.git core/conio.inc: when reading the serial port, drop read of IIR Drop the read of the IIR when reading the serial port. First of all, we weren't protecting AL so we clobbered the actual data; second of all, this isn't actually necessary as reading RDR will clear the interrupt condition per the UART spec. It's worth noting that enabling interrupts here will do bad things if the interrupts aren't edge-triggered (since we don't actually have an interrupt routine to clear the interrupt condition); this also means bad things will happen if the interrupt line is shared. Signed-off-by: H. Peter Anvin --- diff --git a/core/conio.inc b/core/conio.inc index d1b92f5..2d8c61a 100644 --- a/core/conio.inc +++ b/core/conio.inc @@ -1,6 +1,7 @@ ;; ----------------------------------------------------------------------- ;; ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved +;; Copyright 2009 Intel Corporation; author: H. Peter Anvin ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -331,9 +332,7 @@ getchar: jne .again .serial: xor ah,ah ; Avoid confusion mov dx,bx ; Data port - in al,dx - lea dx,[bx+2] ; DX -> IIR - in al,dx ; Read IIR to discard any IRQ bits + in al,dx ; Read data ret .kbd: mov ah,10h ; Get keyboard input int 16h