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 the register r12, and the condition codes, and uses r5 and r6
12 // as temporaries by backing them up and restoring them afterwards.
13 // Does not modify any memory or the stack pointer.
15 // movw r4, #256 // Number of bytes of stack, in units of 4 byte
19 #define PAGE_SIZE 4096
22 DEFINE_COMPILERRT_FUNCTION(__chkstk)
28 sub r12, r12, #PAGE_SIZE
29 subs r5, r5, #PAGE_SIZE
35 END_COMPILERRT_FUNCTION(__chkstk)