2 |
#define MEMORY_H |
#define MEMORY_H |
3 |
|
|
4 |
/* |
/* |
5 |
* Copyright (C) 2004-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2006 Anders Gavare. All rights reserved. |
6 |
* |
* |
7 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
8 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: memory.h,v 1.47 2006/01/01 13:17:18 debug Exp $ |
* $Id: memory.h,v 1.49 2006/06/16 18:31:26 debug Exp $ |
32 |
* |
* |
33 |
* Memory controller related functions. |
* Memory controller related functions. |
34 |
*/ |
*/ |
45 |
struct cpu; |
struct cpu; |
46 |
struct translation_page_entry; |
struct translation_page_entry; |
47 |
|
|
|
/* For bintrans: */ |
|
|
#define MAX_QUICK_JUMPS 8 |
|
|
|
|
48 |
struct memory { |
struct memory { |
49 |
uint64_t physical_max; |
uint64_t physical_max; |
50 |
void *pagetable; |
void *pagetable; |
70 |
uint64_t dev_dyntrans_write_high[MAX_DEVICES]; |
uint64_t dev_dyntrans_write_high[MAX_DEVICES]; |
71 |
|
|
72 |
int dev_dyntrans_alignment; |
int dev_dyntrans_alignment; |
|
|
|
|
|
|
|
/* |
|
|
* NOTE/TODO: This bintrans was for MIPS only. Ugly. :-/ |
|
|
*/ |
|
|
|
|
|
/* |
|
|
* translation_code_chunk_space is a large chunk of (linear) memory |
|
|
* where translated code chunks and translation_entrys are stored. |
|
|
* When this is filled, translation is restart from scratch (by |
|
|
* resetting translation_code_chunk_space_head to 0, and removing all |
|
|
* translation entries). |
|
|
* |
|
|
* (Using a static memory region like this is somewhat inspired by |
|
|
* the QEMU web pages, |
|
|
* http://fabrice.bellard.free.fr/qemu/qemu-tech.html#SEC13) |
|
|
*/ |
|
|
|
|
|
unsigned char *translation_code_chunk_space; |
|
|
size_t translation_code_chunk_space_head; |
|
|
|
|
|
int bintrans_32bit_only; |
|
|
|
|
|
struct translation_page_entry **translation_page_entry_array; |
|
|
|
|
|
unsigned char *quick_jump_host_address[MAX_QUICK_JUMPS]; |
|
|
size_t quick_jump_page_offset[MAX_QUICK_JUMPS]; |
|
|
int n_quick_jumps; |
|
|
int quick_jumps_index; |
|
73 |
}; |
}; |
74 |
|
|
75 |
#define BITS_PER_PAGETABLE 20 |
#define BITS_PER_PAGETABLE 20 |
158 |
void *extra, int flags, unsigned char *dyntrans_data); |
void *extra, int flags, unsigned char *dyntrans_data); |
159 |
void memory_device_remove(struct memory *mem, int i); |
void memory_device_remove(struct memory *mem, int i); |
160 |
|
|
161 |
|
uint64_t memory_checksum(struct memory *mem); |
162 |
|
|
163 |
|
|
164 |
#endif /* MEMORY_H */ |
#endif /* MEMORY_H */ |