source: rtems/cpukit/score/include/rtems/score/assert.h @ 40883773

4.115
Last change on this file since 40883773 was 40883773, checked in by Sebastian Huber <sebastian.huber@…>, on 06/18/13 at 12:57:19

score: Add _Assert_Thread_dispatching_repressed()

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 */
14
15#ifndef _RTEMS_SCORE_ASSERT_H
16#define _RTEMS_SCORE_ASSERT_H
17
18#include <rtems/score/basedefs.h>
19
20#if defined( RTEMS_DEBUG )
21  #include <assert.h>
22#endif
23
24#ifdef __cplusplus
25extern "C" {
26#endif /* __cplusplus */
27
28/**
29 * @brief Assertion similar to assert() controlled via RTEMS_DEBUG instead of
30 * NDEBUG.
31 */
32#if defined( RTEMS_DEBUG )
33  #define _Assert( _e ) \
34    ( ( _e ) ? \
35      ( void ) 0 : \
36        __assert_func( __FILE__, __LINE__, __ASSERT_FUNC, #_e ) )
37#else
38  #define _Assert( _e ) ( ( void ) 0 )
39#endif
40
41/**
42 * @brief Asserts that thread dispatching is repressed.
43 *
44 * Thread dispatching can be repressed via _Thread_Disable_dispatch() or
45 * _ISR_Disable().
46 */
47#if defined( RTEMS_DEBUG )
48  void _Assert_Thread_dispatching_repressed( void );
49#else
50  #define _Assert_Thread_dispatching_repressed() ( ( void ) 0 )
51#endif
52
53#ifdef __cplusplus
54}
55#endif /* __cplusplus */
56
57#endif /* _RTEMS_SCORE_ASSERT_H */
Note: See TracBrowser for help on using the repository browser.