Update contrib.
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.
14 // e32\memmodel\epoc\multiple\x86\xsched.cia
20 GLDEF_C __NAKED__ void DoProcessSwitch()
22 // Enter with kernel locked
23 // EBX = pointer to new thread (NThread)
24 // EDI = pointer to TScheduler
25 // ESI = pointer to TSubScheduler (SMP only)
27 // eax = new process (DX86PlatProcess)
28 asm("mov eax, [ebx+%0]": : "i"_FOFF(NThreadBase,iAddressSpace));
30 asm("cmp eax, [esi+%0]": :"i"_FOFF(TSubScheduler,iAddressSpace));
32 asm("cmp eax, [edi+%0]": : "i"_FOFF(TScheduler,iAddressSpace));
34 asm("jz no_as_switch");
36 asm("mov ecx, [eax+%0]": : "i"_FOFF(DMemModelProcess,iGlobalPageDir));
39 asm("mov [esi+%0], eax": :"i"_FOFF(TSubScheduler,iAddressSpace));
41 asm("mov [edi+%0], eax": : "i"_FOFF(TScheduler,iAddressSpace));
46 // Get DThread* from NThread* (former contains latter so we go backwards in memory to get there)
48 asm("lea ecx, [ecx+%0]": : "i"_FOFF(DThread,iNThread));
51 // check for memory being aliased...
52 asm("mov ecx, [ebx+%0]": : "i"_FOFF(DMemModelThread,iAliasLinAddr));
57 asm("mov edx, [ebx+%0]": : "i"_FOFF(DMemModelThread,iAliasPdePtr));
58 asm("mov eax, [ebx+%0]": : "i"_FOFF(DMemModelThread,iAliasPde));
59 asm("mov [edx], eax");