25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_tail.c,v 1.15 2007/02/02 17:44:04 debug Exp $ |
* $Id: generate_tail.c,v 1.21 2007/06/28 13:36:47 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
67 |
printf("\n/*\n * AUTOMATICALLY GENERATED! Do not edit.\n */\n\n"); |
printf("\n/*\n * AUTOMATICALLY GENERATED! Do not edit.\n */\n\n"); |
68 |
|
|
69 |
printf("extern size_t dyntrans_cache_size;\n"); |
printf("extern size_t dyntrans_cache_size;\n"); |
|
printf("extern int native_code_translation_enabled;\n"); |
|
|
printf("#include \"native.h\"\n"); |
|
70 |
|
|
71 |
printf("#ifdef DYNTRANS_32\n"); |
printf("#ifdef DYNTRANS_32\n"); |
72 |
printf("#define MODE32\n"); |
printf("#define MODE32\n"); |
73 |
printf("#endif\n"); |
printf("#endif\n"); |
74 |
|
|
75 |
printf("#define DYNTRANS_FUNCTION_TRACE " |
printf("#define DYNTRANS_FUNCTION_TRACE_DEF " |
76 |
"%s_cpu_functioncall_trace\n", a); |
"%s_cpu_functioncall_trace\n", a); |
77 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
78 |
printf("#undef DYNTRANS_FUNCTION_TRACE\n\n"); |
printf("#undef DYNTRANS_FUNCTION_TRACE_DEF\n\n"); |
79 |
|
|
80 |
printf("#define DYNTRANS_INIT_TABLES " |
printf("#define DYNTRANS_INIT_TABLES " |
81 |
"%s_cpu_init_tables\n", a); |
"%s_cpu_init_tables\n", a); |
82 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
83 |
printf("#undef DYNTRANS_INIT_TABLES\n\n"); |
printf("#undef DYNTRANS_INIT_TABLES\n\n"); |
84 |
|
|
85 |
printf("#define DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE " |
printf("#define DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE_DEF " |
86 |
"%s_tc_allocate_default_page\n", a); |
"%s_tc_allocate_default_page\n", a); |
87 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
88 |
printf("#undef DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE\n\n"); |
printf("#undef DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE_DEF\n\n"); |
89 |
|
|
90 |
printf("#define DYNTRANS_INVAL_ENTRY\n"); |
printf("#define DYNTRANS_INVAL_ENTRY\n"); |
91 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
108 |
|
|
109 |
printf("#define MEMORY_RW %s_memory_rw\n", a); |
printf("#define MEMORY_RW %s_memory_rw\n", a); |
110 |
printf("#define MEM_%s\n", uppercase(a)); |
printf("#define MEM_%s\n", uppercase(a)); |
111 |
printf("#include \"../memory_rw.c\"\n"); |
printf("#include \"memory_rw.c\"\n"); |
112 |
printf("#undef MEM_%s\n", uppercase(a)); |
printf("#undef MEM_%s\n", uppercase(a)); |
113 |
printf("#undef MEMORY_RW\n\n"); |
printf("#undef MEMORY_RW\n\n"); |
114 |
|
|
134 |
printf("#include \"quick_pc_to_pointers.h\"\n"); |
printf("#include \"quick_pc_to_pointers.h\"\n"); |
135 |
printf("#include \"cpu_%s_instr.c\"\n\n", a); |
printf("#include \"cpu_%s_instr.c\"\n\n", a); |
136 |
|
|
137 |
printf("#define DYNTRANS_RUN_INSTR %s_run_instr\n", a); |
printf("#define DYNTRANS_RUN_INSTR_DEF %s_run_instr\n", a); |
138 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
139 |
printf("#undef DYNTRANS_RUN_INSTR\n\n"); |
printf("#undef DYNTRANS_RUN_INSTR_DEF\n\n"); |
140 |
|
|
141 |
|
|
142 |
printf("#ifdef DYNTRANS_DUALMODE_32\n"); |
printf("#ifdef DYNTRANS_DUALMODE_32\n"); |
191 |
"#define DYNTRANS_PC_TO_POINTERS %s_pc_to_pointers\n" |
"#define DYNTRANS_PC_TO_POINTERS %s_pc_to_pointers\n" |
192 |
"#define DYNTRANS_PC_TO_POINTERS32 %s32_pc_to_pointers\n\n", a, a); |
"#define DYNTRANS_PC_TO_POINTERS32 %s32_pc_to_pointers\n\n", a, a); |
193 |
|
|
194 |
printf("#define DYNTRANS_RUN_INSTR %s32_run_instr\n", a); |
printf("#define DYNTRANS_RUN_INSTR_DEF %s32_run_instr\n", a); |
195 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
196 |
printf("#undef DYNTRANS_RUN_INSTR\n\n"); |
printf("#undef DYNTRANS_RUN_INSTR_DEF\n\n"); |
197 |
|
|
198 |
printf("#endif /* DYNTRANS_DUALMODE_32 */\n\n\n"); |
printf("#endif /* DYNTRANS_DUALMODE_32 */\n\n\n"); |
199 |
|
|