Module Name:    src
Committed By:   tsutsui
Date:           Sun Jun 26 04:45:31 UTC 2022

Modified Files:
        src/sys/arch/atari/dev: kbd.c

Log Message:
Restore redundant register accesses as the original implementation did.

It looks my refactored one for entropy sometimes returns unexpected
values and they cause "kbd: Unknown packet 0xfd" errors and missing
keyboard release events.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/atari/dev/kbd.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/atari/dev/kbd.c
diff -u src/sys/arch/atari/dev/kbd.c:1.54 src/sys/arch/atari/dev/kbd.c:1.55
--- src/sys/arch/atari/dev/kbd.c:1.54	Sat Jun 25 16:09:28 2022
+++ src/sys/arch/atari/dev/kbd.c	Sun Jun 26 04:45:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.54 2022/06/25 16:09:28 tsutsui Exp $	*/
+/*	$NetBSD: kbd.c,v 1.55 2022/06/26 04:45:30 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.54 2022/06/25 16:09:28 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.55 2022/06/26 04:45:30 tsutsui Exp $");
 
 #include "mouse.h"
 #include "ite.h"
@@ -435,11 +435,12 @@ kbdintr(int sr)
 	rndstat = stat;
 	while ((stat & (A_RXRDY | A_OE | A_PE)) != 0) {
 		got_char = true;
-		code = KBD->ac_da;
-		if ((stat & (A_OE | A_PE)) == 0) {
+		if ((KBD->ac_cs & (A_OE | A_PE)) == 0) {
+			code = KBD->ac_da;
 			kbd_ring[kbd_rbput++ & KBD_RING_MASK] = code;
 		} else {
 			/* Silently ignore errors */
+			code = KBD->ac_da;
 		}
 		stat = KBD->ac_cs;
 	}

Reply via email to