Merge pull request #2971 from BrzVlad/feature-cross-binprot
[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 #define REDZONE_SIZE    128
30
31 #elif defined(TARGET_POWERPC)
32
33 #define REDZONE_SIZE    224
34
35 /* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some
36    architectures is 64k.  */
37 #if defined(TARGET_POWERPC) || defined(TARGET_POWERPC64)
38 #define ARCH_MIN_MS_BLOCK_SIZE  (64*1024)
39 #define ARCH_MIN_MS_BLOCK_SIZE_SHIFT    16
40 #endif
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 #endif
69
70 #endif /* __MONO_SGENARCHDEP_H__ */