source: mainline/kernel/genarch/include/acpi/madt.h@ 609cbf8

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 609cbf8 was 49eb681, checked in by Martin Decky <martin@…>, 15 years ago

code cleanup (no change in functionality)

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