1 |
/* |
/* |
2 |
* Cisco C7200 (Predator) NVRAM with Calendar Module. |
* Cisco router simulation platform. |
3 |
* Copyright (c) 2005,2006 Christophe Fillot. All rights reserved. |
* Copyright (c) 2005,2006 Christophe Fillot. All rights reserved. |
4 |
* |
* |
5 |
* Dallas DS1216 chip emulation: |
* Dallas DS1216 chip emulation: |
18 |
#include <time.h> |
#include <time.h> |
19 |
#include <errno.h> |
#include <errno.h> |
20 |
|
|
21 |
#include "mips64.h" |
#include "cpu.h" |
22 |
|
#include "vm.h" |
23 |
#include "dynamips.h" |
#include "dynamips.h" |
24 |
#include "memory.h" |
#include "memory.h" |
25 |
#include "device.h" |
#include "device.h" |
45 |
} |
} |
46 |
|
|
47 |
/* Get the current time (p.8) */ |
/* Get the current time (p.8) */ |
48 |
static m_uint64_t get_current_time(cpu_mips_t *cpu) |
static m_uint64_t get_current_time(cpu_gen_t *cpu) |
49 |
{ |
{ |
50 |
m_uint64_t res; |
m_uint64_t res; |
51 |
struct tm *tmx; |
struct tm *tmx; |
68 |
/* |
/* |
69 |
* dev_nvram_access() |
* dev_nvram_access() |
70 |
*/ |
*/ |
71 |
void *dev_nvram_access(cpu_mips_t *cpu,struct vdevice *dev, |
void *dev_nvram_access(cpu_gen_t *cpu,struct vdevice *dev, |
72 |
m_uint32_t offset,u_int op_size,u_int op_type, |
m_uint32_t offset,u_int op_size,u_int op_type, |
73 |
m_uint64_t *data) |
m_uint64_t *data) |
74 |
{ |
{ |
76 |
|
|
77 |
#if DEBUG_ACCESS |
#if DEBUG_ACCESS |
78 |
if (op_type == MTS_READ) |
if (op_type == MTS_READ) |
79 |
cpu_log(cpu,dev->name,"read access to offset = 0x%x, pc = 0x%llx\n", |
cpu_log(cpu,dev->name,"read access to offset=0x%x, pc=0x%llx\n", |
80 |
offset,cpu->pc); |
offset,cpu_get_pc(cpu)); |
81 |
else |
else |
82 |
cpu_log(cpu,dev->name,"write access to vaddr = 0x%x, pc = 0x%llx, " |
cpu_log(cpu,dev->name, |
83 |
"val = 0x%llx\n",offset,cpu->pc,*data); |
"write access to vaddr=0x%x, pc=0x%llx, val=0x%llx\n", |
84 |
|
offset,cpu_get_pc(cpu),*data); |
85 |
#endif |
#endif |
86 |
|
|
87 |
switch(offset) { |
switch(offset) { |