Mario Kart 64
Loading...
Searching...
No Matches
os_pi.h
Go to the documentation of this file.
1#ifndef _ULTRA64_PI_H_
2#define _ULTRA64_PI_H_
3
4/* Ultra64 Parallel Interface */
5
6/* Types */
7
8typedef struct {
9 void* dramAddr;
10 void* C2Addr;
13 u32 C1ErrSector[4];
15
16typedef struct {
21 uintptr_t devAddr; // c
22 u32 errStatus; // error status added moved to blockinfo
25 __OSBlockInfo block[2]; // 18
27
40
41typedef struct {
43 uintptr_t address;
44} OSPiInfo;
45
46typedef struct {
50 OSMesgQueue* retQueue;
52
53typedef struct {
54 /*0x00*/ OSIoMesgHdr hdr;
55 /*0x08*/ void* dramAddr;
56 /*0x0C*/ uintptr_t devAddr;
57 /*0x10*/ size_t size;
58 OSPiHandle* piHandle; // from the official definition
59} OSIoMesg;
60
61/* Definitions */
62
63#define OS_READ 0 // device -> RDRAM
64#define OS_WRITE 1 // device <- RDRAM
65
66#define OS_MESG_PRI_NORMAL 0
67#define OS_MESG_PRI_HIGH 1
68
69/* Functions */
70
71s32 osPiStartDma(OSIoMesg* mb, s32 priority, s32 direction, uintptr_t devAddr, void* vAddr, size_t nbytes,
72 OSMesgQueue* mq);
73void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt);
74OSMesgQueue* osPiGetCmdQueue(void);
75s32 osPiWriteIo(uintptr_t devAddr, u32 data);
76s32 osPiReadIo(uintptr_t devAddr, u32* data);
77
78s32 osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size);
79s32 osEPiRawStartDma(OSPiHandle* piHandle, s32 dir, u32 cart_addr, void* dram_addr, size_t size);
80#endif
s32 osPiWriteIo(uintptr_t devAddr, u32 data)
s32 osPiReadIo(uintptr_t devAddr, u32 *data)
struct OSPiHandle_s OSPiHandle
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt)
Definition osCreatePiManager.c:23
OSMesgQueue * osPiGetCmdQueue(void)
Definition osPiGetCmdQueue.c:5
s32 osEPiRawStartDma(OSPiHandle *piHandle, s32 dir, u32 cart_addr, void *dram_addr, size_t size)
s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size)
Definition osPiRawStartDma.c:7
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq)
Definition osPiStartDma.c:5
s32 OSPri
Definition os_thread.h:21
Definition os_pi.h:46
u8 pri
Definition os_pi.h:48
OSMesgQueue * retQueue
Definition os_pi.h:50
u16 type
Definition os_pi.h:47
u8 status
Definition os_pi.h:49
Definition os_pi.h:53
uintptr_t devAddr
Definition os_pi.h:56
OSIoMesgHdr hdr
Definition os_pi.h:54
OSPiHandle * piHandle
Definition os_pi.h:58
void * dramAddr
Definition os_pi.h:55
size_t size
Definition os_pi.h:57
Definition os_pi.h:28
u8 domain
Definition os_pi.h:35
u8 relDuration
Definition os_pi.h:33
u32 speed
Definition os_pi.h:37
u32 baseAddress
Definition os_pi.h:36
__OSTranxInfo transferInfo
Definition os_pi.h:38
u8 pulse
Definition os_pi.h:34
struct OSPiHandle_s * next
Definition os_pi.h:29
u8 type
Definition os_pi.h:30
u8 latency
Definition os_pi.h:31
u8 pageSize
Definition os_pi.h:32
Definition os_pi.h:41
u8 type
Definition os_pi.h:42
uintptr_t address
Definition os_pi.h:43
Definition os_pi.h:8
u32 sectorSize
Definition os_pi.h:11
void * dramAddr
Definition os_pi.h:9
u32 C1ErrNum
Definition os_pi.h:12
void * C2Addr
Definition os_pi.h:10
Definition os_pi.h:16
u16 transferMode
Definition os_pi.h:18
s32 sectorNum
Definition os_pi.h:20
u32 bmCtlShadow
Definition os_pi.h:23
u32 seqCtlShadow
Definition os_pi.h:24
u16 blockNum
Definition os_pi.h:19
uintptr_t devAddr
Definition os_pi.h:21
u32 cmdType
Definition os_pi.h:17
u32 errStatus
Definition os_pi.h:22
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
unsigned short int u16
Definition ultratypes.h:14
unsigned char u8
Definition ultratypes.h:12