25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_tail.c,v 1.6 2005/10/22 17:24:21 debug Exp $ |
* $Id: generate_tail.c,v 1.12 2006/07/16 13:32:26 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
35 |
char *uppercase(char *l) |
char *uppercase(char *l) |
36 |
{ |
{ |
37 |
static char staticbuf[1000]; |
static char staticbuf[1000]; |
38 |
int i = 0; |
size_t i = 0; |
39 |
|
|
40 |
while (*l && i < sizeof(staticbuf)) { |
while (*l && i < sizeof(staticbuf)) { |
41 |
char u = *l++; |
char u = *l++; |
75 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
76 |
printf("#undef DYNTRANS_FUNCTION_TRACE\n\n"); |
printf("#undef DYNTRANS_FUNCTION_TRACE\n\n"); |
77 |
|
|
78 |
|
printf("#define DYNTRANS_INIT_TABLES " |
79 |
|
"%s_cpu_init_tables\n", a); |
80 |
|
printf("#include \"cpu_dyntrans.c\"\n"); |
81 |
|
printf("#undef DYNTRANS_INIT_TABLES\n\n"); |
82 |
|
|
83 |
printf("#define DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE " |
printf("#define DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE " |
84 |
"%s_tc_allocate_default_page\n", a); |
"%s_tc_allocate_default_page\n", a); |
85 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
128 |
printf("#define MODE_uint_t uint32_t\n"); |
printf("#define MODE_uint_t uint32_t\n"); |
129 |
printf("#define MODE_int_t int32_t\n"); |
printf("#define MODE_int_t int32_t\n"); |
130 |
printf("#endif\n"); |
printf("#endif\n"); |
131 |
|
printf("#define COMBINE(n) %s_combine_ ## n\n", a); |
132 |
|
printf("#include \"quick_pc_to_pointers.h\"\n"); |
133 |
printf("#include \"cpu_%s_instr.c\"\n\n", a); |
printf("#include \"cpu_%s_instr.c\"\n\n", a); |
134 |
|
|
135 |
|
printf("#define DYNTRANS_RUN_INSTR %s_run_instr\n", a); |
136 |
|
printf("#include \"cpu_dyntrans.c\"\n"); |
137 |
|
printf("#undef DYNTRANS_RUN_INSTR\n\n"); |
138 |
|
|
139 |
|
|
140 |
printf("#ifdef DYNTRANS_DUALMODE_32\n"); |
printf("#ifdef DYNTRANS_DUALMODE_32\n"); |
141 |
printf("#undef COMBINE_INSTRUCTIONS\n"); |
printf("#undef COMBINE_INSTRUCTIONS\n"); |
180 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
181 |
printf("#undef DYNTRANS_PC_TO_POINTERS_FUNC\n\n"); |
printf("#undef DYNTRANS_PC_TO_POINTERS_FUNC\n\n"); |
182 |
printf("#undef DYNTRANS_PC_TO_POINTERS_GENERIC\n\n"); |
printf("#undef DYNTRANS_PC_TO_POINTERS_GENERIC\n\n"); |
183 |
|
printf("#undef COMBINE\n"); |
184 |
|
printf("#define COMBINE(n) %s32_combine_ ## n\n", a); |
185 |
|
printf("#include \"quick_pc_to_pointers.h\"\n"); |
186 |
printf("#include \"cpu_%s_instr.c\"\n", a); |
printf("#include \"cpu_%s_instr.c\"\n", a); |
187 |
|
|
188 |
printf("\n#undef DYNTRANS_PC_TO_POINTERS\n" |
printf("\n#undef DYNTRANS_PC_TO_POINTERS\n" |
189 |
"#define DYNTRANS_PC_TO_POINTERS %s_pc_to_pointers\n" |
"#define DYNTRANS_PC_TO_POINTERS %s_pc_to_pointers\n" |
190 |
"#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); |
191 |
|
|
192 |
printf("#endif /* DYNTRANS_DUALMODE_32 */\n\n\n"); |
printf("#define DYNTRANS_RUN_INSTR %s32_run_instr\n", a); |
|
|
|
|
|
|
|
printf("#define DYNTRANS_CPU_RUN_INSTR %s_cpu_run_instr\n", a); |
|
193 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
194 |
printf("#undef DYNTRANS_CPU_RUN_INSTR\n\n"); |
printf("#undef DYNTRANS_RUN_INSTR\n\n"); |
195 |
|
|
196 |
|
printf("#endif /* DYNTRANS_DUALMODE_32 */\n\n\n"); |
197 |
|
|
|
printf("#define CPU_RUN %s_cpu_run\n", a); |
|
|
printf("#define CPU_RINSTR %s_cpu_run_instr\n", a); |
|
|
printf("#define CPU_RUN_%s\n", uppercase(a)); |
|
|
printf("#include \"cpu_run.c\"\n"); |
|
|
printf("#undef CPU_RINSTR\n"); |
|
|
printf("#undef CPU_RUN_%s\n", uppercase(a)); |
|
|
printf("#undef CPU_RUN\n\n"); |
|
198 |
|
|
199 |
printf("CPU_FAMILY_INIT(%s,\"%s\")\n\n", a, b); |
printf("CPU_FAMILY_INIT(%s,\"%s\")\n\n", a, b); |
200 |
|
|