aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/RingBuffer.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-07-14 18:09:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:01:46 -0400
commit4d64311468a90d4ab1e83c62d63b27da598b73ea (patch)
tree958df2af78911f7f6d66040f7fbcd965a1cbd4b6 /drivers/staging/hv/RingBuffer.c
parent5cd508bc3ac032343e6853cd5712ac392942fb2c (diff)
Staging: hv: remove UINT32 and INT32 typedefs
The UINT32 and INT32 typedefs are now removed from the Hyper-V driver code. Cc: Hank Janssen <hjanssen@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/RingBuffer.c')
-rw-r--r--drivers/staging/hv/RingBuffer.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/drivers/staging/hv/RingBuffer.c b/drivers/staging/hv/RingBuffer.c
index a8df47e13eb..4a05f7d7d2d 100644
--- a/drivers/staging/hv/RingBuffer.c
+++ b/drivers/staging/hv/RingBuffer.c
@@ -44,9 +44,9 @@ Description:
44 44
45--*/ 45--*/
46static inline void 46static inline void
47GetRingBufferAvailBytes(RING_BUFFER_INFO *rbi, UINT32 *read, UINT32 *write) 47GetRingBufferAvailBytes(RING_BUFFER_INFO *rbi, u32 *read, u32 *write)
48{ 48{
49 UINT32 read_loc,write_loc; 49 u32 read_loc,write_loc;
50 50
51 // Capture the read/write indices before they changed 51 // Capture the read/write indices before they changed
52 read_loc = rbi->RingBuffer->ReadIndex; 52 read_loc = rbi->RingBuffer->ReadIndex;
@@ -65,10 +65,10 @@ Description:
65 Get the next write location for the specified ring buffer 65 Get the next write location for the specified ring buffer
66 66
67--*/ 67--*/
68static inline UINT32 68static inline u32
69GetNextWriteLocation(RING_BUFFER_INFO* RingInfo) 69GetNextWriteLocation(RING_BUFFER_INFO* RingInfo)
70{ 70{
71 UINT32 next = RingInfo->RingBuffer->WriteIndex; 71 u32 next = RingInfo->RingBuffer->WriteIndex;
72 72
73 ASSERT(next < RingInfo->RingDataSize); 73 ASSERT(next < RingInfo->RingDataSize);
74 74
@@ -85,7 +85,7 @@ Description:
85 85
86--*/ 86--*/
87static inline void 87static inline void
88SetNextWriteLocation(RING_BUFFER_INFO* RingInfo, UINT32 NextWriteLocation) 88SetNextWriteLocation(RING_BUFFER_INFO* RingInfo, u32 NextWriteLocation)
89{ 89{
90 RingInfo->RingBuffer->WriteIndex = NextWriteLocation; 90 RingInfo->RingBuffer->WriteIndex = NextWriteLocation;
91} 91}
@@ -99,10 +99,10 @@ Description:
99 Get the next read location for the specified ring buffer 99 Get the next read location for the specified ring buffer
100 100
101--*/ 101--*/
102static inline UINT32 102static inline u32
103GetNextReadLocation(RING_BUFFER_INFO* RingInfo) 103GetNextReadLocation(RING_BUFFER_INFO* RingInfo)
104{ 104{
105 UINT32 next = RingInfo->RingBuffer->ReadIndex; 105 u32 next = RingInfo->RingBuffer->ReadIndex;
106 106
107 ASSERT(next < RingInfo->RingDataSize); 107 ASSERT(next < RingInfo->RingDataSize);
108 108
@@ -119,10 +119,10 @@ Description:
119 This allows the caller to skip 119 This allows the caller to skip
120 120
121--*/ 121--*/
122static inline UINT32 122static inline u32
123GetNextReadLocationWithOffset(RING_BUFFER_INFO* RingInfo, UINT32 Offset) 123GetNextReadLocationWithOffset(RING_BUFFER_INFO* RingInfo, u32 Offset)
124{ 124{
125 UINT32 next = RingInfo->RingBuffer->ReadIndex; 125 u32 next = RingInfo->RingBuffer->ReadIndex;
126 126
127 ASSERT(next < RingInfo->RingDataSize); 127 ASSERT(next < RingInfo->RingDataSize);
128 next += Offset; 128 next += Offset;
@@ -141,7 +141,7 @@ Description:
141 141
142--*/ 142--*/
143static inline void 143static inline void
144SetNextReadLocation(RING_BUFFER_INFO* RingInfo, UINT32 NextReadLocation) 144SetNextReadLocation(RING_BUFFER_INFO* RingInfo, u32 NextReadLocation)
145{ 145{
146 RingInfo->RingBuffer->ReadIndex = NextReadLocation; 146 RingInfo->RingBuffer->ReadIndex = NextReadLocation;
147} 147}
@@ -172,7 +172,7 @@ Description:
172 Get the size of the ring buffer 172 Get the size of the ring buffer
173 173
174--*/ 174--*/
175static inline UINT32 175static inline u32
176GetRingBufferSize(RING_BUFFER_INFO* RingInfo) 176GetRingBufferSize(RING_BUFFER_INFO* RingInfo)
177{ 177{
178 return RingInfo->RingDataSize; 178 return RingInfo->RingDataSize;
@@ -206,8 +206,8 @@ Description:
206void 206void
207DumpRingInfo(RING_BUFFER_INFO* RingInfo, char *Prefix) 207DumpRingInfo(RING_BUFFER_INFO* RingInfo, char *Prefix)
208{ 208{
209 UINT32 bytesAvailToWrite; 209 u32 bytesAvailToWrite;
210 UINT32 bytesAvailToRead; 210 u32 bytesAvailToRead;
211 211
212 GetRingBufferAvailBytes(RingInfo, &bytesAvailToRead, &bytesAvailToWrite); 212 GetRingBufferAvailBytes(RingInfo, &bytesAvailToRead, &bytesAvailToWrite);
213 213
@@ -224,19 +224,19 @@ DumpRingInfo(RING_BUFFER_INFO* RingInfo, char *Prefix)
224// 224//
225// Internal routines 225// Internal routines
226// 226//
227static UINT32 227static u32
228CopyToRingBuffer( 228CopyToRingBuffer(
229 RING_BUFFER_INFO *RingInfo, 229 RING_BUFFER_INFO *RingInfo,
230 UINT32 StartWriteOffset, 230 u32 StartWriteOffset,
231 void * Src, 231 void * Src,
232 UINT32 SrcLen); 232 u32 SrcLen);
233 233
234static UINT32 234static u32
235CopyFromRingBuffer( 235CopyFromRingBuffer(
236 RING_BUFFER_INFO *RingInfo, 236 RING_BUFFER_INFO *RingInfo,
237 void * Dest, 237 void * Dest,
238 UINT32 DestLen, 238 u32 DestLen,
239 UINT32 StartReadOffset); 239 u32 StartReadOffset);
240 240
241 241
242 242
@@ -255,8 +255,8 @@ RingBufferGetDebugInfo(
255 RING_BUFFER_DEBUG_INFO *DebugInfo 255 RING_BUFFER_DEBUG_INFO *DebugInfo
256 ) 256 )
257{ 257{
258 UINT32 bytesAvailToWrite; 258 u32 bytesAvailToWrite;
259 UINT32 bytesAvailToRead; 259 u32 bytesAvailToRead;
260 260
261 if (RingInfo->RingBuffer) 261 if (RingInfo->RingBuffer)
262 { 262 {
@@ -281,7 +281,7 @@ Description:
281 Get the interrupt mask for the specified ring buffer 281 Get the interrupt mask for the specified ring buffer
282 282
283--*/ 283--*/
284UINT32 284u32
285GetRingBufferInterruptMask( 285GetRingBufferInterruptMask(
286 RING_BUFFER_INFO *rbi 286 RING_BUFFER_INFO *rbi
287 ) 287 )
@@ -302,7 +302,7 @@ int
302RingBufferInit( 302RingBufferInit(
303 RING_BUFFER_INFO *RingInfo, 303 RING_BUFFER_INFO *RingInfo,
304 void *Buffer, 304 void *Buffer,
305 UINT32 BufferLen 305 u32 BufferLen
306 ) 306 )
307{ 307{
308 ASSERT(sizeof(RING_BUFFER) == PAGE_SIZE); 308 ASSERT(sizeof(RING_BUFFER) == PAGE_SIZE);
@@ -350,15 +350,15 @@ int
350RingBufferWrite( 350RingBufferWrite(
351 RING_BUFFER_INFO* OutRingInfo, 351 RING_BUFFER_INFO* OutRingInfo,
352 SG_BUFFER_LIST SgBuffers[], 352 SG_BUFFER_LIST SgBuffers[],
353 UINT32 SgBufferCount 353 u32 SgBufferCount
354 ) 354 )
355{ 355{
356 int i=0; 356 int i=0;
357 UINT32 byteAvailToWrite; 357 u32 byteAvailToWrite;
358 UINT32 byteAvailToRead; 358 u32 byteAvailToRead;
359 UINT32 totalBytesToWrite=0; 359 u32 totalBytesToWrite=0;
360 360
361 volatile UINT32 nextWriteLocation; 361 volatile u32 nextWriteLocation;
362 UINT64 prevIndices=0; 362 UINT64 prevIndices=0;
363 363
364 DPRINT_ENTER(VMBUS); 364 DPRINT_ENTER(VMBUS);
@@ -439,12 +439,12 @@ int
439RingBufferPeek( 439RingBufferPeek(
440 RING_BUFFER_INFO* InRingInfo, 440 RING_BUFFER_INFO* InRingInfo,
441 void* Buffer, 441 void* Buffer,
442 UINT32 BufferLen 442 u32 BufferLen
443 ) 443 )
444{ 444{
445 UINT32 bytesAvailToWrite; 445 u32 bytesAvailToWrite;
446 UINT32 bytesAvailToRead; 446 u32 bytesAvailToRead;
447 UINT32 nextReadLocation=0; 447 u32 nextReadLocation=0;
448 448
449 SpinlockAcquire(InRingInfo->RingLock); 449 SpinlockAcquire(InRingInfo->RingLock);
450 450
@@ -487,13 +487,13 @@ int
487RingBufferRead( 487RingBufferRead(
488 RING_BUFFER_INFO* InRingInfo, 488 RING_BUFFER_INFO* InRingInfo,
489 void * Buffer, 489 void * Buffer,
490 UINT32 BufferLen, 490 u32 BufferLen,
491 UINT32 Offset 491 u32 Offset
492 ) 492 )
493{ 493{
494 UINT32 bytesAvailToWrite; 494 u32 bytesAvailToWrite;
495 UINT32 bytesAvailToRead; 495 u32 bytesAvailToRead;
496 UINT32 nextReadLocation=0; 496 u32 nextReadLocation=0;
497 UINT64 prevIndices=0; 497 UINT64 prevIndices=0;
498 498
499 ASSERT(BufferLen > 0); 499 ASSERT(BufferLen > 0);
@@ -553,16 +553,16 @@ Description:
553 Assume there is enough room. Handles wrap-around in dest case only!! 553 Assume there is enough room. Handles wrap-around in dest case only!!
554 554
555--*/ 555--*/
556UINT32 556u32
557CopyToRingBuffer( 557CopyToRingBuffer(
558 RING_BUFFER_INFO *RingInfo, 558 RING_BUFFER_INFO *RingInfo,
559 UINT32 StartWriteOffset, 559 u32 StartWriteOffset,
560 void * Src, 560 void * Src,
561 UINT32 SrcLen) 561 u32 SrcLen)
562{ 562{
563 void * ringBuffer=GetRingBuffer(RingInfo); 563 void * ringBuffer=GetRingBuffer(RingInfo);
564 UINT32 ringBufferSize=GetRingBufferSize(RingInfo); 564 u32 ringBufferSize=GetRingBufferSize(RingInfo);
565 UINT32 fragLen; 565 u32 fragLen;
566 566
567 if (SrcLen > ringBufferSize - StartWriteOffset) // wrap-around detected! 567 if (SrcLen > ringBufferSize - StartWriteOffset) // wrap-around detected!
568 { 568 {
@@ -594,17 +594,17 @@ Description:
594 Assume there is enough room. Handles wrap-around in src case only!! 594 Assume there is enough room. Handles wrap-around in src case only!!
595 595
596--*/ 596--*/
597UINT32 597u32
598CopyFromRingBuffer( 598CopyFromRingBuffer(
599 RING_BUFFER_INFO *RingInfo, 599 RING_BUFFER_INFO *RingInfo,
600 void * Dest, 600 void * Dest,
601 UINT32 DestLen, 601 u32 DestLen,
602 UINT32 StartReadOffset) 602 u32 StartReadOffset)
603{ 603{
604 void * ringBuffer=GetRingBuffer(RingInfo); 604 void * ringBuffer=GetRingBuffer(RingInfo);
605 UINT32 ringBufferSize=GetRingBufferSize(RingInfo); 605 u32 ringBufferSize=GetRingBufferSize(RingInfo);
606 606
607 UINT32 fragLen; 607 u32 fragLen;
608 608
609 if (DestLen > ringBufferSize - StartReadOffset) // wrap-around detected at the src 609 if (DestLen > ringBufferSize - StartReadOffset) // wrap-around detected at the src
610 { 610 {