25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_head.c,v 1.5 2005/09/18 19:54:14 debug Exp $ |
* $Id: generate_head.c,v 1.12 2005/12/31 15:48:04 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
36 |
char *uppercase(char *l) |
char *uppercase(char *l) |
37 |
{ |
{ |
38 |
static char staticbuf[1000]; |
static char staticbuf[1000]; |
39 |
int i = 0; |
size_t i = 0; |
40 |
|
|
41 |
while (*l && i < sizeof(staticbuf)) { |
while (*l && i < sizeof(staticbuf)) { |
42 |
char u = *l++; |
char u = *l++; |
103 |
"extern int old_show_trace_tree;\n" |
"extern int old_show_trace_tree;\n" |
104 |
"extern int old_instruction_trace;\n" |
"extern int old_instruction_trace;\n" |
105 |
"extern int old_quiet_mode;\n" |
"extern int old_quiet_mode;\n" |
106 |
|
"extern int show_opcode_statistics;\n" |
107 |
|
"extern int dyntrans_backend_enable;\n" |
108 |
"extern int quiet_mode;\n"); |
"extern int quiet_mode;\n"); |
109 |
|
|
110 |
printf("\n/* instr uses the same names as in " |
printf("\n/* instr uses the same names as in " |
114 |
"#define instr32(n) %s32_instr_ ## n\n\n", a); |
"#define instr32(n) %s32_instr_ ## n\n\n", a); |
115 |
printf("#endif\n\n"); |
printf("#endif\n\n"); |
116 |
|
|
117 |
printf("/* This is for marking a physical page as containing " |
printf("/* This is for marking a physical page as containing" |
118 |
"translated or\n combined instructions, respectively: */\n"); |
"\n combined instructions: */\n"); |
|
printf("#define translated (cpu->cd.%s.cur_physpage->flags " |
|
|
"|= TRANSLATIONS)\n", a); |
|
119 |
printf("#define combined (cpu->cd.%s.cur_physpage->flags " |
printf("#define combined (cpu->cd.%s.cur_physpage->flags " |
120 |
"|= COMBINATIONS)\n", a); |
"|= COMBINATIONS)\n", a); |
121 |
|
|
136 |
printf("\tcpu->cd.%s.next_ic --;\n", a); |
printf("\tcpu->cd.%s.next_ic --;\n", a); |
137 |
printf("}\n\n"); |
printf("}\n\n"); |
138 |
|
|
139 |
/* TODO: solve this in a nicer way! */ |
printf("#ifdef DYNTRANS_VARIABLE_INSTRUCTION_LENGTH\n"); |
140 |
if (strcmp(a, "avr") == 0) |
printf("static struct %s_instr_call nothing_call = { " |
141 |
printf("static struct %s_instr_call nothing_call = { " |
"instr(nothing), {0,0,0} };\n", a); |
142 |
"instr(nothing), {0,0} };\n", a); |
printf("#else\n"); |
143 |
else |
printf("static struct %s_instr_call nothing_call = { " |
144 |
printf("static struct %s_instr_call nothing_call = { " |
"instr(nothing), {0,0,0} };\n", a); |
145 |
"instr(nothing), {0,0,0} };\n", a); |
printf("#endif\n"); |
146 |
|
|
147 |
printf("\n"); |
printf("\n"); |
148 |
|
|