This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] sim: ft32: add character input port


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bcd68f9e44a70c73bde08e612a28e413570dc039

commit bcd68f9e44a70c73bde08e612a28e413570dc039
Author: James Bowman <james.bowman@ftdichip.com>
Date:   Tue Sep 22 22:43:56 2015 -0400

    sim: ft32: add character input port
    
    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.

Diff:
---
 sim/ft32/ChangeLog | 4 ++++
 sim/ft32/interp.c  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/sim/ft32/ChangeLog b/sim/ft32/ChangeLog
index 988413f..29f661f 100644
--- a/sim/ft32/ChangeLog
+++ b/sim/ft32/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-22  James Bowman  <james.bowman@ftdichip.com>
+
+	* ft32/interp.c (cpu_mem_read): Call getchar when ea is 0x10000.
+
 2015-06-23  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure: Regenerate.
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index 404683d..a20907c 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]