From patchwork Mon Sep 21 23:28:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bowman X-Patchwork-Id: 8819 Received: (qmail 10422 invoked by alias); 21 Sep 2015 23:29:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10409 invoked by uid 89); 21 Sep 2015 23:29:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp-out6.electric.net Received: from smtp-out6.electric.net (HELO smtp-out6.electric.net) (192.162.217.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 21 Sep 2015 23:29:33 +0000 Received: from 1ZeAWY-0007DO-T7 by out6b.electric.net with emc1-ok (Exim 4.85) (envelope-from ) id 1ZeAWY-0007Df-UP for gdb-patches@sourceware.org; Mon, 21 Sep 2015 16:29:30 -0700 Received: by emcmailer; Mon, 21 Sep 2015 16:29:30 -0700 Received: from [188.39.184.227] (helo=GLAEXCH3.ftdi.local) by out6b.electric.net with esmtps (TLSv1:AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZeAWY-0007DO-T7 for gdb-patches@sourceware.org; Mon, 21 Sep 2015 16:29:30 -0700 Received: from GLAEXCH1.ftdi.local ([172.16.0.121]) by glaexch3 ([172.16.0.161]) with mapi id 14.01.0438.000; Tue, 22 Sep 2015 00:28:34 +0100 From: James Bowman To: "gdb-patches@sourceware.org" Subject: [PATCH, FT32] sim: character input port Date: Mon, 21 Sep 2015 23:28:31 +0000 Message-ID: MIME-Version: 1.0 X-Outbound-IP: 188.39.184.227 X-Env-From: james.bowman@ftdichip.com X-PolicySMART: 3094660 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 * 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;