1 |
/* |
/* |
2 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_tail.c,v 1.8 2005/12/26 12:32:10 debug Exp $ |
* $Id: generate_tail.c,v 1.15 2007/02/02 17:44:04 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
66 |
|
|
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"); |
70 |
|
printf("extern int native_code_translation_enabled;\n"); |
71 |
|
printf("#include \"native.h\"\n"); |
72 |
|
|
73 |
printf("#ifdef DYNTRANS_32\n"); |
printf("#ifdef DYNTRANS_32\n"); |
74 |
printf("#define MODE32\n"); |
printf("#define MODE32\n"); |
75 |
printf("#endif\n"); |
printf("#endif\n"); |
79 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
80 |
printf("#undef DYNTRANS_FUNCTION_TRACE\n\n"); |
printf("#undef DYNTRANS_FUNCTION_TRACE\n\n"); |
81 |
|
|
82 |
|
printf("#define DYNTRANS_INIT_TABLES " |
83 |
|
"%s_cpu_init_tables\n", a); |
84 |
|
printf("#include \"cpu_dyntrans.c\"\n"); |
85 |
|
printf("#undef DYNTRANS_INIT_TABLES\n\n"); |
86 |
|
|
87 |
printf("#define DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE " |
printf("#define DYNTRANS_TC_ALLOCATE_DEFAULT_PAGE " |
88 |
"%s_tc_allocate_default_page\n", a); |
"%s_tc_allocate_default_page\n", a); |
89 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
136 |
printf("#include \"quick_pc_to_pointers.h\"\n"); |
printf("#include \"quick_pc_to_pointers.h\"\n"); |
137 |
printf("#include \"cpu_%s_instr.c\"\n\n", a); |
printf("#include \"cpu_%s_instr.c\"\n\n", a); |
138 |
|
|
139 |
|
printf("#define DYNTRANS_RUN_INSTR %s_run_instr\n", a); |
140 |
|
printf("#include \"cpu_dyntrans.c\"\n"); |
141 |
|
printf("#undef DYNTRANS_RUN_INSTR\n\n"); |
142 |
|
|
143 |
|
|
144 |
printf("#ifdef DYNTRANS_DUALMODE_32\n"); |
printf("#ifdef DYNTRANS_DUALMODE_32\n"); |
145 |
printf("#undef COMBINE_INSTRUCTIONS\n"); |
printf("#undef COMBINE_INSTRUCTIONS\n"); |
193 |
"#define DYNTRANS_PC_TO_POINTERS %s_pc_to_pointers\n" |
"#define DYNTRANS_PC_TO_POINTERS %s_pc_to_pointers\n" |
194 |
"#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); |
195 |
|
|
196 |
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); |
|
197 |
printf("#include \"cpu_dyntrans.c\"\n"); |
printf("#include \"cpu_dyntrans.c\"\n"); |
198 |
printf("#undef DYNTRANS_CPU_RUN_INSTR\n\n"); |
printf("#undef DYNTRANS_RUN_INSTR\n\n"); |
199 |
|
|
200 |
|
printf("#endif /* DYNTRANS_DUALMODE_32 */\n\n\n"); |
201 |
|
|
|
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"); |
|
202 |
|
|
203 |
printf("CPU_FAMILY_INIT(%s,\"%s\")\n\n", a, b); |
printf("CPU_FAMILY_INIT(%s,\"%s\")\n\n", a, b); |
204 |
|
|