2 * sgen-archdep.h: Architecture dependent parts of SGen.
4 * Copyright 2001-2003 Ximian, Inc
5 * Copyright 2003-2010 Novell, Inc.
6 * Copyright (C) 2012 Xamarin Inc
8 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
10 #ifndef __MONO_SGENARCHDEP_H__
11 #define __MONO_SGENARCHDEP_H__
13 #include <mono/utils/mono-context.h>
15 #if defined(MONO_CROSS_COMPILE)
17 #define REDZONE_SIZE 0
19 #elif defined(TARGET_X86)
21 #define REDZONE_SIZE 0
23 #ifndef MONO_ARCH_HAS_MONO_CONTEXT
27 #elif defined(TARGET_AMD64)
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
34 #define REDZONE_SIZE 128
37 #elif defined(TARGET_POWERPC)
39 #define REDZONE_SIZE 224
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
48 #elif defined(TARGET_ARM)
50 #define REDZONE_SIZE 0
52 #elif defined(TARGET_ARM64)
55 #define REDZONE_SIZE 0
56 #elif defined(__APPLE__)
57 #define REDZONE_SIZE 128
59 #error "Not implemented."
62 #elif defined(__mips__)
64 #define REDZONE_SIZE 0
66 #elif defined(__s390x__)
68 #define REDZONE_SIZE 0
70 #elif defined(__sparc__)
72 #define REDZONE_SIZE 0
76 #endif /* __MONO_SGENARCHDEP_H__ */