/[gxemul]/trunk/src/cpus/generate_head.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/cpus/generate_head.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Mon Oct 8 16:18:51 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 25  Line 25 
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>
# Line 36  Line 36 
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++;
# Line 103  int main(int argc, char *argv[]) Line 103  int main(int argc, char *argv[])
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 "
# Line 112  int main(int argc, char *argv[]) Line 114  int main(int argc, char *argv[])
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    
# Line 136  int main(int argc, char *argv[]) Line 136  int main(int argc, char *argv[])
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    

Legend:
Removed from v.14  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26