Module Name: src
Committed By: dyoung
Date: Sat May 4 02:04:55 UTC 2024
Modified Files:
src/sys/arch/arm/xilinx: zynq_uart.c
Log Message:
Initialize `struct consdev` members cn_dev and cn_pri like other
UART drivers do. If cn_dev is 0 instead of NODEV, then the kernel
may redirect console writes to major 0, minor 0, which is /dev/mem.
On my Zynq board the kernel overwrote the page free list with a
console message in this way.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xilinx/zynq_uart.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/arm/xilinx/zynq_uart.c
diff -u src/sys/arch/arm/xilinx/zynq_uart.c:1.5 src/sys/arch/arm/xilinx/zynq_uart.c:1.6
--- src/sys/arch/arm/xilinx/zynq_uart.c:1.5 Thu Oct 27 07:57:46 2022
+++ src/sys/arch/arm/xilinx/zynq_uart.c Sat May 4 02:04:54 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: zynq_uart.c,v 1.5 2022/10/27 07:57:46 skrll Exp $ */
+/* $NetBSD: zynq_uart.c,v 1.6 2024/05/04 02:04:54 dyoung Exp $ */
/*
* Copyright (c) 2012 Genetec Corporation. All rights reserved.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.5 2022/10/27 07:57:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.6 2024/05/04 02:04:54 dyoung Exp $");
#include "opt_soc.h"
#include "opt_console.h"
@@ -1974,7 +1974,9 @@ zynquart_init(struct zynquart_regs *regs
struct consdev zynquartcons = {
.cn_getc = zynquartcngetc,
.cn_putc = zynquartcnputc,
- .cn_pollc = nullcnpollc
+ .cn_pollc = nullcnpollc,
+ .cn_dev = NODEV,
+ .cn_pri = CN_NORMAL,
};