L4Re - L4 Runtime Environment
irq.h
Go to the documentation of this file.
1 
10 /*
11  * (c) 2003-2009 Author(s)
12  * economic rights: Technische Universit├Ąt Dresden (Germany)
13  * This file is part of TUD:OS and distributed under the terms of the
14  * GNU Lesser General Public License 2.1.
15  * Please see the COPYING-LGPL-2.1 file for details.
16  */
17 
18 #ifndef __L4_IRQ_H__
19 #define __L4_IRQ_H__
20 
21 #include <l4/sys/compiler.h>
22 #include <l4/util/port_io.h>
23 
25 
29 L4_INLINE void
30 l4util_irq_acknowledge(unsigned int irq);
31 
34 static inline void
35 l4util_cli (void)
36 {
37  __asm__ __volatile__ ("cli" : : : "memory");
38 }
39 
42 static inline void
43 l4util_sti (void)
44 {
45  __asm__ __volatile__ ("sti" : : : "memory");
46 }
47 
51 static inline void
52 l4util_flags_save (l4_umword_t *flags)
53 {
54  __asm__ __volatile__ ("pushfl ; popl %0 " :"=g" (*flags) : :"memory");
55 }
56 
59 static inline void
60 l4util_flags_restore (l4_umword_t *flags)
61 {
62  __asm__ __volatile__ ("pushl %0 ; popfl" : :"g" (*flags) : "memory");
63 }
64 
65 L4_INLINE void
66 l4util_irq_acknowledge(unsigned int irq)
67 {
68  if (irq > 7)
69  {
70  l4util_out8(0x60+(irq & 7), 0xA0);
71  l4util_out8(0x0B,0xA0);
72  if (l4util_in8(0xA0) == 0)
73  l4util_out8(0x60 + 2, 0x20);
74  }
75  else
76  l4util_out8(0x60+irq, 0x20); /* acknowledge the irq */
77 };
78 
80 
81 #endif
void l4util_irq_acknowledge(unsigned int irq)
Acknowledge IRQ at PIC in fully special nested mode.
Definition: irq.h:66
#define EXTERN_C_END
End section with C types and functions.
Definition: compiler.h:187
void l4util_out8(l4_uint8_t value, l4_uint16_t port)
Write byte to I/O port.
Definition: port_io.h:223
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
#define EXTERN_C_BEGIN
Start section with C types and functions.
Definition: compiler.h:186
l4_uint8_t l4util_in8(l4_uint16_t port)
Read byte from I/O port.
Definition: port_io.h:172