source: rtems/c/src/exec/score/cpu/i386/rtems/score/interrupts.h @ a324355

4.104.114.84.95
Last change on this file since a324355 was a324355, checked in by Joel Sherrill <joel.sherrill@…>, on 04/12/02 at 15:08:13

2002-03-29 Ralf Corsepius <corsepiu@…>

  • rtems/score/idtr.h: New file, extracted from libcpu/cpu.h.
  • rtems/score/interrupts.h: New file, extracted from libcpu/cpu.h.
  • rtems/score/registers.h: New file, moved from libcpu.
  • Makefile.am: Reflect changes above.
  • cpu.c: Don't include cpuModel.h, #include <rtems.h>, #include <rtems/score/i386types.h>, #include <rtems/score/idtr.h>.
  • rtems/score/cpu.h: Don't include libcpu/cpu.h. #include <rtems/score/interrupts.h>, #include <rtems/score/registers.h>.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  i386 interrupt macros.
3 *
4 *  Formerly contained in and extracted from libcpu/i386/cpu.h
5 *
6 *  COPYRIGHT (c) 1998 valette@crf.canon.fr
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 *
14 *  Applications must not include this file directly.
15 */
16
17#ifndef _rtems_score_interrupts_h
18#define _rtems_score_interrupts_h
19
20#ifndef ASM
21
22struct  __rtems_raw_irq_connect_data__;
23
24typedef void (*rtems_raw_irq_hdl)               (void);
25typedef void (*rtems_raw_irq_enable)            (const struct __rtems_raw_irq_connect_data__*);
26typedef void (*rtems_raw_irq_disable)           (const struct __rtems_raw_irq_connect_data__*);
27typedef int  (*rtems_raw_irq_is_enabled)        (const struct __rtems_raw_irq_connect_data__*);
28
29/*
30 *  Interrupt Level Macros
31 */
32
33#define i386_disable_interrupts( _level ) \
34  { \
35    asm volatile ( "pushf ; \
36                    cli ; \
37                    pop %0" \
38                   : "=rm" ((_level)) \
39    ); \
40  }
41
42#define i386_enable_interrupts( _level )  \
43  { \
44    asm volatile ( "push %0 ; \
45                    popf" \
46                    : : "rm" ((_level)) : "cc" \
47    ); \
48  }
49
50#define i386_flash_interrupts( _level ) \
51  { \
52    asm volatile ( "push %0 ; \
53                    popf ; \
54                    cli" \
55                    : : "rm" ((_level)) : "cc" \
56    ); \
57  }
58
59#define i386_get_interrupt_level( _level ) \
60  do { \
61    register unsigned32 _eflags; \
62    \
63    asm volatile ( "pushf ; \
64                    pop %0" \
65                    : "=rm" ((_eflags)) \
66    ); \
67    \
68    _level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
69  } while (0)
70
71#define _CPU_ISR_Disable( _level ) i386_disable_interrupts( _level )
72#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
73     
74#endif
75#endif
Note: See TracBrowser for help on using the repository browser.