source: rtems/cpukit/score/src/debugisthreaddispatchingallowed.c @ ff25926

4.115
Last change on this file since ff25926 was ff25926, checked in by Sebastian Huber <sebastian.huber@…>, on 03/18/14 at 10:49:38

score: Delete _Assert_Thread_dispatching_repressed

Add _Debug_Is_thread_dispatching_allowed(). This makes it possible to
assert the opposite.

Use _ISR_Disable_without_giant()/_ISR_Enable_without_giant() to avoid
misleading secondary assertion failures.

  • Property mode set to 100644
File size: 942 bytes
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.com/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/score/assert.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/threaddispatch.h>
22
23#if defined( RTEMS_DEBUG )
24  bool _Debug_Is_thread_dispatching_allowed( void )
25  {
26    bool dispatch_allowed;
27    ISR_Level level;
28    Per_CPU_Control *per_cpu;
29
30    _ISR_Disable_without_giant( level );
31    per_cpu = _Per_CPU_Get_by_index( _SMP_Get_current_processor() );
32    dispatch_allowed = per_cpu->thread_dispatch_disable_level == 0;
33    _ISR_Enable_without_giant( level );
34
35    return dispatch_allowed && _ISR_Get_level() == 0;
36  }
37#endif
Note: See TracBrowser for help on using the repository browser.