source: rtems/cpukit/score/src/debugisthreaddispatchingallowed.c @ 2369b10

4.115
Last change on this file since 2369b10 was 3380ee8, checked in by Sebastian Huber <sebastian.huber@…>, on 04/22/14 at 05:46:53

score: Use common names for per-CPU variables

Use "cpu" for an arbitrary Per_CPU_Control variable.

Use "cpu_self" for the Per_CPU_Control of the current processor.

Use "cpu_index" for an arbitrary processor index.

Use "cpu_index_self" for the processor index of the current processor.

Use "cpu_count" for the processor count obtained via
_SMP_Get_processor_count().

Use "cpu_max" for the processor maximum obtained by
rtems_configuration_get_maximum_processors().

  • Property mode set to 100644
File size: 861 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.org/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/threaddispatch.h>
21
22#if defined( RTEMS_DEBUG )
23  bool _Debug_Is_thread_dispatching_allowed( void )
24  {
25    bool dispatch_allowed;
26    ISR_Level level;
27    Per_CPU_Control *cpu_self;
28
29    _ISR_Disable_without_giant( level );
30    cpu_self = _Per_CPU_Get_snapshot();
31    dispatch_allowed = cpu_self->thread_dispatch_disable_level == 0;
32    _ISR_Enable_without_giant( level );
33
34    return dispatch_allowed;
35  }
36#endif
Note: See TracBrowser for help on using the repository browser.