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

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

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_hammerhead.c,v 1.4 2006/12/30 13:30:58 debug Exp $   *  $Id: dev_hammerhead.c,v 1.6 2007/06/15 19:11:15 debug Exp $
29   *     *  
30   *  Hammerhead controller, for the secondary CPU on MacPPC machines.   *  COMMENT: Hammerhead controller, for the secondary CPU on MacPPC machines
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 53  struct hammerhead_data { Line 53  struct hammerhead_data {
53  };  };
54    
55    
 /*  
  *  dev_hammerhead_access():  
  */  
56  DEVICE_ACCESS(hammerhead)  DEVICE_ACCESS(hammerhead)
57  {  {
         uint64_t idata = 0, odata=0;  
58          /*  struct hammerhead_data *d = extra;  */          /*  struct hammerhead_data *d = extra;  */
59            uint64_t idata = 0, odata=0;
60    
61          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
62                  idata = memory_readmax64(cpu, data, len);                  idata = memory_readmax64(cpu, data, len);
# Line 76  return 1; Line 73  return 1;
73    
74                  other_cpu->running = 1;                  other_cpu->running = 1;
75                  other_cpu->pc = idata;                  other_cpu->pc = idata;
76  #ifdef ENABLE_PPC  
77                  if (other_cpu->is_32bit)                  if (other_cpu->is_32bit)
78                          ppc32_pc_to_pointers(other_cpu);                          ppc32_pc_to_pointers(other_cpu);
79                  else                  else
80                          ppc_pc_to_pointers(other_cpu);                          ppc_pc_to_pointers(other_cpu);
 #else  
                 fatal("Hm. PPC not enabled.\n");  
                 exit(1);  
 #endif  
81          } else {          } else {
82                  fatal("[ HAMMERHEAD read: TODO ]\n");                  fatal("[ HAMMERHEAD read: TODO ]\n");
83          }          }
# Line 98  return 1; Line 91  return 1;
91    
92  DEVINIT(hammerhead)  DEVINIT(hammerhead)
93  {  {
94          struct hammerhead_data *d = malloc(sizeof(struct hammerhead_data));          struct hammerhead_data *d;
95    
96          if (d == NULL) {          CHECK_ALLOCATION(d = malloc(sizeof(struct hammerhead_data)));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
97          memset(d, 0, sizeof(struct hammerhead_data));          memset(d, 0, sizeof(struct hammerhead_data));
98    
99          memory_device_register(devinit->machine->memory, devinit->name,          memory_device_register(devinit->machine->memory, devinit->name,

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26