Subversion Repositories HelenOS-historic

Rev

Rev 34 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
29 jermar 1
/*
2
 * Copyright (C) 2005 Jakub Jermar
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 *
9
 * - Redistributions of source code must retain the above copyright
10
 *   notice, this list of conditions and the following disclaimer.
11
 * - Redistributions in binary form must reproduce the above copyright
12
 *   notice, this list of conditions and the following disclaimer in the
13
 *   documentation and/or other materials provided with the distribution.
14
 * - The name of the author may not be used to endorse or promote products
15
 *   derived from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
 
29
#ifndef __MADT_H__
30
#define __MADT_H__
31
 
32
#include <arch/acpi/acpi.h>
33
 
34
/* Multiple APIC Description Table */
35
struct acpi_madt {
36
    struct acpi_sdt_header header;
37
    __u32 l_apic_address;
38
    __u32 flags;
39
    __u8  apic_strucure[];
40
} __attribute__ ((packed));
41
 
42
#define MADT_L_APIC         0
43
#define MADT_IO_APIC            1
44
#define MADT_INTR_SRC_OVRD      2
45
#define MADT_NMI_SRC            3
46
#define MADT_L_APIC_NMI         4
47
#define MADT_L_APIC_ADDR_OVRD       5
48
#define MADT_IO_SAPIC           6
49
#define MADT_L_SAPIC            7
50
#define MADT_PLATFORM_INTR_SRC      8
51
#define MADT_RESERVED_SKIP_BEGIN    9
52
#define MADT_RESERVED_SKIP_END      127
53
#define MADT_RESERVED_OEM_BEGIN     128
54
#define MADT_RESERVED_OEM_END       255
55
 
56
struct madt_l_apic {
57
    __u8 type;
58
    __u8 length;
59
    __u8 acpi_id;
60
    __u8 apic_id;
61
    __u32 flags;   
62
} __attribute__ ((packed));
63
 
64
struct madt_io_apic {
65
    __u8 type;
66
    __u8 length;
67
    __u8 io_apic_id;
68
    __u8 reserved;
69
    __u32 io_apic_address; 
70
    __u32 global_intr_base;
71
} __attribute__ ((packed));
72
 
73
struct madt_intr_src_ovrd {
74
    __u8 type;
75
    __u8 length;
76
    __u8 bus;
77
    __u8 source;
78
    __u32 global_intr;
79
    __u16 flags;
80
} __attribute__ ((packed));
81
 
82
struct madt_nmi_src {
83
    __u8 type;
84
    __u8 length;
85
    __u16 flags;
86
    __u32 global_intr;
87
} __attribute__ ((packed));
88
 
89
struct madt_l_apic_nmi {
90
    __u8 type;
91
    __u8 length;
92
    __u8 acpi_id;
93
    __u16 flags;
94
    __u8 l_apic_lint;
95
} __attribute__ ((packed));
96
 
97
struct madt_l_apic_addr_ovrd {
98
    __u8 type;
99
    __u8 length;
100
    __u16 reserved;
101
    __u64 l_apic_address;
102
} __attribute__ ((packed));
103
 
104
struct madt_io_sapic {
105
    __u8 type;
106
    __u8 length;
107
    __u8 io_apic_id;
108
    __u8 reserved;
109
    __u32 global_intr_base;
110
    __u64 io_apic_address;     
111
} __attribute__ ((packed));
112
 
113
struct madt_l_sapic {
114
    __u8 type;
115
    __u8 length;
116
    __u8 acpi_id;
117
    __u8 sapic_id;
118
    __u8 sapic_eid;
119
    __u8 reserved[3];
120
    __u32 flags;
121
    __u32 acpi_processor_uid_value;
122
    __u8 acpi_processor_uid_str[1];
123
} __attribute__ ((packed));
124
 
125
struct madt_platform_intr_src {
126
    __u8 type;
127
    __u8 length;
128
    __u16 flags;
129
    __u8 intr_type;
130
    __u8 processor_id;
131
    __u8 processor_eid;
132
    __u8 io_sapic_vector;
133
    __u32 global_intr;
134
    __u32 platform_intr_src_flags;
135
} __attribute__ ((packed));
136
 
137
extern struct acpi_madt *acpi_madt;
138
 
139
#endif /* __MADT_H__ */