Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVkjd-0001Ri-LI for qemu-devel@nongnu.org; Sat, 07 Feb 2009 05:48:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVkjc-0001PK-G6 for qemu-devel@nongnu.org; Sat, 07 Feb 2009 05:48:28 -0500 Received: from [199.232.76.173] (port=38798 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVkjc-0001P7-2a for qemu-devel@nongnu.org; Sat, 07 Feb 2009 05:48:28 -0500 Received: from savannah.gnu.org ([199.232.41.3]:53882 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVkjb-0000rt-Lr for qemu-devel@nongnu.org; Sat, 07 Feb 2009 05:48:27 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LVkja-0007SF-Th for qemu-devel@nongnu.org; Sat, 07 Feb 2009 10:48:26 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LVkja-0007S5-Mh for qemu-devel@nongnu.org; Sat, 07 Feb 2009 10:48:26 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Sat, 07 Feb 2009 10:48:26 +0000 Subject: [Qemu-devel] [6547] Add it_shift Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6547 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6547 Author: blueswir1 Date: 2009-02-07 10:48:26 +0000 (Sat, 07 Feb 2009) Log Message: ----------- Add it_shift Modified Paths: -------------- trunk/hw/mac_nvram.c trunk/hw/ppc_chrp.c trunk/hw/ppc_mac.h trunk/hw/ppc_oldworld.c Modified: trunk/hw/mac_nvram.c =================================================================== --- trunk/hw/mac_nvram.c 2009-02-07 09:51:59 UTC (rev 6546) +++ trunk/hw/mac_nvram.c 2009-02-07 10:48:26 UTC (rev 6547) @@ -40,6 +40,7 @@ struct MacIONVRAMState { target_phys_addr_t size; int mem_index; + unsigned int it_shift; uint8_t *data; }; @@ -75,7 +76,7 @@ { MacIONVRAMState *s = opaque; - addr = (addr >> 4) & (s->size - 1); + addr = (addr >> s->it_shift) & (s->size - 1); s->data[addr] = value; NVR_DPRINTF("writeb addr %04x val %x\n", (int)addr, value); } @@ -85,7 +86,7 @@ MacIONVRAMState *s = opaque; uint32_t value; - addr = (addr >> 4) & (s->size - 1); + addr = (addr >> s->it_shift) & (s->size - 1); value = s->data[addr]; NVR_DPRINTF("readb addr %04x val %x\n", (int)addr, value); @@ -127,13 +128,15 @@ { } -MacIONVRAMState *macio_nvram_init (int *mem_index, target_phys_addr_t size) +MacIONVRAMState *macio_nvram_init (int *mem_index, target_phys_addr_t size, + unsigned int it_shift) { MacIONVRAMState *s; s = qemu_mallocz(sizeof(MacIONVRAMState)); s->data = qemu_mallocz(size); s->size = size; + s->it_shift = it_shift; s->mem_index = cpu_register_io_memory(0, nvram_read, nvram_write, s); *mem_index = s->mem_index; @@ -150,7 +153,8 @@ MacIONVRAMState *s; s = opaque; - cpu_register_physical_memory(mem_base, s->size << 4, s->mem_index); + cpu_register_physical_memory(mem_base, s->size << s->it_shift, + s->mem_index); } /* Set up a system OpenBIOS NVRAM partition */ Modified: trunk/hw/ppc_chrp.c =================================================================== --- trunk/hw/ppc_chrp.c 2009-02-07 09:51:59 UTC (rev 6546) +++ trunk/hw/ppc_chrp.c 2009-02-07 10:48:26 UTC (rev 6547) @@ -328,7 +328,7 @@ graphic_depth = 15; #if 0 /* XXX: this is ugly but needed for now, or OHW won't boot */ /* The NewWorld NVRAM is not located in the MacIO device */ - nvr = macio_nvram_init(&nvram_mem_index, 0x2000); + nvr = macio_nvram_init(&nvram_mem_index, 0x2000, 1); pmac_format_nvram_partition(nvr, 0x2000); macio_nvram_map(nvr, 0xFFF04000); nvram.opaque = nvr; Modified: trunk/hw/ppc_mac.h =================================================================== --- trunk/hw/ppc_mac.h 2009-02-07 09:51:59 UTC (rev 6546) +++ trunk/hw/ppc_mac.h 2009-02-07 10:48:26 UTC (rev 6547) @@ -64,7 +64,8 @@ /* Mac NVRAM */ typedef struct MacIONVRAMState MacIONVRAMState; -MacIONVRAMState *macio_nvram_init (int *mem_index, target_phys_addr_t size); +MacIONVRAMState *macio_nvram_init (int *mem_index, target_phys_addr_t size, + unsigned int it_shift); void macio_nvram_map (void *opaque, target_phys_addr_t mem_base); void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len); uint32_t macio_nvram_read (void *opaque, uint32_t addr); Modified: trunk/hw/ppc_oldworld.c =================================================================== --- trunk/hw/ppc_oldworld.c 2009-02-07 09:51:59 UTC (rev 6546) +++ trunk/hw/ppc_oldworld.c 2009-02-07 10:48:26 UTC (rev 6547) @@ -357,7 +357,7 @@ adb_kbd_init(&adb_bus); adb_mouse_init(&adb_bus); - nvr = macio_nvram_init(&nvram_mem_index, 0x2000); + nvr = macio_nvram_init(&nvram_mem_index, 0x2000, 4); pmac_format_nvram_partition(nvr, 0x2000); macio_init(pci_bus, PCI_DEVICE_ID_APPLE_343S1201, 1, pic_mem_index,