summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorrin <rin@NetBSD.org>2018-09-18 02:58:10 +0000
committerrin <rin@NetBSD.org>2018-09-18 02:58:10 +0000
commit8ad5faf22450b9c917975443cd992eb413982d2e (patch)
treec831ae912cd85508aaa4254c3cef5d0dc16631c2 /sys/dev
parentb3b4cfe8b4294b82584a48fe8e6412148b0ad72b (diff)
Apply workaround introduced in r1.32 to hpcmips.
Fix kernel crash when console is attached. Now, my MC/R550 boots multiuser. Thanks Masahiko Ito for encouraging me to do bisection to find this out. XXX pullup-8, pullup-7
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/hpc/hpckbd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/hpc/hpckbd.c b/sys/dev/hpc/hpckbd.c
index 1ba100b4de3..8531d6c2d30 100644
--- a/sys/dev/hpc/hpckbd.c
+++ b/sys/dev/hpc/hpckbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpckbd.c,v 1.32 2017/08/07 23:57:40 uwe Exp $ */
+/* $NetBSD: hpckbd.c,v 1.33 2018/09/18 02:58:10 rin Exp $ */
/*-
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpckbd.c,v 1.32 2017/08/07 23:57:40 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpckbd.c,v 1.33 2018/09/18 02:58:10 rin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -261,10 +261,11 @@ hpckbd_getevent(struct hpckbd_core* hc, u_int *type, int *data)
}
-#ifdef hpcsh
+#if defined(hpcsh) || defined(hpcmips)
/*
- * XXX: Use the old wrong code for now as hpcsh attaches console very
- * early and it's convenient to be able to do early DDB on wscons.
+ * XXX: Use the old wrong code for now as hpcsh and hpcmips attach console very
+ * early when malloc(9) is not yet available. It is convenient to be able to do
+ * early DDB on wscons.
*/
void
hpckbd_keymap_setup(struct hpckbd_core *hc,
@@ -278,8 +279,10 @@ hpckbd_keymap_setup(struct hpckbd_core *hc,
* XXX The way this is done is really wrong. The __UNCONST()
* is a hint as to what is wrong. This actually ends up modifying
* initialized data which is marked "const".
+ *
* The reason we get away with it here is that on sh3 kernel
- * is directly mapped.
+ * is directly mapped. For mips, read-only data is mapped
+ * read/write at the moment.
*/
desc = (struct wscons_keydesc *)__UNCONST(hpckbd_keymapdata.keydesc);
for (i = 0; desc[i].name != 0; i++) {