aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r--include/linux/hyperv.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 5852545e6bba..68ed7f7e1fc9 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -274,6 +274,33 @@ struct hv_ring_buffer_debug_info {
274 u32 bytes_avail_towrite; 274 u32 bytes_avail_towrite;
275}; 275};
276 276
277
278/*
279 *
280 * hv_get_ringbuffer_availbytes()
281 *
282 * Get number of bytes available to read and to write to
283 * for the specified ring buffer
284 */
285static inline void
286hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi,
287 u32 *read, u32 *write)
288{
289 u32 read_loc, write_loc, dsize;
290
291 smp_read_barrier_depends();
292
293 /* Capture the read/write indices before they changed */
294 read_loc = rbi->ring_buffer->read_index;
295 write_loc = rbi->ring_buffer->write_index;
296 dsize = rbi->ring_datasize;
297
298 *write = write_loc >= read_loc ? dsize - (write_loc - read_loc) :
299 read_loc - write_loc;
300 *read = dsize - *write;
301}
302
303
277/* 304/*
278 * We use the same version numbering for all Hyper-V modules. 305 * We use the same version numbering for all Hyper-V modules.
279 * 306 *
@@ -1035,8 +1062,10 @@ struct hyperv_service_callback {
1035 void (*callback) (void *context); 1062 void (*callback) (void *context);
1036}; 1063};
1037 1064
1065#define MAX_SRV_VER 0x7ffffff
1038extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *, 1066extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *,
1039 struct icmsg_negotiate *, u8 *); 1067 struct icmsg_negotiate *, u8 *, int,
1068 int);
1040 1069
1041int hv_kvp_init(struct hv_util_service *); 1070int hv_kvp_init(struct hv_util_service *);
1042void hv_kvp_deinit(void); 1071void hv_kvp_deinit(void);