First public contribution.
1 // Copyright (c) 1994-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\direct\x86\xkernel.cpp
20 /********************************************
22 ********************************************/
24 TInt DX86PlatThread::SetupContext(SThreadCreateInfo& anInfo)
29 DX86PlatProcess::DX86PlatProcess()
32 DX86PlatProcess::~DX86PlatProcess()
34 __KTRACE_OPT(KMMU,Kern::Printf("DX86PlatProcess destruct"));
35 DMemModelProcess::Destruct();
38 TBool Exc::IsMagic(TLinAddr /*anAddress*/)
40 // Return TRUE if anAddress is a 'magic' exception handling instruction
46 void DThread::IpcExcHandler(TExcTrap* aTrap, DThread* aThread, TAny* aContext)
48 aThread->iIpcClient = 0;
49 TIpcExcTrap& xt=*(TIpcExcTrap*)aTrap;
50 TX86ExcInfo& info=*(TX86ExcInfo*)aContext;
51 if (info.iExcId==EX86VectorPageFault)
53 TLinAddr va=(TLinAddr)info.iFaultAddress;
54 if (va>=xt.iRemoteBase && (va-xt.iRemoteBase)<xt.iSize)
55 xt.Exception(KErrBadDescriptor); // problem accessing remote address - 'leave' so an error code will be returned
56 if (xt.iLocalBase && va>=xt.iLocalBase && (va-xt.iLocalBase)<xt.iSize)
57 NKern::UnlockSystem(); // problem accessing local address - return and panic current thread as usual
59 // otherwise return and fault kernel