Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: James Bowman <james.bowman@ftdichip.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH, FT32] sim: character input port
Date: Mon, 21 Sep 2015 23:29:00 -0000	[thread overview]
Message-ID: <CA9BBF0458F83C4F9051448B941B57D119614F7E@glaexch1> (raw)

The FT32 simulator has character output, of course. This patch
adds character input, which lets the simulator run interactive
FT32 applications, e.g. language interpreters.

OK to apply?

sim/Changelog:

2015-09-21  James Bowman  <james.bowman@ftdichip.com>

	* ft32/interp.c: reading from IO address 10000 gives
	character input.

diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index 404683d..b0f3a49 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -169,6 +169,8 @@ static uint32_t cpu_mem_read (SIM_DESC sd, uint32_t dw, uint32_t ea)
       /* Simulate some IO devices */
       switch (ea)
        {
+       case 0x10000:
+         return getchar();
        case 0x1fff4:
          /* Read the simulator cycle timer.  */
          return cpu->state.cycles / 100;


             reply	other threads:[~2015-09-21 23:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 23:29 James Bowman [this message]
2015-09-22 13:28 ` Mike Frysinger
2015-09-22 18:43   ` James Bowman
2015-09-23  2:46     ` Mike Frysinger

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=CA9BBF0458F83C4F9051448B941B57D119614F7E@glaexch1 \
    --to=james.bowman@ftdichip.com \
    --cc=gdb-patches@sourceware.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