Subversion Repositories HelenOS

Rev

Rev 2071 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29 jermar 1
/*
2071 jermar 2
 * Copyright (c) 2005 Jakub Jermar
29 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
 
1888 jermar 29
/** @addtogroup genarch
1702 cejka 30
 * @{
31
 */
32
/** @file
33
 */
34
 
1888 jermar 35
#ifndef KERN_MADT_H_
36
#define KERN_MADT_H_
29 jermar 37
 
452 decky 38
#include <genarch/acpi/acpi.h>
34 jermar 39
#include <arch/smp/apic.h>
129 jermar 40
#include <arch/smp/smp.h>
29 jermar 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
 
34 jermar 55
struct madt_apic_header {
1780 jermar 56
    uint8_t type;
57
    uint8_t length;
34 jermar 58
} __attribute__ ((packed));
59
 
60
 
61
/* Multiple APIC Description Table */
62
struct acpi_madt {
63
    struct acpi_sdt_header header;
1780 jermar 64
    uint32_t l_apic_address;
65
    uint32_t flags;
34 jermar 66
    struct madt_apic_header apic_header[];
67
} __attribute__ ((packed));
68
 
69
struct madt_l_apic {
70
    struct madt_apic_header header;
1780 jermar 71
    uint8_t acpi_id;
72
    uint8_t apic_id;
73
    uint32_t flags;
29 jermar 74
} __attribute__ ((packed));
75
 
76
struct madt_io_apic {
34 jermar 77
    struct madt_apic_header header;
1780 jermar 78
    uint8_t io_apic_id;
79
    uint8_t reserved;
80
    uint32_t io_apic_address;  
81
    uint32_t global_intr_base;
29 jermar 82
} __attribute__ ((packed));
83
 
84
struct madt_intr_src_ovrd {
34 jermar 85
    struct madt_apic_header header;
1780 jermar 86
    uint8_t bus;
87
    uint8_t source;
88
    uint32_t global_int;
89
    uint16_t flags;
29 jermar 90
} __attribute__ ((packed));
91
 
92
struct madt_nmi_src {
34 jermar 93
    struct madt_apic_header header;
1780 jermar 94
    uint16_t flags;
95
    uint32_t global_intr;
29 jermar 96
} __attribute__ ((packed));
97
 
98
struct madt_l_apic_nmi {
34 jermar 99
    struct madt_apic_header header;
1780 jermar 100
    uint8_t acpi_id;
101
    uint16_t flags;
102
    uint8_t l_apic_lint;
29 jermar 103
} __attribute__ ((packed));
104
 
105
struct madt_l_apic_addr_ovrd {
34 jermar 106
    struct madt_apic_header header;
1780 jermar 107
    uint16_t reserved;
108
    uint64_t l_apic_address;
29 jermar 109
} __attribute__ ((packed));
110
 
111
struct madt_io_sapic {
34 jermar 112
    struct madt_apic_header header;
1780 jermar 113
    uint8_t io_apic_id;
114
    uint8_t reserved;
115
    uint32_t global_intr_base;
116
    uint64_t io_apic_address;      
29 jermar 117
} __attribute__ ((packed));
118
 
119
struct madt_l_sapic {
34 jermar 120
    struct madt_apic_header header;
1780 jermar 121
    uint8_t acpi_id;
122
    uint8_t sapic_id;
123
    uint8_t sapic_eid;
124
    uint8_t reserved[3];
125
    uint32_t flags;
126
    uint32_t acpi_processor_uid_value;
127
    uint8_t acpi_processor_uid_str[1];
29 jermar 128
} __attribute__ ((packed));
129
 
130
struct madt_platform_intr_src {
34 jermar 131
    struct madt_apic_header header;
1780 jermar 132
    uint16_t flags;
133
    uint8_t intr_type;
134
    uint8_t processor_id;
135
    uint8_t processor_eid;
136
    uint8_t io_sapic_vector;
137
    uint32_t global_intr;
138
    uint32_t platform_intr_src_flags;
29 jermar 139
} __attribute__ ((packed));
140
 
141
extern struct acpi_madt *acpi_madt;
129 jermar 142
extern struct smp_config_operations madt_config_operations;
29 jermar 143
 
34 jermar 144
extern void acpi_madt_parse(void);
145
 
1888 jermar 146
#endif /* KERN_MADT_H_ */
1702 cejka 147
 
1888 jermar 148
/** @}
1702 cejka 149
 */