source: soft/giet_vm/libs/libsrl/srl_sched_wait.h @ 201

Last change on this file since 201 was 160, checked in by karaoui, 12 years ago

giet-vm new version

File size: 1.4 KB
Line 
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                                                                              \
25void srl_sched_wait_##name(void *addr, sint32_t val );
26
27DECLARE_WAIT(eq, ==)
28DECLARE_WAIT(ne, !=)
29DECLARE_WAIT(le, <=)
30DECLARE_WAIT(ge, >=)
31DECLARE_WAIT(lt, <)
32DECLARE_WAIT(gt, >)
33
34#undef DECLARE_WAIT
35
36
37void srl_sleep_cycles( unsigned int n );
38
39#endif
Note: See TracBrowser for help on using the repository browser.