File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,12 @@ set(aarch64_SOURCES
446
446
${GENERIC_TF_SOURCES}
447
447
${GENERIC_SOURCES} )
448
448
449
+ if (MINGW )
450
+ set (aarch64_SOURCES
451
+ ${aarch64_SOURCES}
452
+ aarch64/chkstk.S )
453
+ endif ()
454
+
449
455
set (armhf_SOURCES ${arm_SOURCES} )
450
456
set (armv7_SOURCES ${arm_SOURCES} )
451
457
set (armv7s_SOURCES ${arm_SOURCES} )
Original file line number Diff line number Diff line change
1
+ // This file is dual licensed under the MIT and the University of Illinois Open
2
+ // Source Licenses. See LICENSE.TXT for details.
3
+
4
+ #include "../assembly.h"
5
+
6
+ // __chkstk routine
7
+ // This routine is windows specific.
8
+ // http://msdn.microsoft.com/en - us/library/ms648426.aspx
9
+
10
+ // This clobbers registers x16 and x17.
11
+ // Does not modify any memory or the stack pointer.
12
+
13
+ // mov x15 , # 256 // Number of bytes of stack , in units of 16 byte
14
+ // bl __chkstk
15
+ // sub sp , sp , x15 , lsl # 4
16
+
17
+ #ifdef __aarch64__
18
+
19
+ #define PAGE_SIZE 4096
20
+
21
+ .p2align 2
22
+ DEFINE_COMPILERRT_FUNCTION(__chkstk)
23
+ lsl x16 , x15 , # 4
24
+ mov x17 , sp
25
+ 1 :
26
+ sub x17 , x17 , #PAGE_SIZE
27
+ subs x16 , x16 , #PAGE_SIZE
28
+ ldr xzr , [ x17 ]
29
+ b.gt 1b
30
+
31
+ ret
32
+ END_COMPILERRT_FUNCTION(__chkstk)
33
+
34
+ #endif // __aarch64__
You can’t perform that action at this time.
0 commit comments