qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v20 17/24] target/rx: Move rx_load_image to rx-virt.


From: Yoshinori Sato
Subject: [Qemu-devel] [PATCH v20 17/24] target/rx: Move rx_load_image to rx-virt.
Date: Sun, 16 Jun 2019 23:28:29 +0900

Signed-off-by: Yoshinori Sato <address@hidden>
---
 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);
-}
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]