mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2025-04-19 17:37:09 +02:00
@update > CMakeLists.txt | remove casiowin-* target (unused) | remove x86-generic target (unused) | update files location | remove old vhex sources files (deprecated, unused) > src/posix | remove this folder > src/libc | move its content to src/ | remove thread module > src/stdlib/reallocarray | check if the multiplication overflow failed | set appropriate errno value if multiplication failed
45 lines
829 B
ArmAsm
45 lines
829 B
ArmAsm
.text
|
|
.global _longjmp
|
|
.type _longjmp, @function
|
|
|
|
|
|
.align 2
|
|
/*
|
|
** void longjmp(jmp_buf env, int val)
|
|
** Store the calling environment in ENV, not saving the signal mask.
|
|
** Return 0.
|
|
*/
|
|
_longjmp:
|
|
! save the context into unbankable register
|
|
mov r4, r8
|
|
|
|
! check the returned value validity
|
|
tst r5, r5
|
|
movt r9
|
|
add r5, r9
|
|
|
|
context_switch:
|
|
! load the old SR register first to force register bank switch
|
|
! (if needed) then move the context and the returned value into
|
|
! non-saved (by the setjmp context) registers.
|
|
ldc.l @r8+, sr
|
|
mov r8, r4
|
|
mov r9, r0
|
|
|
|
! restore all old registers
|
|
mov.l @r4+, r8
|
|
mov.l @r4+, r9
|
|
mov.l @r4+, r10
|
|
mov.l @r4+, r11
|
|
mov.l @r4+, r12
|
|
mov.l @r4+, r13
|
|
mov.l @r4+, r14
|
|
mov.l @r4+, r15
|
|
ldc.l @r4+, gbr
|
|
lds.l @r4+, macl
|
|
lds.l @r4+, mach
|
|
lds.l @r4+, pr
|
|
|
|
! return to the old place
|
|
rts
|
|
nop
|