omap3530/assp/inc/locks.h
changeset 0 6663340f3fc9
equal deleted inserted replaced
-1:000000000000 0:6663340f3fc9
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __95_locks_h__
       
    17 #define __95_locks_h__
       
    18 
       
    19 /**
       
    20 @publishedPartner
       
    21 @prototype
       
    22 */
       
    23 #define __SPIN_LOCK_IRQ_R(lock)					((void)NKern::DisableAllInterrupts())
       
    24 
       
    25 /**
       
    26 @publishedPartner
       
    27 @prototype
       
    28 */
       
    29 #define __SPIN_UNLOCK_IRQ_R(lock)				(NKern::EnableAllInterrupts())
       
    30 
       
    31 /**
       
    32 @publishedPartner
       
    33 @prototype
       
    34 */
       
    35 #define __SPIN_FLASH_IRQ_R(lock)				(NKern::EnableAllInterrupts(),(void)NKern::DisableAllInterrupts(),((TBool)TRUE))
       
    36 
       
    37 /**
       
    38 @publishedPartner
       
    39 @prototype
       
    40 */
       
    41 #define __SPIN_LOCK_IRQ_W(lock)					((void)NKern::DisableAllInterrupts())
       
    42 
       
    43 /**
       
    44 @publishedPartner
       
    45 @prototype
       
    46 */
       
    47 #define __SPIN_UNLOCK_IRQ_W(lock)				(NKern::EnableAllInterrupts())
       
    48 
       
    49 /**
       
    50 @publishedPartner
       
    51 @prototype
       
    52 */
       
    53 #define __SPIN_FLASH_IRQ_W(lock)				(NKern::EnableAllInterrupts(),(void)NKern::DisableAllInterrupts(),((TBool)TRUE))
       
    54 
       
    55 
       
    56 /**
       
    57 @publishedPartner
       
    58 @prototype
       
    59 */
       
    60 #define __SPIN_LOCK_R(lock)						
       
    61 
       
    62 /**
       
    63 @publishedPartner
       
    64 @prototype
       
    65 */
       
    66 #define __SPIN_UNLOCK_R(lock)					
       
    67 
       
    68 /**
       
    69 @internalComponent
       
    70 */
       
    71 #define __SPIN_FLASH_R(lock)					((TBool)FALSE)
       
    72 
       
    73 /**
       
    74 @publishedPartner
       
    75 @prototype
       
    76 */
       
    77 #define __SPIN_LOCK_W(lock)						
       
    78 
       
    79 /**
       
    80 @publishedPartner
       
    81 @prototype
       
    82 */
       
    83 #define __SPIN_UNLOCK_W(lock)					
       
    84 
       
    85 /**
       
    86 @internalComponent
       
    87 */
       
    88 #define __SPIN_FLASH_W(lock)					((TBool)FALSE)
       
    89 
       
    90 
       
    91 /**
       
    92 @publishedPartner
       
    93 @prototype
       
    94 */
       
    95 #define __SPIN_LOCK_IRQSAVE_R(lock)				(NKern::DisableAllInterrupts())
       
    96 
       
    97 /**
       
    98 @publishedPartner
       
    99 @prototype
       
   100 */
       
   101 #define __SPIN_UNLOCK_IRQRESTORE_R(lock,irq)	(NKern::RestoreInterrupts(irq))
       
   102 
       
   103 /**
       
   104 @publishedPartner
       
   105 @prototype
       
   106 */
       
   107 #define __SPIN_FLASH_IRQRESTORE_R(lock,irq)		(NKern::RestoreInterrupts(irq),((void)NKern::DisableAllInterrupts()),((TBool)TRUE))
       
   108 
       
   109 /**
       
   110 @publishedPartner
       
   111 @prototype
       
   112 */
       
   113 #define __SPIN_LOCK_IRQSAVE_W(lock)				(NKern::DisableAllInterrupts())
       
   114 
       
   115 /**
       
   116 @publishedPartner
       
   117 @prototype
       
   118 */
       
   119 #define __SPIN_UNLOCK_IRQRESTORE_W(lock,irq)	(NKern::RestoreInterrupts(irq))
       
   120 
       
   121 /**
       
   122 @publishedPartner
       
   123 @prototype
       
   124 */
       
   125 #define __SPIN_FLASH_IRQRESTORE_W(lock,irq)		(NKern::RestoreInterrupts(irq),((void)NKern::DisableAllInterrupts()),((TBool)TRUE))
       
   126 
       
   127 
       
   128 /**
       
   129 @publishedPartner
       
   130 @prototype
       
   131 */
       
   132 #define __SPIN_FLASH_PREEMPT_R(lock)			((TBool)NKern::PreemptionPoint())
       
   133 
       
   134 /**
       
   135 @publishedPartner
       
   136 @prototype
       
   137 */
       
   138 #define __SPIN_FLASH_PREEMPT_W(lock)			((TBool)NKern::PreemptionPoint())
       
   139 
       
   140 #endif