Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/aarch64/chkstk.S
35291 views
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.1// See https://llvm.org/LICENSE.txt for license information.2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception34#include "../assembly.h"56// __chkstk routine7// This routine is windows specific.8// http://msdn.microsoft.com/en-us/library/ms648426.aspx910// This clobbers registers x16 and x17.11// Does not modify any memory or the stack pointer.1213// mov x15, #256 // Number of bytes of stack, in units of 16 byte14// bl __chkstk15// sub sp, sp, x15, lsl #41617#ifdef __aarch64__1819#define PAGE_SIZE 40962021.p2align 222DEFINE_COMPILERRT_FUNCTION(__chkstk)23lsl x16, x15, #424mov x17, sp251:26sub x17, x17, #PAGE_SIZE27subs x16, x16, #PAGE_SIZE28ldr xzr, [x17]29b.gt 1b3031ret32END_COMPILERRT_FUNCTION(__chkstk)3334#endif // __aarch64__353637