]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[riscv] Map DEL to backspace on the SBI debug console
authorMichael Brown <mcb30@ipxe.org>
Sat, 19 Apr 2025 11:18:53 +0000 (12:18 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sat, 19 Apr 2025 11:20:59 +0000 (12:20 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/riscv/interface/sbi/sbi_console.c
src/include/ipxe/keys.h

index 8352555598b131cf86d60fb4affbf68645a509bb..93cdf0798170972a377401414930ea4bc15018fe 100644 (file)
@@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #include <ipxe/sbi.h>
 #include <ipxe/io.h>
+#include <ipxe/keys.h>
 #include <ipxe/console.h>
 #include <config/console.h>
 
@@ -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;
 }
 
index 49e65fa4c0319ecdfcb16b508c13e3e8096d59d3..38ebd7d1a404b14d7ac977aac046a3bc96e165bf 100644 (file)
@@ -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