From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvEnu-0001jx-Qv for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:46 -0400 Received: from [140.186.70.92] (port=60924 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvEns-0001iM-ED for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvEno-0007QG-5m for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:42 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:48744) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvEno-0007OU-0s for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:40 -0400 Received: by mail-pw0-f45.google.com with SMTP id 9so6226558pwi.4 for ; Fri, 26 Mar 2010 12:02:39 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 26 Mar 2010 21:02:39 +0200 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH 01/10] pflash_cfi02: fix incorrect TARGET_FMT_lx/d use List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Also use target_phys_addr_t for addresses. Signed-off-by: Blue Swirl --- hw/pflash_cfi02.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c index 135c850..50b4c6c 100644 --- a/hw/pflash_cfi02.c +++ b/hw/pflash_cfi02.c @@ -103,13 +103,13 @@ static void pflash_timer (void *opaque) pfl->cmd = 0; } -static uint32_t pflash_read (pflash_t *pfl, uint32_t offset, int width) +static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t offset, int width) { - uint32_t boff; + target_phys_addr_t boff; uint32_t ret; uint8_t *p; - DPRINTF("%s: offset " TARGET_FMT_lx "\n", __func__, offset); + DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset); ret = -1; if (pfl->rom_mode) { /* Lazy reset of to ROMD mode */ @@ -184,7 +184,7 @@ static uint32_t pflash_read (pflash_t *pfl, uint32_t offset, int width) default: goto flash_read; } - DPRINTF("%s: ID " TARGET_FMT_ld " %x\n", __func__, boff, ret); + DPRINTF("%s: ID " TARGET_FMT_pld " %x\n", __func__, boff, ret); break; case 0xA0: case 0x10: @@ -222,10 +222,10 @@ static void pflash_update(pflash_t *pfl, int offset, } } -static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, - int width) +static void pflash_write (pflash_t *pfl, target_phys_addr_t offset, + uint32_t value, int width) { - uint32_t boff; + target_phys_addr_t boff; uint8_t *p; uint8_t cmd; @@ -237,11 +237,11 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, #endif goto reset_flash; } - DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d %d\n", __func__, + DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d %d\n", __func__, offset, value, width, pfl->wcycle); offset &= pfl->chip_len - 1; - DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d\n", __func__, + DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d\n", __func__, offset, value, width); boff = offset & (pfl->sector_len - 1); if (pfl->width == 2) @@ -263,7 +263,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, return; } if (boff != pfl->unlock_addr[0] || cmd != 0xAA) { - DPRINTF("%s: unlock0 failed " TARGET_FMT_lx " %02x %04x\n", + DPRINTF("%s: unlock0 failed " TARGET_FMT_plx " %02x %04x\n", __func__, boff, cmd, pfl->unlock_addr[0]); goto reset_flash; } @@ -273,7 +273,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, /* We started an unlock sequence */ check_unlock1: if (boff != pfl->unlock_addr[1] || cmd != 0x55) { - DPRINTF("%s: unlock1 failed " TARGET_FMT_lx " %02x\n", __func__, + DPRINTF("%s: unlock1 failed " TARGET_FMT_plx " %02x\n", __func__, boff, cmd); goto reset_flash; } @@ -282,7 +282,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, case 2: /* We finished an unlock sequence */ if (!pfl->bypass && boff != pfl->unlock_addr[0]) { - DPRINTF("%s: command failed " TARGET_FMT_lx " %02x\n", __func__, + DPRINTF("%s: command failed " TARGET_FMT_plx " %02x\n", __func__, boff, cmd); goto reset_flash; } @@ -307,7 +307,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, /* We need another unlock sequence */ goto check_unlock0; case 0xA0: - DPRINTF("%s: write data offset " TARGET_FMT_lx " %08x %d\n", + DPRINTF("%s: write data offset " TARGET_FMT_plx " %08x %d\n", __func__, offset, value, width); p = pfl->storage; switch (width) { @@ -378,7 +378,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, switch (cmd) { case 0x10: if (boff != pfl->unlock_addr[0]) { - DPRINTF("%s: chip erase: invalid address " TARGET_FMT_lx "\n", + DPRINTF("%s: chip erase: invalid address " TARGET_FMT_plx "\n", __func__, offset); goto reset_flash; } @@ -395,7 +395,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, /* Sector erase */ p = pfl->storage; offset &= ~(pfl->sector_len - 1); - DPRINTF("%s: start sector erase at " TARGET_FMT_lx "\n", __func__, + DPRINTF("%s: start sector erase at " TARGET_FMT_plx "\n", __func__, offset); memset(p + offset, 0xFF, pfl->sector_len); pflash_update(pfl, offset, pfl->sector_len); -- 1.6.2.4