Match osCreateMesgQueue

This commit is contained in:
Alejandro Javier Asenjo Nitti 2024-02-07 16:06:55 -03:00
parent 650dc4778a
commit 52a8a12bea
2 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -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;
}