/[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 29 by dpavlin, Mon Oct 8 16:20:26 2007 UTC revision 30 by dpavlin, Mon Oct 8 16:20:40 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: generate_head.c,v 1.18 2006/07/20 21:53:00 debug Exp $   *  $Id: generate_head.c,v 1.23 2006/08/11 17:43:30 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 131  int main(int argc, char *argv[]) Line 131  int main(int argc, char *argv[])
131              "#define instr32(n) %s32_instr_ ## n\n\n", a);              "#define instr32(n) %s32_instr_ ## n\n\n", a);
132          printf("#endif\n\n");          printf("#endif\n\n");
133    
         printf("/*  This is for marking a physical page as containing"  
             "\n    combined instructions:  */\n");  
         printf("#define combined (cpu->cd.%s.cur_physpage->flags "  
             "|= COMBINATIONS)\n", a);  
   
134          printf("\n#define X(n) void %s_instr_ ## n(struct cpu *cpu, \\\n"          printf("\n#define X(n) void %s_instr_ ## n(struct cpu *cpu, \\\n"
135              " struct %s_instr_call *ic)\n", a, a);              " struct %s_instr_call *ic)\n", a, a);
136    
137          printf("\n/*\n *  nothing:  Do nothing.\n *\n"          printf("\n/*\n *  nothing:  Do nothing.\n *\n"
138              " *  The difference between this function and a \"nop\" "              " *  The difference between this function and a \"nop\" "
139              "instruction is that\n *  this function does not increase "              "instruction is that\n *  this function does not increase "
140              "the program counter or the number of\n *  translated "              "the program counter.  It is used to \"get out\" of running in "
141              "instructions.  It is used to \"get out\" of running in "              "translated\n *  mode.\n */\n");
             "translated\n *  mode.\n *\n"  
             " *  IMPORTANT NOTE: Do a   cpu->running_translated = 0;\n"  
             " *                  before setting cpu->cd.%s.next_ic = "  
             "&nothing_call;\n */\n", a);  
142          printf("X(nothing)\n{\n");          printf("X(nothing)\n{\n");
         printf("\tcpu->n_translated_instrs --;\n");  
143          printf("\tcpu->cd.%s.next_ic --;\n", a);          printf("\tcpu->cd.%s.next_ic --;\n", a);
144          printf("}\n\n");          printf("}\n\n");
145    
146          /*  Ugly special hack for Transputer:  */          /*  Ugly special hacks for Transputer and SH[34]:  */
147          if (strcasecmp(argv[1], "transputer") == 0) {          if (strcasecmp(argv[1], "transputer") == 0) {
148                  printf("static struct %s_instr_call nothing_call = { "                  printf("static struct %s_instr_call nothing_call = { "
149                      "instr(nothing), {0} };\n", a);                      "instr(nothing), {0} };\n", a);
150            } else if (strcasecmp(argv[1], "sh") == 0) {
151                    printf("static struct %s_instr_call nothing_call = { "
152                        "instr(nothing), {0,0} };\n", a);
153          } else {          } else {
154                  printf("static struct %s_instr_call nothing_call = { "                  printf("static struct %s_instr_call nothing_call = { "
155                      "instr(nothing), {0,0,0} };\n", a);                      "instr(nothing), {0,0,0} };\n", a);

Legend:
Removed from v.29  
changed lines
  Added in v.30

  ViewVC Help
Powered by ViewVC 1.1.26