diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-07-23 23:13:49 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-07-23 23:13:49 +0200 |
| commit | 49ee8172ebb6c77071be113a01fc29c48b991479 (patch) | |
| tree | e3f696b3deb326b7da455bc71d9a0a8d100daa70 /libpsn00b/psxapi/_syscalls.s | |
| parent | 5b63607ba4ca12c2a2935ea9618b3ffe6a6d3ab3 (diff) | |
| download | psn00bsdk-49ee8172ebb6c77071be113a01fc29c48b991479.tar.gz | |
Remove MDEC indev example, add more kernel APIs
Diffstat (limited to 'libpsn00b/psxapi/_syscalls.s')
| -rw-r--r-- | libpsn00b/psxapi/_syscalls.s | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libpsn00b/psxapi/_syscalls.s b/libpsn00b/psxapi/_syscalls.s new file mode 100644 index 0000000..24864f3 --- /dev/null +++ b/libpsn00b/psxapi/_syscalls.s @@ -0,0 +1,50 @@ +# PSn00bSDK syscall wrappers +# (C) 2022 spicyjpeg - MPL licensed + +.set noreorder + +.section .text.EnterCriticalSection +.global EnterCriticalSection +.type EnterCriticalSection, @function +EnterCriticalSection: + li $a0, 0x01 + syscall 0 + + jr $ra + nop + +.section .text.ExitCriticalSection +.global ExitCriticalSection +.type ExitCriticalSection, @function +ExitCriticalSection: + li $a0, 0x02 + syscall 0 + + jr $ra + nop + +.section .text.SwEnterCriticalSection +.global SwEnterCriticalSection +.type SwEnterCriticalSection, @function +SwEnterCriticalSection: + mfc0 $a0, $12 # cop0r12 &= ~0x00000401 + li $a1, -1026 + and $a0, $a1 + mtc0 $a0, $12 + nop + + jr $ra + nop + +.section .text.SwExitCriticalSection +.global SwExitCriticalSection +.type SwExitCriticalSection, @function +SwExitCriticalSection: + mfc0 $a0, $12 # cop0r12 |= 0x00000401 + nop + ori $a0, 0x0401 + mtc0 $a0, $12 + nop + + jr $ra + nop |
