Rev | Line | |
---|
[160] | 1 | #ifndef SRL_SCHED_WAIT_H |
---|
| 2 | #define SRL_SCHED_WAIT_H |
---|
| 3 | |
---|
| 4 | #include "srl_public_types.h" |
---|
| 5 | |
---|
| 6 | /** |
---|
| 7 | * @file |
---|
| 8 | * @module{SRL} |
---|
| 9 | * @short Smart waiting tools |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | #define DECLARE_WAIT(name, cmp) \ |
---|
| 13 | /** \ |
---|
| 14 | @this makes the current task sleep until the value pointed at @tt addr \ |
---|
| 15 | asserts the following test: \ |
---|
| 16 | \ |
---|
| 17 | @code \ |
---|
| 18 | (*addr cmp val) \ |
---|
| 19 | @end code \ |
---|
| 20 | \ |
---|
| 21 | @param addr The address to poll \ |
---|
| 22 | @param val The value to compare to \ |
---|
| 23 | */ \ |
---|
| 24 | \ |
---|
| 25 | void srl_sched_wait_##name(void *addr, sint32_t val ); |
---|
| 26 | |
---|
| 27 | DECLARE_WAIT(eq, ==) |
---|
| 28 | DECLARE_WAIT(ne, !=) |
---|
| 29 | DECLARE_WAIT(le, <=) |
---|
| 30 | DECLARE_WAIT(ge, >=) |
---|
| 31 | DECLARE_WAIT(lt, <) |
---|
| 32 | DECLARE_WAIT(gt, >) |
---|
| 33 | |
---|
| 34 | #undef DECLARE_WAIT |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | void srl_sleep_cycles( unsigned int n ); |
---|
| 38 | |
---|
| 39 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.