summaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-01-05 22:44:12 +0100
committerHelge Deller <deller@gmx.de>2022-01-07 01:29:22 +0100
commitc1c72d9bbf2bf91670ac589adf037f433642fff5 (patch)
treec3b1b78ad149aa2c858a37b0b4601592c26d93a8 /arch/parisc
parent712a270d2db967b387338c26c3dc04ccac3fcec3 (diff)
downloadlinux-c1c72d9bbf2bf91670ac589adf037f433642fff5.tar.bz2
parisc: Add kgdb io_module to read chars via PDC
Add a simplistic keyboard driver for usage of PDC I/O functions with kgdb. This driver makes it possible to use KGDB with QEMU. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/kgdb.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/parisc/kernel/kgdb.c b/arch/parisc/kernel/kgdb.c
index c4554ac13eac..ab7620f695be 100644
--- a/arch/parisc/kernel/kgdb.c
+++ b/arch/parisc/kernel/kgdb.c
@@ -3,6 +3,7 @@
* PA-RISC KGDB support
*
* Copyright (c) 2019 Sven Schnelle <svens@stackframe.org>
+ * Copyright (c) 2022 Helge Deller <deller@gmx.de>
*
*/
@@ -207,3 +208,23 @@ int kgdb_arch_handle_exception(int trap, int signo,
}
return -1;
}
+
+/* KGDB console driver which uses PDC to read chars from keyboard */
+
+static void kgdb_pdc_write_char(u8 chr)
+{
+ /* no need to print char. kgdb will do it. */
+}
+
+static struct kgdb_io kgdb_pdc_io_ops = {
+ .name = "kgdb_pdc",
+ .read_char = pdc_iodc_getc,
+ .write_char = kgdb_pdc_write_char,
+};
+
+static int __init kgdb_pdc_init(void)
+{
+ kgdb_register_io_module(&kgdb_pdc_io_ops);
+ return 0;
+}
+early_initcall(kgdb_pdc_init);