mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-28 09:51:28 +00:00
First proper commit.
This commit is contained in:
parent
be78236d36
commit
087f561f77
14086 changed files with 1200489 additions and 1 deletions
30
src/libultra_boot_O1/osRecvMesg.c
Normal file
30
src/libultra_boot_O1/osRecvMesg.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include <global.h>
|
||||
|
||||
s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag)
|
||||
{
|
||||
register s32 s0 = __osDisableInt();
|
||||
|
||||
while (mq->validCount == 0)
|
||||
{
|
||||
if (flag == OS_MESG_NOBLOCK)
|
||||
{
|
||||
__osRestoreInt(s0);
|
||||
return -1;
|
||||
}
|
||||
__osRunningThread->state = 8;
|
||||
__osEnqueueAndYield(mq);
|
||||
}
|
||||
|
||||
if (msg != NULL)
|
||||
*msg = mq->msg[mq->first];
|
||||
|
||||
mq->first = (mq->first + 1) % mq->msgCount;
|
||||
mq->validCount--;
|
||||
|
||||
if (mq->fullqueue->next != NULL)
|
||||
osStartThread(__osPopThread(&mq->fullqueue));
|
||||
|
||||
__osRestoreInt(s0);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue