From 74101c4128d8a4fc0e71be329865ca5d21c96ace Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 20 Aug 2025 03:54:35 +0000 Subject: kernel/amd64: Add initial ext scancode support Most keyboards nowadays support extended scancodes which are multi-byte packets prefixed with a 0xE0 byte to represent non-standard special keys. This commit introduces the initial groundwork for supporting such scancodes. - i8042_drain() now takes a (nullable) pointer to a i8042 data buffer which will hold bytes drained - Made some timing adjustments between i8042 register reads in the i8042_drain() function - Removed nonessential and contentious locks which choked up input performance Signed-off-by: Ian Moffett --- sys/include/arch/amd64/isa/i8042var.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/include/arch') diff --git a/sys/include/arch/amd64/isa/i8042var.h b/sys/include/arch/amd64/isa/i8042var.h index 13c3095..9619920 100644 --- a/sys/include/arch/amd64/isa/i8042var.h +++ b/sys/include/arch/amd64/isa/i8042var.h @@ -74,6 +74,10 @@ #define I8042_LED_NUM BIT(1) #define I8042_LED_CAPS BIT(2) +/* Extended scancode types */ +#define I8042_XSC_ENDPR 0 /* End pressed */ +#define I8042_XSC_ENDRL 1 /* End released */ + /* Quirks */ #define I8042_HOSTILE BIT(0) /* If EC likes throwing NMIs */ -- cgit v1.2.3