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

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

revision 39 by dpavlin, Mon Oct 8 16:21:53 2007 UTC revision 40 by dpavlin, Mon Oct 8 16:22:11 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: memory_sh.c,v 1.18 2007/04/13 07:06:31 debug Exp $   *  $Id: memory_sh.c,v 1.19 2007/04/16 15:11:31 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 157  static int translate_via_mmu(struct cpu Line 157  static int translate_via_mmu(struct cpu
157                   *  If a matching entry wasn't found in the ITLB, but in the                   *  If a matching entry wasn't found in the ITLB, but in the
158                   *  UTLB, then copy it to a random place in the ITLB.                   *  UTLB, then copy it to a random place in the ITLB.
159                   */                   */
160                  if (i >= 0) {                  if (i >= 0 && !(flags & FLAG_NOEXCEPTIONS)) {
161                          int r = random() % SH_N_ITLB_ENTRIES;                          int r = random() % SH_N_ITLB_ENTRIES;
162    
163                          /*  NOTE: Make sure that the old mapping for                          /*  NOTE: Make sure that the old mapping for
# Line 243  exception: Line 243  exception:
243   *              available as read-only.   *              available as read-only.
244   *      2       Same as 1, but the page is available as read/write.   *      2       Same as 1, but the page is available as read/write.
245   */   */
246  int sh_translate_v2p(struct cpu *cpu, uint64_t vaddr, uint64_t *return_paddr,  int sh_translate_v2p(struct cpu *cpu, uint64_t vaddr64, uint64_t *return_paddr,
247          int flags)          int flags)
248  {  {
249          int user = cpu->cd.sh.sr & SH_SR_MD? 0 : 1;          int user = cpu->cd.sh.sr & SH_SR_MD? 0 : 1;
250            uint32_t vaddr = vaddr64;
         vaddr = (uint32_t)vaddr;  
251    
252          /*  U0/P0: Userspace addresses, or P3: Kernel virtual memory.  */          /*  U0/P0: Userspace addresses, or P3: Kernel virtual memory.  */
253          if (!(vaddr & 0x80000000) ||          if (!(vaddr & 0x80000000) ||

Legend:
Removed from v.39  
changed lines
  Added in v.40

  ViewVC Help
Powered by ViewVC 1.1.26