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)
29 #define REDZONE_SIZE 128
31 #elif defined(TARGET_POWERPC)
33 #define REDZONE_SIZE 224
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
42 #elif defined(TARGET_ARM)
44 #define REDZONE_SIZE 0
46 #elif defined(TARGET_ARM64)
49 #define REDZONE_SIZE 0
50 #elif defined(__APPLE__)
51 #define REDZONE_SIZE 128
53 #error "Not implemented."
56 #elif defined(__mips__)
58 #define REDZONE_SIZE 0
60 #elif defined(__s390x__)
62 #define REDZONE_SIZE 0
64 #elif defined(__sparc__)
66 #define REDZONE_SIZE 0
70 #endif /* __MONO_SGENARCHDEP_H__ */