RTEMS 6.1-rc6
Loading...
Searching...
No Matches
interrupts.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
13/*
14 * COPYRIGHT (c) 1998 valette@crf.canon.fr
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
47#ifndef _RTEMS_SCORE_INTERRUPTS_H
48#define _RTEMS_SCORE_INTERRUPTS_H
49
50#ifndef ASM
51
53
54typedef void (*rtems_raw_irq_hdl) (void);
55typedef void (*rtems_raw_irq_enable) (const struct __rtems_raw_irq_connect_data__*);
56typedef void (*rtems_raw_irq_disable) (const struct __rtems_raw_irq_connect_data__*);
57typedef int (*rtems_raw_irq_is_enabled) (const struct __rtems_raw_irq_connect_data__*);
58
64#if !defined(I386_DISABLE_INLINE_ISR_DISABLE_ENABLE)
65#define i386_disable_interrupts( _level ) \
66 { \
67 __asm__ volatile ( "pushf ; \
68 cli ; \
69 pop %0" \
70 : "=rm" ((_level)) \
71 ); \
72 }
73
74#define i386_enable_interrupts( _level ) \
75 { \
76 __asm__ volatile ( "push %0 ; \
77 popf" \
78 : : "rm" ((_level)) : "cc" \
79 ); \
80 }
81
82#define i386_flash_interrupts( _level ) \
83 { \
84 __asm__ volatile ( "push %0 ; \
85 popf ; \
86 cli" \
87 : : "rm" ((_level)) : "cc" \
88 ); \
89 }
90
91#define i386_get_interrupt_level( _level ) \
92 do { \
93 uint32_t _eflags; \
94 \
95 __asm__ volatile ( "pushf ; \
96 pop %0" \
97 : "=rm" ((_eflags)) \
98 ); \
99 \
100 _level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
101 } while (0)
102#else
103uint32_t i386_disable_interrupts( void );
104void i386_enable_interrupts(uint32_t level);
105void i386_flash_interrupts(uint32_t level);
106void i386_set_interrupt_level(uint32_t new_level);
107uint32_t i386_get_interrupt_level( void );
108#endif /* PARAVIRT */
109
113#endif
114#endif
Definition: i386.h:380