Merge pull request #3337 from akoeplinger/fix-alpine
[mono.git] / mono / sgen / sgen-archdep.h
1 /*
2  * sgen-archdep.h: Architecture dependent parts of SGen.
3  *
4  * Copyright 2001-2003 Ximian, Inc
5  * Copyright 2003-2010 Novell, Inc.
6  * Copyright (C) 2012 Xamarin Inc
7  *
8  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
9  */
10 #ifndef __MONO_SGENARCHDEP_H__
11 #define __MONO_SGENARCHDEP_H__
12
13 #include <mono/utils/mono-context.h>
14
15 #if defined(MONO_CROSS_COMPILE)
16
17 #define REDZONE_SIZE    0
18
19 #elif defined(TARGET_X86)
20
21 #define REDZONE_SIZE    0
22
23 #ifndef MONO_ARCH_HAS_MONO_CONTEXT
24 #error 0
25 #endif
26
27 #elif defined(TARGET_AMD64)
28
29 #ifdef HOST_WIN32
30 /* The Windows x64 ABI defines no "red zone". The ABI states:
31    "All memory beyond the current address of RSP is considered volatile" */
32 #define REDZONE_SIZE    0
33 #else
34 #define REDZONE_SIZE    128
35 #endif
36
37 #elif defined(TARGET_POWERPC)
38
39 #define REDZONE_SIZE    224
40
41 /* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some
42    architectures is 64k.  */
43 #if defined(TARGET_POWERPC) || defined(TARGET_POWERPC64)
44 #define ARCH_MIN_MS_BLOCK_SIZE  (64*1024)
45 #define ARCH_MIN_MS_BLOCK_SIZE_SHIFT    16
46 #endif
47
48 #elif defined(TARGET_ARM)
49
50 #define REDZONE_SIZE    0
51
52 #elif defined(TARGET_ARM64)
53
54 #ifdef __linux__
55 #define REDZONE_SIZE    0
56 #elif defined(__APPLE__)
57 #define REDZONE_SIZE    128
58 #else
59 #error "Not implemented."
60 #endif
61
62 #elif defined(__mips__)
63
64 #define REDZONE_SIZE    0
65
66 #elif defined(__s390x__)
67
68 #define REDZONE_SIZE    0
69
70 #elif defined(__sparc__)
71
72 #define REDZONE_SIZE    0
73
74 #endif
75
76 #endif /* __MONO_SGENARCHDEP_H__ */