From 423cdbeb398ec82e8457bec111deac1465d2a107 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 19 Apr 2025 12:18:53 +0100 Subject: [PATCH] [riscv] Map DEL to backspace on the SBI debug console Signed-off-by: Michael Brown --- src/arch/riscv/interface/sbi/sbi_console.c | 6 ++++++ src/include/ipxe/keys.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/arch/riscv/interface/sbi/sbi_console.c b/src/arch/riscv/interface/sbi/sbi_console.c index 835255559..93cdf0798 100644 --- a/src/arch/riscv/interface/sbi/sbi_console.c +++ b/src/arch/riscv/interface/sbi/sbi_console.c @@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include +#include #include #include @@ -65,6 +66,11 @@ static int sbi_getchar ( void ) { /* Consume and return buffered character, if any */ character = sbi_console_input; sbi_console_input = 0; + + /* Convert DEL to backspace */ + if ( character == DEL ) + character = BACKSPACE; + return character; } diff --git a/src/include/ipxe/keys.h b/src/include/ipxe/keys.h index 49e65fa4c..38ebd7d1a 100644 --- a/src/include/ipxe/keys.h +++ b/src/include/ipxe/keys.h @@ -47,6 +47,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define LF CTRL_J #define CR CTRL_M #define ESC 0x1b +#define DEL 0x7f /* * Special keys outside the normal Unicode range