> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux
 22:40:01  up 3 days 21:40,  2 users,  load average: 1.22, 1.06, 0.98
This commit is contained in:
tracer-ysyx 2024-01-11 22:40:01 +08:00 committed by xinyangli
parent 262133eb4c
commit 9385743084
2 changed files with 4 additions and 3 deletions

View file

@ -40,6 +40,7 @@ typedef MUXDEF(CONFIG_ISA64, int64_t, int32_t) sword_t;
static const word_t WORD_T_MAX = MUXDEF(CONFIG_ISA64, UINT64_MAX, UINT32_MAX);
static const sword_t SWORD_T_MAX = MUXDEF(CONFIG_ISA64, INT64_MAX, INT32_MAX);
static const sword_t SWORD_T_MIN = MUXDEF(CONFIG_ISA64, INT64_MIN, INT32_MIN);
#define WORD_BYTES MUXDEF(CONFIG_ISA64, 8, 4)
#define FMT_WORD MUXDEF(CONFIG_ISA64, "0x%016" PRIx64, "0x%08" PRIx32)
typedef word_t vaddr_t;

View file

@ -189,10 +189,10 @@ static int cmd_x(char *args) {
word_t addr = parse_expr(arg, &res);
if (!res)
goto wrong_usage;
printf("%d, %d\n", addr, MUXDEF(CONFIG_ISA64, 4, 8));
printf("%d, %d\n", addr, WORD_BYTES);
for (paddr_t paddr = addr; paddr < addr + n;
paddr += MUXDEF(CONFIG_ISA64, 4, 8)) {
word_t value = paddr_read(addr, MUXDEF(CONFIG_ISA64, 4, 8));
paddr += WORD_BYTES) {
word_t value = paddr_read(addr, WORD_BYTES);
printf(FMT_WORD "\n", value);
}
return 0;