irq.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef IRQ_H
22 #define IRQ_H
23 
24 #include <stdbool.h>
25 #include "cpu_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #ifdef IRQ_API_INLINED
32 #define MAYBE_INLINE static inline __attribute__((always_inline))
33 #else
34 #define MAYBE_INLINE
35 #endif /* IRQ_API_INLINED */
36 
46 MAYBE_INLINE unsigned irq_disable(void);
47 
57 MAYBE_INLINE unsigned irq_enable(void);
58 
68 MAYBE_INLINE void irq_restore(unsigned state);
69 
74 MAYBE_INLINE int irq_is_in(void);
75 
76 #ifdef IRQ_API_INLINED
77 #include "irq_arch.h"
78 #endif /* IRQ_API_INLINED */
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* IRQ_H */
85 
irq_enable
MAYBE_INLINE unsigned irq_enable(void)
This function clears the IRQ disable bit in the status register.
irq_disable
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
irq_is_in
MAYBE_INLINE int irq_is_in(void)
Check whether called from interrupt service routine.
irq_restore
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...