RTEMS: cpukit/score/cpu/i386/include/rtems/score/interrupts.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
interrupts.h
Go to the documentation of this file.
1
9/*
10 * COPYRIGHT (c) 1998 valette@crf.canon.fr
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 *
16 * Applications must not include this file directly.
17 */
18
28#ifndef _RTEMS_SCORE_INTERRUPTS_H
29#define _RTEMS_SCORE_INTERRUPTS_H
30
31#ifndef ASM
32
33struct __rtems_raw_irq_connect_data__;
34
35typedef void (*rtems_raw_irq_hdl) (void);
36typedef void (*rtems_raw_irq_enable) (const struct __rtems_raw_irq_connect_data__*);
37typedef void (*rtems_raw_irq_disable) (const struct __rtems_raw_irq_connect_data__*);
38typedef int (*rtems_raw_irq_is_enabled) (const struct __rtems_raw_irq_connect_data__*);
39
45#if !defined(I386_DISABLE_INLINE_ISR_DISABLE_ENABLE)
46#define i386_disable_interrupts( _level ) \
47 { \
48 __asm__ volatile ( "pushf ; \
49 cli ; \
50 pop %0" \
51 : "=rm" ((_level)) \
52 ); \
53 }
54
55#define i386_enable_interrupts( _level ) \
56 { \
57 __asm__ volatile ( "push %0 ; \
58 popf" \
59 : : "rm" ((_level)) : "cc" \
60 ); \
61 }
62
63#define i386_flash_interrupts( _level ) \
64 { \
65 __asm__ volatile ( "push %0 ; \
66 popf ; \
67 cli" \
68 : : "rm" ((_level)) : "cc" \
69 ); \
70 }
71
72#define i386_get_interrupt_level( _level ) \
73 do { \
74 uint32_t _eflags; \
75 \
76 __asm__ volatile ( "pushf ; \
77 pop %0" \
78 : "=rm" ((_eflags)) \
79 ); \
80 \
81 _level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
82 } while (0)
83#else
84uint32_t i386_disable_interrupts( void );
85void i386_enable_interrupts(uint32_t level);
86void i386_flash_interrupts(uint32_t level);
87void i386_set_interrupt_level(uint32_t new_level);
88uint32_t i386_get_interrupt_level( void );
89#endif /* PARAVIRT */
90
94#endif
95#endif
__rtems_raw_irq_connect_data__
Definition: i386.h:361