aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/balloon.h19
-rw-r--r--include/xen/events.h2
-rw-r--r--include/xen/grant_table.h2
-rw-r--r--include/xen/hvc-console.h4
-rw-r--r--include/xen/interface/io/blkif.h36
-rw-r--r--include/xen/interface/io/xs_wire.h6
-rw-r--r--include/xen/interface/physdev.h34
-rw-r--r--include/xen/interface/xen.h39
-rw-r--r--include/xen/page.h12
-rw-r--r--include/xen/tmem.h5
-rw-r--r--include/xen/xenbus.h11
11 files changed, 157 insertions, 13 deletions
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index a2b22f01a51d..d29c153705bc 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -15,11 +15,26 @@ struct balloon_stats {
15 unsigned long max_schedule_delay; 15 unsigned long max_schedule_delay;
16 unsigned long retry_count; 16 unsigned long retry_count;
17 unsigned long max_retry_count; 17 unsigned long max_retry_count;
18#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
19 unsigned long hotplug_pages;
20 unsigned long balloon_hotplug;
21#endif
18}; 22};
19 23
20extern struct balloon_stats balloon_stats; 24extern struct balloon_stats balloon_stats;
21 25
22void balloon_set_new_target(unsigned long target); 26void balloon_set_new_target(unsigned long target);
23 27
24int alloc_xenballooned_pages(int nr_pages, struct page** pages); 28int alloc_xenballooned_pages(int nr_pages, struct page **pages,
25void free_xenballooned_pages(int nr_pages, struct page** pages); 29 bool highmem);
30void free_xenballooned_pages(int nr_pages, struct page **pages);
31
32struct sys_device;
33#ifdef CONFIG_XEN_SELFBALLOONING
34extern int register_xen_selfballooning(struct sys_device *sysdev);
35#else
36static inline int register_xen_selfballooning(struct sys_device *sysdev)
37{
38 return -ENOSYS;
39}
40#endif
diff --git a/include/xen/events.h b/include/xen/events.h
index 9af21e19545a..d287997d3eab 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -74,8 +74,6 @@ int xen_set_callback_via(uint64_t via);
74void xen_evtchn_do_upcall(struct pt_regs *regs); 74void xen_evtchn_do_upcall(struct pt_regs *regs);
75void xen_hvm_evtchn_do_upcall(void); 75void xen_hvm_evtchn_do_upcall(void);
76 76
77/* Allocate a pirq for a physical interrupt, given a gsi. */
78int xen_allocate_pirq_gsi(unsigned gsi);
79/* Bind a pirq for a physical interrupt to an irq. */ 77/* Bind a pirq for a physical interrupt to an irq. */
80int xen_bind_pirq_gsi_to_irq(unsigned gsi, 78int xen_bind_pirq_gsi_to_irq(unsigned gsi,
81 unsigned pirq, int shareable, char *name); 79 unsigned pirq, int shareable, char *name);
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index b1fab6b5b3ef..11e2dfce42f8 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -43,7 +43,6 @@
43#include <xen/interface/grant_table.h> 43#include <xen/interface/grant_table.h>
44 44
45#include <asm/xen/hypervisor.h> 45#include <asm/xen/hypervisor.h>
46#include <asm/xen/grant_table.h>
47 46
48#include <xen/features.h> 47#include <xen/features.h>
49 48
@@ -156,6 +155,7 @@ unsigned int gnttab_max_grant_frames(void);
156#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) 155#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
157 156
158int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, 157int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
158 struct gnttab_map_grant_ref *kmap_ops,
159 struct page **pages, unsigned int count); 159 struct page **pages, unsigned int count);
160int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 160int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
161 struct page **pages, unsigned int count); 161 struct page **pages, unsigned int count);
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
index c3adde32669b..b62dfef15f61 100644
--- a/include/xen/hvc-console.h
+++ b/include/xen/hvc-console.h
@@ -6,11 +6,13 @@ extern struct console xenboot_console;
6#ifdef CONFIG_HVC_XEN 6#ifdef CONFIG_HVC_XEN
7void xen_console_resume(void); 7void xen_console_resume(void);
8void xen_raw_console_write(const char *str); 8void xen_raw_console_write(const char *str);
9__printf(1, 2)
9void xen_raw_printk(const char *fmt, ...); 10void xen_raw_printk(const char *fmt, ...);
10#else 11#else
11static inline void xen_console_resume(void) { } 12static inline void xen_console_resume(void) { }
12static inline void xen_raw_console_write(const char *str) { } 13static inline void xen_raw_console_write(const char *str) { }
13static inline void xen_raw_printk(const char *fmt, ...) { } 14static inline __printf(1, 2)
15void xen_raw_printk(const char *fmt, ...) { }
14#endif 16#endif
15 17
16#endif /* XEN_HVC_CONSOLE_H */ 18#endif /* XEN_HVC_CONSOLE_H */
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 3d5d6db864fe..9324488f23f0 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -57,6 +57,36 @@ typedef uint64_t blkif_sector_t;
57 * "feature-flush-cache" node! 57 * "feature-flush-cache" node!
58 */ 58 */
59#define BLKIF_OP_FLUSH_DISKCACHE 3 59#define BLKIF_OP_FLUSH_DISKCACHE 3
60
61/*
62 * Recognised only if "feature-discard" is present in backend xenbus info.
63 * The "feature-discard" node contains a boolean indicating whether trim
64 * (ATA) or unmap (SCSI) - conviently called discard requests are likely
65 * to succeed or fail. Either way, a discard request
66 * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
67 * the underlying block-device hardware. The boolean simply indicates whether
68 * or not it is worthwhile for the frontend to attempt discard requests.
69 * If a backend does not recognise BLKIF_OP_DISCARD, it should *not*
70 * create the "feature-discard" node!
71 *
72 * Discard operation is a request for the underlying block device to mark
73 * extents to be erased. However, discard does not guarantee that the blocks
74 * will be erased from the device - it is just a hint to the device
75 * controller that these blocks are no longer in use. What the device
76 * controller does with that information is left to the controller.
77 * Discard operations are passed with sector_number as the
78 * sector index to begin discard operations at and nr_sectors as the number of
79 * sectors to be discarded. The specified sectors should be discarded if the
80 * underlying block device supports trim (ATA) or unmap (SCSI) operations,
81 * or a BLKIF_RSP_EOPNOTSUPP should be returned.
82 * More information about trim/unmap operations at:
83 * http://t13.org/Documents/UploadedDocuments/docs2008/
84 * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc
85 * http://www.seagate.com/staticfiles/support/disc/manuals/
86 * Interface%20manuals/100293068c.pdf
87 */
88#define BLKIF_OP_DISCARD 5
89
60/* 90/*
61 * Maximum scatter/gather segments per request. 91 * Maximum scatter/gather segments per request.
62 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. 92 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE.
@@ -74,6 +104,11 @@ struct blkif_request_rw {
74 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 104 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
75}; 105};
76 106
107struct blkif_request_discard {
108 blkif_sector_t sector_number;
109 uint64_t nr_sectors;
110};
111
77struct blkif_request { 112struct blkif_request {
78 uint8_t operation; /* BLKIF_OP_??? */ 113 uint8_t operation; /* BLKIF_OP_??? */
79 uint8_t nr_segments; /* number of segments */ 114 uint8_t nr_segments; /* number of segments */
@@ -81,6 +116,7 @@ struct blkif_request {
81 uint64_t id; /* private guest value, echoed in resp */ 116 uint64_t id; /* private guest value, echoed in resp */
82 union { 117 union {
83 struct blkif_request_rw rw; 118 struct blkif_request_rw rw;
119 struct blkif_request_discard discard;
84 } u; 120 } u;
85}; 121};
86 122
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h
index 99fcffb372d1..f0b6890370be 100644
--- a/include/xen/interface/io/xs_wire.h
+++ b/include/xen/interface/io/xs_wire.h
@@ -26,7 +26,11 @@ enum xsd_sockmsg_type
26 XS_SET_PERMS, 26 XS_SET_PERMS,
27 XS_WATCH_EVENT, 27 XS_WATCH_EVENT,
28 XS_ERROR, 28 XS_ERROR,
29 XS_IS_DOMAIN_INTRODUCED 29 XS_IS_DOMAIN_INTRODUCED,
30 XS_RESUME,
31 XS_SET_TARGET,
32 XS_RESTRICT,
33 XS_RESET_WATCHES
30}; 34};
31 35
32#define XS_WRITE_NONE "NONE" 36#define XS_WRITE_NONE "NONE"
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index 534cac89a77d..c1080d9c705d 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -109,6 +109,7 @@ struct physdev_irq {
109#define MAP_PIRQ_TYPE_MSI 0x0 109#define MAP_PIRQ_TYPE_MSI 0x0
110#define MAP_PIRQ_TYPE_GSI 0x1 110#define MAP_PIRQ_TYPE_GSI 0x1
111#define MAP_PIRQ_TYPE_UNKNOWN 0x2 111#define MAP_PIRQ_TYPE_UNKNOWN 0x2
112#define MAP_PIRQ_TYPE_MSI_SEG 0x3
112 113
113#define PHYSDEVOP_map_pirq 13 114#define PHYSDEVOP_map_pirq 13
114struct physdev_map_pirq { 115struct physdev_map_pirq {
@@ -119,7 +120,7 @@ struct physdev_map_pirq {
119 int index; 120 int index;
120 /* IN or OUT */ 121 /* IN or OUT */
121 int pirq; 122 int pirq;
122 /* IN */ 123 /* IN - high 16 bits hold segment for MAP_PIRQ_TYPE_MSI_SEG */
123 int bus; 124 int bus;
124 /* IN */ 125 /* IN */
125 int devfn; 126 int devfn;
@@ -198,6 +199,37 @@ struct physdev_get_free_pirq {
198 uint32_t pirq; 199 uint32_t pirq;
199}; 200};
200 201
202#define XEN_PCI_DEV_EXTFN 0x1
203#define XEN_PCI_DEV_VIRTFN 0x2
204#define XEN_PCI_DEV_PXM 0x4
205
206#define PHYSDEVOP_pci_device_add 25
207struct physdev_pci_device_add {
208 /* IN */
209 uint16_t seg;
210 uint8_t bus;
211 uint8_t devfn;
212 uint32_t flags;
213 struct {
214 uint8_t bus;
215 uint8_t devfn;
216 } physfn;
217#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 uint32_t optarr[];
219#elif defined(__GNUC__)
220 uint32_t optarr[0];
221#endif
222};
223
224#define PHYSDEVOP_pci_device_remove 26
225#define PHYSDEVOP_restore_msi_ext 27
226struct physdev_pci_device {
227 /* IN */
228 uint16_t seg;
229 uint8_t bus;
230 uint8_t devfn;
231};
232
201/* 233/*
202 * Notify that some PIRQ-bound event channels have been unmasked. 234 * Notify that some PIRQ-bound event channels have been unmasked.
203 * ** This command is obsolete since interface version 0x00030202 and is ** 235 * ** This command is obsolete since interface version 0x00030202 and is **
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index d83cc08921a8..6a6e91449347 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -450,6 +450,45 @@ struct start_info {
450 int8_t cmd_line[MAX_GUEST_CMDLINE]; 450 int8_t cmd_line[MAX_GUEST_CMDLINE];
451}; 451};
452 452
453struct dom0_vga_console_info {
454 uint8_t video_type;
455#define XEN_VGATYPE_TEXT_MODE_3 0x03
456#define XEN_VGATYPE_VESA_LFB 0x23
457
458 union {
459 struct {
460 /* Font height, in pixels. */
461 uint16_t font_height;
462 /* Cursor location (column, row). */
463 uint16_t cursor_x, cursor_y;
464 /* Number of rows and columns (dimensions in characters). */
465 uint16_t rows, columns;
466 } text_mode_3;
467
468 struct {
469 /* Width and height, in pixels. */
470 uint16_t width, height;
471 /* Bytes per scan line. */
472 uint16_t bytes_per_line;
473 /* Bits per pixel. */
474 uint16_t bits_per_pixel;
475 /* LFB physical address, and size (in units of 64kB). */
476 uint32_t lfb_base;
477 uint32_t lfb_size;
478 /* RGB mask offsets and sizes, as defined by VBE 1.2+ */
479 uint8_t red_pos, red_size;
480 uint8_t green_pos, green_size;
481 uint8_t blue_pos, blue_size;
482 uint8_t rsvd_pos, rsvd_size;
483
484 /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
485 uint32_t gbl_caps;
486 /* Mode attributes (offset 0x0, VESA command 0x4f01). */
487 uint16_t mode_attrs;
488 } vesa_lfb;
489 } u;
490};
491
453/* These flags are passed in the 'flags' field of start_info_t. */ 492/* These flags are passed in the 'flags' field of start_info_t. */
454#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ 493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
455#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ 494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
diff --git a/include/xen/page.h b/include/xen/page.h
index 0be36b976f4b..12765b6f9517 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -3,6 +3,16 @@
3 3
4#include <asm/xen/page.h> 4#include <asm/xen/page.h>
5 5
6extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size; 6struct xen_memory_region {
7 phys_addr_t start;
8 phys_addr_t size;
9};
10
11#define XEN_EXTRA_MEM_MAX_REGIONS 128 /* == E820MAX */
12
13extern __initdata
14struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS];
15
16extern unsigned long xen_released_pages;
7 17
8#endif /* _XEN_PAGE_H */ 18#endif /* _XEN_PAGE_H */
diff --git a/include/xen/tmem.h b/include/xen/tmem.h
new file mode 100644
index 000000000000..82e2c83a32f5
--- /dev/null
+++ b/include/xen/tmem.h
@@ -0,0 +1,5 @@
1#ifndef _XEN_TMEM_H
2#define _XEN_TMEM_H
3/* defined in drivers/xen/tmem.c */
4extern int tmem_enabled;
5#endif /* _XEN_TMEM_H */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index 5467369e0889..b1b6676c1c43 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -37,6 +37,7 @@
37#include <linux/device.h> 37#include <linux/device.h>
38#include <linux/notifier.h> 38#include <linux/notifier.h>
39#include <linux/mutex.h> 39#include <linux/mutex.h>
40#include <linux/export.h>
40#include <linux/completion.h> 41#include <linux/completion.h>
41#include <linux/init.h> 42#include <linux/init.h>
42#include <linux/slab.h> 43#include <linux/slab.h>
@@ -156,9 +157,9 @@ int xenbus_scanf(struct xenbus_transaction t,
156 __attribute__((format(scanf, 4, 5))); 157 __attribute__((format(scanf, 4, 5)));
157 158
158/* Single printf and write: returns -errno or 0. */ 159/* Single printf and write: returns -errno or 0. */
160__printf(4, 5)
159int xenbus_printf(struct xenbus_transaction t, 161int xenbus_printf(struct xenbus_transaction t,
160 const char *dir, const char *node, const char *fmt, ...) 162 const char *dir, const char *node, const char *fmt, ...);
161 __attribute__((format(printf, 4, 5)));
162 163
163/* Generic read function: NULL-terminated triples of name, 164/* Generic read function: NULL-terminated triples of name,
164 * sprintf-style type string, and pointer. Returns 0 or errno.*/ 165 * sprintf-style type string, and pointer. Returns 0 or errno.*/
@@ -200,11 +201,11 @@ int xenbus_watch_path(struct xenbus_device *dev, const char *path,
200 struct xenbus_watch *watch, 201 struct xenbus_watch *watch,
201 void (*callback)(struct xenbus_watch *, 202 void (*callback)(struct xenbus_watch *,
202 const char **, unsigned int)); 203 const char **, unsigned int));
204__printf(4, 5)
203int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, 205int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch,
204 void (*callback)(struct xenbus_watch *, 206 void (*callback)(struct xenbus_watch *,
205 const char **, unsigned int), 207 const char **, unsigned int),
206 const char *pathfmt, ...) 208 const char *pathfmt, ...);
207 __attribute__ ((format (printf, 4, 5)));
208 209
209int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); 210int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state);
210int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn); 211int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn);
@@ -223,7 +224,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port);
223 224
224enum xenbus_state xenbus_read_driver_state(const char *path); 225enum xenbus_state xenbus_read_driver_state(const char *path);
225 226
227__printf(3, 4)
226void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); 228void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
229__printf(3, 4)
227void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); 230void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
228 231
229const char *xenbus_strstate(enum xenbus_state state); 232const char *xenbus_strstate(enum xenbus_state state);