From patchwork Sun Jun 16 14:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 1116549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45RcVw2tLQz9s9y for ; Mon, 17 Jun 2019 00:42:00 +1000 (AEST) Received: from localhost ([::1]:40392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcWM2-0005v0-CP for incoming@patchwork.ozlabs.org; Sun, 16 Jun 2019 10:41:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36367) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcW9Y-0005L2-8M for qemu-devel@nongnu.org; Sun, 16 Jun 2019 10:29:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcW9W-0002Mz-Sn for qemu-devel@nongnu.org; Sun, 16 Jun 2019 10:29:04 -0400 Received: from mail03.asahi-net.or.jp ([202.224.55.15]:60457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hcW9W-0002A5-II for qemu-devel@nongnu.org; Sun, 16 Jun 2019 10:29:02 -0400 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.ablenetvps.ne.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail03.asahi-net.or.jp (Postfix) with ESMTPA id 6783044545; Sun, 16 Jun 2019 23:28:50 +0900 (JST) Received: from yo-satoh-debian.localdomain (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 25263240086; Sun, 16 Jun 2019 23:28:50 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Date: Sun, 16 Jun 2019 23:28:29 +0900 Message-Id: <20190616142836.10614-18-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190616142836.10614-1-ysato@users.sourceforge.jp> References: <20190616142836.10614-1-ysato@users.sourceforge.jp> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.15 Subject: [Qemu-devel] [PATCH v20 17/24] target/rx: Move rx_load_image to rx-virt. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, richard.henderson@linaro.org, Yoshinori Sato , philmd@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Yoshinori Sato --- hw/rx/rx-virt.c | 22 ++++++++++++++++++++++ target/rx/cpu.c | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/hw/rx/rx-virt.c b/hw/rx/rx-virt.c index ed0a3a1da0..4cfe2e3123 100644 --- a/hw/rx/rx-virt.c +++ b/hw/rx/rx-virt.c @@ -32,6 +32,28 @@ /* Same address of GDB integrated simulator */ #define SDRAM_BASE 0x01000000 +static void rx_load_image(RXCPU *cpu, const char *filename, + uint32_t start, uint32_t size) +{ + static uint32_t extable[32]; + long kernel_size; + int i; + + kernel_size = load_image_targphys(filename, start, size); + if (kernel_size < 0) { + fprintf(stderr, "qemu: could not load kernel '%s'\n", filename); + exit(1); + } + cpu->env.pc = start; + + /* setup exception trap trampoline */ + /* linux kernel only works little-endian mode */ + for (i = 0; i < ARRAY_SIZE(extable); i++) { + extable[i] = cpu_to_le32(0x10 + i * 4); + } + rom_add_blob_fixed("extable", extable, sizeof(extable), 0xffffff80); +} + static void rxvirt_init(MachineState *machine) { RX62NState *s = g_new(RX62NState, 1); diff --git a/target/rx/cpu.c b/target/rx/cpu.c index e3d76af55d..ea38639f47 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -215,25 +215,3 @@ static void rx_cpu_register_types(void) } type_init(rx_cpu_register_types) - -void rx_load_image(RXCPU *cpu, const char *filename, - uint32_t start, uint32_t size) -{ - static uint32_t extable[32]; - long kernel_size; - int i; - - kernel_size = load_image_targphys(filename, start, size); - if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", filename); - exit(1); - } - cpu->env.pc = start; - - /* setup exception trap trampoline */ - /* linux kernel only works little-endian mode */ - for (i = 0; i < ARRAY_SIZE(extable); i++) { - extable[i] = cpu_to_le32(0x10 + i * 4); - } - rom_add_blob_fixed("extable", extable, sizeof(extable), 0xffffff80); -}