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".
26 #include <palacios/vmm_types.h>
27 #include <palacios/vmm_util.h>
28 #include <palacios/vmm_rbtree.h>
36 void v3_init_io_map(struct v3_vm_info * vm);
37 int v3_deinit_io_map(struct v3_vm_info * vm);
42 int v3_hook_io_port(struct v3_vm_info * vm, uint16_t port,
43 int (*read)(struct guest_info * core, uint16_t port, void * dst, uint_t length, void * priv_data),
44 int (*write)(struct guest_info * core, uint16_t port, void * src, uint_t length, void * priv_data),
47 int v3_unhook_io_port(struct v3_vm_info * vm, uint16_t port);
56 // Reads data into the IO port (IN, INS)
57 int (*read)(struct guest_info * core, uint16_t port, void * dst, uint_t length, void * priv_data);
59 // Writes data from the IO port (OUT, OUTS)
60 int (*write)(struct guest_info * core, uint16_t port, void * src, uint_t length, void * priv_data);
64 struct rb_node tree_node;
70 int (*update_map)(struct v3_vm_info * vm, uint16_t port, int hook_read, int hook_write);
75 struct v3_io_hook * v3_get_io_hook(struct v3_vm_info * vm, uint16_t port);
78 void v3_print_io_map(struct v3_vm_info * vm);
80 void v3_refresh_io_map(struct v3_vm_info * vm);
83 void v3_outb(uint16_t port, uint8_t value);
84 uint8_t v3_inb(uint16_t port);
86 void v3_outw(uint16_t port, uint16_t value);
87 uint16_t v3_inw(uint16_t port);
89 void v3_outdw(uint16_t port, uint_t value);
90 uint_t v3_indw(uint16_t port);