--- np2/i386c/ia32/paging.h 2007/02/06 14:20:57 1.21 +++ np2/i386c/ia32/paging.h 2011/12/16 09:05:42 1.25 @@ -1,5 +1,3 @@ -/* $Id: paging.h,v 1.21 2007/02/06 14:20:57 monaka Exp $ */ - /* * Copyright (c) 2003 NONAKA Kimihiro * All rights reserved. @@ -126,8 +124,11 @@ extern "C" { /* * linear address memory access function */ -void MEMCALL cpu_memory_access_la_region(UINT32 address, UINT length, const int ucrw, BYTE *data); -void MEMCALL paging_check(UINT32 laddr, UINT length, const int ucrw); +void MEMCALL cpu_memory_access_la_region(UINT32 address, UINT length, const int ucrw, UINT8 *data); +UINT32 MEMCALL laddr2paddr(const UINT32 laddr, const int ucrw); +#define laddr_to_paddr(laddr, ucrw) \ + (!CPU_STAT_PAGING) ? (laddr) : (laddr2paddr((laddr), (ucrw))) + /* ucrw */ #define CPU_PAGE_WRITE (1 << 0) @@ -196,18 +197,6 @@ void MEMCALL cpu_linear_memory_write_f(U /* - * CR3 (Page Directory Entry base physical address) - */ -#define set_CR3(cr3) \ -do { \ - VERBOSE(("set_CR3: old = %08x, new = 0x%08x", CPU_CR3, (cr3) & CPU_CR3_MASK)); \ - CPU_CR3 = (cr3) & CPU_CR3_MASK; \ - CPU_STAT_PDE_BASE = CPU_CR3 & CPU_CR3_PD_MASK; \ - tlb_flush(FALSE); \ -} while (/*CONSTCOND*/ 0) - - -/* * TLB function */ typedef struct { @@ -224,18 +213,10 @@ typedef struct { UINT8 *memp; /* shortcut for pre-fetch queue */ } TLB_ENTRY_T; - -#if defined(IA32_SUPPORT_TLB) void tlb_init(void); void MEMCALL tlb_flush(BOOL allflush); void MEMCALL tlb_flush_page(UINT32 laddr); TLB_ENTRY_T* MEMCALL tlb_lookup(const UINT32 laddr, const int ucrw); -#else -#define tlb_init() -#define tlb_flush(allflush) (void)(allflush) -#define tlb_flush_page(la) (void)(la) -#define tlb_lookup(la, ucrw) NULL -#endif #ifdef __cplusplus }