Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/dev Restore redundant register accesses as th...



details:   https://anonhg.NetBSD.org/src/rev/5833612f6647
branches:  trunk
changeset: 368147:5833612f6647
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jun 26 04:45:30 2022 +0000

description:
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.

diffstat:

 sys/arch/atari/dev/kbd.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 126f1e2e4d68 -r 5833612f6647 sys/arch/atari/dev/kbd.c
--- a/sys/arch/atari/dev/kbd.c  Sat Jun 25 22:38:43 2022 +0000
+++ b/sys/arch/atari/dev/kbd.c  Sun Jun 26 04:45:30 2022 +0000
@@ -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 @@
        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;
        }



Home | Main Index | Thread Index | Old Index