L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
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
29L4_INLINE void
30l4util_irq_acknowledge(unsigned int irq);
31
34static inline void
35l4util_cli (void)
36{
37 __asm__ __volatile__ ("cli" : : : "memory");
38}
39
42static inline void
43l4util_sti (void)
44{
45 __asm__ __volatile__ ("sti" : : : "memory");
46}
47
51static inline void
52l4util_flags_save (l4_umword_t *flags)
53{
54 __asm__ __volatile__ ("pushf ; popq %0 " :"=g" (*flags) : :"memory");
55}
56
59static inline void
60l4util_flags_restore (l4_umword_t *flags)
61{
62 __asm__ __volatile__ ("pushq %0 ; popf" : :"g" (*flags) : "memory");
63}
64
65L4_INLINE void
66l4util_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
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62
#define EXTERN_C_BEGIN
Start section with C types and functions.
Definition compiler.h:192
#define EXTERN_C_END
End section with C types and functions.
Definition compiler.h:193
void l4util_out8(l4_uint8_t value, l4_uint16_t port)
Write byte to I/O port.
Definition port_io.h:223
l4_uint8_t l4util_in8(l4_uint16_t port)
Read byte from I/O port.
Definition port_io.h:172