Mario Kart 64
Loading...
Searching...
No Matches
piint.h File Reference
#include <PR/os_internal.h>
#include <PR/rcp.h>
#include <PR/os_pi.h>
#include <PR/os.h>
Include dependency graph for piint.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LEO_BASE_REG   0x05000000
 
#define LEO_CMD   (LEO_BASE_REG + 0x508)
 
#define LEO_STATUS   (LEO_BASE_REG + 0x508)
 
#define LEO_BM_CTL   (LEO_BASE_REG + 0x510)
 
#define LEO_BM_STATUS   (LEO_BASE_REG + 0x510)
 
#define LEO_SEQ_CTL   (LEO_BASE_REG + 0x518)
 
#define LEO_SEQ_STATUS   (LEO_BASE_REG + 0x518)
 
#define LEO_C2_BUFF   (LEO_BASE_REG + 0x000)
 
#define LEO_SECTOR_BUFF   (LEO_BASE_REG + 0x400)
 
#define LEO_DATA   (LEO_BASE_REG + 0x500)
 
#define LEO_MISC_REG   (LEO_BASE_REG + 0x504)
 
#define LEO_CUR_TK   (LEO_BASE_REG + 0x50C)
 
#define LEO_ERR_SECTOR   (LEO_BASE_REG + 0x514)
 
#define LEO_CUR_SECTOR   (LEO_BASE_REG + 0x51C)
 
#define LEO_HARD_RESET   (LEO_BASE_REG + 0x520)
 
#define LEO_C1_S0   (LEO_BASE_REG + 0x524)
 
#define LEO_HOST_SECBYTE   (LEO_BASE_REG + 0x528)
 
#define LEO_C1_S2   (LEO_BASE_REG + 0x52C)
 
#define LEO_SEC_BYTE   (LEO_BASE_REG + 0x530)
 
#define LEO_C1_S4   (LEO_BASE_REG + 0x534)
 
#define LEO_C1_S6   (LEO_BASE_REG + 0x538)
 
#define LEO_CUR_ADDR   (LEO_BASE_REG + 0x53C)
 
#define LEO_ID_REG   (LEO_BASE_REG + 0x540)
 
#define LEO_TEST_REG   (LEO_BASE_REG + 0x544)
 
#define LEO_TEST_PIN_SEL   (LEO_BASE_REG + 0x548)
 
#define LEO_RAM_ADDR   (LEO_BASE_REG + 0x580)
 
#define LEO_STATUS_PRESENCE_MASK   0xFFFF
 
#define LEO_STATUS_DATA_REQUEST   0x40000000
 
#define LEO_STATUS_C2_TRANSFER   0x10000000
 
#define LEO_STATUS_BUFFER_MANAGER_ERROR   0x08000000
 
#define LEO_STATUS_BUFFER_MANAGER_INTERRUPT   0x04000000
 
#define LEO_STATUS_MECHANIC_INTERRUPT   0x02000000
 
#define LEO_STATUS_DISK_PRESENT   0x01000000
 
#define LEO_STATUS_BUSY_STATE   0x00800000
 
#define LEO_STATUS_RESET_STATE   0x00400000
 
#define LEO_STATUS_MOTOR_NOT_SPINNING   0x00100000
 
#define LEO_STATUS_HEAD_RETRACTED   0x00080000
 
#define LEO_STATUS_WRITE_PROTECT_ERROR   0x00040000
 
#define LEO_STATUS_MECHANIC_ERROR   0x00020000
 
#define LEO_STATUS_DISK_CHANGE   0x00010000
 
#define LEO_STATUS_MODE_MASK   (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED)
 
#define LEO_STATUS_MODE_SLEEP   (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED)
 
#define LEO_STATUS_MODE_STANDBY   (LEO_STATUS_HEAD_RETRACTED)
 
#define LEO_STATUS_MODE_ACTIVE   0
 
#define LEO_CUR_TK_INDEX_LOCK   0x60000000
 
#define LEO_BM_STATUS_RUNNING   0x80000000
 
#define LEO_BM_STATUS_ERROR   0x04000000
 
#define LEO_BM_STATUS_MICRO   0x02000000
 
#define LEO_BM_STATUS_BLOCK   0x01000000
 
#define LEO_BM_STATUS_C1CORRECTION   0x00800000
 
#define LEO_BM_STATUS_C1DOUBLE   0x00400000
 
#define LEO_BM_STATUS_C1SINGLE   0x00200000
 
#define LEO_BM_STATUS_C1ERROR   0x00010000
 
#define LEO_BM_CTL_START   0x80000000
 
#define LEO_BM_CTL_MODE   0x40000000
 
#define LEO_BM_CTL_IMASK   0x20000000
 
#define LEO_BM_CTL_RESET   0x10000000
 
#define LEO_BM_CTL_DISABLE_OR   0x08000000
 
#define LEO_BM_CTL_DISABLE_C1   0x04000000
 
#define LEO_BM_CTL_BLOCK   0x02000000
 
#define LEO_BM_CTL_CLR_MECHANIC_INTR   0x01000000
 
#define LEO_BM_CTL_CONTROL_MASK   0xFF000000
 
#define LEO_BM_CTL_SECTOR_MASK   0x00FF0000
 
#define LEO_BM_CTL_SECTOR_SHIFT   16
 
#define LEO_CMD_TYPE_0   0
 
#define LEO_CMD_TYPE_1   1
 
#define LEO_CMD_TYPE_2   2
 
#define LEO_ERROR_GOOD   0
 
#define LEO_ERROR_3   3
 
#define LEO_ERROR_4   4
 
#define LEO_ERROR_6   6
 
#define LEO_ERROR_17   17
 
#define LEO_ERROR_22   22
 
#define LEO_ERROR_23   23
 
#define LEO_ERROR_24   24
 
#define LEO_ERROR_29   29
 
#define LEO_ERROR_75   75
 
#define OS_RAMROM_STACKSIZE   1024
 
#define WAIT_ON_LEO_IO_BUSY(stat)
 
#define WAIT_ON_IOBUSY(stat)
 
#define UPDATE_REG(reg, var)
 
#define EPI_SYNC(pihandle, stat, domain)
 

Functions

int __osPiDeviceBusy (void)
 
void __osDevMgrMain (void *)
 
void __osPiCreateAccessQueue (void)
 
void __osPiRelAccess (void)
 
void __osPiGetAccess (void)
 
OSMesgQueue * osPiGetCmdQueue (void)
 

Variables

OSDevMgr __osPiDevMgr
 
OSPiHandle__osCurrentHandle [2]
 
OSPiHandle CartRomHandle
 
OSPiHandle LeoDiskHandle
 
OSMesgQueue __osPiAccessQueue
 
u32 __osPiAccessQueueEnabled
 

Macro Definition Documentation

◆ EPI_SYNC

#define EPI_SYNC ( pihandle,
stat,
domain )
Value:
\
WAIT_ON_IOBUSY(stat) \
\
domain = pihandle->domain; \
if (__osCurrentHandle[domain] != pihandle) { \
OSPiHandle* cHandle = __osCurrentHandle[domain]; \
if (domain == PI_DOMAIN1) { \
UPDATE_REG(PI_BSD_DOM1_LAT_REG, latency); \
UPDATE_REG(PI_BSD_DOM1_PGS_REG, pageSize); \
UPDATE_REG(PI_BSD_DOM1_RLS_REG, relDuration); \
UPDATE_REG(PI_BSD_DOM1_PWD_REG, pulse); \
} else { \
UPDATE_REG(PI_BSD_DOM2_LAT_REG, latency); \
UPDATE_REG(PI_BSD_DOM2_PGS_REG, pageSize); \
UPDATE_REG(PI_BSD_DOM2_RLS_REG, relDuration); \
UPDATE_REG(PI_BSD_DOM2_PWD_REG, pulse); \
} \
__osCurrentHandle[domain] = pihandle; \
}
#define PI_BSD_DOM2_PGS_REG
Definition hardware.h:62
#define PI_BSD_DOM2_PWD_REG
Definition hardware.h:61
#define PI_BSD_DOM1_LAT_REG
Definition hardware.h:54
#define PI_BSD_DOM1_PGS_REG
Definition hardware.h:57
#define PI_BSD_DOM2_LAT_REG
Definition hardware.h:59
#define PI_BSD_DOM2_RLS_REG
Definition hardware.h:63
#define PI_BSD_DOM1_PWD_REG
Definition hardware.h:56
#define PI_BSD_DOM1_RLS_REG
Definition hardware.h:58
#define PI_DOMAIN1
Definition osEPiRawStartDma.c:10
OSPiHandle * __osCurrentHandle[2]
Definition os_pi.h:28

◆ LEO_BASE_REG

#define LEO_BASE_REG   0x05000000

◆ LEO_BM_CTL

#define LEO_BM_CTL   (LEO_BASE_REG + 0x510)

◆ LEO_BM_CTL_BLOCK

#define LEO_BM_CTL_BLOCK   0x02000000

◆ LEO_BM_CTL_CLR_MECHANIC_INTR

#define LEO_BM_CTL_CLR_MECHANIC_INTR   0x01000000

◆ LEO_BM_CTL_CONTROL_MASK

#define LEO_BM_CTL_CONTROL_MASK   0xFF000000

◆ LEO_BM_CTL_DISABLE_C1

#define LEO_BM_CTL_DISABLE_C1   0x04000000

◆ LEO_BM_CTL_DISABLE_OR

#define LEO_BM_CTL_DISABLE_OR   0x08000000

◆ LEO_BM_CTL_IMASK

#define LEO_BM_CTL_IMASK   0x20000000

◆ LEO_BM_CTL_MODE

#define LEO_BM_CTL_MODE   0x40000000

◆ LEO_BM_CTL_RESET

#define LEO_BM_CTL_RESET   0x10000000

◆ LEO_BM_CTL_SECTOR_MASK

#define LEO_BM_CTL_SECTOR_MASK   0x00FF0000

◆ LEO_BM_CTL_SECTOR_SHIFT

#define LEO_BM_CTL_SECTOR_SHIFT   16

◆ LEO_BM_CTL_START

#define LEO_BM_CTL_START   0x80000000

◆ LEO_BM_STATUS

#define LEO_BM_STATUS   (LEO_BASE_REG + 0x510)

◆ LEO_BM_STATUS_BLOCK

#define LEO_BM_STATUS_BLOCK   0x01000000

◆ LEO_BM_STATUS_C1CORRECTION

#define LEO_BM_STATUS_C1CORRECTION   0x00800000

◆ LEO_BM_STATUS_C1DOUBLE

#define LEO_BM_STATUS_C1DOUBLE   0x00400000

◆ LEO_BM_STATUS_C1ERROR

#define LEO_BM_STATUS_C1ERROR   0x00010000

◆ LEO_BM_STATUS_C1SINGLE

#define LEO_BM_STATUS_C1SINGLE   0x00200000

◆ LEO_BM_STATUS_ERROR

#define LEO_BM_STATUS_ERROR   0x04000000

◆ LEO_BM_STATUS_MICRO

#define LEO_BM_STATUS_MICRO   0x02000000

◆ LEO_BM_STATUS_RUNNING

#define LEO_BM_STATUS_RUNNING   0x80000000

◆ LEO_C1_S0

#define LEO_C1_S0   (LEO_BASE_REG + 0x524)

◆ LEO_C1_S2

#define LEO_C1_S2   (LEO_BASE_REG + 0x52C)

◆ LEO_C1_S4

#define LEO_C1_S4   (LEO_BASE_REG + 0x534)

◆ LEO_C1_S6

#define LEO_C1_S6   (LEO_BASE_REG + 0x538)

◆ LEO_C2_BUFF

#define LEO_C2_BUFF   (LEO_BASE_REG + 0x000)

◆ LEO_CMD

#define LEO_CMD   (LEO_BASE_REG + 0x508)

◆ LEO_CMD_TYPE_0

#define LEO_CMD_TYPE_0   0
Todo
name

◆ LEO_CMD_TYPE_1

#define LEO_CMD_TYPE_1   1
Todo
name

◆ LEO_CMD_TYPE_2

#define LEO_CMD_TYPE_2   2
Todo
name

◆ LEO_CUR_ADDR

#define LEO_CUR_ADDR   (LEO_BASE_REG + 0x53C)

◆ LEO_CUR_SECTOR

#define LEO_CUR_SECTOR   (LEO_BASE_REG + 0x51C)

◆ LEO_CUR_TK

#define LEO_CUR_TK   (LEO_BASE_REG + 0x50C)

◆ LEO_CUR_TK_INDEX_LOCK

#define LEO_CUR_TK_INDEX_LOCK   0x60000000

◆ LEO_DATA

#define LEO_DATA   (LEO_BASE_REG + 0x500)

◆ LEO_ERR_SECTOR

#define LEO_ERR_SECTOR   (LEO_BASE_REG + 0x514)

◆ LEO_ERROR_17

#define LEO_ERROR_17   17

◆ LEO_ERROR_22

#define LEO_ERROR_22   22

◆ LEO_ERROR_23

#define LEO_ERROR_23   23

◆ LEO_ERROR_24

#define LEO_ERROR_24   24

◆ LEO_ERROR_29

#define LEO_ERROR_29   29

◆ LEO_ERROR_3

#define LEO_ERROR_3   3

◆ LEO_ERROR_4

#define LEO_ERROR_4   4

◆ LEO_ERROR_6

#define LEO_ERROR_6   6

◆ LEO_ERROR_75

#define LEO_ERROR_75   75

◆ LEO_ERROR_GOOD

#define LEO_ERROR_GOOD   0

◆ LEO_HARD_RESET

#define LEO_HARD_RESET   (LEO_BASE_REG + 0x520)

◆ LEO_HOST_SECBYTE

#define LEO_HOST_SECBYTE   (LEO_BASE_REG + 0x528)

◆ LEO_ID_REG

#define LEO_ID_REG   (LEO_BASE_REG + 0x540)

◆ LEO_MISC_REG

#define LEO_MISC_REG   (LEO_BASE_REG + 0x504)

◆ LEO_RAM_ADDR

#define LEO_RAM_ADDR   (LEO_BASE_REG + 0x580)

◆ LEO_SEC_BYTE

#define LEO_SEC_BYTE   (LEO_BASE_REG + 0x530)

◆ LEO_SECTOR_BUFF

#define LEO_SECTOR_BUFF   (LEO_BASE_REG + 0x400)

◆ LEO_SEQ_CTL

#define LEO_SEQ_CTL   (LEO_BASE_REG + 0x518)

◆ LEO_SEQ_STATUS

#define LEO_SEQ_STATUS   (LEO_BASE_REG + 0x518)

◆ LEO_STATUS

#define LEO_STATUS   (LEO_BASE_REG + 0x508)

◆ LEO_STATUS_BUFFER_MANAGER_ERROR

#define LEO_STATUS_BUFFER_MANAGER_ERROR   0x08000000

◆ LEO_STATUS_BUFFER_MANAGER_INTERRUPT

#define LEO_STATUS_BUFFER_MANAGER_INTERRUPT   0x04000000

◆ LEO_STATUS_BUSY_STATE

#define LEO_STATUS_BUSY_STATE   0x00800000

◆ LEO_STATUS_C2_TRANSFER

#define LEO_STATUS_C2_TRANSFER   0x10000000

◆ LEO_STATUS_DATA_REQUEST

#define LEO_STATUS_DATA_REQUEST   0x40000000

◆ LEO_STATUS_DISK_CHANGE

#define LEO_STATUS_DISK_CHANGE   0x00010000

◆ LEO_STATUS_DISK_PRESENT

#define LEO_STATUS_DISK_PRESENT   0x01000000

◆ LEO_STATUS_HEAD_RETRACTED

#define LEO_STATUS_HEAD_RETRACTED   0x00080000

◆ LEO_STATUS_MECHANIC_ERROR

#define LEO_STATUS_MECHANIC_ERROR   0x00020000

◆ LEO_STATUS_MECHANIC_INTERRUPT

#define LEO_STATUS_MECHANIC_INTERRUPT   0x02000000

◆ LEO_STATUS_MODE_ACTIVE

#define LEO_STATUS_MODE_ACTIVE   0

◆ LEO_STATUS_MODE_MASK

#define LEO_STATUS_MODE_MASK   (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED)

◆ LEO_STATUS_MODE_SLEEP

#define LEO_STATUS_MODE_SLEEP   (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED)

◆ LEO_STATUS_MODE_STANDBY

#define LEO_STATUS_MODE_STANDBY   (LEO_STATUS_HEAD_RETRACTED)

◆ LEO_STATUS_MOTOR_NOT_SPINNING

#define LEO_STATUS_MOTOR_NOT_SPINNING   0x00100000

◆ LEO_STATUS_PRESENCE_MASK

#define LEO_STATUS_PRESENCE_MASK   0xFFFF

◆ LEO_STATUS_RESET_STATE

#define LEO_STATUS_RESET_STATE   0x00400000

◆ LEO_STATUS_WRITE_PROTECT_ERROR

#define LEO_STATUS_WRITE_PROTECT_ERROR   0x00040000

◆ LEO_TEST_PIN_SEL

#define LEO_TEST_PIN_SEL   (LEO_BASE_REG + 0x548)

◆ LEO_TEST_REG

#define LEO_TEST_REG   (LEO_BASE_REG + 0x544)

◆ OS_RAMROM_STACKSIZE

#define OS_RAMROM_STACKSIZE   1024

◆ UPDATE_REG

#define UPDATE_REG ( reg,
var )
Value:
if (cHandle->var != pihandle->var) \
IO_WRITE(reg, pihandle->var);

◆ WAIT_ON_IOBUSY

#define WAIT_ON_IOBUSY ( stat)
Value:
stat = IO_READ(PI_STATUS_REG); \
stat = IO_READ(PI_STATUS_REG);
#define PI_STATUS_REG
Definition hardware.h:53
#define PI_STATUS_DMA_BUSY
Definition rcp.h:727
#define PI_STATUS_IO_BUSY
Definition rcp.h:726

◆ WAIT_ON_LEO_IO_BUSY

#define WAIT_ON_LEO_IO_BUSY ( stat)
Value:
stat = IO_READ(PI_STATUS_REG); \
while (stat & PI_STATUS_IO_BUSY) \
stat = IO_READ(PI_STATUS_REG);

Function Documentation

◆ __osDevMgrMain()

void __osDevMgrMain ( void * args)
Here is the call graph for this function:

◆ __osPiCreateAccessQueue()

void __osPiCreateAccessQueue ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osPiDeviceBusy()

int __osPiDeviceBusy ( void )

◆ __osPiGetAccess()

void __osPiGetAccess ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osPiRelAccess()

void __osPiRelAccess ( void )
Here is the call graph for this function:

◆ osPiGetCmdQueue()

OSMesgQueue * osPiGetCmdQueue ( void )

Variable Documentation

◆ __osCurrentHandle

OSPiHandle* __osCurrentHandle[2]
extern

◆ __osPiAccessQueue

OSMesgQueue __osPiAccessQueue
extern

◆ __osPiAccessQueueEnabled

u32 __osPiAccessQueueEnabled
extern

◆ __osPiDevMgr

OSDevMgr __osPiDevMgr
extern
Todo
In libreultra this is in an include

◆ CartRomHandle

OSPiHandle CartRomHandle
extern

◆ LeoDiskHandle

OSPiHandle LeoDiskHandle
extern