RTEMS
isrisinprogress.c
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2013-2015 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Dornierstr. 4
14  * 82178 Puchheim
15  * Germany
16  * <rtems@embedded-brains.de>
17  *
18  * The license and distribution terms for this file may be
19  * found in the file LICENSE in this distribution or at
20  * http://www.rtems.org/license/LICENSE.
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26 
27 #include <rtems/score/isr.h>
28 #include <rtems/score/percpu.h>
29 
30 #if CPU_PROVIDES_ISR_IS_IN_PROGRESS == FALSE
31 
32 bool _ISR_Is_in_progress( void )
33 {
34  uint32_t isr_nest_level;
35 
36  #if defined( RTEMS_SMP )
37  ISR_Level level;
38 
39  _ISR_Local_disable( level );
40  #endif
41 
42  isr_nest_level = _ISR_Nest_level;
43 
44  #if defined( RTEMS_SMP )
45  _ISR_Local_enable( level );
46  #endif
47 
48  return isr_nest_level != 0;
49 }
50 
51 #endif
bool _ISR_Is_in_progress(void)
Checks if an ISR in progress.
#define _ISR_Local_disable(_level)
Disables interrupts on this processor.
Definition: isrlevel.h:57
Data Related to the Management of Processor Interrupt Levels.
uint32_t ISR_Level
Definition: isrlevel.h:41
#define _ISR_Local_enable(_level)
Enables interrupts on this processor.
Definition: isrlevel.h:74