diff options
Diffstat (limited to 'include/xen')
-rw-r--r-- | include/xen/grant_table.h | 1 | ||||
-rw-r--r-- | include/xen/hvc-console.h | 4 | ||||
-rw-r--r-- | include/xen/interface/io/blkif.h | 36 | ||||
-rw-r--r-- | include/xen/xenbus.h | 12 |
4 files changed, 44 insertions, 9 deletions
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 6b99bfbd785d..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 | ||
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h index 901724dc528d..b62dfef15f61 100644 --- a/include/xen/hvc-console.h +++ b/include/xen/hvc-console.h | |||
@@ -6,12 +6,12 @@ extern struct console xenboot_console; | |||
6 | #ifdef CONFIG_HVC_XEN | 6 | #ifdef CONFIG_HVC_XEN |
7 | void xen_console_resume(void); | 7 | void xen_console_resume(void); |
8 | void xen_raw_console_write(const char *str); | 8 | void xen_raw_console_write(const char *str); |
9 | __attribute__((format(printf, 1, 2))) | 9 | __printf(1, 2) |
10 | void xen_raw_printk(const char *fmt, ...); | 10 | void xen_raw_printk(const char *fmt, ...); |
11 | #else | 11 | #else |
12 | static inline void xen_console_resume(void) { } | 12 | static inline void xen_console_resume(void) { } |
13 | static inline void xen_raw_console_write(const char *str) { } | 13 | static inline void xen_raw_console_write(const char *str) { } |
14 | static inline __attribute__((format(printf, 1, 2))) | 14 | static inline __printf(1, 2) |
15 | void xen_raw_printk(const char *fmt, ...) { } | 15 | void xen_raw_printk(const char *fmt, ...) { } |
16 | #endif | 16 | #endif |
17 | 17 | ||
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 | ||
107 | struct blkif_request_discard { | ||
108 | blkif_sector_t sector_number; | ||
109 | uint64_t nr_sectors; | ||
110 | }; | ||
111 | |||
77 | struct blkif_request { | 112 | struct 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/xenbus.h b/include/xen/xenbus.h index 553a7a21af5e..b1b6676c1c43 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
@@ -157,9 +157,9 @@ int xenbus_scanf(struct xenbus_transaction t, | |||
157 | __attribute__((format(scanf, 4, 5))); | 157 | __attribute__((format(scanf, 4, 5))); |
158 | 158 | ||
159 | /* Single printf and write: returns -errno or 0. */ | 159 | /* Single printf and write: returns -errno or 0. */ |
160 | __printf(4, 5) | ||
160 | int xenbus_printf(struct xenbus_transaction t, | 161 | int xenbus_printf(struct xenbus_transaction t, |
161 | const char *dir, const char *node, const char *fmt, ...) | 162 | const char *dir, const char *node, const char *fmt, ...); |
162 | __attribute__((format(printf, 4, 5))); | ||
163 | 163 | ||
164 | /* Generic read function: NULL-terminated triples of name, | 164 | /* Generic read function: NULL-terminated triples of name, |
165 | * sprintf-style type string, and pointer. Returns 0 or errno.*/ | 165 | * sprintf-style type string, and pointer. Returns 0 or errno.*/ |
@@ -201,11 +201,11 @@ int xenbus_watch_path(struct xenbus_device *dev, const char *path, | |||
201 | struct xenbus_watch *watch, | 201 | struct xenbus_watch *watch, |
202 | void (*callback)(struct xenbus_watch *, | 202 | void (*callback)(struct xenbus_watch *, |
203 | const char **, unsigned int)); | 203 | const char **, unsigned int)); |
204 | __printf(4, 5) | ||
204 | int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, | 205 | int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, |
205 | void (*callback)(struct xenbus_watch *, | 206 | void (*callback)(struct xenbus_watch *, |
206 | const char **, unsigned int), | 207 | const char **, unsigned int), |
207 | const char *pathfmt, ...) | 208 | const char *pathfmt, ...); |
208 | __attribute__ ((format (printf, 4, 5))); | ||
209 | 209 | ||
210 | int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); | 210 | int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); |
211 | int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn); | 211 | int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn); |
@@ -224,9 +224,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port); | |||
224 | 224 | ||
225 | enum xenbus_state xenbus_read_driver_state(const char *path); | 225 | enum xenbus_state xenbus_read_driver_state(const char *path); |
226 | 226 | ||
227 | __attribute__((format(printf, 3, 4))) | 227 | __printf(3, 4) |
228 | void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); | 228 | void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); |
229 | __attribute__((format(printf, 3, 4))) | 229 | __printf(3, 4) |
230 | void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); | 230 | void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); |
231 | 231 | ||
232 | const char *xenbus_strstate(enum xenbus_state state); | 232 | const char *xenbus_strstate(enum xenbus_state state); |