diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-14 18:09:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 15:01:46 -0400 |
commit | 4d64311468a90d4ab1e83c62d63b27da598b73ea (patch) | |
tree | 958df2af78911f7f6d66040f7fbcd965a1cbd4b6 /drivers/staging/hv/RingBuffer.c | |
parent | 5cd508bc3ac032343e6853cd5712ac392942fb2c (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.c | 96 |
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 | --*/ |
46 | static inline void | 46 | static inline void |
47 | GetRingBufferAvailBytes(RING_BUFFER_INFO *rbi, UINT32 *read, UINT32 *write) | 47 | GetRingBufferAvailBytes(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 | --*/ |
68 | static inline UINT32 | 68 | static inline u32 |
69 | GetNextWriteLocation(RING_BUFFER_INFO* RingInfo) | 69 | GetNextWriteLocation(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 | --*/ |
87 | static inline void | 87 | static inline void |
88 | SetNextWriteLocation(RING_BUFFER_INFO* RingInfo, UINT32 NextWriteLocation) | 88 | SetNextWriteLocation(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 | --*/ |
102 | static inline UINT32 | 102 | static inline u32 |
103 | GetNextReadLocation(RING_BUFFER_INFO* RingInfo) | 103 | GetNextReadLocation(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 | --*/ |
122 | static inline UINT32 | 122 | static inline u32 |
123 | GetNextReadLocationWithOffset(RING_BUFFER_INFO* RingInfo, UINT32 Offset) | 123 | GetNextReadLocationWithOffset(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 | --*/ |
143 | static inline void | 143 | static inline void |
144 | SetNextReadLocation(RING_BUFFER_INFO* RingInfo, UINT32 NextReadLocation) | 144 | SetNextReadLocation(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 | --*/ |
175 | static inline UINT32 | 175 | static inline u32 |
176 | GetRingBufferSize(RING_BUFFER_INFO* RingInfo) | 176 | GetRingBufferSize(RING_BUFFER_INFO* RingInfo) |
177 | { | 177 | { |
178 | return RingInfo->RingDataSize; | 178 | return RingInfo->RingDataSize; |
@@ -206,8 +206,8 @@ Description: | |||
206 | void | 206 | void |
207 | DumpRingInfo(RING_BUFFER_INFO* RingInfo, char *Prefix) | 207 | DumpRingInfo(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 | // |
227 | static UINT32 | 227 | static u32 |
228 | CopyToRingBuffer( | 228 | CopyToRingBuffer( |
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 | ||
234 | static UINT32 | 234 | static u32 |
235 | CopyFromRingBuffer( | 235 | CopyFromRingBuffer( |
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 | --*/ |
284 | UINT32 | 284 | u32 |
285 | GetRingBufferInterruptMask( | 285 | GetRingBufferInterruptMask( |
286 | RING_BUFFER_INFO *rbi | 286 | RING_BUFFER_INFO *rbi |
287 | ) | 287 | ) |
@@ -302,7 +302,7 @@ int | |||
302 | RingBufferInit( | 302 | RingBufferInit( |
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 | |||
350 | RingBufferWrite( | 350 | RingBufferWrite( |
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 | |||
439 | RingBufferPeek( | 439 | RingBufferPeek( |
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 | |||
487 | RingBufferRead( | 487 | RingBufferRead( |
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 | --*/ |
556 | UINT32 | 556 | u32 |
557 | CopyToRingBuffer( | 557 | CopyToRingBuffer( |
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 | --*/ |
597 | UINT32 | 597 | u32 |
598 | CopyFromRingBuffer( | 598 | CopyFromRingBuffer( |
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 | { |