Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354975
b: refs/heads/master
c: 6fdf3b2
h: refs/heads/master
i:
  354973: dc8867f
  354971: 9c6ed27
  354967: 7ba0716
  354959: a3ed94f
  354943: c6895eb
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Jan 17, 2013
1 parent f3fb0bc commit 7095a53
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0bffd25ce919f88ea6473150b66d26e7fa5712af
refs/heads/master: 6fdf3b21433e901dcba0ac186f00d604ce944f56
4 changes: 4 additions & 0 deletions trunk/drivers/hv/hyperv_vmbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ u32 hv_get_ringbuffer_interrupt_mask(struct hv_ring_buffer_info *ring_info);
void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info,
struct hv_ring_buffer_debug_info *debug_info);

void hv_begin_read(struct hv_ring_buffer_info *rbi);

u32 hv_end_read(struct hv_ring_buffer_info *rbi);

/*
* Maximum channels is determined by the size of the interrupt page
* which is PAGE_SIZE. 1/2 of PAGE_SIZE is for send endpoint interrupt
Expand Down
24 changes: 24 additions & 0 deletions trunk/drivers/hv/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@

#include "hyperv_vmbus.h"

void hv_begin_read(struct hv_ring_buffer_info *rbi)
{
rbi->ring_buffer->interrupt_mask = 1;
smp_mb();
}

u32 hv_end_read(struct hv_ring_buffer_info *rbi)
{
u32 read;
u32 write;

rbi->ring_buffer->interrupt_mask = 0;
smp_mb();

/*
* Now check to see if the ring buffer is still empty.
* If it is not, we raced and we need to process new
* incoming messages.
*/
hv_get_ringbuffer_availbytes(rbi, &read, &write);

return read;
}


/*
* hv_get_next_write_location()
Expand Down

0 comments on commit 7095a53

Please sign in to comment.