epiwrite.c OK (#411)

* epiwrite.c OK

* uintptr_t

* Reintroduce bad code rather than start rearranging headers
This commit is contained in:
EllipticEllipsis 2021-11-11 21:25:53 +00:00 committed by GitHub
parent 987566eebe
commit 40ec8a9fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -1,12 +1,10 @@
#include "global.h"
s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) {
s32 __osEPiRawWriteIo(OSPiHandle* handle, uintptr_t devAddr, u32 data) {
s32 status;
OSPiHandle* curHandle;
while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY)) {
;
}
while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY)) {}
if (__osCurrentHandle[handle->domain]->type != handle->type) {
curHandle = __osCurrentHandle[handle->domain];

View File

@ -1,3 +1,11 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/epiwrite/osEPiWriteIo.s")
s32 osEPiWriteIo(OSPiHandle* handle, uintptr_t devAddr, u32 data) {
register s32 ret;
__osPiGetAccess();
ret = __osEPiRawWriteIo(handle, devAddr, data);
__osPiRelAccess();
return ret;
}