* [PATCH, FT32] sim: character input port
@ 2015-09-21 23:29 James Bowman
2015-09-22 13:28 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: James Bowman @ 2015-09-21 23:29 UTC (permalink / raw)
To: gdb-patches
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, FT32] sim: character input port
2015-09-21 23:29 [PATCH, FT32] sim: character input port James Bowman
@ 2015-09-22 13:28 ` Mike Frysinger
2015-09-22 18:43 ` James Bowman
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2015-09-22 13:28 UTC (permalink / raw)
To: James Bowman; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
On 21 Sep 2015 23:28, James Bowman wrote:
> * ft32/interp.c: reading from IO address 10000 gives
> character input.
should read like:
* ft32/interp.c (cpu_mem_read): Call getchar when ea is 0x10000.
> + case 0x10000:
> + return getchar();
needs a space before the (
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH, FT32] sim: character input port
2015-09-22 13:28 ` Mike Frysinger
@ 2015-09-22 18:43 ` James Bowman
2015-09-23 2:46 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: James Bowman @ 2015-09-22 18:43 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
Thanks for the review. Corrected Changelog/patch is:
sim/Changelog:
2015-09-22 James Bowman <james.bowman@ftdichip.com>
* ft32/interp.c: (cpu_mem_read) Call getchar when ea is 0x10000.
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, FT32] sim: character input port
2015-09-22 18:43 ` James Bowman
@ 2015-09-23 2:46 ` Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2015-09-23 2:46 UTC (permalink / raw)
To: James Bowman; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
On 22 Sep 2015 18:41, James Bowman wrote:
> Thanks for the review. Corrected Changelog/patch is:
your e-mail client corrupted the patch -- all the tabs were spaces. i
applied it by hand this time, but you probably want to use something
like `git send-email` in the future so that it works correctly.
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-09-23 2:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 23:29 [PATCH, FT32] sim: character input port James Bowman
2015-09-22 13:28 ` Mike Frysinger
2015-09-22 18:43 ` James Bowman
2015-09-23 2:46 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox