|
|
| version 1.32, 2011/01/15 18:36:12 | 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 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 */ |