diff --git a/Makefile b/Makefile index e296fe85..f7076323 100644 --- a/Makefile +++ b/Makefile @@ -273,6 +273,7 @@ build/src/libultra/libc/xlitob.o: OPTFLAGS := -O2 -g0 build/src/libultra/libc/ll.o: OPTFLAGS := -O1 -g0 build/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32 +build/src/libultra/os/createmesgqueue.o: OPTFLAGS := -O1 -g0 build/src/libultra/os/getactivequeue.o: OPTFLAGS := -O1 -g0 build/src/libultra/os/stopthread.o: OPTFLAGS := -O1 -g0 diff --git a/src/libultra/os/createmesgqueue.c b/src/libultra/os/createmesgqueue.c index 0c11e0c2..bc931e5a 100644 --- a/src/libultra/os/createmesgqueue.c +++ b/src/libultra/os/createmesgqueue.c @@ -1,3 +1,18 @@ -#include "common.h" +#include "PR/os_internal.h" +#include "PR/ultraerror.h" +#include "osint.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/os/createmesgqueue/osCreateMesgQueue.s") +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; +}