Attempt to decompile osEPiRawStartDma

This commit is contained in:
Ryan Dwyer 2021-03-17 08:00:52 +10:00
parent 2da23852f6
commit ced612bc20
3 changed files with 56 additions and 0 deletions

View File

@ -97,6 +97,12 @@ typedef char *va_list;
#define EEP16K_MAXBLOCKS 256
#define EEPROM_BLOCK_SIZE 8
/*
* PI/EPI
*/
#define PI_DOMAIN1 0
#define PI_DOMAIN2 1
/* Miscellaneous OS functions */
void osInitialize(void);

View File

@ -88,6 +88,10 @@ typedef struct {
while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \
stat = IO_READ(PI_STATUS_REG);
#define UPDATE_REG(reg, var) \
if (cHandle->var != pihandle->var) \
IO_WRITE(reg, pihandle->var);
/* Functions */
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction,

View File

@ -140,3 +140,49 @@ glabel osEPiRawStartDma
/* 49df8: 03e00008 */ jr $ra
/* 49dfc: 00000000 */ nop
);
// Mismatch: branch/branch-likely
//s32 osEPiRawStartDma(OSPiHandle *pihandle, s32 direction, u32 devAddr, void *dramAddr, u32 size)
//{
// u32 stat;
//
// WAIT_ON_IOBUSY(stat)
//
// if (pihandle->type != __osCurrentHandle[pihandle->domain]->type) {
// OSPiHandle *cHandle = __osCurrentHandle[pihandle->domain];
//
// if (pihandle->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);
// }
//
// cHandle->type = pihandle->type;
// cHandle->latency = pihandle->latency;
// cHandle->pageSize = pihandle->pageSize;
// cHandle->relDuration = pihandle->relDuration;
// cHandle->pulse = pihandle->pulse;
// }
//
// IO_WRITE(PI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr));
// IO_WRITE(PI_CART_ADDR_REG, K1_TO_PHYS(pihandle->baseAddress | devAddr));
//
// switch (direction) {
// case OS_READ:
// IO_WRITE(PI_WR_LEN_REG, size - 1);
// break;
// case OS_WRITE:
// IO_WRITE(PI_RD_LEN_REG, size - 1);
// break;
// default:
// return -1;
// }
//
// return 0;
//}