qemu-devel
[Top][All Lists]
Advanced

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

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


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH v20 17/24] target/rx: Move rx_load_image to rx-virt.
Date: Sun, 16 Jun 2019 20:49:42 +0200

On Sun, 16 Jun 2019 23:28:29 +0900
Yoshinori Sato <address@hidden> wrote:

> 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)

function shouldn't be added to target/rx/cpu.c at all,
it should be introduced in 16/24 instead and this patch
shouldn't exist.

> +{
> +    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);
> -}




reply via email to

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