Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: linux-parisc@vger.kernel.org
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	John David Anglin <dave.anglin@bell.net>,
	Sven Schnelle <svens@stackframe.org>
Subject: [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb
Date: Wed,  5 Jan 2022 22:45:52 +0100	[thread overview]
Message-ID: <20220105214552.590606-2-deller@gmx.de> (raw)
In-Reply-To: <20220105214552.590606-1-deller@gmx.de>

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@gmx.de>
---
 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


  reply	other threads:[~2022-01-05 21:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 21:45 [PATCH 1/2] Subject: parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 structs Helge Deller
2022-01-05 21:45 ` Helge Deller [this message]
2022-01-06 10:04   ` [PATCH 2/2] parisc: Provide a trivial PDC-based io_module for kgdb Rolf Eike Beer
2022-01-06 10:32     ` Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220105214552.590606-2-deller@gmx.de \
    --to=deller@gmx.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dave.anglin@bell.net \
    --cc=linux-parisc@vger.kernel.org \
    --cc=svens@stackframe.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox