2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2012, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2012, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifndef __VMM_EXITS_H__
21 #define __VMM_EXITS_H__
26 #include <palacios/vmm_types.h>
33 typedef enum { V3_EXIT_RDTSC,
36 V3_EXIT_INVALID } v3_exit_type_t;
43 int (*enable)(struct guest_info * core, v3_exit_type_t exit_type);
44 int (*disable)(struct guest_info * core, v3_exit_type_t exit_type);
51 uint32_t registered : 1;
53 } __attribute__((packed));
54 } __attribute__((packed));
56 } __attribute__((packed));
60 int (*handler)(struct guest_info * core, v3_exit_type_t exit_type,
61 void * priv_data, void * exit_data);
69 struct v3_exit_hook * exits;
75 int v3_init_exit_hooks(struct v3_vm_info * vm);
76 int v3_deinit_exit_hooks(struct v3_vm_info * vm);
78 int v3_init_exit_hooks_core(struct guest_info * core);
82 int v3_register_exit(struct v3_vm_info * vm, v3_exit_type_t exit_type,
83 int (*enable)(struct guest_info * core, v3_exit_type_t exit_type),
84 int (*disable)(struct guest_info * core, v3_exit_type_t exit_type));
88 int v3_dispatch_exit_hook(struct guest_info * core, v3_exit_type_t exit_type, void * exit_data);
95 int v3_hook_exit(struct v3_vm_info * vm, v3_exit_type_t exit_type,
96 int (*handler)(struct guest_info * core, v3_exit_type_t exit_type,
97 void * priv_data, void * exit_data),
99 struct guest_info * current_core);
101 int v3_unhook_exit(struct v3_vm_info * vm, v3_exit_type_t exit_type, struct guest_info * current_core);