|
|
| version 1.2, 2003/12/11 15:06:50 | version 1.3, 2004/01/13 16:37:42 |
|---|---|
| Line 421 paging(DWORD laddr, int crw, int user_mo | Line 421 paging(DWORD laddr, int crw, int user_mo |
| pde_addr = (CPU_CR3 & CPU_CR3_PD_MASK) | ((laddr >> 20) & 0xffc); | pde_addr = (CPU_CR3 & CPU_CR3_PD_MASK) | ((laddr >> 20) & 0xffc); |
| pde = cpu_memoryread_d(pde_addr); | pde = cpu_memoryread_d(pde_addr); |
| if (!(pde & CPU_PDE_PRESENT)) { | if (!(pde & CPU_PDE_PRESENT)) { |
| VERBOSE(("PDE is not present. (laddr = 0x%08x, pde_addr = 0x%08x, pde = 0x%08x)", laddr, pde_addr, pde)); | |
| err = 0; | err = 0; |
| goto pf_exception; | goto pf_exception; |
| } | } |
| Line 446 paging(DWORD laddr, int crw, int user_mo | Line 447 paging(DWORD laddr, int crw, int user_mo |
| pte_addr = (pde & CPU_PDE_BASEADDR_MASK) | ((laddr >> 10) & 0xffc); | pte_addr = (pde & CPU_PDE_BASEADDR_MASK) | ((laddr >> 10) & 0xffc); |
| pte = cpu_memoryread_d(pte_addr); | pte = cpu_memoryread_d(pte_addr); |
| if (!(pte & CPU_PTE_PRESENT)) { | if (!(pte & CPU_PTE_PRESENT)) { |
| VERBOSE(("PTE is not present. (laddr = 0x%08x, pde_addr = 0x%08x, pde = 0x%08x, pte_addr = 0x%08x, pte = 0x%08x)", laddr, pde_addr, pde, pte_addr, pte)); | |
| err = 0; | err = 0; |
| goto pf_exception; | goto pf_exception; |
| } | } |
| Line 469 paging(DWORD laddr, int crw, int user_mo | Line 471 paging(DWORD laddr, int crw, int user_mo |
| if (!(page_access_bit[bit])) | if (!(page_access_bit[bit])) |
| #endif | #endif |
| { | { |
| VERBOSE(("page access violation. (laddr = 0x%08x, pde_addr = 0x%08x, pde = 0x%08x, pte_addr = 0x%08x, pte = 0x%08x, paddr = 0x%08x, bit = 0x%08x)", laddr, pde_addr, pde, pte_addr, pte, paddr, bit)); | |
| err = 1; | err = 1; |
| goto pf_exception; | goto pf_exception; |
| } | } |
| Line 641 tlb_flush_page(DWORD vaddr) | Line 644 tlb_flush_page(DWORD vaddr) |
| } | } |
| static BOOL | static BOOL |
| tlb_lookup(DWORD vaddr, int crw, DWORD* paddr) | tlb_lookup(DWORD laddr, int crw, DWORD* paddr) |
| { | { |
| TLB_ENTRY_T* ep; | TLB_ENTRY_T* ep; |
| int idx; | int idx; |
| Line 657 tlb_lookup(DWORD vaddr, int crw, DWORD* | Line 660 tlb_lookup(DWORD vaddr, int crw, DWORD* |
| idx = 0; | idx = 0; |
| } else { | } else { |
| if (tlb[i].kind & TLB_KIND_SMALL) { | if (tlb[i].kind & TLB_KIND_SMALL) { |
| idx = (vaddr >> 12) & (tlb[i].idx - 1); | idx = (laddr >> 12) & (tlb[i].idx - 1); |
| } else { | } else { |
| idx = (vaddr >> 22) & (tlb[i].idx - 1); | idx = (laddr >> 22) & (tlb[i].idx - 1); |
| } | } |
| } | } |
| Line 667 tlb_lookup(DWORD vaddr, int crw, DWORD* | Line 670 tlb_lookup(DWORD vaddr, int crw, DWORD* |
| ep = &tlb[i].entry[idx * tlb[i].way]; | ep = &tlb[i].entry[idx * tlb[i].way]; |
| for (i = 0; i < tlb[i].way; i++) { | for (i = 0; i < tlb[i].way; i++) { |
| if (ep->valid) { | if (ep->valid) { |
| if ((vaddr & ep->mask) == ep->tag) { | if ((laddr & ep->mask) == ep->tag) { |
| if (ep->score != (BYTE)~0) | if (ep->score != (BYTE)~0) |
| ep->score++; | ep->score++; |
| *paddr = ep->paddr; | *paddr = ep->paddr; |
| Line 756 tlb_flush(BOOL allflush) | Line 759 tlb_flush(BOOL allflush) |
| } | } |
| void | void |
| tlb_flush_page(DWORD vaddr) | tlb_flush_page(DWORD laddr) |
| { | { |
| (void)vaddr; | (void)laddr; |
| } | } |
| #endif /* IA32_SUPPORT_TLB */ | #endif /* IA32_SUPPORT_TLB */ |