Path: blob/master/libs/compiler-rt/lib/builtins/aarch64/chkstk.S
12349 views
// This file is dual licensed under the MIT and the University of Illinois Open1// Source Licenses. See LICENSE.TXT for details.23#include "../assembly.h"45// __chkstk routine6// This routine is windows specific.7// http://msdn.microsoft.com/en-us/library/ms648426.aspx89// This clobbers registers x16 and x17.10// Does not modify any memory or the stack pointer.1112// mov x15, #256 // Number of bytes of stack, in units of 16 byte13// bl __chkstk14// sub sp, sp, x15, lsl #41516#if defined(__aarch64__) || defined(__arm64ec__)1718#ifdef __arm64ec__19#define CHKSTK_FUNC __chkstk_arm64ec20#else21#define CHKSTK_FUNC __chkstk22#endif2324#define PAGE_SIZE 40962526.p2align 227DEFINE_COMPILERRT_FUNCTION(CHKSTK_FUNC)28lsl x16, x15, #429mov x17, sp301:31sub x17, x17, #PAGE_SIZE32subs x16, x16, #PAGE_SIZE33ldr xzr, [x17]34b.gt 1b3536ret37END_COMPILERRT_FUNCTION(CHKSTK_FUNC)3839#endif // defined(__aarch64__) || defined(__arm64ec__)404142