}
static void memory_dump(int count, int format, int wsize,
- target_ulong addr, int is_physical)
+ target_phys_addr_t addr, int is_physical)
{
CPUState *env;
int nb_per_line, l, line_size, i, max_digits, len;
}
while (len > 0) {
- term_printf(TARGET_FMT_lx ":", addr);
+ if (is_physical)
+ term_printf(TARGET_FMT_plx ":", addr);
+ else
+ term_printf(TARGET_FMT_lx ":", (target_ulong)addr);
l = len;
if (l > line_size)
l = line_size;
memory_dump(count, format, size, addr, 0);
}
+#if TARGET_PHYS_ADDR_BITS > 32
+#define GET_TPHYSADDR(h, l) (((uint64_t)(h) << 32) | (l))
+#else
+#define GET_TPHYSADDR(h, l) (l)
+#endif
+
static void do_physical_memory_dump(int count, int format, int size,
uint32_t addrh, uint32_t addrl)
{
- target_long addr = GET_TLONG(addrh, addrl);
+ target_phys_addr_t addr = GET_TPHYSADDR(addrh, addrl);
memory_dump(count, format, size, addr, 1);
}
static void do_print(int count, int format, int size, unsigned int valh, unsigned int vall)
{
- target_long val = GET_TLONG(valh, vall);
-#if TARGET_LONG_BITS == 32
+ target_phys_addr_t val = GET_TPHYSADDR(valh, vall);
+#if TARGET_PHYS_ADDR_BITS == 32
switch(format) {
case 'o':
term_printf("%#o", val);
}
}
-static target_long expr_sum(void);
+static target_phys_addr_t expr_sum(void);
-static target_long expr_unary(void)
+static target_phys_addr_t expr_unary(void)
{
- target_long n;
+ target_phys_addr_t n;
char *p;
int ret;
case '$':
{
char buf[128], *q;
+ target_long reg;
pch++;
q = buf;
while (isspace(*pch))
pch++;
*q = 0;
- ret = get_monitor_def(&n, buf);
+ ret = get_monitor_def(®, buf);
if (ret == -1)
expr_error("unknown register");
else if (ret == -2)
expr_error("no cpu defined");
+ n = reg;
}
break;
case '\0':
n = 0;
break;
default:
-#if TARGET_LONG_BITS == 64
+#if TARGET_PHYS_ADDR_BITS > 32
n = strtoull(pch, &p, 0);
#else
n = strtoul(pch, &p, 0);
}
-static target_long expr_prod(void)
+static target_phys_addr_t expr_prod(void)
{
- target_long val, val2;
+ target_phys_addr_t val, val2;
int op;
val = expr_unary();
return val;
}
-static target_long expr_logic(void)
+static target_phys_addr_t expr_logic(void)
{
- target_long val, val2;
+ target_phys_addr_t val, val2;
int op;
val = expr_prod();
return val;
}
-static target_long expr_sum(void)
+static target_phys_addr_t expr_sum(void)
{
- target_long val, val2;
+ target_phys_addr_t val, val2;
int op;
val = expr_logic();
return val;
}
-static int get_expr(target_long *pval, const char **pp)
+static int get_expr(target_phys_addr_t *pval, const char **pp)
{
pch = *pp;
if (setjmp(expr_env)) {
case 'i':
case 'l':
{
- target_long val;
+ target_phys_addr_t val;
+
while (isspace(*p))
p++;
if (*typestr == '?' || *typestr == '.') {
} else {
if ((nb_args + 1) >= MAX_ARGS)
goto error_args;
-#if TARGET_LONG_BITS == 64
+#if TARGET_PHYS_ADDR_BITS > 32
args[nb_args++] = (void *)(long)((val >> 32) & 0xffffffff);
#else
args[nb_args++] = (void *)0;