sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\nkern\nk_old.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: sl@0: extern "C" { sl@0: sl@0: EXPORT_C TInt __old_LockedInc(TInt& aCount) sl@0: { return __e32_atomic_add_ord32(&aCount,1); } sl@0: sl@0: EXPORT_C TInt __old_LockedDec(TInt& aCount) sl@0: { return __e32_atomic_add_ord32(&aCount,0xffffffff); } sl@0: sl@0: EXPORT_C TInt __old_LockedAdd(TInt& aDest, TInt aSrc) sl@0: { return __e32_atomic_add_ord32(&aDest,aSrc); } sl@0: sl@0: EXPORT_C TInt64 __old_LockedInc64(TInt64& aCount) sl@0: { return __e32_atomic_add_ord64(&aCount,1); } sl@0: sl@0: EXPORT_C TInt64 __old_LockedDec64(TInt64& aCount) sl@0: { return __e32_atomic_add_ord64(&aCount,TUint64(TInt64(-1))); } sl@0: sl@0: EXPORT_C TInt64 __old_LockedAdd64(TInt64& aDest, TInt64 aSrc) sl@0: { return __e32_atomic_add_ord64(&aDest,aSrc); } sl@0: sl@0: EXPORT_C TUint32 __old_LockedSetClear(TUint32& aDest, TUint32 aClearMask, TUint32 aSetMask) sl@0: { return __e32_atomic_axo_ord32(&aDest,~(aClearMask|aSetMask),aSetMask); } sl@0: sl@0: EXPORT_C TUint16 __old_LockedSetClear16(TUint16& aDest, TUint16 aClearMask, TUint16 aSetMask) sl@0: { return __e32_atomic_axo_ord16(&aDest,TUint16(~(aClearMask|aSetMask)),aSetMask); } sl@0: sl@0: EXPORT_C TUint8 __old_LockedSetClear8(TUint8& aDest, TUint8 aClearMask, TUint8 aSetMask) sl@0: { return __e32_atomic_axo_ord8(&aDest,TUint8(~(aClearMask|aSetMask)),aSetMask); } sl@0: sl@0: EXPORT_C TInt __old_SafeInc(TInt& aCount) sl@0: { return __e32_atomic_tas_ord32(&aCount,1,1,0); } sl@0: sl@0: EXPORT_C TInt __old_SafeDec(TInt& aCount) sl@0: { return __e32_atomic_tas_ord32(&aCount,1,-1,0); } sl@0: sl@0: EXPORT_C TInt __old_AddIfGe(TInt& aCount, TInt aLimit, TInt aInc) sl@0: { return __e32_atomic_tas_ord32(&aCount,aLimit,aInc,0); } sl@0: sl@0: EXPORT_C TInt __old_AddIfLt(TInt& aCount, TInt aLimit, TInt aInc) sl@0: { return __e32_atomic_tas_ord32(&aCount,aLimit,0,aInc); } sl@0: sl@0: EXPORT_C TAny* __old_SafeSwap(TAny* aNewValue, TAny*& aPtr) sl@0: { return __e32_atomic_swp_ord_ptr(&aPtr, aNewValue); } sl@0: sl@0: EXPORT_C TUint8 __old_SafeSwap8(TUint8 aNewValue, TUint8& aPtr) sl@0: { return __e32_atomic_swp_ord8(&aPtr, aNewValue); } sl@0: sl@0: EXPORT_C TUint16 __old_SafeSwap16(TUint16 aNewValue, TUint16& aPtr) sl@0: { return __e32_atomic_swp_ord16(&aPtr, aNewValue); } sl@0: sl@0: EXPORT_C TBool __old_CompareAndSwap(TAny*& aPtr, TAny* aExpected, TAny* aNew) sl@0: { return __e32_atomic_cas_ord_ptr(&aPtr, &aExpected, aNew); } sl@0: sl@0: EXPORT_C TBool __old_CompareAndSwap8(TUint8& aPtr, TUint8 aExpected, TUint8 aNew) sl@0: { return __e32_atomic_cas_ord8(&aPtr, (TUint8*)&aExpected, (TUint8)aNew); } sl@0: sl@0: EXPORT_C TBool __old_CompareAndSwap16(TUint16& aPtr, TUint16 aExpected, TUint16 aNew) sl@0: { return __e32_atomic_cas_ord16(&aPtr, (TUint16*)&aExpected, (TUint16)aNew); } sl@0: sl@0: }