/[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 14 by dpavlin, Mon Oct 8 16:18:51 2007 UTC revision 24 by dpavlin, Mon Oct 8 16:19:56 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.1 2005/08/29 14:36:41 debug Exp $   *  $Id: cpu_ia64.c,v 1.11 2006/06/16 18:31:25 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->memory_rw = ia64_memory_rw;          cpu->memory_rw = ia64_memory_rw;
62          cpu->update_translation_table = ia64_update_translation_table;          cpu->update_translation_table = ia64_update_translation_table;
63          cpu->invalidate_translation_caches_paddr =          cpu->invalidate_translation_caches =
64              ia64_invalidate_translation_caches_paddr;              ia64_invalidate_translation_caches;
65          cpu->invalidate_code_translation = ia64_invalidate_code_translation;          cpu->invalidate_code_translation = ia64_invalidate_code_translation;
66          cpu->is_32bit = 0;          cpu->is_32bit = 0;
67    
# Line 72  int ia64_cpu_new(struct cpu *cpu, struct Line 70  int ia64_cpu_new(struct cpu *cpu, struct
70                  debug("%s", cpu->name);                  debug("%s", cpu->name);
71          }          }
72    
73          /*  Create the default virtual->physical->host translation:  */          ia64_init_64bit_dummy_tables(cpu);
         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    
75          return 1;          return 1;
76  }  }
# Line 151  void ia64_cpu_register_dump(struct cpu * Line 140  void ia64_cpu_register_dump(struct cpu *
140          if (gprs) {          if (gprs) {
141                  symbol = get_symbol_name(&cpu->machine->symbol_context,                  symbol = get_symbol_name(&cpu->machine->symbol_context,
142                      cpu->pc, &offset);                      cpu->pc, &offset);
143                  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);
144                  debug("  <%s>\n", symbol != NULL? symbol : " no symbol ");                  debug("  <%s>\n", symbol != NULL? symbol : " no symbol ");
145    
146                  /*  TODO  */                  /*  TODO  */
# Line 160  void ia64_cpu_register_dump(struct cpu * Line 149  void ia64_cpu_register_dump(struct cpu *
149    
150    
151  /*  /*
152   *  ia64_cpu_show_full_statistics():   *  mips_cpu_tlbdump():
153   *   *
154   *  Show detailed statistics on opcode usage on each cpu.   *  Called from the debugger to dump the TLB in a readable format.
155     *  x is the cpu number to dump, or -1 to dump all CPUs.
156     *
157     *  If rawflag is nonzero, then the TLB contents isn't formated nicely,
158     *  just dumped.
159   */   */
160  void ia64_cpu_show_full_statistics(struct machine *m)  void ia64_cpu_tlbdump(struct machine *m, int x, int rawflag)
161  {  {
         fatal("ia64_cpu_show_full_statistics(): TODO\n");  
162  }  }
163    
164    
165  /*  /*
166   *  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.  
167   *   *
168   *  If rawflag is nonzero, then the TLB contents isn't formated nicely,   *  Execute a "remote GDB" command. Returns a newly allocated response string
169   *  just dumped.   *  on success, NULL on failure.
170   */   */
171  void ia64_cpu_tlbdump(struct machine *m, int x, int rawflag)  char *ia64_cpu_gdb_stub(struct cpu *cpu, char *cmd)
172  {  {
173          fatal("ia64_cpu_tlbdump(): TODO\n");          fatal("ia64_cpu_gdb_stub(): TODO\n");
174            return NULL;
175  }  }
176    
177    
# Line 218  int ia64_cpu_interrupt_ack(struct cpu *c Line 208  int ia64_cpu_interrupt_ack(struct cpu *c
208   *  cpu->pc for relative addresses.   *  cpu->pc for relative addresses.
209   */                       */                    
210  int ia64_cpu_disassemble_instr(struct cpu *cpu, unsigned char *ib,  int ia64_cpu_disassemble_instr(struct cpu *cpu, unsigned char *ib,
211          int running, uint64_t dumpaddr, int bintrans)          int running, uint64_t dumpaddr)
212  {  {
213          uint64_t offset;          uint64_t offset;
214          char *symbol;          char *symbol;
# Line 234  int ia64_cpu_disassemble_instr(struct cp Line 224  int ia64_cpu_disassemble_instr(struct cp
224          if (cpu->machine->ncpus > 1 && running)          if (cpu->machine->ncpus > 1 && running)
225                  debug("cpu%i:\t", cpu->cpu_id);                  debug("cpu%i:\t", cpu->cpu_id);
226    
227          debug("%016llx:  ", (long long)dumpaddr);          debug("%016"PRIx64":  ", (uint64_t) dumpaddr);
228    
229  debug("TODO\n");  debug("TODO\n");
230    

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

  ViewVC Help
Powered by ViewVC 1.1.26