[PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a simple 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@xxxxxx>
---
 arch/parisc/kernel/toc.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/parisc/kernel/toc.c b/arch/parisc/kernel/toc.c
index 18327611cf8f..dfe7cccc086f 100644
--- a/arch/parisc/kernel/toc.c
+++ b/arch/parisc/kernel/toc.c
@@ -109,3 +109,30 @@ static __init int setup_toc(void)
 	return 0;
 }
 early_initcall(setup_toc);
+
+
+#ifdef CONFIG_KGDB_KDB
+/* read a character, return -1 if no char can be polled. */
+static int kgdbpdc_read_char(void)
+{
+	return pdc_iodc_getc();
+}
+
+static void kgdbpdc_write_char(u8 chr)
+{
+	/* no need to print char. kdb will do it. */
+}
+
+static struct kgdb_io kgdbpdc_io_ops = {
+	.name		= "kgdb_pdc",
+	.read_char	= kgdbpdc_read_char,
+	.write_char	= kgdbpdc_write_char,
+};
+
+static int __init kgdbpdc_init(void)
+{
+	kgdb_register_io_module(&kgdbpdc_io_ops);
+	return 0;
+}
+early_initcall(kgdbpdc_init);
+#endif
--
2.31.1




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux