tables.c (c441bfb5f2866de71e092c1b9d866a65978dfe1a) | tables.c (cefc7ca46235f01d5233e3abd4b79452af01d9e9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * acpi_tables.c - ACPI Boot-Time Table Parsing 4 * 5 * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 6 */ 7 8/* Uncomment next line to get verbose printout */ --- 25 unchanged lines hidden (view full) --- 34 35static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; 36 37static int acpi_apic_instance __initdata; 38 39enum acpi_subtable_type { 40 ACPI_SUBTABLE_COMMON, 41 ACPI_SUBTABLE_HMAT, | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * acpi_tables.c - ACPI Boot-Time Table Parsing 4 * 5 * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 6 */ 7 8/* Uncomment next line to get verbose printout */ --- 25 unchanged lines hidden (view full) --- 34 35static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; 36 37static int acpi_apic_instance __initdata; 38 39enum acpi_subtable_type { 40 ACPI_SUBTABLE_COMMON, 41 ACPI_SUBTABLE_HMAT, |
42 ACPI_SUBTABLE_PRMT, |
|
42}; 43 44struct acpi_subtable_entry { 45 union acpi_subtable_headers *hdr; 46 enum acpi_subtable_type type; 47}; 48 49/* --- 167 unchanged lines hidden (view full) --- 217static unsigned long __init 218acpi_get_entry_type(struct acpi_subtable_entry *entry) 219{ 220 switch (entry->type) { 221 case ACPI_SUBTABLE_COMMON: 222 return entry->hdr->common.type; 223 case ACPI_SUBTABLE_HMAT: 224 return entry->hdr->hmat.type; | 43}; 44 45struct acpi_subtable_entry { 46 union acpi_subtable_headers *hdr; 47 enum acpi_subtable_type type; 48}; 49 50/* --- 167 unchanged lines hidden (view full) --- 218static unsigned long __init 219acpi_get_entry_type(struct acpi_subtable_entry *entry) 220{ 221 switch (entry->type) { 222 case ACPI_SUBTABLE_COMMON: 223 return entry->hdr->common.type; 224 case ACPI_SUBTABLE_HMAT: 225 return entry->hdr->hmat.type; |
226 case ACPI_SUBTABLE_PRMT: 227 return 0; |
|
225 } 226 return 0; 227} 228 229static unsigned long __init 230acpi_get_entry_length(struct acpi_subtable_entry *entry) 231{ 232 switch (entry->type) { 233 case ACPI_SUBTABLE_COMMON: 234 return entry->hdr->common.length; 235 case ACPI_SUBTABLE_HMAT: 236 return entry->hdr->hmat.length; | 228 } 229 return 0; 230} 231 232static unsigned long __init 233acpi_get_entry_length(struct acpi_subtable_entry *entry) 234{ 235 switch (entry->type) { 236 case ACPI_SUBTABLE_COMMON: 237 return entry->hdr->common.length; 238 case ACPI_SUBTABLE_HMAT: 239 return entry->hdr->hmat.length; |
240 case ACPI_SUBTABLE_PRMT: 241 return entry->hdr->prmt.length; |
|
237 } 238 return 0; 239} 240 241static unsigned long __init 242acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) 243{ 244 switch (entry->type) { 245 case ACPI_SUBTABLE_COMMON: 246 return sizeof(entry->hdr->common); 247 case ACPI_SUBTABLE_HMAT: 248 return sizeof(entry->hdr->hmat); | 242 } 243 return 0; 244} 245 246static unsigned long __init 247acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) 248{ 249 switch (entry->type) { 250 case ACPI_SUBTABLE_COMMON: 251 return sizeof(entry->hdr->common); 252 case ACPI_SUBTABLE_HMAT: 253 return sizeof(entry->hdr->hmat); |
254 case ACPI_SUBTABLE_PRMT: 255 return sizeof(entry->hdr->prmt); |
|
249 } 250 return 0; 251} 252 253static enum acpi_subtable_type __init 254acpi_get_subtable_type(char *id) 255{ 256 if (strncmp(id, ACPI_SIG_HMAT, 4) == 0) 257 return ACPI_SUBTABLE_HMAT; | 256 } 257 return 0; 258} 259 260static enum acpi_subtable_type __init 261acpi_get_subtable_type(char *id) 262{ 263 if (strncmp(id, ACPI_SIG_HMAT, 4) == 0) 264 return ACPI_SUBTABLE_HMAT; |
265 if (strncmp(id, ACPI_SIG_PRMT, 4) == 0) 266 return ACPI_SUBTABLE_PRMT; |
|
258 return ACPI_SUBTABLE_COMMON; 259} 260 261/** 262 * acpi_parse_entries_array - for each proc_num find a suitable subtable 263 * 264 * @id: table id (for debugging purposes) 265 * @table_size: size of the root table --- 612 unchanged lines hidden --- | 267 return ACPI_SUBTABLE_COMMON; 268} 269 270/** 271 * acpi_parse_entries_array - for each proc_num find a suitable subtable 272 * 273 * @id: table id (for debugging purposes) 274 * @table_size: size of the root table --- 612 unchanged lines hidden --- |