First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 extern "C" void __DebugMsgFlushTLB();
20 extern "C" void __DebugMsgLocalFlushTLB();
21 extern "C" void __DebugMsgTotalFlushTLB();
22 extern "C" void __DebugMsgINVLPG(int a);
26 __NAKED__ void __fastcall DoInvalidateTLBForPage(TLinAddr /*aLinAddr*/)
28 // Flush a specified virtual address from the TLB.
31 ASM_DEBUG1(INVLPG,ecx)
36 // On 486 and Pentium this invalidates all TLB entries.
37 // On P6 and later CPUs it only invalidates non-global TLB entries.
38 __NAKED__ void DoLocalInvalidateTLB()
40 ASM_DEBUG0(LocalFlushTLB)
46 // Invalidate all TLB entries regardless of CPU type.
47 __NAKED__ void DoInvalidateTLB()
50 asm("mov edx, [%a0]": : "i"(&X86_UseGlobalPTEs));
53 asm("jz no_global_pages");
64 asm("no_global_pages:");
69 __NAKED__ void __fastcall UserWriteFault(TLinAddr /*aAddr*/)
71 // must use ES for writes because IpcExcHandler expects this...
73 asm("mov eax, %0" : : "i"(RING3_DS));
75 asm("mov es:[ecx], ecx");
80 __NAKED__ void __fastcall UserReadFault(TLinAddr /*aAddr*/)
82 // must use DS for reads because IpcExcHandler expects this...
84 asm("mov eax, %0" : : "i"(RING3_DS));
86 asm("mov eax, [ecx]");
92 extern "C" __NAKED__ void __e32_instruction_barrier()
95 asm("cpuid "); // fully serializing instruction