--- upstream/dynamips-0.2.6-RC1/dev_c7200_bri.c 2007/10/06 16:03:58 2 +++ upstream/dynamips-0.2.7/dev_c7200_bri.c 2007/10/06 16:29:14 10 @@ -1,5 +1,5 @@ /* - * Cisco C7200 (Predator) Simulation Platform. + * Cisco router Simulation Platform. * Copyright (C) 2005-2006 Christophe Fillot. All rights reserved. * * EEPROM types: @@ -22,7 +22,8 @@ #include #include -#include "mips64.h" +#include "cpu.h" +#include "vm.h" #include "dynamips.h" #include "memory.h" #include "device.h" @@ -285,17 +286,6 @@ u_int m32_offset; }; -/* EEPROM definition (3D = PA-4B, 3E = PA-8B) */ -static const m_uint16_t eeprom_pa_4b_data[64] = { - 0x013D, 0x0202, 0xffff, 0xffff, 0x490C, 0x7806, 0x0000, 0x0000, - 0x5000, 0x0000, 0x0208, 0x1900, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, -}; - -static const struct c7200_eeprom eeprom_pa_4b = { - "PA-4B", (m_uint16_t *)eeprom_pa_4b_data, - sizeof(eeprom_pa_4b_data)/2, -}; - /* Log a PA-4B/PA-8B message */ #define BRI_LOG(d,msg...) vm_log((d)->vm,(d)->name,msg) @@ -501,7 +491,7 @@ printf("M32: data_ptr=0x%x, len=%u\n",txd.tdp,pkt_len); mem_dump(stdout,pkt,pkt_len); - /* Poll the next descriptor (wait for HOLD bit to be reset */ + /* Poll the next descriptor (wait for HOLD bit to be reset) */ chan->poll_mode = 1; if (txd.params & M32_TXDESC_FE) { @@ -589,7 +579,7 @@ } /* Munich32 general access function */ -static void *m32_gen_access(struct m32_data *d,cpu_mips_t *cpu, +static void *m32_gen_access(struct m32_data *d,cpu_gen_t *cpu, m_uint32_t offset,u_int op_size,u_int op_type, m_uint64_t *data) { @@ -652,7 +642,7 @@ /* * pa_4b_access() */ -void *pa_4b_access(cpu_mips_t *cpu,struct vdevice *dev,m_uint32_t offset, +void *pa_4b_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_4b_data *d = dev->priv_data; @@ -665,10 +655,11 @@ if (offset >= MUNICH32_MEM_SIZE) { if (op_type == MTS_READ) { cpu_log(cpu,d->name,"read access to offset = 0x%x, pc = 0x%llx " - "(op_size=%u)\n",offset,cpu->pc,op_size); + "(op_size=%u)\n",offset,cpu_get_pc(cpu),op_size); } else { cpu_log(cpu,d->name,"write access to vaddr = 0x%x, pc = 0x%llx, " - "val = 0x%llx (op_size=%u)\n",offset,cpu->pc,*data,op_size); + "val = 0x%llx (op_size=%u)\n", + offset,cpu_get_pc(cpu),*data,op_size); } } #endif @@ -752,7 +743,7 @@ /* * pci_munich32_read() */ -static m_uint32_t pci_munich32_read(cpu_mips_t *cpu,struct pci_device *dev, +static m_uint32_t pci_munich32_read(cpu_gen_t *cpu,struct pci_device *dev, int reg) { struct pa_4b_data *d = dev->priv_data; @@ -771,7 +762,7 @@ /* * pci_munich32_write() */ -static void pci_munich32_write(cpu_mips_t *cpu,struct pci_device *dev, +static void pci_munich32_write(cpu_gen_t *cpu,struct pci_device *dev, int reg,m_uint32_t value) { struct pa_4b_data *d = dev->priv_data; @@ -810,7 +801,7 @@ d->m32_data.vm = router->vm; /* Set the EEPROM */ - c7200_pa_set_eeprom(router,pa_bay,&eeprom_pa_4b); + c7200_pa_set_eeprom(router,pa_bay,cisco_eeprom_find_pa("PA-4B")); /* Add as PCI device PA-4B */ pci_dev = pci_dev_add(router->pa_bay[pa_bay].pci_map,name,