1 #ifndef __LWP_SEMA_INL__
2 #define __LWP_SEMA_INL__
4 static __inline__ u32 __lwp_sema_ispriority(lwp_semattr *attr)
6 return (attr->mode==LWP_SEMA_MODEPRIORITY);
9 static __inline__ void __lwp_sema_seize_isrdisable(lwp_sema *sema,u32 id,u32 wait,u32 *isrlevel)
12 u32 level = *isrlevel;
14 exec = _thr_executing;
15 exec->wait.ret_code = LWP_SEMA_SUCCESSFUL;
18 _CPU_ISR_Restore(level);
23 _CPU_ISR_Restore(level);
24 exec->wait.ret_code = LWP_SEMA_UNSATISFIED_NOWAIT;
28 __lwp_thread_dispatchdisable();
29 __lwp_threadqueue_csenter(&sema->wait_queue);
30 exec->wait.queue = &sema->wait_queue;
32 _CPU_ISR_Restore(level);
34 __lwp_threadqueue_enqueue(&sema->wait_queue,0);
35 __lwp_thread_dispatchenable();