X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=guest%2Flinux%2Fhvm-ros%2Ftest.c;h=461d8afe1b0c7947c412d745c8d6c817a9c35588;hb=15b65ca6d546fbd03cdd7ae72830555e0263e538;hp=e6e14bffe79c6d1d995420659b6c37ee4f99e3e4;hpb=495d40c7d02054399e118be6a10b0096c938d232;p=palacios.git diff --git a/guest/linux/hvm-ros/test.c b/guest/linux/hvm-ros/test.c index e6e14bf..461d8af 100644 --- a/guest/linux/hvm-ros/test.c +++ b/guest/linux/hvm-ros/test.c @@ -188,17 +188,28 @@ int timing_test_async(uint64_t num_merge, uint64_t num_call) return 0; } +#define HVM_SIG_STACK_SIZE 8192 +static char hvm_sig_stack[HVM_SIG_STACK_SIZE] __attribute__((aligned(4096))); + +static void my_hvm_sig_handler(uint64_t code) +{ + printf("HVM Signal Handler Invoked: code=0x%lx\n",code); +} + int main(int argc, char *argv[]) { int rc; - + if (argc!=3 && argc!=5) { printf("usage: test simple|time sync|async num_merges num_calls\n"); return -1; } v3_hvm_ros_user_init(); - + + v3_hvm_ros_unregister_signal(); // remove any existing signal handler + v3_hvm_ros_register_signal(my_hvm_sig_handler,hvm_sig_stack,HVM_SIG_STACK_SIZE); + if (argv[1][0]=='s') { if (argv[2][0]=='s') { rc=simple_test_sync(); @@ -222,6 +233,8 @@ int main(int argc, char *argv[]) rc=-1; } + v3_hvm_ros_unregister_signal(); + v3_hvm_ros_user_deinit(); return rc;