mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-29 18:54:34 +00:00
Implement __chkstk for arm64
Lifted from a previously built SDL3.dll
This commit is contained in:
committed by
Anonymous Maarten
parent
578ac0ef52
commit
4fbf59ac3a
@@ -728,14 +728,6 @@ void __declspec(naked) _alloca_probe_16(void)
|
||||
|
||||
#endif // _M_IX86
|
||||
|
||||
#ifdef _M_ARM64
|
||||
|
||||
void __chkstk(void);
|
||||
void __chkstk() {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // MSC_VER
|
||||
|
||||
#ifdef __ICL
|
||||
|
||||
26
src/stdlib/SDL_mslibc_arm64.masm
Normal file
26
src/stdlib/SDL_mslibc_arm64.masm
Normal file
@@ -0,0 +1,26 @@
|
||||
TeStackLimit EQU 0x00010
|
||||
PAGE_SIZE equ 0x1000
|
||||
|
||||
AREA CODE, READONLY
|
||||
|
||||
EXPORT __chkstk
|
||||
|
||||
__chkstk PROC
|
||||
ldr x17,[x18, #TeStackLimit]
|
||||
subs x16,sp,x15, LSL #0x4
|
||||
csel x16,xzr,x16,cc
|
||||
cmp x16,x17
|
||||
b.cc chkstk_start_loop
|
||||
ret
|
||||
chkstk_start_loop
|
||||
and x16,x16,#-PAGE_SIZE
|
||||
chkstk_loop
|
||||
sub x17,x17,#0x1, LSL #12
|
||||
ldr xzr,[x17]
|
||||
cmp x17,x16
|
||||
b.ne chkstk_loop
|
||||
ret
|
||||
|
||||
ENDP
|
||||
|
||||
END
|
||||
Reference in New Issue
Block a user