From fa3cdcf5645f56667400ba292ccfec69e5f2a6a2 Mon Sep 17 00:00:00 2001 From: hubertf Date: Mon, 4 Oct 2004 00:20:23 +0000 Subject: [PATCH] Add & document WSKBD_USONLY: In order to strip down the space usage of wscons, all keymaps except the US english one can be removed from the kernel with this option, which results in a space gain of about 10kB. XXX it would be nice if we could strip down more kernel facilities --- share/man/man4/wscons.4 | 6 +++++- sys/dev/pckbport/wskbdmap_mfii.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/share/man/man4/wscons.4 b/share/man/man4/wscons.4 index 8c85b62e2670..6020b2b67fa3 100644 --- a/share/man/man4/wscons.4 +++ b/share/man/man4/wscons.4 @@ -1,4 +1,4 @@ -.\" $NetBSD: wscons.4,v 1.24 2004/07/30 15:18:44 jmmv Exp $ +.\" $NetBSD: wscons.4,v 1.25 2004/10/04 00:20:23 hubertf Exp $ .\" .\" Copyright (c) 1999, 2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -55,6 +55,7 @@ .Cd options WSDISPLAY_COMPAT_SYSCONS .Cd options WSDISPLAY_COMPAT_USL .Cd options WSDISPLAY_COMPAT_RAWKBD +.Cd options WSKBD_USONLY .Pp .Cd "wsdisplay* at ..." .Cd "wskbd* at ... mux N" @@ -269,6 +270,9 @@ application from locking the whole console system, a screen switch will be rolled back after a 5 second timeout if the application does not respond. This option can be used to specify in seconds a different timeout value. +.Dq WSKBD_USONLY In order to strip down the space usage of wscons, +all keymaps except the US english one can be removed from the kernel +with this option, which results in a space gain of about 10kB. .El .Sh SEE ALSO .Xr wsdisplay 4 , diff --git a/sys/dev/pckbport/wskbdmap_mfii.c b/sys/dev/pckbport/wskbdmap_mfii.c index 99808799d115..c26b78a9b55c 100644 --- a/sys/dev/pckbport/wskbdmap_mfii.c +++ b/sys/dev/pckbport/wskbdmap_mfii.c @@ -1,4 +1,4 @@ -/* $NetBSD: wskbdmap_mfii.c,v 1.4 2004/08/14 16:42:36 mycroft Exp $ */ +/* $NetBSD: wskbdmap_mfii.c,v 1.5 2004/10/04 00:20:23 hubertf Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wskbdmap_mfii.c,v 1.4 2004/08/14 16:42:36 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wskbdmap_mfii.c,v 1.5 2004/10/04 00:20:23 hubertf Exp $"); #include #include @@ -158,6 +158,7 @@ static const keysym_t pckbd_keydesc_us[] = { 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 @@ static const keysym_t pckbd_keydesc_iopener[] = { 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 @@ static const keysym_t pckbd_keydesc_iopener[] = { 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 @@ const struct wscons_keydesc pckbd_keydesctab[] = { 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 @@ const struct wscons_keydesc pckbd_keydesctab[] = { KB_US | KB_SWAPCTRLCAPS), KBD_NULLMAP(KB_JP | KB_MACHDEP | KB_SWAPCTRLCAPS, KB_JP | KB_SWAPCTRLCAPS), +#endif /* WSKBD_USONLY */ {0, 0, 0, 0} };