diff mbox

[qom-next,v2,1/3] xilinx_zynq: Use cpu_arm_init() to obtain ARMCPU

Message ID 1337356920-30784-2-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber May 18, 2012, 4:01 p.m. UTC
Needed for arm_load_kernel().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/xilinx_zynq.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Comments

Peter A. G. Crosthwaite May 21, 2012, 1:02 a.m. UTC | #1
Cant see it affecting the change pattern to the zynq boot though, so
theres no blocker.

Acked-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com>

On Sat, May 19, 2012 at 2:01 AM, Andreas Färber <afaerber@suse.de> wrote:
> Needed for arm_load_kernel().
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  hw/xilinx_zynq.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
> index 7290c64..68349e2 100644
> --- a/hw/xilinx_zynq.c
> +++ b/hw/xilinx_zynq.c
> @@ -50,7 +50,7 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device,
>                         const char *kernel_filename, const char *kernel_cmdline,
>                         const char *initrd_filename, const char *cpu_model)
>  {
> -    CPUARMState *env = NULL;
> +    ARMCPU *cpu;
>     MemoryRegion *address_space_mem = get_system_memory();
>     MemoryRegion *ext_ram = g_new(MemoryRegion, 1);
>     MemoryRegion *ocm_ram = g_new(MemoryRegion, 1);
> @@ -66,12 +66,12 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device,
>         cpu_model = "cortex-a9";
>     }
>
> -    env = cpu_init(cpu_model);
> -    if (!env) {
> +    cpu = cpu_arm_init(cpu_model);
> +    if (!cpu) {
>         fprintf(stderr, "Unable to find CPU definition\n");
>         exit(1);
>     }
> -    irqp = arm_pic_init_cpu(env);
> +    irqp = arm_pic_init_cpu(&cpu->env);
>     cpu_irq = irqp[ARM_PIC_CPU_IRQ];
>
>     /* max 2GB ram */
> --
> 1.7.7
>
Andreas Färber May 21, 2012, 8:43 a.m. UTC | #2
Am 21.05.2012 03:02, schrieb Peter Crosthwaite:
> Cant see it affecting the change pattern to the zynq boot though, so
> theres no blocker.
> 
> Acked-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com>
> 
> On Sat, May 19, 2012 at 2:01 AM, Andreas Färber <afaerber@suse.de> wrote:
>> Needed for arm_load_kernel().
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>>  hw/xilinx_zynq.c |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)

Thanks, applied to qom-next:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next

Andreas
diff mbox

Patch

diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
index 7290c64..68349e2 100644
--- a/hw/xilinx_zynq.c
+++ b/hw/xilinx_zynq.c
@@ -50,7 +50,7 @@  static void zynq_init(ram_addr_t ram_size, const char *boot_device,
                         const char *kernel_filename, const char *kernel_cmdline,
                         const char *initrd_filename, const char *cpu_model)
 {
-    CPUARMState *env = NULL;
+    ARMCPU *cpu;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *ext_ram = g_new(MemoryRegion, 1);
     MemoryRegion *ocm_ram = g_new(MemoryRegion, 1);
@@ -66,12 +66,12 @@  static void zynq_init(ram_addr_t ram_size, const char *boot_device,
         cpu_model = "cortex-a9";
     }
 
-    env = cpu_init(cpu_model);
-    if (!env) {
+    cpu = cpu_arm_init(cpu_model);
+    if (!cpu) {
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
-    irqp = arm_pic_init_cpu(env);
+    irqp = arm_pic_init_cpu(&cpu->env);
     cpu_irq = irqp[ARM_PIC_CPU_IRQ];
 
     /* max 2GB ram */