direct-io.hg

view xen/include/asm-x86/vmx_intercept.h @ 5669:ff5d7ccd8d69

No changes from me.
author cl349@firebug.cl.cam.ac.uk
date Tue Jul 05 08:47:55 2005 +0000 (2005-07-05)
parents 8bd2e8933277
children 551d099dae3a
line source
1 #ifndef _VMX_INTERCEPT_H
2 #define _VMX_INTERCEPT_H
4 #include <xen/config.h>
5 #include <xen/init.h>
6 #include <xen/lib.h>
7 #include <xen/time.h>
8 #include <xen/errno.h>
9 #include <public/io/ioreq.h>
11 #define MAX_IO_HANDLER 10
13 typedef int (*intercept_action_t)(ioreq_t*);
15 enum {PORTIO, MMIO};
17 struct vmx_handler_t {
18 int num_slot;
19 struct {
20 unsigned long addr;
21 int type;
22 unsigned long offset;
23 intercept_action_t action;
24 } hdl_list[MAX_IO_HANDLER];
25 };
27 /* global io interception point in HV */
28 extern int vmx_io_intercept(ioreq_t *p, int type);
29 extern int register_io_handler(unsigned long addr, unsigned long offset,
30 intercept_action_t action, int type);
32 static inline int vmx_portio_intercept(ioreq_t *p)
33 {
34 return vmx_io_intercept(p, PORTIO);
35 }
37 static inline int vmx_mmio_intercept(ioreq_t *p)
38 {
39 return vmx_io_intercept(p, MMIO);
40 }
42 static inline int register_portio_handler(unsigned long addr,
43 unsigned long offset,
44 intercept_action_t action)
45 {
46 return register_io_handler(addr, offset, action, PORTIO);
47 }
49 static inline int register_mmio_handler(unsigned long addr,
50 unsigned long offset,
51 intercept_action_t action)
52 {
53 return register_io_handler(addr, offset, action, MMIO);
54 }
56 #endif /* _VMX_INTERCEPT_H */