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.
16 #include <plat_priv.h>
27 static TDfc CleanupDfc(TMemoryCleanup::Cleanup, NULL, 2);
29 static TMemoryCleanup* CleanupList = 0;
32 static TSpinLock CleanupLock(TSpinLock::EOrderEventHandlerList);
35 void TMemoryCleanup::Init2()
37 CleanupDfc.SetDfcQ(K::SvMsgQ);
41 void TMemoryCleanup::Add(TMemoryCleanupCallback aCallback, TAny* aArg)
43 __SPIN_LOCK_IRQ(CleanupLock);
47 __NK_ASSERT_DEBUG(iCallback==aCallback);
48 __SPIN_UNLOCK_IRQ(CleanupLock);
52 iCallback = aCallback;
56 __SPIN_UNLOCK_IRQ(CleanupLock);
62 void TMemoryCleanup::Cleanup(TAny* /*aDummy*/)
66 __SPIN_LOCK_IRQ(CleanupLock);
67 TMemoryCleanup* c = CleanupList;
70 __SPIN_UNLOCK_IRQ(CleanupLock);
74 CleanupList = c->iNext;
75 TMemoryCleanupCallback fn = c->iCallback;
78 __SPIN_UNLOCK_IRQ(CleanupLock);