28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: memory.h,v 1.40 2005/10/23 14:24:15 debug Exp $ |
* $Id: memory.h,v 1.44 2005/11/22 16:26:38 debug Exp $ |
32 |
* |
* |
33 |
* Memory controller related functions. |
* Memory controller related functions. |
34 |
*/ |
*/ |
40 |
|
|
41 |
|
|
42 |
#define DEFAULT_RAM_IN_MB 32 |
#define DEFAULT_RAM_IN_MB 32 |
43 |
#define MAX_DEVICES 24 |
#define MAX_DEVICES 26 |
44 |
|
|
45 |
#define DEVICE_STATE_TYPE_INT 1 |
#define DEVICE_STATE_TYPE_INT 1 |
46 |
#define DEVICE_STATE_TYPE_UINT64_T 2 |
#define DEVICE_STATE_TYPE_UINT64_T 2 |
75 |
int *type, char **namep, void **data, size_t *len); |
int *type, char **namep, void **data, size_t *len); |
76 |
unsigned char *dev_dyntrans_data[MAX_DEVICES]; |
unsigned char *dev_dyntrans_data[MAX_DEVICES]; |
77 |
|
|
|
int dev_dyntrans_alignment; |
|
|
|
|
78 |
uint64_t dev_dyntrans_write_low[MAX_DEVICES]; |
uint64_t dev_dyntrans_write_low[MAX_DEVICES]; |
79 |
uint64_t dev_dyntrans_write_high[MAX_DEVICES]; |
uint64_t dev_dyntrans_write_high[MAX_DEVICES]; |
80 |
|
|
81 |
|
int dev_dyntrans_alignment; |
82 |
|
|
83 |
|
|
84 |
/* |
/* |
85 |
* NOTE/TODO: This bintrans was for MIPS only. Ugly. :-/ |
* NOTE/TODO: This bintrans was for MIPS only. Ugly. :-/ |
114 |
#define BITS_PER_MEMBLOCK 20 |
#define BITS_PER_MEMBLOCK 20 |
115 |
#define MAX_BITS 40 |
#define MAX_BITS 40 |
116 |
|
|
|
#define MEM_READ 0 |
|
|
#define MEM_WRITE 1 |
|
|
|
|
|
|
|
|
#define CACHE_DATA 0 |
|
|
#define CACHE_INSTRUCTION 1 |
|
|
#define CACHE_NONE 2 |
|
|
|
|
|
#define CACHE_FLAGS_MASK 0x3 |
|
|
|
|
|
#define NO_EXCEPTIONS 16 |
|
|
#define PHYSICAL 32 |
|
|
#define NO_SEGMENTATION 64 /* for X86 */ |
|
|
#define MEMORY_USER_ACCESS 128 /* for ARM, at least */ |
|
|
|
|
117 |
|
|
118 |
/* memory.c: */ |
/* memory.c: */ |
119 |
|
#define MEM_PCI_LITTLE_ENDIAN 128 |
120 |
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len); |
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len); |
121 |
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, |
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, |
122 |
uint64_t data); |
uint64_t data); |
150 |
uint64_t *return_addr, int flags); |
uint64_t *return_addr, int flags); |
151 |
|
|
152 |
|
|
153 |
|
/* Writeflag: */ |
154 |
|
#define MEM_READ 0 |
155 |
|
#define MEM_WRITE 1 |
156 |
|
#define MEM_DOWNGRADE 128 |
157 |
|
|
158 |
|
/* Misc. flags: */ |
159 |
|
#define CACHE_DATA 0 |
160 |
|
#define CACHE_INSTRUCTION 1 |
161 |
|
#define CACHE_NONE 2 |
162 |
|
#define CACHE_FLAGS_MASK 0x3 |
163 |
|
#define NO_EXCEPTIONS 16 |
164 |
|
#define PHYSICAL 32 |
165 |
|
#define NO_SEGMENTATION 64 /* for X86 */ |
166 |
|
#define MEMORY_USER_ACCESS 128 /* for ARM, at least */ |
167 |
|
|
168 |
|
/* Dyntrans Memory flags: */ |
169 |
|
#define DM_DEFAULT 0 |
170 |
|
#define DM_DYNTRANS_OK 1 |
171 |
|
#define DM_DYNTRANS_WRITE_OK 2 |
172 |
|
#define DM_READS_HAVE_NO_SIDE_EFFECTS 4 |
173 |
|
#define DM_EMULATED_RAM 8 |
174 |
|
|
175 |
#define FLAG_WRITEFLAG 1 |
#define FLAG_WRITEFLAG 1 |
176 |
#define FLAG_NOEXCEPTIONS 2 |
#define FLAG_NOEXCEPTIONS 2 |
177 |
#define FLAG_INSTR 4 |
#define FLAG_INSTR 4 |
198 |
void *extra, int flags, unsigned char *dyntrans_data); |
void *extra, int flags, unsigned char *dyntrans_data); |
199 |
void memory_device_remove(struct memory *mem, int i); |
void memory_device_remove(struct memory *mem, int i); |
200 |
|
|
|
/* Bit flags: */ |
|
|
#define MEM_DEFAULT 0 |
|
|
#define MEM_DYNTRANS_OK 1 |
|
|
#define MEM_DYNTRANS_WRITE_OK 2 |
|
|
#define MEM_READING_HAS_NO_SIDE_EFFECTS 4 |
|
|
#define MEM_EMULATED_RAM 8 |
|
|
|
|
|
|
|
201 |
#endif /* MEMORY_H */ |
#endif /* MEMORY_H */ |