Changeset b8aa1c1 in rtems


Ignore:
Timestamp:
Mar 5, 2015, 8:53:09 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
5d428576
Parents:
5b5d2fd4
git-author:
Sebastian Huber <sebastian.huber@…> (03/05/15 08:53:09)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/05/15 10:22:48)
Message:

score: C/C++ compatibility macros for ISR locks

Update #2273.

Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/include/rtems/rtems/intr.h

    r5b5d2fd4 rb8aa1c1  
    166166
    167167/**
     168 * @brief Defines an interrupt lock member.
     169 *
     170 * Do not add a ';' after this macro.
     171 *
     172 * @param _designator The designator for the interrupt lock.
     173 */
     174#define RTEMS_INTERRUPT_LOCK_MEMBER( _designator ) \
     175  ISR_LOCK_MEMBER( _designator )
     176
     177/**
     178 * @brief Declares an interrupt lock variable.
     179 *
     180 * Do not add a ';' after this macro.
     181 *
     182 * @param _qualifier The qualifier for the interrupt lock, e.g. extern.
     183 * @param _designator The designator for the interrupt lock.
     184 */
     185#define RTEMS_INTERRUPT_LOCK_DECLARE( _qualifier, _designator ) \
     186  ISR_LOCK_DECLARE( _qualifier, _designator )
     187
     188/**
     189 * @brief Defines an interrupt lock variable.
     190 *
     191 * Do not add a ';' after this macro.
     192 *
     193 * @param _qualifier The qualifier for the interrupt lock, e.g. static.
     194 * @param _designator The designator for the interrupt lock.
     195 * @param _name The name for the interrupt lock.  It must be a string.  The
     196 * name is only used if profiling is enabled.
     197 */
     198#define RTEMS_INTERRUPT_LOCK_DEFINE( _qualifier, _designator, _name ) \
     199  ISR_LOCK_DEFINE( _qualifier, _designator, _name )
     200
     201/**
     202 * @brief Defines an interrupt lock variable reference.
     203 *
     204 * Do not add a ';' after this macro.
     205 *
     206 * @param _designator The designator for the interrupt lock reference.
     207 * @param _target The target for the interrupt lock reference.
     208 */
     209#define RTEMS_INTERRUPT_LOCK_REFERENCE( _designator, _target ) \
     210  ISR_LOCK_REFERENCE( _designator, _target )
     211
     212/**
    168213 * @brief Initializer for static initialization of interrupt locks.
    169214 *
  • cpukit/score/include/rtems/score/isrlock.h

    r5b5d2fd4 rb8aa1c1  
    88
    99/*
    10  * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
     10 * Copyright (c) 2013-2015 embedded brains GmbH.  All rights reserved.
    1111 *
    1212 *  embedded brains GmbH
     
    7272
    7373/**
    74  * @brief Defines an ISR lock.
     74 * @brief Defines an ISR lock member.
    7575 *
    7676 * Do not add a ';' after this macro.
     
    7979 */
    8080#if defined( RTEMS_SMP )
    81   #define ISR_LOCK_DEFINE( _designator ) ISR_lock_Control _designator;
    82 #else
    83   #define ISR_LOCK_DEFINE( _designator )
     81  #define ISR_LOCK_MEMBER( _designator ) ISR_lock_Control _designator;
     82#else
     83  #define ISR_LOCK_MEMBER( _designator )
     84#endif
     85
     86/**
     87 * @brief Declares an ISR lock variable.
     88 *
     89 * Do not add a ';' after this macro.
     90 *
     91 * @param _qualifier The qualifier for the interrupt lock, e.g. extern.
     92 * @param _designator The designator for the interrupt lock.
     93 */
     94#if defined( RTEMS_SMP )
     95  #define ISR_LOCK_DECLARE( _qualifier, _designator ) \
     96    _qualifier ISR_lock_Control _designator;
     97#else
     98  #define ISR_LOCK_DECLARE( _qualifier, _designator )
     99#endif
     100
     101/**
     102 * @brief Defines an ISR lock variable.
     103 *
     104 * Do not add a ';' after this macro.
     105 *
     106 * @param _qualifier The qualifier for the interrupt lock, e.g. static.
     107 * @param _designator The designator for the interrupt lock.
     108 * @param _name The name for the interrupt lock.  It must be a string.  The
     109 * name is only used if profiling is enabled.
     110 */
     111#if defined( RTEMS_SMP )
     112  #define ISR_LOCK_DEFINE( _qualifier, _designator, _name ) \
     113    _qualifier ISR_lock_Control _designator = { SMP_LOCK_INITIALIZER( _name ) };
     114#else
     115  #define ISR_LOCK_DEFINE( _qualifier, _designator, _name )
     116#endif
     117
     118/**
     119 * @brief Defines an ISR lock variable reference.
     120 *
     121 * Do not add a ';' after this macro.
     122 *
     123 * @param _designator The designator for the interrupt lock reference.
     124 * @param _target The target for the interrupt lock reference.
     125 */
     126#if defined( RTEMS_SMP )
     127  #define ISR_LOCK_REFERENCE( _designator, _target ) \
     128    ISR_lock_Control *_designator = _target;
     129#else
     130  #define ISR_LOCK_REFERENCE( _designator, _target )
    84131#endif
    85132
Note: See TracChangeset for help on using the changeset viewer.