00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __unistd_h__
00027 #define __unistd_h__
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 #include <tm.h>
00034 #include <time.h>
00035
00037
00038
00039
00041
00042 #ifdef CONF_TM
00043
00052 extern tid_t execi(int (*code_start) (int, char **), int argc, char **argv,
00053 priority_t priority, size_t stack_size);
00054
00058 extern void shutdown_task(tid_t tid);
00059
00064 extern void shutdown_tasks(tflags_t flags);
00065
00070 extern void kill(tid_t tid);
00071
00076 extern void killall(priority_t p);
00077
00081 extern void exit(int code) __attribute__((noreturn));
00082
00083
00085
00086 extern void yield(void);
00087
00094 extern wakeup_t wait_event(wakeup_t(*wakeup) (wakeup_t), wakeup_t data);
00095
00096
00098
00102 extern unsigned int sleep(unsigned int sec);
00103
00109 extern unsigned int msleep(unsigned int msec);
00110
00111 #else
00112 extern inline wakeup_t wait_event(wakeup_t(*wakeup) (wakeup_t), wakeup_t data)
00113 {
00114 wakeup_t res;
00115
00116 while (!(res = wakeup(data)))
00117 ;
00118 return res;
00119 }
00120
00121
00122 #define sleep(s) delay(1000*(s))
00123 #define msleep(s) delay(s)
00124 #endif
00125
00126 #ifdef __cplusplus
00127 }
00128 #endif
00129
00130 #endif // __unistd_h__