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) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, 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".
21 #ifndef __VMM_MEM_HOOK_H
22 #define __VMM_MEM_HOOK_H
30 void * hook_hvas; // this is an array of pages, equal to the number of cores
32 struct list_head hook_list;
36 int v3_init_mem_hooks(struct v3_vm_info * vm);
37 int v3_deinit_mem_hooks(struct v3_vm_info * vm);
39 int v3_hook_full_mem(struct v3_vm_info * vm, uint16_t core_id,
40 addr_t guest_addr_start, addr_t guest_addr_end,
41 int (*read)(struct guest_info * core, addr_t guest_addr, void * dst, uint_t length, void * priv_data),
42 int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
45 int v3_hook_write_mem(struct v3_vm_info * vm, uint16_t core_id,
46 addr_t guest_addr_start, addr_t guest_addr_end, addr_t host_addr,
47 int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
51 int v3_unhook_mem(struct v3_vm_info * vm, uint16_t core_id, addr_t guest_addr_start);
53 int v3_find_mem_hook(struct v3_vm_info *vm, uint16_t core_id, addr_t guest_addr,
54 int (**read)(struct guest_info * core, addr_t guest_addr, void * dst, uint_t length, void * priv_data),
55 void **read_priv_data,
56 int (**write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
57 void **write_priv_data);
61 #endif /* ! __V3VEE__ */