From patchwork Thu Dec 19 05:51:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 303188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F27CC2C00AF for ; Thu, 19 Dec 2013 17:02:27 +1100 (EST) Received: from localhost ([::1]:42245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtWgj-0003WK-1U for incoming@patchwork.ozlabs.org; Thu, 19 Dec 2013 01:02:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtWg0-0003Im-SO for qemu-devel@nongnu.org; Thu, 19 Dec 2013 01:01:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtWfv-0001Vc-13 for qemu-devel@nongnu.org; Thu, 19 Dec 2013 01:01:40 -0500 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:49402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtWfu-0001VT-NQ for qemu-devel@nongnu.org; Thu, 19 Dec 2013 01:01:34 -0500 Received: by mail-pa0-f51.google.com with SMTP id fa1so708136pad.10 for ; Wed, 18 Dec 2013 22:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cLbAPfk5+2sJ6Zjsk/z4kvwppAqh6JDw3aEg9BZr9uI=; b=ZvoLlGky+g5MGbhDBeEctRfWTS+b6dI/VjfSv4+vqZV4iPwRal5Z7lpDQEbKfMnFGO dPIrM070bkcCt9zA9t6NDD7xTjGKS94/FO9yPwLyyw1VQYABct3JOq6hJBtSF1al9r3V 6JOgDGndTkXlV3VK5aTdBLs/qQu/tUMiN/eyhjrveY4mPo6UeHywTyeXQvkjEFooCtul 8TQML3S9nAYrW2jW7qiOETdJwMkY0Ipu0Dp6ZEgiZn2OzFQQeQbVveCzdReK2lueqtSU /saemq/LS1YiMLa8w6CTfvkcgWgPzoXZE0DwEWI2987t309vBttGqGf7jh+SbMlNc3TO m6CA== X-Received: by 10.68.34.37 with SMTP id w5mr38277882pbi.159.1387432893757; Wed, 18 Dec 2013 22:01:33 -0800 (PST) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id ic7sm4359649pbc.29.2013.12.18.22.01.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Dec 2013 22:01:27 -0800 (PST) From: edgar.iglesias@gmail.com To: qemu-devel@nongnu.org Date: Thu, 19 Dec 2013 15:51:27 +1000 Message-Id: <1387432293-17711-17-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387432293-17711-1-git-send-email-edgar.iglesias@gmail.com> References: <1387432293-17711-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::233 Cc: peter.maydell@linaro.org, blauwirbel@gmail.com, aliguori@amazon.com, pcrost@xilinx.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH v2 16/22] exec: Make cpu_physical_memory_write_rom input an AS 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 From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias --- exec.c | 8 ++++---- hw/core/loader.c | 3 ++- hw/intc/apic.c | 3 ++- hw/sparc/sun4m.c | 3 ++- include/exec/cpu-common.h | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index eab68b3..f606376 100644 --- a/exec.c +++ b/exec.c @@ -2090,7 +2090,7 @@ void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf, } /* used for ROM loading : can write in RAM and ROM */ -void cpu_physical_memory_write_rom(hwaddr addr, +void cpu_physical_memory_write_rom(AddressSpace *as, hwaddr addr, const uint8_t *buf, int len) { hwaddr l; @@ -2100,8 +2100,7 @@ void cpu_physical_memory_write_rom(hwaddr addr, while (len > 0) { l = len; - mr = address_space_translate(&address_space_memory, - addr, &addr1, &l, true); + mr = address_space_translate(as, addr, &addr1, &l, true); if (!(memory_region_is_ram(mr) || memory_region_is_romd(mr))) { @@ -2679,7 +2678,8 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, l = len; phys_addr += (addr & ~TARGET_PAGE_MASK); if (is_write) - cpu_physical_memory_write_rom(phys_addr, buf, l); + cpu_physical_memory_write_rom(&address_space_memory, + phys_addr, buf, l); else cpu_physical_memory_rw(phys_addr, buf, l, is_write); len -= l; diff --git a/hw/core/loader.c b/hw/core/loader.c index 60d2ebd..5598b30 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -778,7 +778,8 @@ static void rom_reset(void *unused) void *host = memory_region_get_ram_ptr(rom->mr); memcpy(host, rom->data, rom->datasize); } else { - cpu_physical_memory_write_rom(rom->addr, rom->data, rom->datasize); + cpu_physical_memory_write_rom(&address_space_memory, + rom->addr, rom->data, rom->datasize); } if (rom->isrom) { /* rom needs to be written only once */ diff --git a/hw/intc/apic.c b/hw/intc/apic.c index a913186..b48b5ef 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -129,7 +129,8 @@ static void apic_sync_vapic(APICCommonState *s, int sync_type) } vapic_state.irr = vector & 0xff; - cpu_physical_memory_write_rom(s->vapic_paddr + start, + cpu_physical_memory_write_rom(&address_space_memory, + s->vapic_paddr + start, ((void *)&vapic_state) + start, length); } } diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 94f7950..2957d90 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -577,7 +577,8 @@ static void idreg_init(hwaddr addr) s = SYS_BUS_DEVICE(dev); sysbus_mmio_map(s, 0, addr); - cpu_physical_memory_write_rom(addr, idreg_data, sizeof(idreg_data)); + cpu_physical_memory_write_rom(&address_space_memory, + addr, idreg_data, sizeof(idreg_data)); } #define MACIO_ID_REGISTER(obj) \ diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 20d3518..1710c51 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -108,7 +108,7 @@ void stl_phys(AddressSpace *as, hwaddr addr, uint32_t val); void stq_phys(AddressSpace *as, hwaddr addr, uint64_t val); #endif -void cpu_physical_memory_write_rom(hwaddr addr, +void cpu_physical_memory_write_rom(AddressSpace *as, hwaddr addr, const uint8_t *buf, int len); extern struct MemoryRegion io_mem_rom;