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

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

revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 26 by dpavlin, Mon Oct 8 16:20:10 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: memory_alpha.c,v 1.2 2006/06/12 08:35:23 debug Exp $   *  $Id: memory_alpha.c,v 1.3 2006/06/24 21:47:23 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 39  Line 39 
39    
40    
41  /*  /*
42   *  alpha_translate_address():   *  alpha_translate_v2p():
43   */   */
44  int alpha_translate_address(struct cpu *cpu, uint64_t vaddr,  int alpha_translate_v2p(struct cpu *cpu, uint64_t vaddr,
45          uint64_t *return_addr, int flags)          uint64_t *return_paddr, int flags)
46  {  {
47          *return_addr = vaddr & 0x000003ffffffffffULL;          *return_paddr = vaddr & 0x000003ffffffffffULL;
48    
49          /*  UGLY hack for now:  */          /*  UGLY hack for now:  */
50          /*  TODO: Real virtual memory support.  */          /*  TODO: Real virtual memory support.  */
51    
52          if ((vaddr & ~0xffff) == 0xfffffc0010000000ULL ||          if ((vaddr & ~0xffff) == 0xfffffc0010000000ULL ||
53              (vaddr & ~0xffff) == 0x0000000010000000ULL)              (vaddr & ~0xffff) == 0x0000000010000000ULL)
54                  *return_addr = (vaddr & 0x0fffffff) +                  *return_paddr = (vaddr & 0x0fffffff) +
55                      (cpu->machine->physical_ram_in_mb-1) * 1048576;                      (cpu->machine->physical_ram_in_mb-1) * 1048576;
56    
57          /*  At 0x20000000, NetBSD stores temp prom data  */          /*  At 0x20000000, NetBSD stores temp prom data  */
58          if ((vaddr & ~0x1fff) == 0xfffffc0020000000ULL ||          if ((vaddr & ~0x1fff) == 0xfffffc0020000000ULL ||
59              (vaddr & ~0x1fff) == 0x0000000020000000ULL)              (vaddr & ~0x1fff) == 0x0000000020000000ULL)
60                  *return_addr = (vaddr & 0x0fffffff) + 512*1024 +                  *return_paddr = (vaddr & 0x0fffffff) + 512*1024 +
61                      (cpu->machine->physical_ram_in_mb-1) * 1048576;                      (cpu->machine->physical_ram_in_mb-1) * 1048576;
62    
63          /*  printf("yo %016"PRIx64" %016"PRIx64"\n", vaddr, *return_addr);  */          /*  printf("yo %016"PRIx64" %016"PRIx64"\n", vaddr, *return_paddr);  */
64    
65          return 2;          return 2;
66  }  }

Legend:
Removed from v.24  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26