c: osPiStartDma

This commit is contained in:
Mittenshugg
2020-07-31 21:09:50 -05:00
parent c88d28a0b7
commit 62ffeeb878
4 changed files with 49 additions and 10 deletions
+2
View File
@@ -179,6 +179,8 @@ $(BUILD_DIR)/lib/src/osSetTimer.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osTimer.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osViBlack.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osViSwapBuffer.o : OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osPiStartDma.o : OPT_FLAGS := -O1
######################## Targets #############################
+11 -2
View File
@@ -60,11 +60,20 @@ typedef struct {
/*0x08*/ void *dramAddr;
/*0x0C*/ uintptr_t devAddr;
/*0x10*/ size_t size;
#if defined(VERSION_EU) || defined(VERSION_SH)
OSPiHandle *piHandle; // from the official definition
#endif
} OSIoMesg;
typedef struct {
s32 active; /* Status flag */
OSThread *thread; /* Calling thread */
OSMesgQueue *cmdQueue; /* Command queue */
OSMesgQueue *evtQueue; /* Event queue */
OSMesgQueue *acsQueue; /* Access queue */
/* Raw DMA routine */
s32 (*dma)(s32, u32, void *, u32);
s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
} OSDevMgr;
/* Definitions */
#define OS_READ 0 // device -> RDRAM
+36
View File
@@ -0,0 +1,36 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800C8F80 */
#include "types.h"
#include "macros.h"
#include "libultra_internal.h"
//GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9B80/osPiStartDma.s")
extern OSDevMgr D_800E3740; //__osPiDevMgr;
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *dramAddr, u32 size, OSMesgQueue *mq)
{
register s32 ret;
if (!D_800E3740.active)
return -1;
if (direction == OS_READ)
mb->hdr.type = 11;
else
mb->hdr.type = 12;
mb->hdr.pri = priority;
mb->hdr.retQueue = mq;
mb->dramAddr = dramAddr;
mb->devAddr = devAddr;
mb->size = size;
mb->piHandle = NULL;
if (priority == OS_MESG_PRI_HIGH)
{
ret = osJamMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
}
else
{
ret = osSendMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
}
return ret;
}
-8
View File
@@ -1,8 +0,0 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x800C8F80 */
#include "types.h"
#include "macros.h"
#include "libultra_internal.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9B80/osPiStartDma.s")