Update contrib.
1 // Copyright (c) 2005-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\nkernsmp\x86\ncutilf.cpp
21 extern SVariantInterfaceBlock* VIB;
24 /******************************************************************************
26 ******************************************************************************/
27 /** Create a spin lock
32 EXPORT_C TSpinLock::TSpinLock(TUint aOrder)
35 __NK_ASSERT_DEBUG( (aOrder==EOrderNone) || ((aOrder&0x7f)<0x20) );
36 if (aOrder>=0x80 && aOrder!=EOrderNone)
39 iLock = TUint64(aOrder)<<48; // byte 6 = 00-1F for interrupt, 20-3F for preemption
40 // byte 7 = FF if not held
44 /******************************************************************************
45 * Read/Write Spin lock
46 ******************************************************************************/
47 /** Create a spin lock
52 EXPORT_C TRWSpinLock::TRWSpinLock(TUint aOrder)
55 __NK_ASSERT_DEBUG( (aOrder==TSpinLock::EOrderNone) || ((aOrder&0x7f)<0x20) );
56 if (aOrder>=0x80 && aOrder!=TSpinLock::EOrderNone)
59 iLock = TUint64(aOrder)<<48; // byte 6 = 00-1F for interrupt, 20-3F for preemption
60 // byte 7 = FF if not held
64 /** Get the frequency of counter queried by NKern::Timestamp().
66 EXPORT_C TUint32 NKern::TimestampFrequency()
68 return VIB->iTimestampFreq;