--- np2/i386c/ia32/paging.c 2008/03/22 04:03:07 1.30 +++ np2/i386c/ia32/paging.c 2011/12/16 09:05:42 1.33 @@ -1,5 +1,3 @@ -/* $Id: paging.c,v 1.30 2008/03/22 04:03:07 monaka Exp $ */ - /* * Copyright (c) 2003-2004 NONAKA Kimihiro * All rights reserved. @@ -183,9 +181,7 @@ static const UINT8 page_access_bit[32] = */ 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); -#endif #define PAGE_SIZE 0x1000 #define PAGE_MASK (PAGE_SIZE - 1) @@ -641,13 +637,11 @@ paging(const UINT32 laddr, const int ucr UINT32 pte; /* page table entry */ UINT bit; UINT err; -#if defined(IA32_SUPPORT_TLB) TLB_ENTRY_T *ep; ep = tlb_lookup(laddr, ucrw); if (ep != NULL) return ep->paddr + (laddr & PAGE_MASK); -#endif pde_addr = CPU_STAT_PDE_BASE + ((laddr >> 20) & 0xffc); pde = cpu_memoryread_d(pde_addr); @@ -703,9 +697,8 @@ paging(const UINT32 laddr, const int ucr 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)); -#endif + return paddr; pf_exception: @@ -716,8 +709,6 @@ pf_exception: return 0; /* compiler happy */ } - -#if defined(IA32_SUPPORT_TLB) /* * TLB */ @@ -789,7 +780,7 @@ tlb_init(void) memset(tlb, 0, sizeof(tlb)); #if defined(IA32_PROFILE_TLB) - memset(tlb_profile, 0, sizeof(tlb_profile)); + memset(&tlb_profile, 0, sizeof(tlb_profile)); #endif /* IA32_PROFILE_TLB */ } @@ -906,4 +897,3 @@ tlb_update(const UINT32 laddr, const UIN } ep->memp = NULL; } -#endif /* IA32_SUPPORT_TLB */