1#ifndef LIBULTRA_IO_PIINT_H
2#define LIBULTRA_IO_PIINT_H
22extern u32 __osPiAccessQueueEnabled;
38extern OSMesg piAccessBuf[1];
78extern u64 piThreadStack[0x1000 /
sizeof(
u64)];
94extern OSMesg piEventBuf[1];
127void __osPiCreateAccessQueue(
void);
135void __osPiGetAccess(
void);
143void __osPiRelAccess(
void);
151void __osDevMgrMain(
void *arg);
157#define WAIT_ON_IOBUSY(stat) \
158 stat = IO_READ(PI_STATUS_REG); \
159 while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \
160 stat = IO_READ(PI_STATUS_REG)
163#define LEO_BASE_REG 0x05000000
164#define LEO_C2_BUFF (LEO_BASE_REG + 0x000)
165#define LEO_SECTOR_BUFF (LEO_BASE_REG + 0x400)
166#define LEO_STATUS (LEO_BASE_REG + 0x508)
167#define LEO_BM_CTL (LEO_BASE_REG + 0x510)
168#define LEO_BM_STATUS (LEO_BASE_REG + 0x510)
171#define LEO_STATUS_DATA_REQUEST 0x40000000
172#define LEO_STATUS_C2_TRANSFER 0x10000000
173#define LEO_STATUS_BUFFER_MANAGER_ERROR 0x08000000
174#define LEO_STATUS_MECHANIC_INTERRUPT 0x02000000
177#define LEO_BM_CTL_START 0x80000000
178#define LEO_BM_CTL_RESET 0x10000000
179#define LEO_BM_CTL_CLR_MECHANIC_INTR 0x01000000
182#define LEO_BM_STATUS_MICRO 0x02000000
183#define LEO_BM_STATUS_C1DOUBLE 0x00400000
184#define LEO_BM_STATUS_C1SINGLE 0x00200000
187#define LEO_CMD_TYPE_0 0
188#define LEO_CMD_TYPE_1 1
189#define LEO_CMD_TYPE_2 2
190#define LEO_TRACK_MODE 2
191#define LEO_SECTOR_MODE 3
194#define LEO_ERROR_GOOD 0
196#define LEO_ERROR_22 22
197#define LEO_ERROR_23 23
198#define LEO_ERROR_24 24
199#define LEO_ERROR_29 29
207s32 __osLeoInterrupt(
void);
struct OSPiHandle_s OSPiHandle
A device on the peripheral interface, with the timing of its PI domain.
struct OSThread_s OSThread
A thread: its place in the queues, its state, and the registers saved when it last stopped.
struct OSMesgQueue_s OSMesgQueue
A message queue: a ring of messages and the threads blocked sending or receiving.
void * OSMesg
Definition os.h:73
A device manager: the thread and queues that serve the I/O requests of one interface.
Definition os.h:219
Umbrella header of the reconstructed libultra.
unsigned int u32
Definition ultratypes.h:20
int s32
Definition ultratypes.h:25
unsigned long long u64
Definition ultratypes.h:21