[PATCH 1 of 5] fix cpu_physical_memory len

Andrea Arcangeli
2008-12-12T18:18:20Z

From: Andrea Arcangeli <aarcange@redhat.com>

Be consistent and have length be size_t for all methods.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---

diff --git a/cpu-all.h b/cpu-all.h
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -911,14 +911,14 @@ CPUReadMemoryFunc **cpu_get_io_memory_re
CPUReadMemoryFunc **cpu_get_io_memory_read(int io_index);

void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
- int len, int is_write);
+ size_t len, int is_write);
static inline void cpu_physical_memory_read(target_phys_addr_t addr,
- uint8_t *buf, int len)
+ uint8_t *buf, size_t len)
{
cpu_physical_memory_rw(addr, buf, len, 0);
}
static inline void cpu_physical_memory_write(target_phys_addr_t addr,
- const uint8_t *buf, int len)
+ const uint8_t *buf, size_t len)
{
cpu_physical_memory_rw(addr, (uint8_t *)buf, len, 1);
}
@@ -936,7 +936,7 @@ void cpu_physical_memory_write_rom(targe
void cpu_physical_memory_write_rom(target_phys_addr_t addr,
const uint8_t *buf, int len);
int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
- uint8_t *buf, int len, int is_write);
+ uint8_t *buf, size_t len, int is_write);

#define VGA_DIRTY_FLAG 0x01
#define CODE_DIRTY_FLAG 0x02
diff --git a/exec.c b/exec.c
--- a/exec.c
+++ b/exec.c
@@ -2839,7 +2839,7 @@ CPUReadMemoryFunc **cpu_get_io_memory_re
/* physical memory access (slow version, mainly for debug) */
#if defined(CONFIG_USER_ONLY)
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
- int len, int is_write)
+ size_t len, int is_write)
{
int l, flags;
target_ulong page;
@@ -2880,7 +2880,7 @@ void cpu_physical_memory_rw(target_phys_

#else
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
- int len, int is_write)
+ size_t len, int is_write)
{
int l, io_index;
uint8_t *ptr;
@@ -3232,7 +3232,7 @@ void stq_phys(target_phys_addr_t addr, u

/* virtual memory access for debug */
int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
- uint8_t *buf, int len, int is_write)
+ uint8_t *buf, size_t len, int is_write)
{
int l;
target_phys_addr_t phys_addr;