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