summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2023-01-28 21:20:01 +0200
committerTal Hayon <talhayon1@gmail.com>2023-01-28 21:20:01 +0200
commit7c49fbffb66fbfb0955abb0bf269c675697ddba5 (patch)
tree81b2fa1441bfbbe893d2ee32a9005c8168d69dcb /libs
parent0436820724c90a0ced750ec87dbcd7aa7b184bb3 (diff)
Match __OSDispatchInterrupt and AIRegisterDMACallback
Diffstat (limited to 'libs')
-rw-r--r--libs/dolphin/ai/ai.c17
-rw-r--r--libs/dolphin/os/OSInterrupt.c12
2 files changed, 9 insertions, 20 deletions
diff --git a/libs/dolphin/ai/ai.c b/libs/dolphin/ai/ai.c
index c5f864b734..f497ba29be 100644
--- a/libs/dolphin/ai/ai.c
+++ b/libs/dolphin/ai/ai.c
@@ -21,15 +21,16 @@ static AISCallback __AIS_Callback;
static AIDCallback __AID_Callback;
/* 8034FC70-8034FCB4 34A5B0 0044+00 0/0 1/1 0/0 .text AIRegisterDMACallback */
-// need compiler epilogue patch
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm AIDCallback AIRegisterDMACallback(AIDCallback callback) {
- nofralloc
-#include "asm/dolphin/ai/ai/AIRegisterDMACallback.s"
+AIDCallback AIRegisterDMACallback(AIDCallback callback) {
+ s32 oldInts;
+ AIDCallback ret;
+
+ ret = __AID_Callback;
+ oldInts = OSDisableInterrupts();
+ __AID_Callback = callback;
+ OSRestoreInterrupts(oldInts);
+ return ret;
}
-#pragma pop
/* 8034FCB4-8034FD3C 34A5F4 0088+00 0/0 2/2 0/0 .text AIInitDMA */
void AIInitDMA(u32 addr, u32 length) {
diff --git a/libs/dolphin/os/OSInterrupt.c b/libs/dolphin/os/OSInterrupt.c
index e86ded77fa..086dbb8ee4 100644
--- a/libs/dolphin/os/OSInterrupt.c
+++ b/libs/dolphin/os/OSInterrupt.c
@@ -315,8 +315,6 @@ extern u32 __OSLastInterruptSrr0;
u32 __OSLastInterruptSrr0;
/* 8033DBCC-8033DF10 33850C 0344+00 1/1 0/0 0/0 .text __OSDispatchInterrupt */
-// need compiler epilogue patch
-#ifdef NONMATCHING
void __OSDispatchInterrupt(__OSException exception, OSContext* context) {
u32 intsr;
u32 reg;
@@ -435,16 +433,6 @@ void __OSDispatchInterrupt(__OSException exception, OSContext* context) {
OSLoadContext(context);
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void __OSDispatchInterrupt(__OSException exception, OSContext* context) {
- nofralloc
-#include "asm/dolphin/os/OSInterrupt/__OSDispatchInterrupt.s"
-}
-#pragma pop
-#endif
/* 8033DF10-8033DF60 338850 0050+00 1/1 0/0 0/0 .text ExternalInterruptHandler */
static asm void ExternalInterruptHandler(register OSInterrupt type, register OSContext* context) {