[JIT/GC] Optimize mono_gc_wbarrier_value_copy_bitmap.
[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 /* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some
43    architectures is 64k.  */
44 #if defined(TARGET_POWERPC) || defined(TARGET_POWERPC64)
45 #define ARCH_MIN_MS_BLOCK_SIZE  (64*1024)
46 #define ARCH_MIN_MS_BLOCK_SIZE_SHIFT    16
47 #endif
48
49 #elif defined(TARGET_ARM)
50
51 #define REDZONE_SIZE    0
52
53 #elif defined(TARGET_ARM64)
54
55 #ifdef __linux__
56 #define REDZONE_SIZE    0
57 #elif defined(__APPLE__)
58 #define REDZONE_SIZE    128
59 #else
60 #error "Not implemented."
61 #endif
62
63 #elif defined(__mips__)
64
65 #define REDZONE_SIZE    0
66
67 #elif defined(__s390x__)
68
69 #define REDZONE_SIZE    0
70
71 #elif defined(__sparc__)
72
73 #define REDZONE_SIZE    0
74
75 #endif
76
77 #endif /* __MONO_SGENARCHDEP_H__ */