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

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

revision 2 by dpavlin, Mon Oct 8 16:17:48 2007 UTC revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: memory_fast_v2h.c,v 1.12 2005/02/18 06:01:18 debug Exp $   *  $Id: memory_fast_v2h.c,v 1.13 2005/04/09 21:13:58 debug Exp $
29   *   *
30   *  Fast virtual memory to host address, used by binary translated code.   *  Fast virtual memory to host address, used by binary translated code.
31   */   */
# Line 140  if ((vaddr & 0xc0000000ULL) >= 0xc000000 Line 140  if ((vaddr & 0xc0000000ULL) >= 0xc000000
140                  return NULL;                  return NULL;
141    
142          for (i=0; i<cpu->mem->n_mmapped_devices; i++)          for (i=0; i<cpu->mem->n_mmapped_devices; i++)
143                  if (paddr >= cpu->mem->dev_baseaddr[i] &&                  if (paddr >= (cpu->mem->dev_baseaddr[i] & ~0xfff) &&
144                      paddr < cpu->mem->dev_baseaddr[i] +                      paddr <= ((cpu->mem->dev_baseaddr[i] +
145                      cpu->mem->dev_length[i]) {                      cpu->mem->dev_length[i] - 1) | 0xfff)) {
146                          if (cpu->mem->dev_flags[i] & MEM_BINTRANS_OK) {                          if (cpu->mem->dev_flags[i] & MEM_BINTRANS_OK) {
147                                  paddr -= cpu->mem->dev_baseaddr[i];                                  paddr -= cpu->mem->dev_baseaddr[i];
148    
149                                    /*  Within a device _page_ but not within the
150                                        actual device? Then abort:  */
151                                    if ((int64_t)paddr < 0 ||
152                                        paddr >= cpu->mem->dev_length[i])
153                                            return NULL;
154    
155                                  if (writeflag) {                                  if (writeflag) {
156                                          uint64_t low_paddr = paddr & ~0xfff;                                          uint64_t low_paddr = paddr & ~0xfff;
157                                          uint64_t high_paddr = paddr | 0xfff;                                          uint64_t high_paddr = paddr | 0xfff;

Legend:
Removed from v.2  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26