blob: 6de9bf4744a40324f0106d1c0fc5cd7096590037 [file] [log] [blame]
Logan35849002011-01-15 07:30:43 +08001#ifndef BCC_CONFIG_H
2#define BCC_CONFIG_H
3
4//---------------------------------------------------------------------------
Shih-wei Liao898c5a92011-05-18 07:02:39 -07005// Configuration for JIT & MC Assembler
6//---------------------------------------------------------------------------
Joseph Wen739527e2011-07-07 10:04:54 -07007#define USE_OLD_JIT 0
8#define USE_MCJIT 1
Logan Chienb0ceca22011-06-12 13:34:49 +08009
10#if !USE_OLD_JIT && !USE_MCJIT
11#error "You should choose at least one code generation method."
12#endif
Shih-wei Liao898c5a92011-05-18 07:02:39 -070013
14//---------------------------------------------------------------------------
Logan1dc63142011-02-25 17:14:51 +080015// Configuration for libbcc
16//---------------------------------------------------------------------------
Logan35849002011-01-15 07:30:43 +080017
18#define USE_CACHE 1
19
20#define USE_DISASSEMBLER 1
Shih-wei Liao9f73de02011-07-01 04:40:24 -070021#define DEBUG_OLD_JIT_DISASSEMBLE 0
22#define DEBUG_MCJIT_DISASSEMBLE 0
Logan35849002011-01-15 07:30:43 +080023
24#define USE_DISASSEMBLER_FILE 0
25
Logan4dcd6792011-02-28 05:12:00 +080026#define USE_LOGGER 1
27
28#define USE_FUNC_LOGGER 0
29
Shih-wei Liao9f73de02011-07-01 04:40:24 -070030#define DEBUG_BCC_REFLECT 0
31
Joseph Wen739527e2011-07-07 10:04:54 -070032#define DEBUG_MCJIT_REFLECT 0
33
Logan35849002011-01-15 07:30:43 +080034//---------------------------------------------------------------------------
Logan1dc63142011-02-25 17:14:51 +080035// Configuration for ContextManager
36//---------------------------------------------------------------------------
37
38// Note: Most of the code should NOT use these constants. Use the public
39// static member of ContextManager instead, which is type-safe. For example,
40// if you need BCC_CONTEXT_FIXED_ADDR_, then you should write:
41// ContextManager::ContextFixedAddr
42
43#define BCC_CONTEXT_FIXED_ADDR_ reinterpret_cast<char *>(0x7e000000)
44
45#define BCC_CONTEXT_SLOT_COUNT_ 8
46
47#define BCC_CONTEXT_CODE_SIZE_ (128 * 1024)
48
49#define BCC_CONTEXT_DATA_SIZE_ (128 * 1024)
50
51//---------------------------------------------------------------------------
52// Configuration for CodeGen and CompilerRT
53//---------------------------------------------------------------------------
Logan35849002011-01-15 07:30:43 +080054
55#if defined(__arm__)
56 #define DEFAULT_ARM_CODEGEN
57 #define PROVIDE_ARM_CODEGEN
58#elif defined(__i386__)
59 #define DEFAULT_X86_CODEGEN
60 #define PROVIDE_X86_CODEGEN
61#elif defined(__x86_64__)
62 #define DEFAULT_X64_CODEGEN
63 #define PROVIDE_X64_CODEGEN
64#endif
65
66#if defined(FORCE_ARM_CODEGEN)
67 #define DEFAULT_ARM_CODEGEN
68 #undef DEFAULT_X86_CODEGEN
69 #undef DEFAULT_X64_CODEGEN
70 #define PROVIDE_ARM_CODEGEN
71 #undef PROVIDE_X86_CODEGEN
72 #undef PROVIDE_X64_CODEGEN
73#elif defined(FORCE_X86_CODEGEN)
74 #undef DEFAULT_ARM_CODEGEN
75 #define DEFAULT_X86_CODEGEN
76 #undef DEFAULT_X64_CODEGEN
77 #undef PROVIDE_ARM_CODEGEN
78 #define PROVIDE_X86_CODEGEN
79 #undef PROVIDE_X64_CODEGEN
80#elif defined(FORCE_X64_CODEGEN)
81 #undef DEFAULT_ARM_CODEGEN
82 #undef DEFAULT_X86_CODEGEN
83 #define DEFAULT_X64_CODEGEN
84 #undef PROVIDE_ARM_CODEGEN
85 #undef PROVIDE_X86_CODEGEN
86 #define PROVIDE_X64_CODEGEN
87#endif
88
89#if defined(DEFAULT_ARM_CODEGEN)
90 #define TARGET_TRIPLE_STRING "armv7-none-linux-gnueabi"
91#elif defined(DEFAULT_X86_CODEGEN)
92 #define TARGET_TRIPLE_STRING "i686-unknown-linux"
93#elif defined(DEFAULT_X64_CODEGEN)
94 #define TARGET_TRIPLE_STRING "x86_64-unknown-linux"
95#endif
96
97#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
98 #define ARM_USE_VFP
99#endif
100
101//---------------------------------------------------------------------------
102
103#endif // BCC_CONFIG_H