diff options
Diffstat (limited to 'libpsn00b/libc')
| -rw-r--r-- | libpsn00b/libc/_start.s | 5 | ||||
| -rw-r--r-- | libpsn00b/libc/abort.c | 21 | ||||
| -rw-r--r-- | libpsn00b/libc/memset.s | 3 |
3 files changed, 18 insertions, 11 deletions
diff --git a/libpsn00b/libc/_start.s b/libpsn00b/libc/_start.s index 56075c8..fcd4c4c 100644 --- a/libpsn00b/libc/_start.s +++ b/libpsn00b/libc/_start.s @@ -2,17 +2,16 @@ # (C) 2022 spicyjpeg - MPL licensed # # This file provides a weak function that can be easily overridden to e.g. set -# $sp or perform additional initialization before the "real" _start() +# $sp or perform additional initialization before the "real" _start() function # (_start_inner()) is called. .set noreorder -.section .text +.section .text._start .global _start .type _start, @function .weak _start _start: la $gp, _gp - j _start_inner nop diff --git a/libpsn00b/libc/abort.c b/libpsn00b/libc/abort.c index 2db5016..0a3c325 100644 --- a/libpsn00b/libc/abort.c +++ b/libpsn00b/libc/abort.c @@ -1,19 +1,26 @@ +/* + * PSn00bSDK assert macro and internal logging + * (C) 2022 spicyjpeg - MPL licensed + */ -#include <psxetc.h> +#undef SDK_LIBRARY_NAME -/* Standard abort */ +#include <assert.h> +#include <psxapi.h> -void abort(void) { - _sdk_log("abort()\n"); +/* Internal function used by assert() macro */ + +void _assert_abort(const char *file, int line, const char *expr) { + _sdk_log("%s:%d: assert(%s)\n", file, line, expr); for (;;) __asm__ volatile(""); } -/* Internal function used by assert() macro */ +/* Standard abort */ -void _assert_abort(const char *file, int line, const char *expr) { - _sdk_log("%s:%d: assert(%s)\n", file, line, expr); +void abort(void) { + _sdk_log("abort()\n"); for (;;) __asm__ volatile(""); diff --git a/libpsn00b/libc/memset.s b/libpsn00b/libc/memset.s index 5a1589d..6ef84ec 100644 --- a/libpsn00b/libc/memset.s +++ b/libpsn00b/libc/memset.s @@ -38,8 +38,9 @@ memset: sb $a1, 0xc($a0) sb $a1, 0xd($a0) sb $a1, 0xe($a0) - jr $ra sb $a1, 0xf($a0) + jr $ra + nop .Llarge_fill: # Initialize fast filling by repeating the fill byte 4 times, so it can be |
