Subversion Repositories HelenOS-historic

Rev

Rev 534 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 534 Rev 1702
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
 /** @addtogroup genarch   
-
 
30
 * @{
-
 
31
 */
-
 
32
/** @file
-
 
33
 */
-
 
34
 
29
#ifndef __MADT_H__
35
#ifndef __MADT_H__
30
#define __MADT_H__
36
#define __MADT_H__
31
 
37
 
32
#include <genarch/acpi/acpi.h>
38
#include <genarch/acpi/acpi.h>
33
#include <arch/smp/apic.h>
39
#include <arch/smp/apic.h>
34
#include <arch/smp/smp.h>
40
#include <arch/smp/smp.h>
35
 
41
 
36
#define MADT_L_APIC         0
42
#define MADT_L_APIC         0
37
#define MADT_IO_APIC            1
43
#define MADT_IO_APIC            1
38
#define MADT_INTR_SRC_OVRD      2
44
#define MADT_INTR_SRC_OVRD      2
39
#define MADT_NMI_SRC            3
45
#define MADT_NMI_SRC            3
40
#define MADT_L_APIC_NMI         4
46
#define MADT_L_APIC_NMI         4
41
#define MADT_L_APIC_ADDR_OVRD       5
47
#define MADT_L_APIC_ADDR_OVRD       5
42
#define MADT_IO_SAPIC           6
48
#define MADT_IO_SAPIC           6
43
#define MADT_L_SAPIC            7
49
#define MADT_L_SAPIC            7
44
#define MADT_PLATFORM_INTR_SRC      8
50
#define MADT_PLATFORM_INTR_SRC      8
45
#define MADT_RESERVED_SKIP_BEGIN    9
51
#define MADT_RESERVED_SKIP_BEGIN    9
46
#define MADT_RESERVED_SKIP_END      127
52
#define MADT_RESERVED_SKIP_END      127
47
#define MADT_RESERVED_OEM_BEGIN     128
53
#define MADT_RESERVED_OEM_BEGIN     128
48
 
54
 
49
struct madt_apic_header {
55
struct madt_apic_header {
50
    __u8 type;
56
    __u8 type;
51
    __u8 length;
57
    __u8 length;
52
} __attribute__ ((packed));
58
} __attribute__ ((packed));
53
 
59
 
54
 
60
 
55
/* Multiple APIC Description Table */
61
/* Multiple APIC Description Table */
56
struct acpi_madt {
62
struct acpi_madt {
57
    struct acpi_sdt_header header;
63
    struct acpi_sdt_header header;
58
    __u32 l_apic_address;
64
    __u32 l_apic_address;
59
    __u32 flags;
65
    __u32 flags;
60
    struct madt_apic_header apic_header[];
66
    struct madt_apic_header apic_header[];
61
} __attribute__ ((packed));
67
} __attribute__ ((packed));
62
 
68
 
63
struct madt_l_apic {
69
struct madt_l_apic {
64
    struct madt_apic_header header;
70
    struct madt_apic_header header;
65
    __u8 acpi_id;
71
    __u8 acpi_id;
66
    __u8 apic_id;
72
    __u8 apic_id;
67
    __u32 flags;   
73
    __u32 flags;   
68
} __attribute__ ((packed));
74
} __attribute__ ((packed));
69
 
75
 
70
struct madt_io_apic {
76
struct madt_io_apic {
71
    struct madt_apic_header header;
77
    struct madt_apic_header header;
72
    __u8 io_apic_id;
78
    __u8 io_apic_id;
73
    __u8 reserved;
79
    __u8 reserved;
74
    __u32 io_apic_address; 
80
    __u32 io_apic_address; 
75
    __u32 global_intr_base;
81
    __u32 global_intr_base;
76
} __attribute__ ((packed));
82
} __attribute__ ((packed));
77
 
83
 
78
struct madt_intr_src_ovrd {
84
struct madt_intr_src_ovrd {
79
    struct madt_apic_header header;
85
    struct madt_apic_header header;
80
    __u8 bus;
86
    __u8 bus;
81
    __u8 source;
87
    __u8 source;
82
    __u32 global_int;
88
    __u32 global_int;
83
    __u16 flags;
89
    __u16 flags;
84
} __attribute__ ((packed));
90
} __attribute__ ((packed));
85
 
91
 
86
struct madt_nmi_src {
92
struct madt_nmi_src {
87
    struct madt_apic_header header;
93
    struct madt_apic_header header;
88
    __u16 flags;
94
    __u16 flags;
89
    __u32 global_intr;
95
    __u32 global_intr;
90
} __attribute__ ((packed));
96
} __attribute__ ((packed));
91
 
97
 
92
struct madt_l_apic_nmi {
98
struct madt_l_apic_nmi {
93
    struct madt_apic_header header;
99
    struct madt_apic_header header;
94
    __u8 acpi_id;
100
    __u8 acpi_id;
95
    __u16 flags;
101
    __u16 flags;
96
    __u8 l_apic_lint;
102
    __u8 l_apic_lint;
97
} __attribute__ ((packed));
103
} __attribute__ ((packed));
98
 
104
 
99
struct madt_l_apic_addr_ovrd {
105
struct madt_l_apic_addr_ovrd {
100
    struct madt_apic_header header;
106
    struct madt_apic_header header;
101
    __u16 reserved;
107
    __u16 reserved;
102
    __u64 l_apic_address;
108
    __u64 l_apic_address;
103
} __attribute__ ((packed));
109
} __attribute__ ((packed));
104
 
110
 
105
struct madt_io_sapic {
111
struct madt_io_sapic {
106
    struct madt_apic_header header;
112
    struct madt_apic_header header;
107
    __u8 io_apic_id;
113
    __u8 io_apic_id;
108
    __u8 reserved;
114
    __u8 reserved;
109
    __u32 global_intr_base;
115
    __u32 global_intr_base;
110
    __u64 io_apic_address;     
116
    __u64 io_apic_address;     
111
} __attribute__ ((packed));
117
} __attribute__ ((packed));
112
 
118
 
113
struct madt_l_sapic {
119
struct madt_l_sapic {
114
    struct madt_apic_header header;
120
    struct madt_apic_header header;
115
    __u8 acpi_id;
121
    __u8 acpi_id;
116
    __u8 sapic_id;
122
    __u8 sapic_id;
117
    __u8 sapic_eid;
123
    __u8 sapic_eid;
118
    __u8 reserved[3];
124
    __u8 reserved[3];
119
    __u32 flags;
125
    __u32 flags;
120
    __u32 acpi_processor_uid_value;
126
    __u32 acpi_processor_uid_value;
121
    __u8 acpi_processor_uid_str[1];
127
    __u8 acpi_processor_uid_str[1];
122
} __attribute__ ((packed));
128
} __attribute__ ((packed));
123
 
129
 
124
struct madt_platform_intr_src {
130
struct madt_platform_intr_src {
125
    struct madt_apic_header header;
131
    struct madt_apic_header header;
126
    __u16 flags;
132
    __u16 flags;
127
    __u8 intr_type;
133
    __u8 intr_type;
128
    __u8 processor_id;
134
    __u8 processor_id;
129
    __u8 processor_eid;
135
    __u8 processor_eid;
130
    __u8 io_sapic_vector;
136
    __u8 io_sapic_vector;
131
    __u32 global_intr;
137
    __u32 global_intr;
132
    __u32 platform_intr_src_flags;
138
    __u32 platform_intr_src_flags;
133
} __attribute__ ((packed));
139
} __attribute__ ((packed));
134
 
140
 
135
extern struct acpi_madt *acpi_madt;
141
extern struct acpi_madt *acpi_madt;
136
extern struct smp_config_operations madt_config_operations;
142
extern struct smp_config_operations madt_config_operations;
137
 
143
 
138
extern void acpi_madt_parse(void);
144
extern void acpi_madt_parse(void);
139
 
145
 
140
#endif /* __MADT_H__ */
146
#endif /* __MADT_H__ */
-
 
147
 
-
 
148
 /** @}
-
 
149
 */
-
 
150
 
141
 
151