c: osPiGetCmdQueue

This commit is contained in:
Mittenshugg
2020-08-04 16:17:46 -05:00
parent 90dc1f3056
commit bfe4858ca2
11 changed files with 59 additions and 118 deletions
-3
View File
@@ -2,13 +2,10 @@
/* RAM_POS: 0x800D4590 */
#include "types.h"
//#include "macros.h"
#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
#define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr))
//GLOBAL_ASM("lib/asm/non_matchings/unknown_0D5190/__osSiRawReadIo.s")
s32 __osSiRawReadIo(u32 devAddr, u32 *data)
{
if (__osSiDeviceBusy())
+35
View File
@@ -0,0 +1,35 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D36A0 */
#include "libultra_internal.h"
extern OSThread* __osRunningThread;
s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag)
{
register u32 saveMask = __osDisableInt();
while (mq->validCount >= mq->msgCount)
{
if (flag == OS_MESG_BLOCK)
{
__osRunningThread->state = OS_STATE_WAITING;
__osEnqueueAndYield(&mq->fullqueue);
}
else
{
__osRestoreInt(saveMask);
return -1;
}
}
mq->first = (mq->first + mq->msgCount - 1) % mq->msgCount;
mq->msg[mq->first] = msg;
mq->validCount++;
if (mq->mtqueue->next != NULL)
{
osStartThread(__osPopThread(&mq->mtqueue));
}
__osRestoreInt(saveMask);
return 0;
}
+13
View File
@@ -0,0 +1,13 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D37F0 */
#include "libultra_internal.h"
extern OSDevMgr __osPiDevMgr;
OSMesgQueue *osPiGetCmdQueue(void)
{
if (!__osPiDevMgr.active)
return NULL;
return __osPiDevMgr.cmdQueue;
}
-5
View File
@@ -5,8 +5,3 @@
#include "macros.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3670.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osJamMesg.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osPiGetCmdQueue.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3820.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Putfld.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Printf.s")
+9
View File
@@ -0,0 +1,9 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800D3820 */
#include "types.h"
#include "macros.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/func_800D3820.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/_Putfld.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/_Printf.s")