--- upstream/dynamips-0.2.6-RC1/dev_pa_a1.c 2007/10/06 16:03:58 2 +++ upstream/dynamips-0.2.7-RC1/dev_pa_a1.c 2007/10/06 16:23:47 7 @@ -1,5 +1,5 @@ /* - * Cisco C7200 (Predator) Simulation Platform. + * Cisco router simulation platform. * Copyright (C) 2005,2006 Christophe Fillot. All rights reserved. * * PA-A1 ATM interface based on TI1570 and PLX 9060-ES. @@ -35,7 +35,8 @@ #include "crc.h" #include "atm.h" -#include "mips64.h" +#include "cpu.h" +#include "vm.h" #include "dynamips.h" #include "memory.h" #include "device.h" @@ -329,16 +330,6 @@ ptask_id_t tx_tid; }; -/* EEPROM definition */ -static const m_uint16_t eeprom_pa_a1_data[64] = { - 0x0117, 0x010F, 0xffff, 0xffff, 0x4906, 0x2E07, 0x0000, 0x0000, - 0x5000, 0x0000, 0x0010, 0x2400, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, -}; - -static const struct c7200_eeprom eeprom_pa_a1 = { - "PA-A1-OC3MM", (m_uint16_t *)eeprom_pa_a1_data, sizeof(eeprom_pa_a1_data)/2, -}; - /* Log a TI1570 message */ #define TI1570_LOG(d,msg...) vm_log((d)->vm,(d)->name,msg) @@ -348,7 +339,7 @@ /* * dev_pa_a1_access() */ -void *dev_pa_a1_access(cpu_mips_t *cpu,struct vdevice *dev,m_uint32_t offset, +void *dev_pa_a1_access(cpu_gen_t *cpu,struct vdevice *dev,m_uint32_t offset, u_int op_size,u_int op_type,m_uint64_t *data) { struct pa_a1_data *d = dev->priv_data; @@ -359,10 +350,10 @@ #if DEBUG_ACCESS if (op_type == MTS_READ) { cpu_log(cpu,"TI1570","read access to offset = 0x%x, pc = 0x%llx\n", - offset,cpu->pc); + offset,cpu_get_pc(cpu)); } else { cpu_log(cpu,"TI1570","write access to vaddr = 0x%x, pc = 0x%llx, " - "val = 0x%llx\n",offset,cpu->pc,*data); + "val = 0x%llx\n",offset,cpu_get_pc(cpu),*data); } #endif @@ -394,10 +385,10 @@ #if DEBUG_UNKNOWN if (op_type == MTS_READ) { cpu_log(cpu,d->name,"read from unknown addr 0x%x, pc=0x%llx (size=%u)\n", - offset,cpu->pc,op_size); + offset,cpu_get_pc(cpu),op_size); } else { cpu_log(cpu,d->name,"write to unknown addr 0x%x, value=0x%llx, " - "pc=0x%llx (size=%u)\n",offset,*data,cpu->pc,op_size); + "pc=0x%llx (size=%u)\n",offset,*data,cpu_get_pc(cpu),op_size); } #endif return NULL; @@ -1438,7 +1429,7 @@ /* * pci_ti1570_read() */ -static m_uint32_t pci_ti1570_read(cpu_mips_t *cpu,struct pci_device *dev, +static m_uint32_t pci_ti1570_read(cpu_gen_t *cpu,struct pci_device *dev, int reg) { struct pa_a1_data *d = dev->priv_data; @@ -1458,7 +1449,7 @@ /* * pci_ti1570_write() */ -static void pci_ti1570_write(cpu_mips_t *cpu,struct pci_device *dev, +static void pci_ti1570_write(cpu_gen_t *cpu,struct pci_device *dev, int reg,m_uint32_t value) { struct pa_a1_data *d = dev->priv_data; @@ -1478,7 +1469,7 @@ /* * pci_plx9060es_read() */ -static m_uint32_t pci_plx9060es_read(cpu_mips_t *cpu,struct pci_device *dev, +static m_uint32_t pci_plx9060es_read(cpu_gen_t *cpu,struct pci_device *dev, int reg) { #if DEBUG_ACCESS @@ -1493,7 +1484,7 @@ /* * pci_plx9060es_write() */ -static void pci_plx9060es_write(cpu_mips_t *cpu,struct pci_device *dev, +static void pci_plx9060es_write(cpu_gen_t *cpu,struct pci_device *dev, int reg,m_uint32_t value) { #if DEBUG_ACCESS @@ -1537,7 +1528,7 @@ memset(d,0,sizeof(*d)); /* Set the EEPROM */ - c7200_pa_set_eeprom(router,pa_bay,&eeprom_pa_a1); + c7200_pa_set_eeprom(router,pa_bay,cisco_eeprom_find_pa("PA-A1")); /* Add PCI device TI1570 */ pci_dev_ti = pci_dev_add(router->pa_bay[pa_bay].pci_map,name,