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