/[gxemul]/trunk/src/include/memory.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/include/memory.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by dpavlin, Mon Oct 8 16:18:11 2007 UTC revision 12 by dpavlin, Mon Oct 8 16:18:38 2007 UTC
# Line 28  Line 28 
28   *  SUCH DAMAGE.   *  SUCH DAMAGE.
29   *   *
30   *   *
31   *  $Id: memory.h,v 1.32 2005/05/23 14:22:03 debug Exp $   *  $Id: memory.h,v 1.35 2005/07/19 10:48:07 debug Exp $
32   *   *
33   *  Memory controller related functions.   *  Memory controller related functions.
34   */   */
# Line 72  struct memory { Line 72  struct memory {
72          int             (*dev_f_state[MAX_DEVICES])(struct cpu *,          int             (*dev_f_state[MAX_DEVICES])(struct cpu *,
73                              struct memory *, void *extra, int wf, int nr,                              struct memory *, void *extra, int wf, int nr,
74                              int *type, char **namep, void **data, size_t *len);                              int *type, char **namep, void **data, size_t *len);
75          unsigned char   *dev_bintrans_data[MAX_DEVICES];          unsigned char   *dev_dyntrans_data[MAX_DEVICES];
76    
77  #ifdef BINTRANS          int             dev_dyntrans_alignment;
78          uint64_t        dev_bintrans_write_low[MAX_DEVICES];  
79          uint64_t        dev_bintrans_write_high[MAX_DEVICES];          uint64_t        dev_dyntrans_write_low[MAX_DEVICES];
80            uint64_t        dev_dyntrans_write_high[MAX_DEVICES];
81    
82    
83            /*
84             *  NOTE/TODO: This bintrans was for MIPS only. Ugly. :-/
85             */
86    
87          /*          /*
88           *  translation_code_chunk_space is a large chunk of (linear) memory           *  translation_code_chunk_space is a large chunk of (linear) memory
# Line 101  struct memory { Line 107  struct memory {
107          int             quick_jump_page_offset[MAX_QUICK_JUMPS];          int             quick_jump_page_offset[MAX_QUICK_JUMPS];
108          int             n_quick_jumps;          int             n_quick_jumps;
109          int             quick_jumps_index;          int             quick_jumps_index;
 #endif  
110  };  };
111    
112  #define BITS_PER_PAGETABLE      20  #define BITS_PER_PAGETABLE      20
# Line 130  void memory_writemax64(struct cpu *cpu, Line 135  void memory_writemax64(struct cpu *cpu,
135    
136  void *zeroed_alloc(size_t s);  void *zeroed_alloc(size_t s);
137    
138  struct memory *memory_new(uint64_t physical_max);  struct memory *memory_new(uint64_t physical_max, int arch);
139    
140  int memory_points_to_string(struct cpu *cpu, struct memory *mem,  int memory_points_to_string(struct cpu *cpu, struct memory *mem,
141          uint64_t addr, int min_string_length);          uint64_t addr, int min_string_length);
# Line 170  int userland_memory_rw(struct cpu *cpu, Line 175  int userland_memory_rw(struct cpu *cpu,
175  #define MEMORY_ACCESS_FAILED    0  #define MEMORY_ACCESS_FAILED    0
176  #define MEMORY_ACCESS_OK        1  #define MEMORY_ACCESS_OK        1
177    
178  void memory_device_bintrans_access(struct cpu *, struct memory *mem,  void memory_device_dyntrans_access(struct cpu *, struct memory *mem,
179          void *extra, uint64_t *low, uint64_t *high);          void *extra, uint64_t *low, uint64_t *high);
180    
181  void memory_device_register_statefunction(  void memory_device_register_statefunction(
# Line 182  void memory_device_register_statefunctio Line 187  void memory_device_register_statefunctio
187  void memory_device_register(struct memory *mem, const char *,  void memory_device_register(struct memory *mem, const char *,
188          uint64_t baseaddr, uint64_t len, int (*f)(struct cpu *,          uint64_t baseaddr, uint64_t len, int (*f)(struct cpu *,
189              struct memory *,uint64_t,unsigned char *,size_t,int,void *),              struct memory *,uint64_t,unsigned char *,size_t,int,void *),
190          void *extra, int flags, unsigned char *bintrans_data);          void *extra, int flags, unsigned char *dyntrans_data);
191  void memory_device_remove(struct memory *mem, int i);  void memory_device_remove(struct memory *mem, int i);
192    
193  /*  Bit flags:  */  /*  Bit flags:  */
194  #define MEM_DEFAULT                             0  #define MEM_DEFAULT                             0
195  #define MEM_BINTRANS_OK                         1  #define MEM_DYNTRANS_OK                         1
196  #define MEM_BINTRANS_WRITE_OK                   2  #define MEM_DYNTRANS_WRITE_OK                   2
197  #define MEM_READING_HAS_NO_SIDE_EFFECTS         4  #define MEM_READING_HAS_NO_SIDE_EFFECTS         4
198    
199    

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26