The compiler rightly complains when we build on 32 bit that casting
uint64_t into a void is a bad idea. We are really dealing with a host
pointer at this point so treat it as such. This does involve
a uintptr_t cast of the result of the TLB addend as we know that has
to point to the host memory.
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <
20210709143005[email protected]>
data->v.io.offset = (iotlbentry->addr & TARGET_PAGE_MASK) + addr;
} else {
data->is_io = false;
- data->v.ram.hostaddr = addr + tlbe->addend;
+ data->v.ram.hostaddr = (void *)((uintptr_t)addr + tlbe->addend);
}
return true;
} else {
hwaddr offset;
} io;
struct {
- uint64_t hostaddr;
+ void *hostaddr;
} ram;
} v;
};
if (!haddr->is_io) {
RAMBlock *block;
ram_addr_t offset;
- void *hostaddr = (void *) haddr->v.ram.hostaddr;
+ void *hostaddr = haddr->v.ram.hostaddr;
block = qemu_ram_block_from_host(hostaddr, false, &offset);
if (!block) {
- error_report("Bad ram pointer %"PRIx64"", haddr->v.ram.hostaddr);
+ error_report("Bad host ram pointer %p", haddr->v.ram.hostaddr);
abort();
}