Spaces:
Runtime error
Runtime error
File size: 534 Bytes
8df6da4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
#include "kvmxx.hh"
#include "identity.hh"
#include "exception.hh"
#include <stdio.h>
static int global = 0;
static void set_global()
{
global = 1;
}
int test_main(int ac, char** av)
{
kvm::system system;
kvm::vm vm(system);
mem_map memmap(vm);
identity::vm ident_vm(vm, memmap);
kvm::vcpu vcpu(vm, 0);
identity::vcpu thread(vcpu, set_global);
vcpu.run();
printf("global %d\n", global);
return global == 1 ? 0 : 1;
}
int main(int ac, char** av)
{
return try_main(test_main, ac, av);
}
|