3 * Architecture dependent parts of SGen.
5 * Copyright 2001-2003 Ximian, Inc
6 * Copyright 2003-2010 Novell, Inc.
7 * Copyright (C) 2012 Xamarin Inc
9 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
11 #ifndef __MONO_SGENARCHDEP_H__
12 #define __MONO_SGENARCHDEP_H__
14 #include <mono/utils/mono-context.h>
16 #if defined(MONO_CROSS_COMPILE)
18 #define REDZONE_SIZE 0
20 #elif defined(TARGET_X86)
22 #define REDZONE_SIZE 0
24 #ifndef MONO_ARCH_HAS_MONO_CONTEXT
28 #elif defined(TARGET_AMD64)
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
35 #define REDZONE_SIZE 128
38 #elif defined(TARGET_POWERPC)
40 #define REDZONE_SIZE 224
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
49 #elif defined(TARGET_ARM)
51 #define REDZONE_SIZE 0
53 #elif defined(TARGET_ARM64)
56 #define REDZONE_SIZE 0
57 #elif defined(__APPLE__)
58 #define REDZONE_SIZE 128
60 #error "Not implemented."
63 #elif defined(__mips__)
65 #define REDZONE_SIZE 0
67 #elif defined(__s390x__)
69 #define REDZONE_SIZE 0
71 #elif defined(__sparc__)
73 #define REDZONE_SIZE 0
77 #endif /* __MONO_SGENARCHDEP_H__ */