L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 * License: see LICENSE.spdx (in this directory or the directories above)
14 */
15
16#ifndef __L4_IRQ_H__
17#define __L4_IRQ_H__
18
19#include <l4/sys/compiler.h>
20#include <l4/util/port_io.h>
21
23
27L4_INLINE void
28l4util_irq_acknowledge(unsigned int irq);
29
32static inline void
33l4util_cli (void)
34{
35 __asm__ __volatile__ ("cli" : : : "memory");
36}
37
40static inline void
41l4util_sti (void)
42{
43 __asm__ __volatile__ ("sti" : : : "memory");
44}
45
49static inline void
50l4util_flags_save (l4_umword_t *flags)
51{
52 __asm__ __volatile__ ("pushfl ; popl %0 " :"=g" (*flags) : :"memory");
53}
54
57static inline void
58l4util_flags_restore (l4_umword_t *flags)
59{
60 __asm__ __volatile__ ("pushl %0 ; popfl" : :"g" (*flags) : "memory");
61}
62
63L4_INLINE void
64l4util_irq_acknowledge(unsigned int irq)
65{
66 if (irq > 7)
67 {
68 l4util_out8(0x60+(irq & 7), 0xA0);
69 l4util_out8(0x0B,0xA0);
70 if (l4util_in8(0xA0) == 0)
71 l4util_out8(0x60 + 2, 0x20);
72 }
73 else
74 l4util_out8(0x60+irq, 0x20); /* acknowledge the irq */
75};
76
78
79#endif
void l4util_irq_acknowledge(unsigned int irq)
Acknowledge IRQ at PIC in fully special nested mode.
Definition irq.h:64
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
#define __END_DECLS
End section with C types and functions.
Definition compiler.h:167
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
#define __BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:164
void l4util_out8(l4_uint8_t value, l4_uint16_t port)
Write byte to I/O port.
Definition port_io.h:221
l4_uint8_t l4util_in8(l4_uint16_t port)
Read byte from I/O port.
Definition port_io.h:170