diff options
Diffstat (limited to 'include/xen')
| -rw-r--r-- | include/xen/Kbuild | 1 | ||||
| -rw-r--r-- | include/xen/events.h | 26 | ||||
| -rw-r--r-- | include/xen/interface/features.h | 3 | ||||
| -rw-r--r-- | include/xen/interface/io/pciif.h | 112 | ||||
| -rw-r--r-- | include/xen/interface/io/xenbus.h | 8 | ||||
| -rw-r--r-- | include/xen/interface/memory.h | 29 | ||||
| -rw-r--r-- | include/xen/interface/physdev.h | 67 | ||||
| -rw-r--r-- | include/xen/platform_pci.h | 14 | ||||
| -rw-r--r-- | include/xen/privcmd.h | 80 | ||||
| -rw-r--r-- | include/xen/xen-ops.h | 5 |
10 files changed, 339 insertions, 6 deletions
diff --git a/include/xen/Kbuild b/include/xen/Kbuild index 4e65c16a445b..84ad8f02fee5 100644 --- a/include/xen/Kbuild +++ b/include/xen/Kbuild | |||
| @@ -1 +1,2 @@ | |||
| 1 | header-y += evtchn.h | 1 | header-y += evtchn.h |
| 2 | header-y += privcmd.h | ||
diff --git a/include/xen/events.h b/include/xen/events.h index a15d93262e30..646dd17d3aa4 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
| @@ -12,6 +12,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn, | |||
| 12 | irq_handler_t handler, | 12 | irq_handler_t handler, |
| 13 | unsigned long irqflags, const char *devname, | 13 | unsigned long irqflags, const char *devname, |
| 14 | void *dev_id); | 14 | void *dev_id); |
| 15 | int bind_virq_to_irq(unsigned int virq, unsigned int cpu); | ||
| 15 | int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, | 16 | int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, |
| 16 | irq_handler_t handler, | 17 | irq_handler_t handler, |
| 17 | unsigned long irqflags, const char *devname, | 18 | unsigned long irqflags, const char *devname, |
| @@ -53,6 +54,10 @@ bool xen_test_irq_pending(int irq); | |||
| 53 | irq will be disabled so it won't deliver an interrupt. */ | 54 | irq will be disabled so it won't deliver an interrupt. */ |
| 54 | void xen_poll_irq(int irq); | 55 | void xen_poll_irq(int irq); |
| 55 | 56 | ||
| 57 | /* Poll waiting for an irq to become pending with a timeout. In the usual case, | ||
| 58 | * the irq will be disabled so it won't deliver an interrupt. */ | ||
| 59 | void xen_poll_irq_timeout(int irq, u64 timeout); | ||
| 60 | |||
| 56 | /* Determine the IRQ which is bound to an event channel */ | 61 | /* Determine the IRQ which is bound to an event channel */ |
| 57 | unsigned irq_from_evtchn(unsigned int evtchn); | 62 | unsigned irq_from_evtchn(unsigned int evtchn); |
| 58 | 63 | ||
| @@ -63,4 +68,25 @@ int xen_set_callback_via(uint64_t via); | |||
| 63 | void xen_evtchn_do_upcall(struct pt_regs *regs); | 68 | void xen_evtchn_do_upcall(struct pt_regs *regs); |
| 64 | void xen_hvm_evtchn_do_upcall(void); | 69 | void xen_hvm_evtchn_do_upcall(void); |
| 65 | 70 | ||
| 71 | /* Allocate an irq for a physical interrupt, given a gsi. "Legacy" | ||
| 72 | * GSIs are identity mapped; others are dynamically allocated as | ||
| 73 | * usual. */ | ||
| 74 | int xen_allocate_pirq(unsigned gsi, int shareable, char *name); | ||
| 75 | int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name); | ||
| 76 | |||
| 77 | #ifdef CONFIG_PCI_MSI | ||
| 78 | /* Allocate an irq and a pirq to be used with MSIs. */ | ||
| 79 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq); | ||
| 80 | int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type); | ||
| 81 | #endif | ||
| 82 | |||
| 83 | /* De-allocates the above mentioned physical interrupt. */ | ||
| 84 | int xen_destroy_irq(int irq); | ||
| 85 | |||
| 86 | /* Return vector allocated to pirq */ | ||
| 87 | int xen_vector_from_irq(unsigned pirq); | ||
| 88 | |||
| 89 | /* Return gsi allocated to pirq */ | ||
| 90 | int xen_gsi_from_irq(unsigned pirq); | ||
| 91 | |||
| 66 | #endif /* _XEN_EVENTS_H */ | 92 | #endif /* _XEN_EVENTS_H */ |
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h index 70d2563ab166..b6ca39a069d8 100644 --- a/include/xen/interface/features.h +++ b/include/xen/interface/features.h | |||
| @@ -47,6 +47,9 @@ | |||
| 47 | /* x86: pvclock algorithm is safe to use on HVM */ | 47 | /* x86: pvclock algorithm is safe to use on HVM */ |
| 48 | #define XENFEAT_hvm_safe_pvclock 9 | 48 | #define XENFEAT_hvm_safe_pvclock 9 |
| 49 | 49 | ||
| 50 | /* x86: pirq can be used by HVM guests */ | ||
| 51 | #define XENFEAT_hvm_pirqs 10 | ||
| 52 | |||
| 50 | #define XENFEAT_NR_SUBMAPS 1 | 53 | #define XENFEAT_NR_SUBMAPS 1 |
| 51 | 54 | ||
| 52 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ | 55 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ |
diff --git a/include/xen/interface/io/pciif.h b/include/xen/interface/io/pciif.h new file mode 100644 index 000000000000..d9922ae36eb5 --- /dev/null +++ b/include/xen/interface/io/pciif.h | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | /* | ||
| 2 | * PCI Backend/Frontend Common Data Structures & Macros | ||
| 3 | * | ||
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 5 | * of this software and associated documentation files (the "Software"), to | ||
| 6 | * deal in the Software without restriction, including without limitation the | ||
| 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| 8 | * sell copies of the Software, and to permit persons to whom the Software is | ||
| 9 | * furnished to do so, subject to the following conditions: | ||
| 10 | * | ||
| 11 | * The above copyright notice and this permission notice shall be included in | ||
| 12 | * all copies or substantial portions of the Software. | ||
| 13 | * | ||
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 20 | * DEALINGS IN THE SOFTWARE. | ||
| 21 | * | ||
| 22 | * Author: Ryan Wilson <hap9@epoch.ncsc.mil> | ||
| 23 | */ | ||
| 24 | #ifndef __XEN_PCI_COMMON_H__ | ||
| 25 | #define __XEN_PCI_COMMON_H__ | ||
| 26 | |||
| 27 | /* Be sure to bump this number if you change this file */ | ||
| 28 | #define XEN_PCI_MAGIC "7" | ||
| 29 | |||
| 30 | /* xen_pci_sharedinfo flags */ | ||
| 31 | #define _XEN_PCIF_active (0) | ||
| 32 | #define XEN_PCIF_active (1<<_XEN_PCIF_active) | ||
| 33 | #define _XEN_PCIB_AERHANDLER (1) | ||
| 34 | #define XEN_PCIB_AERHANDLER (1<<_XEN_PCIB_AERHANDLER) | ||
| 35 | #define _XEN_PCIB_active (2) | ||
| 36 | #define XEN_PCIB_active (1<<_XEN_PCIB_active) | ||
| 37 | |||
| 38 | /* xen_pci_op commands */ | ||
| 39 | #define XEN_PCI_OP_conf_read (0) | ||
| 40 | #define XEN_PCI_OP_conf_write (1) | ||
| 41 | #define XEN_PCI_OP_enable_msi (2) | ||
| 42 | #define XEN_PCI_OP_disable_msi (3) | ||
| 43 | #define XEN_PCI_OP_enable_msix (4) | ||
| 44 | #define XEN_PCI_OP_disable_msix (5) | ||
| 45 | #define XEN_PCI_OP_aer_detected (6) | ||
| 46 | #define XEN_PCI_OP_aer_resume (7) | ||
| 47 | #define XEN_PCI_OP_aer_mmio (8) | ||
| 48 | #define XEN_PCI_OP_aer_slotreset (9) | ||
| 49 | |||
| 50 | /* xen_pci_op error numbers */ | ||
| 51 | #define XEN_PCI_ERR_success (0) | ||
| 52 | #define XEN_PCI_ERR_dev_not_found (-1) | ||
| 53 | #define XEN_PCI_ERR_invalid_offset (-2) | ||
| 54 | #define XEN_PCI_ERR_access_denied (-3) | ||
| 55 | #define XEN_PCI_ERR_not_implemented (-4) | ||
| 56 | /* XEN_PCI_ERR_op_failed - backend failed to complete the operation */ | ||
| 57 | #define XEN_PCI_ERR_op_failed (-5) | ||
| 58 | |||
| 59 | /* | ||
| 60 | * it should be PAGE_SIZE-sizeof(struct xen_pci_op))/sizeof(struct msix_entry)) | ||
| 61 | * Should not exceed 128 | ||
| 62 | */ | ||
| 63 | #define SH_INFO_MAX_VEC 128 | ||
| 64 | |||
| 65 | struct xen_msix_entry { | ||
| 66 | uint16_t vector; | ||
| 67 | uint16_t entry; | ||
| 68 | }; | ||
| 69 | struct xen_pci_op { | ||
| 70 | /* IN: what action to perform: XEN_PCI_OP_* */ | ||
| 71 | uint32_t cmd; | ||
| 72 | |||
| 73 | /* OUT: will contain an error number (if any) from errno.h */ | ||
| 74 | int32_t err; | ||
| 75 | |||
| 76 | /* IN: which device to touch */ | ||
| 77 | uint32_t domain; /* PCI Domain/Segment */ | ||
| 78 | uint32_t bus; | ||
| 79 | uint32_t devfn; | ||
| 80 | |||
| 81 | /* IN: which configuration registers to touch */ | ||
| 82 | int32_t offset; | ||
| 83 | int32_t size; | ||
| 84 | |||
| 85 | /* IN/OUT: Contains the result after a READ or the value to WRITE */ | ||
| 86 | uint32_t value; | ||
| 87 | /* IN: Contains extra infor for this operation */ | ||
| 88 | uint32_t info; | ||
| 89 | /*IN: param for msi-x */ | ||
| 90 | struct xen_msix_entry msix_entries[SH_INFO_MAX_VEC]; | ||
| 91 | }; | ||
| 92 | |||
| 93 | /*used for pcie aer handling*/ | ||
| 94 | struct xen_pcie_aer_op { | ||
| 95 | /* IN: what action to perform: XEN_PCI_OP_* */ | ||
| 96 | uint32_t cmd; | ||
| 97 | /*IN/OUT: return aer_op result or carry error_detected state as input*/ | ||
| 98 | int32_t err; | ||
| 99 | |||
| 100 | /* IN: which device to touch */ | ||
| 101 | uint32_t domain; /* PCI Domain/Segment*/ | ||
| 102 | uint32_t bus; | ||
| 103 | uint32_t devfn; | ||
| 104 | }; | ||
| 105 | struct xen_pci_sharedinfo { | ||
| 106 | /* flags - XEN_PCIF_* */ | ||
| 107 | uint32_t flags; | ||
| 108 | struct xen_pci_op op; | ||
| 109 | struct xen_pcie_aer_op aer_op; | ||
| 110 | }; | ||
| 111 | |||
| 112 | #endif /* __XEN_PCI_COMMON_H__ */ | ||
diff --git a/include/xen/interface/io/xenbus.h b/include/xen/interface/io/xenbus.h index 46508c7fa399..9fda532973a5 100644 --- a/include/xen/interface/io/xenbus.h +++ b/include/xen/interface/io/xenbus.h | |||
| @@ -27,8 +27,14 @@ enum xenbus_state | |||
| 27 | XenbusStateClosing = 5, /* The device is being closed | 27 | XenbusStateClosing = 5, /* The device is being closed |
| 28 | due to an error or an unplug | 28 | due to an error or an unplug |
| 29 | event. */ | 29 | event. */ |
| 30 | XenbusStateClosed = 6 | 30 | XenbusStateClosed = 6, |
| 31 | 31 | ||
| 32 | /* | ||
| 33 | * Reconfiguring: The device is being reconfigured. | ||
| 34 | */ | ||
| 35 | XenbusStateReconfiguring = 7, | ||
| 36 | |||
| 37 | XenbusStateReconfigured = 8 | ||
| 32 | }; | 38 | }; |
| 33 | 39 | ||
| 34 | #endif /* _XEN_PUBLIC_IO_XENBUS_H */ | 40 | #endif /* _XEN_PUBLIC_IO_XENBUS_H */ |
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index d3938d3e71f8..d7a6c13bde69 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
| @@ -186,6 +186,35 @@ struct xen_translate_gpfn_list { | |||
| 186 | }; | 186 | }; |
| 187 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); | 187 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); |
| 188 | 188 | ||
| 189 | /* | ||
| 190 | * Returns the pseudo-physical memory map as it was when the domain | ||
| 191 | * was started (specified by XENMEM_set_memory_map). | ||
| 192 | * arg == addr of struct xen_memory_map. | ||
| 193 | */ | ||
| 194 | #define XENMEM_memory_map 9 | ||
| 195 | struct xen_memory_map { | ||
| 196 | /* | ||
| 197 | * On call the number of entries which can be stored in buffer. On | ||
| 198 | * return the number of entries which have been stored in | ||
| 199 | * buffer. | ||
| 200 | */ | ||
| 201 | unsigned int nr_entries; | ||
| 202 | |||
| 203 | /* | ||
| 204 | * Entries in the buffer are in the same format as returned by the | ||
| 205 | * BIOS INT 0x15 EAX=0xE820 call. | ||
| 206 | */ | ||
| 207 | GUEST_HANDLE(void) buffer; | ||
| 208 | }; | ||
| 209 | DEFINE_GUEST_HANDLE_STRUCT(xen_memory_map); | ||
| 210 | |||
| 211 | /* | ||
| 212 | * Returns the real physical memory map. Passes the same structure as | ||
| 213 | * XENMEM_memory_map. | ||
| 214 | * arg == addr of struct xen_memory_map. | ||
| 215 | */ | ||
| 216 | #define XENMEM_machine_memory_map 10 | ||
| 217 | |||
| 189 | 218 | ||
| 190 | /* | 219 | /* |
| 191 | * Prevent the balloon driver from changing the memory reservation | 220 | * Prevent the balloon driver from changing the memory reservation |
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index cd6939147cb6..2b2c66c3df00 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
| @@ -106,6 +106,57 @@ struct physdev_irq { | |||
| 106 | uint32_t vector; | 106 | uint32_t vector; |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | #define MAP_PIRQ_TYPE_MSI 0x0 | ||
| 110 | #define MAP_PIRQ_TYPE_GSI 0x1 | ||
| 111 | #define MAP_PIRQ_TYPE_UNKNOWN 0x2 | ||
| 112 | |||
| 113 | #define PHYSDEVOP_map_pirq 13 | ||
| 114 | struct physdev_map_pirq { | ||
| 115 | domid_t domid; | ||
| 116 | /* IN */ | ||
| 117 | int type; | ||
| 118 | /* IN */ | ||
| 119 | int index; | ||
| 120 | /* IN or OUT */ | ||
| 121 | int pirq; | ||
| 122 | /* IN */ | ||
| 123 | int bus; | ||
| 124 | /* IN */ | ||
| 125 | int devfn; | ||
| 126 | /* IN */ | ||
| 127 | int entry_nr; | ||
| 128 | /* IN */ | ||
| 129 | uint64_t table_base; | ||
| 130 | }; | ||
| 131 | |||
| 132 | #define PHYSDEVOP_unmap_pirq 14 | ||
| 133 | struct physdev_unmap_pirq { | ||
| 134 | domid_t domid; | ||
| 135 | /* IN */ | ||
| 136 | int pirq; | ||
| 137 | }; | ||
| 138 | |||
| 139 | #define PHYSDEVOP_manage_pci_add 15 | ||
| 140 | #define PHYSDEVOP_manage_pci_remove 16 | ||
| 141 | struct physdev_manage_pci { | ||
| 142 | /* IN */ | ||
| 143 | uint8_t bus; | ||
| 144 | uint8_t devfn; | ||
| 145 | }; | ||
| 146 | |||
| 147 | #define PHYSDEVOP_manage_pci_add_ext 20 | ||
| 148 | struct physdev_manage_pci_ext { | ||
| 149 | /* IN */ | ||
| 150 | uint8_t bus; | ||
| 151 | uint8_t devfn; | ||
| 152 | unsigned is_extfn; | ||
| 153 | unsigned is_virtfn; | ||
| 154 | struct { | ||
| 155 | uint8_t bus; | ||
| 156 | uint8_t devfn; | ||
| 157 | } physfn; | ||
| 158 | }; | ||
| 159 | |||
| 109 | /* | 160 | /* |
| 110 | * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() | 161 | * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() |
| 111 | * hypercall since 0x00030202. | 162 | * hypercall since 0x00030202. |
| @@ -121,6 +172,22 @@ struct physdev_op { | |||
| 121 | } u; | 172 | } u; |
| 122 | }; | 173 | }; |
| 123 | 174 | ||
| 175 | #define PHYSDEVOP_setup_gsi 21 | ||
| 176 | struct physdev_setup_gsi { | ||
| 177 | int gsi; | ||
| 178 | /* IN */ | ||
| 179 | uint8_t triggering; | ||
| 180 | /* IN */ | ||
| 181 | uint8_t polarity; | ||
| 182 | /* IN */ | ||
| 183 | }; | ||
| 184 | |||
| 185 | #define PHYSDEVOP_get_nr_pirqs 22 | ||
| 186 | struct physdev_nr_pirqs { | ||
| 187 | /* OUT */ | ||
| 188 | uint32_t nr_pirqs; | ||
| 189 | }; | ||
| 190 | |||
| 124 | /* | 191 | /* |
| 125 | * Notify that some PIRQ-bound event channels have been unmasked. | 192 | * Notify that some PIRQ-bound event channels have been unmasked. |
| 126 | * ** This command is obsolete since interface version 0x00030202 and is ** | 193 | * ** This command is obsolete since interface version 0x00030202 and is ** |
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h index ce9d671c636c..a785a3b0c8c7 100644 --- a/include/xen/platform_pci.h +++ b/include/xen/platform_pci.h | |||
| @@ -16,11 +16,15 @@ | |||
| 16 | #define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */ | 16 | #define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */ |
| 17 | #define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */ | 17 | #define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */ |
| 18 | 18 | ||
| 19 | #define XEN_UNPLUG_ALL_IDE_DISKS 1 | 19 | #define XEN_UNPLUG_ALL_IDE_DISKS (1<<0) |
| 20 | #define XEN_UNPLUG_ALL_NICS 2 | 20 | #define XEN_UNPLUG_ALL_NICS (1<<1) |
| 21 | #define XEN_UNPLUG_AUX_IDE_DISKS 4 | 21 | #define XEN_UNPLUG_AUX_IDE_DISKS (1<<2) |
| 22 | #define XEN_UNPLUG_ALL 7 | 22 | #define XEN_UNPLUG_ALL (XEN_UNPLUG_ALL_IDE_DISKS|\ |
| 23 | #define XEN_UNPLUG_IGNORE 8 | 23 | XEN_UNPLUG_ALL_NICS|\ |
| 24 | XEN_UNPLUG_AUX_IDE_DISKS) | ||
| 25 | |||
| 26 | #define XEN_UNPLUG_UNNECESSARY (1<<16) | ||
| 27 | #define XEN_UNPLUG_NEVER (1<<17) | ||
| 24 | 28 | ||
| 25 | static inline int xen_must_unplug_nics(void) { | 29 | static inline int xen_must_unplug_nics(void) { |
| 26 | #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \ | 30 | #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \ |
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h new file mode 100644 index 000000000000..b42cdfd92fee --- /dev/null +++ b/include/xen/privcmd.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * privcmd.h | ||
| 3 | * | ||
| 4 | * Interface to /proc/xen/privcmd. | ||
| 5 | * | ||
| 6 | * Copyright (c) 2003-2005, K A Fraser | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License version 2 | ||
| 10 | * as published by the Free Software Foundation; or, when distributed | ||
| 11 | * separately from the Linux kernel or incorporated into other | ||
| 12 | * software packages, subject to the following license: | ||
| 13 | * | ||
| 14 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 15 | * of this source file (the "Software"), to deal in the Software without | ||
| 16 | * restriction, including without limitation the rights to use, copy, modify, | ||
| 17 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
| 18 | * and to permit persons to whom the Software is furnished to do so, subject to | ||
| 19 | * the following conditions: | ||
| 20 | * | ||
| 21 | * The above copyright notice and this permission notice shall be included in | ||
| 22 | * all copies or substantial portions of the Software. | ||
| 23 | * | ||
| 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
| 30 | * IN THE SOFTWARE. | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __LINUX_PUBLIC_PRIVCMD_H__ | ||
| 34 | #define __LINUX_PUBLIC_PRIVCMD_H__ | ||
| 35 | |||
| 36 | #include <linux/types.h> | ||
| 37 | |||
| 38 | typedef unsigned long xen_pfn_t; | ||
| 39 | |||
| 40 | #ifndef __user | ||
| 41 | #define __user | ||
| 42 | #endif | ||
| 43 | |||
| 44 | struct privcmd_hypercall { | ||
| 45 | __u64 op; | ||
| 46 | __u64 arg[5]; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct privcmd_mmap_entry { | ||
| 50 | __u64 va; | ||
| 51 | __u64 mfn; | ||
| 52 | __u64 npages; | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct privcmd_mmap { | ||
| 56 | int num; | ||
| 57 | domid_t dom; /* target domain */ | ||
| 58 | struct privcmd_mmap_entry __user *entry; | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct privcmd_mmapbatch { | ||
| 62 | int num; /* number of pages to populate */ | ||
| 63 | domid_t dom; /* target domain */ | ||
| 64 | __u64 addr; /* virtual address */ | ||
| 65 | xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */ | ||
| 66 | }; | ||
| 67 | |||
| 68 | /* | ||
| 69 | * @cmd: IOCTL_PRIVCMD_HYPERCALL | ||
| 70 | * @arg: &privcmd_hypercall_t | ||
| 71 | * Return: Value returned from execution of the specified hypercall. | ||
| 72 | */ | ||
| 73 | #define IOCTL_PRIVCMD_HYPERCALL \ | ||
| 74 | _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) | ||
| 75 | #define IOCTL_PRIVCMD_MMAP \ | ||
| 76 | _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) | ||
| 77 | #define IOCTL_PRIVCMD_MMAPBATCH \ | ||
| 78 | _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) | ||
| 79 | |||
| 80 | #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ | ||
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h index 351f4051f6d8..98b92154a264 100644 --- a/include/xen/xen-ops.h +++ b/include/xen/xen-ops.h | |||
| @@ -23,4 +23,9 @@ int xen_create_contiguous_region(unsigned long vstart, unsigned int order, | |||
| 23 | 23 | ||
| 24 | void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); | 24 | void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); |
| 25 | 25 | ||
| 26 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | ||
| 27 | unsigned long addr, | ||
| 28 | unsigned long mfn, int nr, | ||
| 29 | pgprot_t prot, unsigned domid); | ||
| 30 | |||
| 26 | #endif /* INCLUDE_XEN_OPS_H */ | 31 | #endif /* INCLUDE_XEN_OPS_H */ |
