summaryrefslogtreecommitdiff
path: root/src/libultra/os/createmesgqueue.c
blob: bc931e5a2923fad6fcadd711261116b1f6870358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "PR/os_internal.h"
#include "PR/ultraerror.h"
#include "osint.h"

void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 msgCount) {
#ifdef _DEBUG
    if (msgCount <= 0) {
        __osError(ERR_OSCREATEMESGQUEUE, 1, msgCount);
        return;
    }
#endif
    mq->mtqueue = (OSThread*) &__osThreadTail.next;
    mq->fullqueue = (OSThread*) &__osThreadTail.next;
    mq->validCount = 0;
    mq->first = 0;
    mq->msgCount = msgCount;
    mq->msg = msg;
}