}
// Yes, we're frugal
- if (posix_memalign(&ram, 64 * 1024, RAMSIZE))
+ if (posix_memalign((void **) &ram, 64 * 1024, RAMSIZE))
abort();
memset(ram, 0, RAMSIZE);
printf("Loading binary %u bytes\n", binlen); // TODO
- if (posix_memalign(&progmem, 64 * 1024, binlen))
+ if (posix_memalign((void **) &progmem, 64 * 1024, binlen))
abort();
if (fread(progmem, binlen, 1, binary) != 1)
.slot = 0,
.guest_phys_addr = 0,
.memory_size = RAMSIZE,
- .userspace_addr = ram,
+ .userspace_addr = (uint64_t) ram,
.flags = 0
};
ioctl(vmfd, KVM_SET_USER_MEMORY_REGION, ®ion);
region.slot = 1;
region.guest_phys_addr = PROGSTART;
region.memory_size = binlen;
- region.userspace_addr = progmem;
+ region.userspace_addr = (uint64_t) progmem;
region.flags = KVM_MEM_READONLY;
ioctl(vmfd, KVM_SET_USER_MEMORY_REGION, ®ion);
abort();
const struct kvm_guest_debug dbg = {
- .control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP;
+ .control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP
};
if (ioctl(vcpu, KVM_SET_GUEST_DEBUG, &dbg) == -1)
abort();