diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-05-12 18:05:21 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-05-12 18:05:21 +0200 |
| commit | 513a6e99dd1f9cf5531d55f544478bec72efb910 (patch) | |
| tree | 47d7789347ba596dca54704df24e85b6763f26a2 /libpsn00b/include/setjmp.h | |
| parent | 4230715311892502452f326f3618e5ef4dc81972 (diff) | |
| download | psn00bsdk-513a6e99dd1f9cf5531d55f544478bec72efb910.tar.gz | |
Downgrade GCC to 12.3, add setjmp(), fix CdGetRegion()
Diffstat (limited to 'libpsn00b/include/setjmp.h')
| -rw-r--r-- | libpsn00b/include/setjmp.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libpsn00b/include/setjmp.h b/libpsn00b/include/setjmp.h new file mode 100644 index 0000000..0f05b67 --- /dev/null +++ b/libpsn00b/include/setjmp.h @@ -0,0 +1,31 @@ +/* + * PSn00bSDK standard library + * (C) 2023 spicyjpeg - MPL licensed + * + * This setjmp() implementation is compatible with the one in the BIOS, making + * it possible to pass a jmp_buf structure as-is to BIOS functions such as + * HookEntryInt(). + */ + +#pragma once + +#include <stdint.h> + +typedef struct _JumpBuffer { + uint32_t ra, sp, fp; + uint32_t s0, s1, s2, s3, s4, s5, s6, s7; + uint32_t gp; +} JumpBuffer; + +typedef JumpBuffer *jmp_buf; + +#ifdef __cplusplus +extern "C" { +#endif + +int setjmp(jmp_buf buf); +void longjmp(jmp_buf buf, int value); + +#ifdef __cplusplus +} +#endif |
