Update contrib.
1 // Copyright (c) 1998-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\include\nkern\x86\nk_plat.h
16 // WARNING: This file contains some APIs which are internal and are subject
17 // to change without notice. Such APIs should therefore not be used
18 // outside the Kernel and Hardware Services package.
30 #define IRQ_STACK_SIZE 1024
32 //#define __SCHEDULER_MACHINE_CODED__
33 //#define __DFC_MACHINE_CODED__
34 //#define __MSTIM_MACHINE_CODED__
35 //#define __PRI_LIST_MACHINE_CODED__
36 //#define __FAST_SEM_MACHINE_CODED__
37 //#define __FAST_MUTEX_MACHINE_CODED__
39 // TScheduler member data
40 #define i_ExcInfo iExtras[15] // pointer to exception info for crash debugger
43 class NThread : public NThreadBase
46 TInt Create(SNThreadCreateInfo& anInfo, TBool aInitial);
47 inline void Stillborn()
49 void GetUserContext(TX86RegSet& aContext);
50 void ModifyUsp(TLinAddr aUsp);
52 TUint32 i_NThread_Pad1;
53 TUint64 iCoprocessorState[64]; // state of FPU, SSE, SSE2
56 __ASSERT_COMPILE(!(_FOFF(NThread,iCoprocessorState)&7));
58 // Positions of registers on stack, relative to saved SP
73 GLREF_D TUint32 X86_IrqStack[IRQ_STACK_SIZE/4];
74 GLREF_D TLinAddr X86_IrqHandler;
75 GLREF_D TInt X86_IrqNestCount;
76 GLREF_D SCpuIdleHandler CpuIdleHandler;
77 GLREF_D TBool X86_UseGlobalPTEs;
78 GLREF_D TUint64 DefaultCoprocessorState[64];
82 /** Ensure the ordering of explicit memory writes
84 On x86 this is a no-op
89 /** Ensure the ordering of explicit memory accesses
91 On x86 any instruction with the LOCK prefix does this
94 #define mb() __asm__ __volatile__("lock add dword ptr [esp], 0" : : : "memory")
96 #define mb() do { _asm lock add dword ptr [esp], 0 } while (0)