blob: 17554a34869a6fa4251dab1e95c3a7bab53d37d1 [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//---------------------------------------------------------------------------
Logan Chienb0ceca22011-06-12 13:34:49 +08007#define USE_OLD_JIT 1
8#define USE_MCJIT 0
9
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
21
22#define USE_DISASSEMBLER_FILE 0
23
Shih-wei Liaobb5adc72011-03-17 22:22:57 -070024#define USE_LIBBCC_SHA1SUM 1
Logan35849002011-01-15 07:30:43 +080025
Logan4dcd6792011-02-28 05:12:00 +080026#define USE_LOGGER 1
27
28#define USE_FUNC_LOGGER 0
29
Logan35849002011-01-15 07:30:43 +080030//---------------------------------------------------------------------------
Logan1dc63142011-02-25 17:14:51 +080031// Configuration for ContextManager
32//---------------------------------------------------------------------------
33
34// Note: Most of the code should NOT use these constants. Use the public
35// static member of ContextManager instead, which is type-safe. For example,
36// if you need BCC_CONTEXT_FIXED_ADDR_, then you should write:
37// ContextManager::ContextFixedAddr
38
39#define BCC_CONTEXT_FIXED_ADDR_ reinterpret_cast<char *>(0x7e000000)
40
41#define BCC_CONTEXT_SLOT_COUNT_ 8
42
43#define BCC_CONTEXT_CODE_SIZE_ (128 * 1024)
44
45#define BCC_CONTEXT_DATA_SIZE_ (128 * 1024)
46
47//---------------------------------------------------------------------------
48// Configuration for CodeGen and CompilerRT
49//---------------------------------------------------------------------------
Logan35849002011-01-15 07:30:43 +080050
51#if defined(__arm__)
52 #define DEFAULT_ARM_CODEGEN
53 #define PROVIDE_ARM_CODEGEN
54#elif defined(__i386__)
55 #define DEFAULT_X86_CODEGEN
56 #define PROVIDE_X86_CODEGEN
57#elif defined(__x86_64__)
58 #define DEFAULT_X64_CODEGEN
59 #define PROVIDE_X64_CODEGEN
60#endif
61
62#if defined(FORCE_ARM_CODEGEN)
63 #define DEFAULT_ARM_CODEGEN
64 #undef DEFAULT_X86_CODEGEN
65 #undef DEFAULT_X64_CODEGEN
66 #define PROVIDE_ARM_CODEGEN
67 #undef PROVIDE_X86_CODEGEN
68 #undef PROVIDE_X64_CODEGEN
69#elif defined(FORCE_X86_CODEGEN)
70 #undef DEFAULT_ARM_CODEGEN
71 #define DEFAULT_X86_CODEGEN
72 #undef DEFAULT_X64_CODEGEN
73 #undef PROVIDE_ARM_CODEGEN
74 #define PROVIDE_X86_CODEGEN
75 #undef PROVIDE_X64_CODEGEN
76#elif defined(FORCE_X64_CODEGEN)
77 #undef DEFAULT_ARM_CODEGEN
78 #undef DEFAULT_X86_CODEGEN
79 #define DEFAULT_X64_CODEGEN
80 #undef PROVIDE_ARM_CODEGEN
81 #undef PROVIDE_X86_CODEGEN
82 #define PROVIDE_X64_CODEGEN
83#endif
84
85#if defined(DEFAULT_ARM_CODEGEN)
86 #define TARGET_TRIPLE_STRING "armv7-none-linux-gnueabi"
87#elif defined(DEFAULT_X86_CODEGEN)
88 #define TARGET_TRIPLE_STRING "i686-unknown-linux"
89#elif defined(DEFAULT_X64_CODEGEN)
90 #define TARGET_TRIPLE_STRING "x86_64-unknown-linux"
91#endif
92
93#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
94 #define ARM_USE_VFP
95#endif
96
97//---------------------------------------------------------------------------
98
99#endif // BCC_CONFIG_H