[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH] Update EVTCHN FIFO ABI



This patch is in response to review comments by David Vrabel.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenbus/evtchn_fifo.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/xenbus/evtchn_fifo.c b/src/xenbus/evtchn_fifo.c
index d37b1cd..2dd9597 100644
--- a/src/xenbus/evtchn_fifo.c
+++ b/src/xenbus/evtchn_fifo.c
@@ -102,9 +102,7 @@ __EvtchnFifoTestFlag(
     IN  ULONG           Flag
     )
 {
-    KeMemoryBarrier();
-
-    return !!(*EventWord & (1 << Flag));
+    return (*EventWord & (1 << Flag)) ? TRUE : FALSE;
 }
 
 static FORCEINLINE BOOLEAN
@@ -113,9 +111,7 @@ __EvtchnFifoTestAndSetFlag(
     IN  ULONG           Flag
     )
 {
-    KeMemoryBarrier();
-
-    return !!InterlockedBitTestAndSet((LONG *)EventWord, Flag);
+    return (InterlockedBitTestAndSet((LONG *)EventWord, Flag) != 0) ? TRUE : 
FALSE
 }
 
 static FORCEINLINE BOOLEAN
@@ -124,9 +120,7 @@ __EvtchnFifoTestAndClearFlag(
     IN  ULONG           Flag
     )
 {
-    KeMemoryBarrier();
-
-    return !!InterlockedBitTestAndReset((LONG *)EventWord, Flag);
+    return (InterlockedBitTestAndReset((LONG *)EventWord, Flag) != 0) ? TRUE : 
FALSE;
 }
 
 static FORCEINLINE VOID
@@ -135,8 +129,7 @@ __EvtchnFifoSetFlag(
     IN  ULONG           Flag
     )
 {
-    *EventWord |= (1 << Flag);
-    KeMemoryBarrier();
+    (VOID) InterlockedBitTestAndSet((LONG *)EventWord, Flag);
 }
 
 static FORCEINLINE VOID
@@ -145,8 +138,7 @@ __EvtchnFifoClearFlag(
     IN  ULONG           Flag
     )
 {
-    *EventWord &= ~(1 << Flag);
-    KeMemoryBarrier();
+    (VOID) InterlockedBitTestAndReset((LONG *)EventWord, Flag);
 }
 
 static FORCEINLINE ULONG
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.