1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 /* 26 * Copyright (c) 2010, Intel Corporation. 27 * All rights reserved. 28 */ 29 30 #ifndef _ACPI_FW_H 31 #define _ACPI_FW_H 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 extern void process_acpi_properties(); 38 39 #define ACPI_RSDP_SIG "RSD PTR " 40 #define ACPI_RSDP_SIG_LEN (8) 41 #define ACPI_TABLE_SIG_LEN (4) 42 #define ACPI_EBDA_SEG_ADDR (0x40e) 43 #define ACPI_EBDA_LEN (1024) 44 45 #pragma pack(1) 46 47 struct rsdp_v1 { 48 char sig[8]; 49 uint8_t checksum; 50 char oem_id[6]; 51 char revision; 52 uint32_t rsdt; 53 }; 54 55 struct rsdp { 56 struct rsdp_v1 v1; 57 uint32_t len; 58 uint64_t xsdt; 59 uint8_t ext_checksum; 60 char reserved[3]; 61 }; 62 63 struct table_header { 64 char sig[4]; 65 uint32_t len; 66 uint8_t revision; 67 uint8_t checksum; 68 char oem_id[6]; 69 char oem_table_id[8]; 70 uint32_t oem_revision; 71 uint32_t creator_id; 72 uint32_t creator_revision; 73 }; 74 75 struct xsdt { 76 struct table_header hdr; 77 union { 78 uint32_t r[1]; 79 uint64_t x[1]; 80 } p; 81 }; 82 83 84 #define MADT_PROCESSOR 0 85 86 struct madt_processor { 87 uint8_t type; 88 uint8_t len; 89 uint8_t acpi_processor_id; 90 uint8_t apic_id; 91 uint32_t flags; 92 }; 93 94 struct madt { 95 struct table_header hdr; 96 uint32_t lapic_addr; 97 uint32_t flags; 98 struct madt_processor list[1]; 99 }; 100 101 struct srat_processor { 102 uint8_t domain1; 103 uint8_t apic_id; 104 uint32_t flags; 105 uint8_t local_sapic_eid; 106 uint8_t domain2[3]; 107 uint8_t reserved[4]; 108 }; 109 110 struct srat_x2apic { 111 uint8_t reserved[2]; 112 uint32_t domain; 113 uint32_t x2apic_id; 114 uint32_t flags; 115 }; 116 117 struct srat_memory { 118 uint32_t domain; 119 uint8_t reserved1[2]; 120 uint64_t base_addr; 121 uint64_t len; 122 uint8_t reserved2[4]; 123 uint32_t flags; 124 uint8_t reserved3[8]; 125 }; 126 127 struct srat_item { 128 uint8_t type; 129 uint8_t len; 130 union { 131 struct srat_processor p; 132 struct srat_memory m; 133 struct srat_x2apic xp; 134 } i; 135 }; 136 137 struct srat { 138 struct table_header hdr; 139 uint32_t reserved1; 140 uint8_t reserved2[8]; 141 struct srat_item list[1]; 142 }; 143 144 #define SRAT_PROCESSOR (0) 145 #define SRAT_MEMORY (1) 146 #define SRAT_X2APIC (2) 147 148 #define SRAT_ENABLED (1) 149 #define SRAT_HOT_PLUG (2) 150 #define SRAT_NON_VOLATILE (4) 151 152 /* 153 * Pointer to System Resource Affinity Table (SRAT) 154 */ 155 extern struct srat *srat_ptr; 156 157 struct slit { 158 struct table_header hdr; 159 uint64_t number; 160 uint8_t entry[1]; 161 }; 162 163 /* 164 * Pointer to System Locality Information Table (SLIT) 165 */ 166 extern struct slit *slit_ptr; 167 168 struct msct_proximity_domain { 169 uint8_t revision; 170 uint8_t length; 171 uint32_t domain_min; 172 uint32_t domain_max; 173 uint32_t processor_max; 174 uint64_t memory_max; 175 }; 176 177 struct msct { 178 struct table_header hdr; 179 uint32_t proximity_domain_offset; 180 uint32_t maximum_proximity_domains; 181 uint32_t maximum_power_domains; 182 uint64_t maximum_physical_address; 183 }; 184 185 /* 186 * Pointer to Maximum System Capability Table (MSCT) 187 */ 188 extern struct msct *msct_ptr; 189 190 struct cfg_base_addr_alloc { 191 uint64_t base_addr; 192 uint16_t segment; 193 uint8_t start_bno; 194 uint8_t end_bno; 195 uint32_t reserved; 196 }; 197 198 struct mcfg { 199 char Signature[4]; 200 uint32_t Length; 201 uint8_t Revision; 202 uint8_t Checksum; 203 char OemId[6]; 204 char OemTableId[8]; 205 uint32_t OemRevision; 206 char CreatorId[4]; 207 uint32_t CreatorRevision; 208 uint8_t Reserved[8]; 209 struct cfg_base_addr_alloc CfgBaseAddrAllocList[1]; 210 }; 211 212 struct dmar { 213 struct table_header hdr; 214 uint8_t width; 215 uint8_t flags; 216 uint8_t rsvd[10]; 217 }; 218 219 220 /* 221 * Arbitrary limit on number of localities we handle; if 222 * this limit is raised to more than UINT16_MAX, make sure 223 * process_slit() knows how to handle it. 224 */ 225 #define SLIT_LOCALITIES_MAX (4096) 226 227 #define SLIT_NUM_PROPNAME "acpi-slit-localities" 228 #define SLIT_PROPNAME "acpi-slit" 229 230 #pragma pack() 231 232 #ifdef __cplusplus 233 } 234 #endif 235 236 #endif /* _ACPI_FW_H */ 237