summaryrefslogtreecommitdiff
path: root/src/libultra_code_O2/osSpTaskYielded.c
blob: 4fec2a6d5170324cdafc0bc9fa14f572224cb34d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "global.h"

u32 osSpTaskYielded(OSTask* task) {
    u32 ret;
    u32 status = __osSpGetStatus();

    if (status & SP_STATUS_YIELDED) {
        ret = OS_TASK_YIELDED;
    } else {
        ret = 0;
    }

    if (status & SP_STATUS_YIELD) {
        task->t.flags |= ret;
        task->t.flags &= ~OS_TASK_DP_WAIT;
    }

    return ret;
}