1 // Copyright (c) 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 #ifndef __95_locks_h__
17 #define __95_locks_h__
23 #define __SPIN_LOCK_IRQ_R(lock) ((void)NKern::DisableAllInterrupts())
29 #define __SPIN_UNLOCK_IRQ_R(lock) (NKern::EnableAllInterrupts())
35 #define __SPIN_FLASH_IRQ_R(lock) (NKern::EnableAllInterrupts(),(void)NKern::DisableAllInterrupts(),((TBool)TRUE))
41 #define __SPIN_LOCK_IRQ_W(lock) ((void)NKern::DisableAllInterrupts())
47 #define __SPIN_UNLOCK_IRQ_W(lock) (NKern::EnableAllInterrupts())
53 #define __SPIN_FLASH_IRQ_W(lock) (NKern::EnableAllInterrupts(),(void)NKern::DisableAllInterrupts(),((TBool)TRUE))
60 #define __SPIN_LOCK_R(lock)
66 #define __SPIN_UNLOCK_R(lock)
71 #define __SPIN_FLASH_R(lock) ((TBool)FALSE)
77 #define __SPIN_LOCK_W(lock)
83 #define __SPIN_UNLOCK_W(lock)
88 #define __SPIN_FLASH_W(lock) ((TBool)FALSE)
95 #define __SPIN_LOCK_IRQSAVE_R(lock) (NKern::DisableAllInterrupts())
101 #define __SPIN_UNLOCK_IRQRESTORE_R(lock,irq) (NKern::RestoreInterrupts(irq))
107 #define __SPIN_FLASH_IRQRESTORE_R(lock,irq) (NKern::RestoreInterrupts(irq),((void)NKern::DisableAllInterrupts()),((TBool)TRUE))
113 #define __SPIN_LOCK_IRQSAVE_W(lock) (NKern::DisableAllInterrupts())
119 #define __SPIN_UNLOCK_IRQRESTORE_W(lock,irq) (NKern::RestoreInterrupts(irq))
125 #define __SPIN_FLASH_IRQRESTORE_W(lock,irq) (NKern::RestoreInterrupts(irq),((void)NKern::DisableAllInterrupts()),((TBool)TRUE))
132 #define __SPIN_FLASH_PREEMPT_R(lock) ((TBool)NKern::PreemptionPoint())
138 #define __SPIN_FLASH_PREEMPT_W(lock) ((TBool)NKern::PreemptionPoint())