diff options
author | Michael Brown <mcb30@ipxe.org> | 2022-02-16 00:11:33 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2022-02-16 13:50:41 +0000 |
commit | 11e17991d0729fd17ab06d94ec67a8ca48032af4 (patch) | |
tree | bde32314934b638ed27ffd41f5b4b8d1ede9e401 | |
parent | 252cff5e9a0b67a27e1837cb674491692b717fd0 (diff) | |
download | ipxe-11e17991d0729fd17ab06d94ec67a8ca48032af4.zip ipxe-11e17991d0729fd17ab06d94ec67a8ca48032af4.tar.gz ipxe-11e17991d0729fd17ab06d94ec67a8ca48032af4.tar.bz2 |
[console] Ensure that US keyboard map appears at start of linker table
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/hci/keymap/keymap_us.c | 2 | ||||
-rw-r--r-- | src/include/ipxe/keymap.h | 5 | ||||
-rwxr-xr-x | src/util/genkeymap.py | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/hci/keymap/keymap_us.c b/src/hci/keymap/keymap_us.c index 6432474..b8e604a 100644 --- a/src/hci/keymap/keymap_us.c +++ b/src/hci/keymap/keymap_us.c @@ -21,7 +21,7 @@ static struct keymap_key us_altgr[] = { }; /** "us" keyboard map */ -struct keymap us_keymap __keymap = { +struct keymap us_keymap __keymap_default = { .name = "us", .basic = us_basic, .altgr = us_altgr, diff --git a/src/include/ipxe/keymap.h b/src/include/ipxe/keymap.h index 72b6961..392d3ab 100644 --- a/src/include/ipxe/keymap.h +++ b/src/include/ipxe/keymap.h @@ -39,8 +39,11 @@ struct keymap { /** Keyboard mapping table */ #define KEYMAP __table ( struct keymap, "keymap" ) +/** Define a default keyboard mapping */ +#define __keymap_default __table_entry ( KEYMAP, 01 ) + /** Define a keyboard mapping */ -#define __keymap __table_entry ( KEYMAP, 01 ) +#define __keymap __table_entry ( KEYMAP, 02 ) /** Mappable character mask */ #define KEYMAP_MASK 0xff diff --git a/src/util/genkeymap.py b/src/util/genkeymap.py index 632f71e..9fd9874 100755 --- a/src/util/genkeymap.py +++ b/src/util/genkeymap.py @@ -399,6 +399,7 @@ class Keymap: keymap_name = self.cname("keymap") basic_name = self.cname("basic") altgr_name = self.cname("altgr") + attribute = "__keymap_default" if self.name == "us" else "__keymap" code = textwrap.dedent(f""" /** @file * @@ -419,7 +420,7 @@ class Keymap: static struct keymap_key {altgr_name}[] = %s; /** "{self.name}" keyboard map */ - struct keymap {keymap_name} __keymap = {{ + struct keymap {keymap_name} {attribute} = {{ \t.name = "{self.name}", \t.basic = {basic_name}, \t.altgr = {altgr_name}, |