Subject: stripping down wscons: only US keymap [patch]
To: None <tech-kern@netbsd.org>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-kern
Date: 09/20/2004 13:18:17
I'm looking at stripping down wscons, and aparently one can save 10kB (on
a install floppy w/ wscons[1]) when removing all but the US keymaps.
Any comments on adding the patch below? Suggestions for better name of the
option?


 - Hubert

[1] wscons seems to be needed for USB keyboards


Index: wskbdmap_mfii.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/wskbdmap_mfii.c,v
retrieving revision 1.4
diff -u -r1.4 wskbdmap_mfii.c
--- wskbdmap_mfii.c	14 Aug 2004 16:42:36 -0000	1.4
+++ wskbdmap_mfii.c	20 Sep 2004 11:09:57 -0000
@@ -158,6 +158,7 @@
     KC(221),			KS_Menu,
 };

+#ifndef WSKBD_USONLY
 static const keysym_t pckbd_keydesc_de[] = {
 /*  pos      normal		shifted		altgr		shift-altgr */
     KC(3),   KS_2,		KS_quotedbl,	KS_twosuperior,
@@ -509,6 +510,7 @@
     KC(87),  KS_Cmd_Screen9,	KS_f10,
     KC(88), 			KS_f11,
 };
+#endif /* WSKBD_USONLY */

 #define KBD_MAP(name, base, map) \
 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
@@ -518,6 +520,7 @@

 const struct wscons_keydesc pckbd_keydesctab[] = {
 	KBD_MAP(KB_US,			0,	pckbd_keydesc_us),
+#ifndef WSKBD_USONLY
 	KBD_MAP(KB_DE,			KB_US,	pckbd_keydesc_de),
 	KBD_MAP(KB_DE | KB_NODEAD,	KB_DE,	pckbd_keydesc_de_nodead),
 	KBD_MAP(KB_FR,                  KB_US,  pckbd_keydesc_fr),
@@ -542,9 +545,11 @@
 		pckbd_keydesc_swapctrlcaps),
 	KBD_MAP(KB_ES ,			KB_US,	pckbd_keydesc_es),
 	KBD_MAP(KB_PT,			KB_US,	pckbd_keydesc_pt),
+#endif /* WSKBD_USONLY */

 	/* placeholders */
 	KBD_NULLMAP(KB_US | KB_MACHDEP,	KB_US),
+#ifndef WSKBD_USONLY
 	KBD_NULLMAP(KB_DE | KB_MACHDEP,	KB_DE),
 	KBD_NULLMAP(KB_FR | KB_MACHDEP,	KB_FR),
 	KBD_NULLMAP(KB_JP | KB_MACHDEP,	KB_JP),
@@ -552,6 +557,7 @@
 		    KB_US | KB_SWAPCTRLCAPS),
 	KBD_NULLMAP(KB_JP | KB_MACHDEP | KB_SWAPCTRLCAPS,
 		    KB_JP | KB_SWAPCTRLCAPS),
+#endif /* WSKBD_USONLY */

 	{0, 0, 0, 0}
 };

-- 
                         ,,_
If wishes were wings,  o"   )~  would fly.            -- Go www.NetBSD.org!
                        ''''