Diff for /np2/i386c/ia32/paging.c between versions 1.31 and 1.33

version 1.31, 2011/01/15 17:17:23 version 1.33, 2011/12/16 09:05:42
Line 181  static const UINT8 page_access_bit[32] = Line 181  static const UINT8 page_access_bit[32] =
  */   */
   
 static UINT32 MEMCALL paging(const UINT32 laddr, const int ucrw);  static UINT32 MEMCALL paging(const UINT32 laddr, const int ucrw);
 #if defined(IA32_SUPPORT_TLB)  
 static void MEMCALL tlb_update(const UINT32 laddr, const UINT entry, const int ucrw);  static void MEMCALL tlb_update(const UINT32 laddr, const UINT entry, const int ucrw);
 #endif  
   
 #define PAGE_SIZE       0x1000  #define PAGE_SIZE       0x1000
 #define PAGE_MASK       (PAGE_SIZE - 1)  #define PAGE_MASK       (PAGE_SIZE - 1)
Line 639  paging(const UINT32 laddr, const int ucr Line 637  paging(const UINT32 laddr, const int ucr
         UINT32 pte;             /* page table entry */          UINT32 pte;             /* page table entry */
         UINT bit;          UINT bit;
         UINT err;          UINT err;
 #if defined(IA32_SUPPORT_TLB)  
         TLB_ENTRY_T *ep;          TLB_ENTRY_T *ep;
   
         ep = tlb_lookup(laddr, ucrw);          ep = tlb_lookup(laddr, ucrw);
         if (ep != NULL)          if (ep != NULL)
                 return ep->paddr + (laddr & PAGE_MASK);                  return ep->paddr + (laddr & PAGE_MASK);
 #endif  
   
         pde_addr = CPU_STAT_PDE_BASE + ((laddr >> 20) & 0xffc);          pde_addr = CPU_STAT_PDE_BASE + ((laddr >> 20) & 0xffc);
         pde = cpu_memoryread_d(pde_addr);          pde = cpu_memoryread_d(pde_addr);
Line 701  paging(const UINT32 laddr, const int ucr Line 697  paging(const UINT32 laddr, const int ucr
                 cpu_memorywrite_d(pte_addr, pte);                  cpu_memorywrite_d(pte_addr, pte);
         }          }
   
 #if defined(IA32_SUPPORT_TLB)  
         tlb_update(laddr, pte, (bit & (CPU_PTE_WRITABLE|CPU_PTE_USER_MODE)) + ((ucrw & CPU_PAGE_CODE) >> 1));          tlb_update(laddr, pte, (bit & (CPU_PTE_WRITABLE|CPU_PTE_USER_MODE)) + ((ucrw & CPU_PAGE_CODE) >> 1));
 #endif  
         return paddr;          return paddr;
   
 pf_exception:  pf_exception:
Line 714  pf_exception: Line 709  pf_exception:
         return 0;       /* compiler happy */          return 0;       /* compiler happy */
 }  }
   
   
 #if defined(IA32_SUPPORT_TLB)  
 /*   /* 
  * TLB   * TLB
  */   */
Line 787  tlb_init(void) Line 780  tlb_init(void)
   
         memset(tlb, 0, sizeof(tlb));          memset(tlb, 0, sizeof(tlb));
 #if defined(IA32_PROFILE_TLB)  #if defined(IA32_PROFILE_TLB)
         memset(tlb_profile, 0, sizeof(tlb_profile));          memset(&tlb_profile, 0, sizeof(tlb_profile));
 #endif  /* IA32_PROFILE_TLB */  #endif  /* IA32_PROFILE_TLB */
 }  }
   
Line 904  tlb_update(const UINT32 laddr, const UIN Line 897  tlb_update(const UINT32 laddr, const UIN
         }          }
         ep->memp = NULL;          ep->memp = NULL;
 }  }
 #endif  /* IA32_SUPPORT_TLB */  

Removed from v.1.31  
changed lines
  Added in v.1.33


RetroPC.NET-CVS <cvs@retropc.net>