X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fgeekos%2Fvmm_io.h;h=8909d5590e049264678dc96034bf59ad8cb00b9a;hb=29dcf8d7134d5c8fe56ec1f3ffaaa37192ce6fb8;hp=fde2ea64a383ea974e60d8b9660f28e4a1729f05;hpb=b85f79b8030114370851ed3422c078debe630570;p=palacios.releases.git diff --git a/palacios/include/geekos/vmm_io.h b/palacios/include/geekos/vmm_io.h index fde2ea6..8909d55 100644 --- a/palacios/include/geekos/vmm_io.h +++ b/palacios/include/geekos/vmm_io.h @@ -5,18 +5,18 @@ #include -// FOREACH_IO_HOOK(vmm_io_map_t io_map, vmm_io_hook_t * io_hook) -#define FOREACH_IO_HOOK(io_map, io_hook) for (io_hook = io_map.head; io_hook != NULL; io_hook = io_hook->next) +// FOREACH_IO_HOOK(vmm_io_map_t * io_map, vmm_io_hook_t * io_hook) +#define FOREACH_IO_HOOK(io_map, io_hook) for (io_hook = (io_map).head; io_hook != NULL; io_hook = (io_hook)->next) typedef struct vmm_io_hook { ushort_t port; // Reads data into the IO port (IN, INS) - int (*read)(ushort_t port, void * dst, uint_t length); + int (*read)(ushort_t port, void * dst, uint_t length, uint_t io_width); // Writes data from the IO port (OUT, OUTS) - int (*write)(ushort_t port, void * src, uint_t length); + int (*write)(ushort_t port, void * src, uint_t length, uint_t io_width); struct vmm_io_hook * next; struct vmm_io_hook * prev; @@ -37,11 +37,13 @@ void add_io_hook(vmm_io_map_t * io_map, vmm_io_hook_t * io_hook); +vmm_io_hook_t * get_io_hook(vmm_io_map_t * io_map, uint_t port); + /* External API */ void hook_io_port(vmm_io_map_t * io_map, uint_t port, - int (*read)(ushort_t port, void * dst, uint_t length), - int (*write)(ushort_t port, void * src, uint_t length)); + int (*read)(ushort_t port, void * dst, uint_t length, uint_t io_width), + int (*write)(ushort_t port, void * src, uint_t length, uint_t io_width)); void init_vmm_io_map(vmm_io_map_t * io_map);