18 #include <timer_alarm.h>
19 #include <delaythread.h>
23 static u64 DelayThreadWakeup_callback(s32 alarm_id, u64 scheduled_time, u64 actual_time,
void *arg,
void *pc_value)
30 iSignalSema((s32)arg);
35 s32 DelayThread(s32 microseconds)
43 if ((eie & 0x10000) == 0)
48 sema.option = (u32)
"DelayThread";
50 sema_id = CreateSema(&sema);
55 timer_alarm_id = SetTimerAlarm(TimerUSec2BusClock(0, microseconds), DelayThreadWakeup_callback, (
void *)sema_id);
56 if (timer_alarm_id < 0)
59 return timer_alarm_id;