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

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 * Copyright (c) 2013-2014 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.org/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 Returns true if thread dispatching is allowed.
43 *
44 * Thread dispatching can be repressed via _Thread_Disable_dispatch() or
45 * _ISR_Disable().
46 */
47#if defined( RTEMS_DEBUG )
48  bool _Debug_Is_thread_dispatching_allowed( void );
49#endif
50
51/**
52 * @brief Returns true if the current thread of execution owns the giant lock.
53 */
54#if defined( RTEMS_DEBUG )
55  #if defined( RTEMS_SMP )
56    bool _Debug_Is_owner_of_giant( void );
57  #else
58    #define _Debug_Is_owner_of_giant() (true)
59  #endif
60#endif
61
62/**
63 * @brief Returns true if the current thread of execution owns the allocator
64 * mutex.
65 */
66#if defined( RTEMS_DEBUG )
67  bool _Debug_Is_owner_of_allocator( void );
68#endif
69
70/**
71 * @brief Asserts that this point is not reached during run-time.
72 */
73#define _Assert_Not_reached() _Assert( 0 )
74
75#ifdef __cplusplus
76}
77#endif /* __cplusplus */
78
79#endif /* _RTEMS_SCORE_ASSERT_H */
Note: See TracBrowser for help on using the repository browser.