1 |
/* |
/* |
2 |
* Cisco C7200 (Predator) simulation platform. |
* Cisco router simulation platform. |
3 |
* Copyright (c) 2006 Christophe Fillot. All rights reserved. |
* Copyright (c) 2006 Christophe Fillot. All rights reserved. |
4 |
* |
* |
5 |
* PCMCIA ATA Flash emulation. |
* PCMCIA ATA Flash emulation. |
15 |
#include <sys/stat.h> |
#include <sys/stat.h> |
16 |
#include <fcntl.h> |
#include <fcntl.h> |
17 |
|
|
18 |
#include "mips64.h" |
#include "cpu.h" |
19 |
|
#include "vm.h" |
20 |
#include "dynamips.h" |
#include "dynamips.h" |
21 |
#include "memory.h" |
#include "memory.h" |
22 |
#include "device.h" |
#include "device.h" |
362 |
/* |
/* |
363 |
* dev_pcmcia_disk_access_0() |
* dev_pcmcia_disk_access_0() |
364 |
*/ |
*/ |
365 |
void *dev_pcmcia_disk_access_0(cpu_mips_t *cpu,struct vdevice *dev, |
void *dev_pcmcia_disk_access_0(cpu_gen_t *cpu,struct vdevice *dev, |
366 |
m_uint32_t offset,u_int op_size,u_int op_type, |
m_uint32_t offset,u_int op_size,u_int op_type, |
367 |
m_uint64_t *data) |
m_uint64_t *data) |
368 |
{ |
{ |
375 |
if (op_type == MTS_READ) { |
if (op_type == MTS_READ) { |
376 |
cpu_log(cpu,d->dev.name, |
cpu_log(cpu,d->dev.name, |
377 |
"reading offset 0x%5.5x at pc=0x%llx (size=%u)\n", |
"reading offset 0x%5.5x at pc=0x%llx (size=%u)\n", |
378 |
offset,cpu->pc,op_size); |
offset,cpu_get_pc(cpu),op_size); |
379 |
} else { |
} else { |
380 |
cpu_log(cpu,d->dev.name, |
cpu_log(cpu,d->dev.name, |
381 |
"writing offset 0x%5.5x, data=0x%llx at pc=0x%llx (size=%u)\n", |
"writing offset 0x%5.5x, data=0x%llx at pc=0x%llx (size=%u)\n", |
382 |
offset,*data,cpu->pc,op_size); |
offset,*data,cpu_get_pc(cpu),op_size); |
383 |
} |
} |
384 |
#endif |
#endif |
385 |
|
|
456 |
/* |
/* |
457 |
* dev_pcmcia_disk_access_1() |
* dev_pcmcia_disk_access_1() |
458 |
*/ |
*/ |
459 |
void *dev_pcmcia_disk_access_1(cpu_mips_t *cpu,struct vdevice *dev, |
void *dev_pcmcia_disk_access_1(cpu_gen_t *cpu,struct vdevice *dev, |
460 |
m_uint32_t offset,u_int op_size,u_int op_type, |
m_uint32_t offset,u_int op_size,u_int op_type, |
461 |
m_uint64_t *data) |
m_uint64_t *data) |
462 |
{ |
{ |
619 |
free(d); |
free(d); |
620 |
return NULL; |
return NULL; |
621 |
} |
} |
622 |
|
|
623 |
|
/* Get the device associated with a PCMCIA disk object */ |
624 |
|
struct vdevice *dev_pcmcia_disk_get_device(vm_obj_t *obj) |
625 |
|
{ |
626 |
|
struct pcmcia_disk_data *d; |
627 |
|
|
628 |
|
if (!obj || !(d = obj->data)) |
629 |
|
return NULL; |
630 |
|
|
631 |
|
return(&d->dev); |
632 |
|
} |