From patchwork Thu May 10 00:14:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 158141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6F56BB6F9D for ; Thu, 10 May 2012 12:44:50 +1000 (EST) Received: from localhost ([::1]:48069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH4F-0004CC-RQ for incoming@patchwork.ozlabs.org; Wed, 09 May 2012 20:17:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2N-0001Dt-43 for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSH2H-0005YS-Ov for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35571 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2H-0005XB-9d for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:13 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 3B46E975D0; Thu, 10 May 2012 02:15:12 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 10 May 2012 02:14:11 +0200 Message-Id: <1336608892-30501-34-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1336608892-30501-1-git-send-email-afaerber@suse.de> References: <1336608892-30501-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH next v2 33/74] pxa2xx: Use cpu_arm_init() and store ARMCPU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Also use cpu_reset() in place of cpu_state_reset(). Signed-off-by: Andreas Färber Acked-by: Peter Maydell --- hw/mainstone.c | 2 +- hw/pxa.h | 2 +- hw/pxa2xx.c | 40 ++++++++++++++++++++-------------------- hw/spitz.c | 2 +- hw/tosa.c | 2 +- hw/z2.c | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/hw/mainstone.c b/hw/mainstone.c index 27f5900..00a8adc 100644 --- a/hw/mainstone.c +++ b/hw/mainstone.c @@ -168,7 +168,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, mainstone_binfo.kernel_cmdline = kernel_cmdline; mainstone_binfo.initrd_filename = initrd_filename; mainstone_binfo.board_id = arm_id; - arm_load_kernel(cpu->env, &mainstone_binfo); + arm_load_kernel(&cpu->cpu->env, &mainstone_binfo); } static void mainstone_init(ram_addr_t ram_size, diff --git a/hw/pxa.h b/hw/pxa.h index 025be34..2be006d 100644 --- a/hw/pxa.h +++ b/hw/pxa.h @@ -122,7 +122,7 @@ typedef struct PXA2xxI2SState PXA2xxI2SState; typedef struct PXA2xxFIrState PXA2xxFIrState; typedef struct { - CPUARMState *env; + ARMCPU *cpu; DeviceState *pic; qemu_irq reset; MemoryRegion sdram; diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c index ddaa846..5f8f226 100644 --- a/hw/pxa2xx.c +++ b/hw/pxa2xx.c @@ -269,24 +269,24 @@ static void pxa2xx_clkpwr_write(void *opaque, int op2, int reg, int crm, case 1: /* Idle */ if (!(s->cm_regs[CCCR >> 2] & (1 << 31))) { /* CPDIS */ - cpu_interrupt(s->env, CPU_INTERRUPT_HALT); + cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_HALT); break; } /* Fall through. */ case 2: /* Deep-Idle */ - cpu_interrupt(s->env, CPU_INTERRUPT_HALT); + cpu_interrupt(&s->cpu->env, CPU_INTERRUPT_HALT); s->pm_regs[RCSR >> 2] |= 0x8; /* Set GPR */ goto message; case 3: - s->env->uncached_cpsr = + s->cpu->env.uncached_cpsr = ARM_CPU_MODE_SVC | CPSR_A | CPSR_F | CPSR_I; - s->env->cp15.c1_sys = 0; - s->env->cp15.c1_coproc = 0; - s->env->cp15.c2_base0 = 0; - s->env->cp15.c3 = 0; + s->cpu->env.cp15.c1_sys = 0; + s->cpu->env.cp15.c1_coproc = 0; + s->cpu->env.cp15.c2_base0 = 0; + s->cpu->env.cp15.c3 = 0; s->pm_regs[PSSR >> 2] |= 0x8; /* Set STS */ s->pm_regs[RCSR >> 2] |= 0x8; /* Set GPR */ @@ -296,8 +296,8 @@ static void pxa2xx_clkpwr_write(void *opaque, int op2, int reg, int crm, * lack of a resuming bootloader, perform a jump * directly to that address. */ - memset(s->env->regs, 0, 4 * 15); - s->env->regs[15] = s->pm_regs[PSPR >> 2]; + memset(s->cpu->env.regs, 0, 4 * 15); + s->cpu->env.regs[15] = s->pm_regs[PSPR >> 2]; #if 0 buffer = 0xe59ff000; /* ldr pc, [pc, #0] */ @@ -2044,7 +2044,7 @@ static void pxa2xx_reset(void *opaque, int line, int level) PXA2xxState *s = (PXA2xxState *) opaque; if (level && (s->pm_regs[PCFR >> 2] & 0x10)) { /* GPR_EN */ - cpu_state_reset(s->env); + cpu_reset(CPU(s->cpu)); /* TODO: reset peripherals */ } } @@ -2065,8 +2065,8 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, if (!revision) revision = "pxa270"; - s->env = cpu_init(revision); - if (!s->env) { + s->cpu = cpu_arm_init(revision); + if (s->cpu == NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } @@ -2081,7 +2081,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE, &s->internal); - s->pic = pxa2xx_pic_init(0x40d00000, s->env); + s->pic = pxa2xx_pic_init(0x40d00000, &s->cpu->env); s->dma = pxa27x_dma_init(0x40000000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_DMA)); @@ -2094,7 +2094,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, qdev_get_gpio_in(s->pic, PXA27X_PIC_OST_4_11), NULL); - s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121); + s->gpio = pxa2xx_gpio_init(0x40e00000, &s->cpu->env, s->pic, 121); dinfo = drive_get(IF_SD, 0, 0); if (!dinfo) { @@ -2133,7 +2133,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, memory_region_add_subregion(address_space, s->cm_base, &s->cm_iomem); vmstate_register(NULL, 0, &vmstate_pxa2xx_cm, s); - cpu_arm_set_cp_io(s->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s); + cpu_arm_set_cp_io(&s->cpu->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s); s->mm_base = 0x48000000; s->mm_regs[MDMRS >> 2] = 0x00020002; @@ -2196,8 +2196,8 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) s = (PXA2xxState *) g_malloc0(sizeof(PXA2xxState)); - s->env = cpu_init("pxa255"); - if (!s->env) { + s->cpu = cpu_arm_init("pxa255"); + if (s->cpu == NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } @@ -2213,7 +2213,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE, &s->internal); - s->pic = pxa2xx_pic_init(0x40d00000, s->env); + s->pic = pxa2xx_pic_init(0x40d00000, &s->cpu->env); s->dma = pxa255_dma_init(0x40000000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_DMA)); @@ -2225,7 +2225,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) qdev_get_gpio_in(s->pic, PXA2XX_PIC_OST_0 + 3), NULL); - s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85); + s->gpio = pxa2xx_gpio_init(0x40e00000, &s->cpu->env, s->pic, 85); dinfo = drive_get(IF_SD, 0, 0); if (!dinfo) { @@ -2264,7 +2264,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) memory_region_add_subregion(address_space, s->cm_base, &s->cm_iomem); vmstate_register(NULL, 0, &vmstate_pxa2xx_cm, s); - cpu_arm_set_cp_io(s->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s); + cpu_arm_set_cp_io(&s->cpu->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s); s->mm_base = 0x48000000; s->mm_regs[MDMRS >> 2] = 0x00020002; diff --git a/hw/spitz.c b/hw/spitz.c index 1d6d2b0..9042d44 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -932,7 +932,7 @@ static void spitz_common_init(ram_addr_t ram_size, spitz_binfo.kernel_cmdline = kernel_cmdline; spitz_binfo.initrd_filename = initrd_filename; spitz_binfo.board_id = arm_id; - arm_load_kernel(cpu->env, &spitz_binfo); + arm_load_kernel(&cpu->cpu->env, &spitz_binfo); sl_bootparam_write(SL_PXA_PARAM_BASE); } diff --git a/hw/tosa.c b/hw/tosa.c index 6baa17d..d1ede8d 100644 --- a/hw/tosa.c +++ b/hw/tosa.c @@ -242,7 +242,7 @@ static void tosa_init(ram_addr_t ram_size, tosa_binfo.kernel_cmdline = kernel_cmdline; tosa_binfo.initrd_filename = initrd_filename; tosa_binfo.board_id = 0x208; - arm_load_kernel(cpu->env, &tosa_binfo); + arm_load_kernel(&cpu->cpu->env, &tosa_binfo); sl_bootparam_write(SL_PXA_PARAM_BASE); } diff --git a/hw/z2.c b/hw/z2.c index 654ac55..9dd83ff 100644 --- a/hw/z2.c +++ b/hw/z2.c @@ -363,7 +363,7 @@ static void z2_init(ram_addr_t ram_size, z2_binfo.kernel_cmdline = kernel_cmdline; z2_binfo.initrd_filename = initrd_filename; z2_binfo.board_id = 0x6dd; - arm_load_kernel(cpu->env, &z2_binfo); + arm_load_kernel(&cpu->cpu->env, &z2_binfo); } }