From patchwork Wed Dec 30 11:05:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 10178 Received: (qmail 116788 invoked by alias); 30 Dec 2015 11:05:48 -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 116683 invoked by uid 89); 30 Dec 2015 11:05:47 -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_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*m:24637, H*MI:24637, Hx-languages-length:2042, 586 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 30 Dec 2015 11:05:42 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id C2BA234072E for ; Wed, 30 Dec 2015 11:05:40 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: h8300: inline sim_state_initialize [committed] Date: Wed, 30 Dec 2015 06:05:39 -0500 Message-Id: <1451473539-24637-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes All the state is handled already by the common cpu allocation which zeros out the entire state. --- sim/h8300/ChangeLog | 6 ++++++ sim/h8300/compile.c | 28 +--------------------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 834fcec..7d87d1f 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,5 +1,11 @@ 2015-12-30 Mike Frysinger + * compile.c (sim_state_initialize): Delete. + (sim_open): Replace sim_state_initialize call with SBR_REGNUM + assignment. + +2015-12-30 Mike Frysinger + * compile.c (h8300_reg_store): Delete sd. Change init_pointers to use CPU_STATE (cpu). Change h8_set_pc to cpu->pc. Return -1 and drop the printf if the default case. Change all the set func calls diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 99d28ad..ef6a853 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -58,32 +58,6 @@ static void set_simcache_size (SIM_DESC, int); /* CPU data object: */ -static int -sim_state_initialize (SIM_DESC sd, sim_cpu *cpu) -{ - /* FIXME: not really necessary, since sim_cpu_alloc calls zalloc. */ - - memset (&cpu->regs, 0, sizeof(cpu->regs)); - cpu->regs[SBR_REGNUM] = 0xFFFFFF00; - cpu->pc = 0; - cpu->delayed_branch = 0; - cpu->memory = NULL; - cpu->eightbit = NULL; - cpu->mask = 0; - - /* Initialize local simulator state. */ - sd->sim_cache = NULL; - sd->sim_cache_size = 0; - sd->cache_idx = NULL; - sd->cache_top = 0; - sd->memory_size = 0; - sd->compiles = 0; -#ifdef ADEBUG - memset (&cpu->stats, 0, sizeof (cpu->stats)); -#endif - return 0; -} - static unsigned int h8_get_pc (SIM_DESC sd) { @@ -4869,7 +4843,7 @@ sim_open (SIM_OPEN_KIND kind, cpu = STATE_CPU (sd, 0); SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); - sim_state_initialize (sd, cpu); + cpu->regs[SBR_REGNUM] = 0xFFFFFF00; /* sim_cpu object is new, so some initialization is needed. */ init_pointers_needed = 1;