25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_tail.c,v 1.5 2005/09/18 19:54:14 debug Exp $ |
* $Id: generate_tail.c,v 1.11 2006/06/24 21:47:23 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"); |
89 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
90 |
printf("#undef DYNTRANS_INVAL_ENTRY\n\n"); |
printf("#undef DYNTRANS_INVAL_ENTRY\n\n"); |
91 |
|
|
92 |
printf("#define DYNTRANS_INVALIDATE_TC_PADDR " |
printf("#define DYNTRANS_INVALIDATE_TC " |
93 |
"%s_invalidate_translation_caches_paddr\n", a); |
"%s_invalidate_translation_caches\n", a); |
94 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
95 |
printf("#undef DYNTRANS_INVALIDATE_TC_PADDR\n\n"); |
printf("#undef DYNTRANS_INVALIDATE_TC\n\n"); |
96 |
|
|
97 |
printf("#define DYNTRANS_INVALIDATE_TC_CODE " |
printf("#define DYNTRANS_INVALIDATE_TC_CODE " |
98 |
"%s_invalidate_code_translation\n", a); |
"%s_invalidate_code_translation\n", a); |
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 |
|
|
156 |
"%s32_invalidate_tlb_entry\n", a); |
"%s32_invalidate_tlb_entry\n", a); |
157 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
158 |
printf("#undef DYNTRANS_INVAL_ENTRY\n\n"); |
printf("#undef DYNTRANS_INVAL_ENTRY\n\n"); |
159 |
printf("#define DYNTRANS_INVALIDATE_TC_PADDR " |
printf("#define DYNTRANS_INVALIDATE_TC " |
160 |
"%s32_invalidate_translation_caches_paddr\n", a); |
"%s32_invalidate_translation_caches\n", a); |
161 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
162 |
printf("#undef DYNTRANS_INVALIDATE_TC_PADDR\n\n"); |
printf("#undef DYNTRANS_INVALIDATE_TC\n\n"); |
163 |
printf("#define DYNTRANS_INVALIDATE_TC_CODE " |
printf("#define DYNTRANS_INVALIDATE_TC_CODE " |
164 |
"%s32_invalidate_code_translation\n", a); |
"%s32_invalidate_code_translation\n", a); |
165 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
176 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
177 |
printf("#undef DYNTRANS_PC_TO_POINTERS_FUNC\n\n"); |
printf("#undef DYNTRANS_PC_TO_POINTERS_FUNC\n\n"); |
178 |
printf("#undef DYNTRANS_PC_TO_POINTERS_GENERIC\n\n"); |
printf("#undef DYNTRANS_PC_TO_POINTERS_GENERIC\n\n"); |
179 |
|
printf("#undef COMBINE\n"); |
180 |
|
printf("#define COMBINE(n) %s32_combine_ ## n\n", a); |
181 |
|
printf("#include \"quick_pc_to_pointers.h\"\n"); |
182 |
printf("#include \"cpu_%s_instr.c\"\n", a); |
printf("#include \"cpu_%s_instr.c\"\n", a); |
183 |
|
|
184 |
printf("\n#undef DYNTRANS_PC_TO_POINTERS\n" |
printf("\n#undef DYNTRANS_PC_TO_POINTERS\n" |
192 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
193 |
printf("#undef DYNTRANS_CPU_RUN_INSTR\n\n"); |
printf("#undef DYNTRANS_CPU_RUN_INSTR\n\n"); |
194 |
|
|
|
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"); |
|
|
|
|
195 |
printf("CPU_FAMILY_INIT(%s,\"%s\")\n\n", a, b); |
printf("CPU_FAMILY_INIT(%s,\"%s\")\n\n", a, b); |
196 |
|
|
197 |
return 0; |
return 0; |