Rev 1817 | Rev 1829 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1817 | Rev 1824 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | #include <macros.h> |
33 | #include <macros.h> |
34 | 34 | ||
35 | 35 | ||
36 | typedef uint16_t domid_t; |
36 | typedef uint16_t domid_t; |
37 | 37 | ||
38 | typedef struct { |
- | |
39 | uint64_t ptr; /**< Machine address of PTE */ |
- | |
40 | uint64_t val; /**< New contents of PTE */ |
- | |
41 | } mmu_update_t; |
- | |
42 | 38 | ||
43 | typedef struct { |
- | |
44 | unsigned int cmd; |
- | |
45 | union { |
- | |
46 | unsigned long mfn; |
39 | #define XEN_MMU_UPDATE 1 |
47 | unsigned long linear_addr; |
40 | #define XEN_UPDATE_VA_MAPPING 14 |
48 | } arg1; |
- | |
49 | union { |
- | |
50 | unsigned int nr_ents; |
- | |
51 | void *vcpumask; |
- | |
52 | } arg2; |
- | |
53 | } mmuext_op_t; |
- | |
54 | - | ||
55 | - | ||
56 | #define XEN_MMU_UPDATE 1 |
41 | #define XEN_CONSOLE_IO 18 |
57 | #define XEN_CONSOLE_IO 18 |
42 | #define XEN_VM_ASSIST 21 |
58 | #define XEN_MMUEXT_OP 26 |
43 | #define XEN_MMUEXT_OP 26 |
59 | 44 | ||
60 | 45 | ||
61 | /* |
46 | /* |
62 | * Commands for XEN_CONSOLE_IO |
47 | * Commands for XEN_CONSOLE_IO |
63 | */ |
48 | */ |
Line 80... | Line 65... | ||
80 | #define MMUEXT_FLUSH_CACHE 12 |
65 | #define MMUEXT_FLUSH_CACHE 12 |
81 | #define MMUEXT_SET_LDT 13 |
66 | #define MMUEXT_SET_LDT 13 |
82 | #define MMUEXT_NEW_USER_BASEPTR 15 |
67 | #define MMUEXT_NEW_USER_BASEPTR 15 |
83 | 68 | ||
84 | 69 | ||
- | 70 | #define UVMF_NONE 0 /**< No flushing at all */ |
|
- | 71 | #define UVMF_TLB_FLUSH 1 /**< Flush entire TLB(s) */ |
|
- | 72 | #define UVMF_INVLPG 2 /**< Flush only one entry */ |
|
- | 73 | #define UVMF_FLUSHTYPE_MASK 3 |
|
- | 74 | #define UVMF_MULTI 0 /**< Flush subset of TLBs */ |
|
- | 75 | #define UVMF_LOCAL 0 /**< Flush local TLB */ |
|
- | 76 | #define UVMF_ALL (1 << 2) /**< Flush all TLBs */ |
|
- | 77 | ||
- | 78 | ||
- | 79 | /* |
|
- | 80 | * Commands to XEN_VM_ASSIST |
|
- | 81 | */ |
|
- | 82 | #define VMASST_CMD_ENABLE 0 |
|
- | 83 | #define VMASST_CMD_DISABLE 1 |
|
- | 84 | #define VMASST_TYPE_4GB_SEGMENTS 0 |
|
- | 85 | #define VMASST_TYPE_4GB_SEGMENTS_NOTIFY 1 |
|
- | 86 | #define VMASST_TYPE_WRITABLE_PAGETABLES 2 |
|
- | 87 | ||
- | 88 | ||
85 | #define DOMID_SELF (0x7FF0U) |
89 | #define DOMID_SELF (0x7FF0U) |
86 | #define DOMID_IO (0x7FF1U) |
90 | #define DOMID_IO (0x7FF1U) |
87 | 91 | ||
88 | 92 | ||
89 | #define hypercall0(id) \ |
93 | #define hypercall0(id) \ |
Line 187... | Line 191... | ||
187 | static inline int xen_console_io(const unsigned int cmd, const unsigned int count, const char *str) |
191 | static inline int xen_console_io(const unsigned int cmd, const unsigned int count, const char *str) |
188 | { |
192 | { |
189 | return hypercall3(XEN_CONSOLE_IO, cmd, count, str); |
193 | return hypercall3(XEN_CONSOLE_IO, cmd, count, str); |
190 | } |
194 | } |
191 | 195 | ||
192 | static inline int xen_mmu_update(const mmu_update_t *req, const unsigned int count, unsigned int *success_count, domid_t domid) |
- | |
193 | { |
- | |
194 | return hypercall4(XEN_MMU_UPDATE, req, count, success_count, domid); |
- | |
195 | } |
- | |
196 | - | ||
197 | static inline int xen_mmuext_op(const mmuext_op_t *op, const unsigned int count, unsigned int *success_count, domid_t domid) |
196 | static inline int xen_vm_assist(const unsigned int cmd, const unsigned int type) |
198 | { |
197 | { |
199 | return hypercall4(XEN_MMUEXT_OP, op, count, success_count, domid); |
198 | return hypercall2(XEN_VM_ASSIST, cmd, type); |
200 | } |
199 | } |
201 | 200 | ||
202 | #endif |
201 | #endif |