Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/amlogic UART_RFIFO_REG should be masked before ...



details:   https://anonhg.NetBSD.org/src/rev/5846dcb3bd4d
branches:  trunk
changeset: 959394:5846dcb3bd4d
user:      ryo <ryo%NetBSD.org@localhost>
date:      Fri Feb 12 21:39:55 2021 +0000

description:
UART_RFIFO_REG should be masked before passing to cn_check_magic(). there is any data in other than the lower 8 bits.

diffstat:

 sys/arch/arm/amlogic/meson_uart.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r ee445a66b171 -r 5846dcb3bd4d sys/arch/arm/amlogic/meson_uart.c
--- a/sys/arch/arm/amlogic/meson_uart.c Fri Feb 12 21:29:54 2021 +0000
+++ b/sys/arch/arm/amlogic/meson_uart.c Fri Feb 12 21:39:55 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_uart.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */
+/* $NetBSD: meson_uart.c,v 1.6 2021/02/12 21:39:55 ryo Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: meson_uart.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: meson_uart.c,v 1.6 2021/02/12 21:39:55 ryo Exp $");
 
 #define cn_trap()                      \
        do {                            \
@@ -260,7 +260,7 @@
                return -1;
        }
 
-       c = bus_space_read_4(bst, bsh, UART_RFIFO_REG);
+       c = bus_space_read_4(bst, bsh, UART_RFIFO_REG) & 0xff;
 #if defined(DDB)
        extern int db_active;
        if (!db_active)
@@ -272,7 +272,7 @@
 
        splx(s);
 
-       return c & 0xff;
+       return c;
 }
 
 static void



Home | Main Index | Thread Index | Old Index