/[gxemul]/trunk/src/devices/dev_ram.c
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/devices/dev_ram.c

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

revision 35 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 36 by dpavlin, Mon Oct 8 16:21:34 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_ram.c,v 1.23 2006/12/30 13:30:59 debug Exp $   *  $Id: dev_ram.c,v 1.24 2007/03/08 11:43:44 debug Exp $
29   *     *  
30   *  A generic RAM (memory) device. Can also be used to mirror/alias another   *  A generic RAM (memory) device. Can also be used to mirror/alias another
31   *  part of RAM.   *  part of RAM.
# Line 47  Line 47 
47  /*  #define RAM_DEBUG  */  /*  #define RAM_DEBUG  */
48    
49  struct ram_data {  struct ram_data {
50            uint64_t        baseaddress;
51    
52          int             mode;          int             mode;
53          uint64_t        otheraddress;          uint64_t        otheraddress;
54    
# Line 83  DEVICE_ACCESS(ram) Line 85  DEVICE_ACCESS(ram)
85                      d->otheraddress + relative_addr, data, len,                      d->otheraddress + relative_addr, data, len,
86                      writeflag, PHYSICAL);                      writeflag, PHYSICAL);
87          case DEV_RAM_RAM:          case DEV_RAM_RAM:
88                  if (writeflag == MEM_WRITE)                  if (writeflag == MEM_WRITE) {
89                          memcpy(&d->data[relative_addr], data, len);                          memcpy(&d->data[relative_addr], data, len);
90                  else  
91                            /*  Invalidate any code translations on a write:  */
92                            if (cpu->invalidate_code_translation != NULL) {
93                                    cpu->invalidate_code_translation(
94                                        cpu, d->baseaddress + relative_addr,
95                                        INVALIDATE_PADDR);
96                            }
97                    } else {
98                          memcpy(data, &d->data[relative_addr], len);                          memcpy(data, &d->data[relative_addr], len);
99                    }
100                  break;                  break;
101          default:          default:
102                  fatal("dev_ram_access(): unknown mode %i\n", d->mode);                  fatal("dev_ram_access(): unknown mode %i\n", d->mode);
# Line 124  void dev_ram_init(struct machine *machin Line 134  void dev_ram_init(struct machine *machin
134          }          }
135    
136          d->mode         = mode;          d->mode         = mode;
137            d->baseaddress  = baseaddr;
138          d->otheraddress = otheraddress;          d->otheraddress = otheraddress;
139    
140          switch (d->mode) {          switch (d->mode) {

Legend:
Removed from v.35  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.26