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
32 /* Scratch memory pages for full hooks (1 per core) */
35 /* A second set of scratch memory pages */
36 /* The ONLY reason this exists is because of 'rep cmps'... */
40 struct list_head hook_list;
42 /* We track memory hooks via a hash table */
43 /* keyed to the memory region pointer */
44 struct hashtable * reg_table;
48 int v3_init_mem_hooks(struct v3_vm_info * vm);
49 int v3_deinit_mem_hooks(struct v3_vm_info * vm);
51 int v3_hook_full_mem(struct v3_vm_info * vm, uint16_t core_id,
52 addr_t guest_addr_start, addr_t guest_addr_end,
53 int (*read)(struct guest_info * core, addr_t guest_addr, void * dst, uint_t length, void * priv_data),
54 int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
57 int v3_hook_write_mem(struct v3_vm_info * vm, uint16_t core_id,
58 addr_t guest_addr_start, addr_t guest_addr_end, addr_t host_addr,
59 int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
63 int v3_unhook_mem(struct v3_vm_info * vm, uint16_t core_id, addr_t guest_addr_start);
69 #endif /* ! __V3VEE__ */