/[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 21 by dpavlin, Mon Oct 8 16:19:23 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.8 2005/11/06 22:41:12 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 104  int main(int argc, char *argv[]) Line 104  int main(int argc, char *argv[])
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"              "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 135  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,0} };\n", a);          printf("#else\n");
143          else {          printf("static struct %s_instr_call nothing_call = { "
144                  printf("#ifdef DYNTRANS_VARIABLE_INSTRUCTION_LENGTH\n");              "instr(nothing), {0,0,0} };\n", a);
145                  printf("static struct %s_instr_call nothing_call = { "          printf("#endif\n");
                     "instr(nothing), 0, {0,0,0} };\n", a);  
                 printf("#else\n");  
                 printf("static struct %s_instr_call nothing_call = { "  
                     "instr(nothing), {0,0,0} };\n", a);  
                 printf("#endif\n");  
         }  
146    
147          printf("\n");          printf("\n");
148    

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

  ViewVC Help
Powered by ViewVC 1.1.26