1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 #include "../assembly.h"
8 // This routine is windows specific.
9 // http://msdn.microsoft.com/en-us/library/ms648426.aspx
11 // This clobbers registers x16 and x17.
12 // Does not modify any memory or the stack pointer.
14 // mov x15, #256 // Number of bytes of stack, in units of 16 byte
16 // sub sp, sp, x15, lsl #4
20 #define PAGE_SIZE 4096
23 DEFINE_COMPILERRT_FUNCTION(__chkstk)
27 sub x17, x17, #PAGE_SIZE
28 subs x16, x16, #PAGE_SIZE
33 END_COMPILERRT_FUNCTION(__chkstk)