/[gxemul]/trunk/src/cpus/cpu_ia64.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/cpu_ia64.c

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

revision 18 by dpavlin, Mon Oct 8 16:19:11 2007 UTC revision 28 by dpavlin, Mon Oct 8 16:20:26 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2006  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:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_ia64.c,v 1.2 2005/10/22 17:24:20 debug Exp $   *  $Id: cpu_ia64.c,v 1.13 2006/07/16 13:32:26 debug Exp $
29   *   *
30   *  IA64 CPU emulation.   *  IA64 CPU emulation.
31   *   *
# Line 55  Line 55 
55  int ia64_cpu_new(struct cpu *cpu, struct memory *mem,  int ia64_cpu_new(struct cpu *cpu, struct memory *mem,
56          struct machine *machine, int cpu_id, char *cpu_type_name)          struct machine *machine, int cpu_id, char *cpu_type_name)
57  {  {
         int i;  
   
58          if (strcasecmp(cpu_type_name, "IA64") != 0)          if (strcasecmp(cpu_type_name, "IA64") != 0)
59                  return 0;                  return 0;
60    
61            cpu->run_instr = ia64_run_instr;
62          cpu->memory_rw = ia64_memory_rw;          cpu->memory_rw = ia64_memory_rw;
63          cpu->update_translation_table = ia64_update_translation_table;          cpu->update_translation_table = ia64_update_translation_table;
64          cpu->invalidate_translation_caches =          cpu->invalidate_translation_caches =
# Line 72  int ia64_cpu_new(struct cpu *cpu, struct Line 71  int ia64_cpu_new(struct cpu *cpu, struct
71                  debug("%s", cpu->name);                  debug("%s", cpu->name);
72          }          }
73    
         /*  Create the default virtual->physical->host translation:  */  
         cpu->cd.ia64.vph_default_page = malloc(sizeof(struct ia64_vph_page));  
         if (cpu->cd.ia64.vph_default_page == NULL) {  
                 fprintf(stderr, "out of memory in ia64_cpu_new()\n");  
                 exit(1);  
         }  
         memset(cpu->cd.ia64.vph_default_page, 0, sizeof(struct ia64_vph_page));  
         for (i=0; i<IA64_LEVEL0; i++)  
                 cpu->cd.ia64.vph_table0[i] = cpu->cd.ia64.vph_table0_kernel[i]  
                     = cpu->cd.ia64.vph_default_page;  
   
74          return 1;          return 1;
75  }  }
76    
# Line 151  void ia64_cpu_register_dump(struct cpu * Line 139  void ia64_cpu_register_dump(struct cpu *
139          if (gprs) {          if (gprs) {
140                  symbol = get_symbol_name(&cpu->machine->symbol_context,                  symbol = get_symbol_name(&cpu->machine->symbol_context,
141                      cpu->pc, &offset);                      cpu->pc, &offset);
142                  debug("cpu%i:\t pc = 0x%016llx", x, (long long)cpu->pc);                  debug("cpu%i:\t pc = 0x%016"PRIx64, x, (uint64_t)cpu->pc);
143                  debug("  <%s>\n", symbol != NULL? symbol : " no symbol ");                  debug("  <%s>\n", symbol != NULL? symbol : " no symbol ");
144    
145                  /*  TODO  */                  /*  TODO  */
# Line 160  void ia64_cpu_register_dump(struct cpu * Line 148  void ia64_cpu_register_dump(struct cpu *
148    
149    
150  /*  /*
151   *  ia64_cpu_show_full_statistics():   *  mips_cpu_tlbdump():
152     *
153     *  Called from the debugger to dump the TLB in a readable format.
154     *  x is the cpu number to dump, or -1 to dump all CPUs.
155   *   *
156   *  Show detailed statistics on opcode usage on each cpu.   *  If rawflag is nonzero, then the TLB contents isn't formated nicely,
157     *  just dumped.
158   */   */
159  void ia64_cpu_show_full_statistics(struct machine *m)  void ia64_cpu_tlbdump(struct machine *m, int x, int rawflag)
160  {  {
         fatal("ia64_cpu_show_full_statistics(): TODO\n");  
161  }  }
162    
163    
164  /*  /*
165   *  ia64_cpu_tlbdump():   *  ia64_cpu_gdb_stub():
  *  
  *  Called from the debugger to dump the TLB in a readable format.  
  *  x is the cpu number to dump, or -1 to dump all CPUs.  
166   *   *
167   *  If rawflag is nonzero, then the TLB contents isn't formated nicely,   *  Execute a "remote GDB" command. Returns a newly allocated response string
168   *  just dumped.   *  on success, NULL on failure.
169   */   */
170  void ia64_cpu_tlbdump(struct machine *m, int x, int rawflag)  char *ia64_cpu_gdb_stub(struct cpu *cpu, char *cmd)
171  {  {
172          fatal("ia64_cpu_tlbdump(): TODO\n");          fatal("ia64_cpu_gdb_stub(): TODO\n");
173            return NULL;
174  }  }
175    
176    
# Line 218  int ia64_cpu_interrupt_ack(struct cpu *c Line 207  int ia64_cpu_interrupt_ack(struct cpu *c
207   *  cpu->pc for relative addresses.   *  cpu->pc for relative addresses.
208   */                       */                    
209  int ia64_cpu_disassemble_instr(struct cpu *cpu, unsigned char *ib,  int ia64_cpu_disassemble_instr(struct cpu *cpu, unsigned char *ib,
210          int running, uint64_t dumpaddr, int bintrans)          int running, uint64_t dumpaddr)
211  {  {
212          uint64_t offset;          uint64_t offset;
213          char *symbol;          char *symbol;
# Line 234  int ia64_cpu_disassemble_instr(struct cp Line 223  int ia64_cpu_disassemble_instr(struct cp
223          if (cpu->machine->ncpus > 1 && running)          if (cpu->machine->ncpus > 1 && running)
224                  debug("cpu%i:\t", cpu->cpu_id);                  debug("cpu%i:\t", cpu->cpu_id);
225    
226          debug("%016llx:  ", (long long)dumpaddr);          debug("%016"PRIx64":  ", (uint64_t) dumpaddr);
227    
228  debug("TODO\n");  debug("TODO\n");
229    

Legend:
Removed from v.18  
changed lines
  Added in v.28

  ViewVC Help
Powered by ViewVC 1.1.26