|
Revision 2010, 510 bytes
(checked in by mwhitworth, 3 years ago)
|
|
Use new completion data structure, used in async bus scan and URB (USB) code.
|
| Line | |
|---|
| 1 | #ifndef COMPLETION_H |
|---|
| 2 | #define COMPLETION_H |
|---|
| 3 | |
|---|
| 4 | #include <wait.h> |
|---|
| 5 | |
|---|
| 6 | struct Completion |
|---|
| 7 | { |
|---|
| 8 | unsigned int done; |
|---|
| 9 | WaitQueue waitQueue; |
|---|
| 10 | }; |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | static inline void CompletionInit(struct Completion* comp) |
|---|
| 15 | { |
|---|
| 16 | comp->done = 0; |
|---|
| 17 | INIT_WAITQUEUE_HEAD(&comp->waitQueue); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | int CompletionWaitEx(struct Completion* comp, int timeout); |
|---|
| 21 | |
|---|
| 22 | static inline int CompletionWait(struct Completion* comp) |
|---|
| 23 | { |
|---|
| 24 | return CompletionWaitEx(comp, ~0); |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | void CompletionDone(struct Completion* comp); |
|---|
| 28 | |
|---|
| 29 | #endif |
|---|