/[gxemul]/trunk/src/devices/dev_eagle.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_eagle.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_eagle.c,v 1.18 2007/02/16 19:57:56 debug Exp $   *  $Id: dev_eagle.c,v 1.19 2007/06/15 19:11:15 debug Exp $
29   *     *  
30   *  Motorola MPC105 "Eagle" host bridge.   *  COMMENT: Motorola MPC105 "Eagle" host bridge
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 53  struct eagle_data { Line 53  struct eagle_data {
53    
54  DEVICE_ACCESS(eagle)  DEVICE_ACCESS(eagle)
55  {  {
         uint64_t idata = 0, odata = 0;  
56          struct eagle_data *d = extra;          struct eagle_data *d = extra;
57            uint64_t idata = 0, odata = 0;
58          int bus, dev, func, reg;          int bus, dev, func, reg;
59    
60          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
# Line 65  DEVICE_ACCESS(eagle) Line 65  DEVICE_ACCESS(eagle)
65           */           */
66    
67          switch (relative_addr) {          switch (relative_addr) {
68    
69          case 0: /*  Address:  */          case 0: /*  Address:  */
70                  bus_pci_decompose_1(idata, &bus, &dev, &func, &reg);                  bus_pci_decompose_1(idata, &bus, &dev, &func, &reg);
71                  bus_pci_setaddr(cpu, d->pci_data, bus, dev, func, reg);                  bus_pci_setaddr(cpu, d->pci_data, bus, dev, func, reg);
# Line 92  DEVINIT(eagle) Line 93  DEVINIT(eagle)
93          char pci_irq_base[300];          char pci_irq_base[300];
94          char isa_irq_base[300];          char isa_irq_base[300];
95    
96          d = malloc(sizeof(struct eagle_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct eagle_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
97          memset(d, 0, sizeof(struct eagle_data));          memset(d, 0, sizeof(struct eagle_data));
98    
99          /*  The interrupt path to the CPU at which we are connected:  */          /*  The interrupt path to the CPU at which we are connected:  */
# Line 160  DEVINIT(eagle) Line 157  DEVINIT(eagle)
157              DM_DEFAULT, NULL);              DM_DEFAULT, NULL);
158    
159          switch (devinit->machine->machine_type) {          switch (devinit->machine->machine_type) {
160    
161          case MACHINE_BEBOX:          case MACHINE_BEBOX:
162                  bus_isa_init(devinit->machine, isa_irq_base,                  bus_isa_init(devinit->machine, isa_irq_base,
163                      BUS_ISA_IDE0 | BUS_ISA_VGA, isa_portbase, isa_membase);                      BUS_ISA_IDE0 | BUS_ISA_VGA, isa_portbase, isa_membase);
164                  bus_pci_add(devinit->machine, d->pci_data,                  bus_pci_add(devinit->machine, d->pci_data,
165                      devinit->machine->memory, 0, 11, 0, "i82378zb");                      devinit->machine->memory, 0, 11, 0, "i82378zb");
166                  break;                  break;
167    
168          case MACHINE_PREP:          case MACHINE_PREP:
169                  bus_pci_add(devinit->machine, d->pci_data,                  bus_pci_add(devinit->machine, d->pci_data,
170                      devinit->machine->memory, 0, 11, 0, "ibm_isa");                      devinit->machine->memory, 0, 11, 0, "ibm_isa");
171                  break;                  break;
172    
173          case MACHINE_MVMEPPC:          case MACHINE_MVMEPPC:
174                  bus_isa_init(devinit->machine, isa_irq_base,                  bus_isa_init(devinit->machine, isa_irq_base,
175                      BUS_ISA_LPTBASE_3BC, isa_portbase, isa_membase);                      BUS_ISA_LPTBASE_3BC, isa_portbase, isa_membase);
176    
177                  switch (devinit->machine->machine_subtype) {                  switch (devinit->machine->machine_subtype) {
178                  case MACHINE_MVMEPPC_1600:                  case MACHINE_MVMEPPC_1600:
179                          bus_pci_add(devinit->machine, d->pci_data,                          bus_pci_add(devinit->machine, d->pci_data,
# Line 183  DEVINIT(eagle) Line 184  DEVINIT(eagle)
184                          exit(1);                          exit(1);
185                  }                  }
186                  break;                  break;
187    
188          default:fatal("unimplemented machine type for eagle\n");          default:fatal("unimplemented machine type for eagle\n");
189                  exit(1);                  exit(1);
190          }          }

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

  ViewVC Help
Powered by ViewVC 1.1.26