1 #ifndef BCC_CONFIG_H 2 #define BCC_CONFIG_H 3 4 #include "ConfigFromMk.h" 5 6 //--------------------------------------------------------------------------- 7 // Configuration for JIT & MC Assembler 8 //--------------------------------------------------------------------------- 9 #if !USE_OLD_JIT && !USE_MCJIT 10 #error "You should choose at least one code generation method." 11 #endif 12 13 //--------------------------------------------------------------------------- 14 // Configuration for Disassembler 15 //--------------------------------------------------------------------------- 16 17 #if !USE_OLD_JIT 18 #undef DEBUG_OLD_JIT_DISASSEMBLER 19 #define DEBUG_OLD_JIT_DISASSEMBLER 0 20 #endif 21 22 #if !USE_MCJIT 23 #undef DEBUG_MCJIT_DISASSEMBLER 24 #define DEBUG_MCJIT_DISASSEMBLER 0 25 #endif 26 27 #if DEBUG_OLD_JIT_DISASSEMBLER || DEBUG_MCJIT_DISASSEMBLER 28 #define USE_DISASSEMBLER 1 29 #else 30 #define USE_DISASSEMBLER 0 31 #endif 32 33 #define DEBUG_OLD_JIT_DISASSEMBLER_FILE "/data/local/tmp/oldjit-dis.s" 34 #define DEBUG_MCJIT_DISASSEMBLER_FILE "/data/local/tmp/mcjit-dis.s" 35 36 //--------------------------------------------------------------------------- 37 // Configuration for ContextManager 38 //--------------------------------------------------------------------------- 39 40 // Note: Most of the code should NOT use these constants. Use the public 41 // static member of ContextManager instead, which is type-safe. For example, 42 // if you need BCC_CONTEXT_FIXED_ADDR_, then you should write: 43 // ContextManager::ContextFixedAddr 44 45 #define BCC_CONTEXT_FIXED_ADDR_ reinterpret_cast<char *>(0x7e000000) 46 47 #define BCC_CONTEXT_SLOT_COUNT_ 8 48 49 #define BCC_CONTEXT_CODE_SIZE_ (128 * 1024) 50 51 #define BCC_CONTEXT_DATA_SIZE_ (128 * 1024) 52 53 //--------------------------------------------------------------------------- 54 // Configuration for CodeGen and CompilerRT 55 //--------------------------------------------------------------------------- 56 57 #if defined(__arm__) 58 #define DEFAULT_ARM_CODEGEN 59 #define PROVIDE_ARM_CODEGEN 60 #elif defined(__i386__) 61 #define DEFAULT_X86_CODEGEN 62 #define PROVIDE_X86_CODEGEN 63 #elif defined(__x86_64__) 64 #define DEFAULT_X64_CODEGEN 65 #define PROVIDE_X64_CODEGEN 66 #endif 67 68 #if defined(FORCE_ARM_CODEGEN) 69 #define DEFAULT_ARM_CODEGEN 70 #undef DEFAULT_X86_CODEGEN 71 #undef DEFAULT_X64_CODEGEN 72 #define PROVIDE_ARM_CODEGEN 73 #undef PROVIDE_X86_CODEGEN 74 #undef PROVIDE_X64_CODEGEN 75 #elif defined(FORCE_X86_CODEGEN) 76 #undef DEFAULT_ARM_CODEGEN 77 #define DEFAULT_X86_CODEGEN 78 #undef DEFAULT_X64_CODEGEN 79 #undef PROVIDE_ARM_CODEGEN 80 #define PROVIDE_X86_CODEGEN 81 #undef PROVIDE_X64_CODEGEN 82 #elif defined(FORCE_X64_CODEGEN) 83 #undef DEFAULT_ARM_CODEGEN 84 #undef DEFAULT_X86_CODEGEN 85 #define DEFAULT_X64_CODEGEN 86 #undef PROVIDE_ARM_CODEGEN 87 #undef PROVIDE_X86_CODEGEN 88 #define PROVIDE_X64_CODEGEN 89 #endif 90 91 #if defined(DEFAULT_ARM_CODEGEN) 92 #define TARGET_TRIPLE_STRING "armv7-none-linux-gnueabi" 93 #elif defined(DEFAULT_X86_CODEGEN) 94 #define TARGET_TRIPLE_STRING "i686-unknown-linux" 95 #elif defined(DEFAULT_X64_CODEGEN) 96 #define TARGET_TRIPLE_STRING "x86_64-unknown-linux" 97 #endif 98 99 #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) 100 #define ARM_USE_VFP 101 #endif 102 103 //--------------------------------------------------------------------------- 104 105 #endif // BCC_CONFIG_H 106