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>
32 int v3_unhook_io_port(struct guest_info * info, uint_t port);
36 int v3_hook_io_port(struct guest_info * info, uint_t port,
37 int (*read)(ushort_t port, void * dst, uint_t length, void * priv_data),
38 int (*write)(ushort_t port, void * src, uint_t length, void * priv_data),
50 struct vmm_io_hook * head;
55 void v3_init_vmm_io_map(struct guest_info * info);
57 // FOREACH_IO_HOOK(vmm_io_map_t * io_map, vmm_io_hook_t * io_hook)
58 #define FOREACH_IO_HOOK(io_map, io_hook) for (io_hook = (io_map).head; io_hook != NULL; io_hook = (io_hook)->next)
64 // Reads data into the IO port (IN, INS)
65 int (*read)(ushort_t port, void * dst, uint_t length, void * priv_data);
67 // Writes data from the IO port (OUT, OUTS)
68 int (*write)(ushort_t port, void * src, uint_t length, void * priv_data);
72 struct vmm_io_hook * next;
73 struct vmm_io_hook * prev;
78 struct vmm_io_hook * v3_get_io_hook(struct vmm_io_map * io_map, uint_t port);
81 void v3_print_io_map(struct vmm_io_map * io_map);
86 void v3_outb(ushort_t port, uchar_t value);
87 uchar_t v3_inb(ushort_t port);
89 void v3_outw(ushort_t port, ushort_t value);
90 ushort_t v3_inw(ushort_t port);
92 void v3_outdw(ushort_t port, uint_t value);
93 uint_t v3_indw(ushort_t port);