void wait_taskwait(task_wait_t *wait_for) { task_t *task = current_task(); task->wait_for = wait_for; __asm volatile ("dmb"); task->state = task_state_WAITFOR; yield_task(); }
void sleepms_task(uint32_t millisec) { task_t *task = current_task(); task->sleepms = millisec; __asm volatile ("dmb"); task->state = task_state_SLEEP; yield_task(); }
int first_task(void) { unsigned int pid; pid = fork(); if(!pid) { name_server_task(); } if(pid != NAME_SERVER_PID) { bwputs("name server PID: "); nputs(pid); bwputs("\n"); return 1; } yield_task(); return 0; }