Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/hpc Pull up following revision(s) (requested by u...



details:   https://anonhg.NetBSD.org/src/rev/dc5501456a75
branches:  netbsd-7
changeset: 800283:dc5501456a75
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Aug 09 06:48:57 2017 +0000

description:
Pull up following revision(s) (requested by uwe in ticket #1465):
        sys/dev/hpc/hpckbd.c: revision 1.32
XXX: On hpcsh only - bring back old incorrect hpckbd_keymap_setup()
fixed in 1.31.  The old one with UNCONST does work on hpcsh b/c the
kernel is directly mapped.  The new one does not work on hpcsh b/c it
calls consinit() very early when malloc() is not yet available.
The real fix for this is to fix the constness of wscons keymap
structures that is self-contradictory.

diffstat:

 sys/dev/hpc/hpckbd.c |  39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r b6ae64f00001 -r dc5501456a75 sys/dev/hpc/hpckbd.c
--- a/sys/dev/hpc/hpckbd.c      Wed Aug 09 06:40:25 2017 +0000
+++ b/sys/dev/hpc/hpckbd.c      Wed Aug 09 06:48:57 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpckbd.c,v 1.30.12.1 2017/07/23 06:05:36 snj Exp $ */
+/*     $NetBSD: hpckbd.c,v 1.30.12.2 2017/08/09 06:48:57 snj 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.30.12.1 2017/07/23 06:05:36 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpckbd.c,v 1.30.12.2 2017/08/09 06:48:57 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -260,6 +260,40 @@
        return (1);
 }
 
+
+#ifdef hpcsh
+/*
+ * 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.
+ */
+void
+hpckbd_keymap_setup(struct hpckbd_core *hc,
+                   const keysym_t *map, int mapsize)
+{
+       int i;
+       struct wscons_keydesc *desc;
+
+       /* fix keydesc table */
+       /* 
+        * 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.
+        */
+       desc = (struct wscons_keydesc *)__UNCONST(hpckbd_keymapdata.keydesc);
+       for (i = 0; desc[i].name != 0; i++) {
+               if ((desc[i].name & KB_MACHDEP) && desc[i].map == NULL) {
+                       desc[i].map = map;
+                       desc[i].map_size = mapsize;
+               }
+       }
+
+       return;
+}
+
+#else
+
 void
 hpckbd_keymap_setup(struct hpckbd_core *hc,
                    const keysym_t *map, int mapsize)
@@ -294,6 +328,7 @@
 
        return;
 }
+#endif
 
 void
 hpckbd_keymap_lookup(struct hpckbd_core *hc)



Home | Main Index | Thread Index | Old Index