tbfadt.c (233250) | tbfadt.c (235945) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: tbfadt - FADT table utilities 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 38 unchanged lines hidden (view full) --- 47#include <contrib/dev/acpica/include/accommon.h> 48#include <contrib/dev/acpica/include/actables.h> 49 50#define _COMPONENT ACPI_TABLES 51 ACPI_MODULE_NAME ("tbfadt") 52 53/* Local prototypes */ 54 | 1/****************************************************************************** 2 * 3 * Module Name: tbfadt - FADT table utilities 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 38 unchanged lines hidden (view full) --- 47#include <contrib/dev/acpica/include/accommon.h> 48#include <contrib/dev/acpica/include/actables.h> 49 50#define _COMPONENT ACPI_TABLES 51 ACPI_MODULE_NAME ("tbfadt") 52 53/* Local prototypes */ 54 |
55static ACPI_INLINE void | 55static void |
56AcpiTbInitGenericAddress ( 57 ACPI_GENERIC_ADDRESS *GenericAddress, 58 UINT8 SpaceId, 59 UINT8 ByteWidth, | 56AcpiTbInitGenericAddress ( 57 ACPI_GENERIC_ADDRESS *GenericAddress, 58 UINT8 SpaceId, 59 UINT8 ByteWidth, |
60 UINT64 Address); | 60 UINT64 Address, 61 char *RegisterName); |
61 62static void 63AcpiTbConvertFadt ( 64 void); 65 66static void 67AcpiTbValidateFadt ( 68 void); --- 128 unchanged lines hidden (view full) --- 197 * RETURN: None 198 * 199 * DESCRIPTION: Initialize a Generic Address Structure (GAS) 200 * See the ACPI specification for a full description and 201 * definition of this structure. 202 * 203 ******************************************************************************/ 204 | 62 63static void 64AcpiTbConvertFadt ( 65 void); 66 67static void 68AcpiTbValidateFadt ( 69 void); --- 128 unchanged lines hidden (view full) --- 198 * RETURN: None 199 * 200 * DESCRIPTION: Initialize a Generic Address Structure (GAS) 201 * See the ACPI specification for a full description and 202 * definition of this structure. 203 * 204 ******************************************************************************/ 205 |
205static ACPI_INLINE void | 206static void |
206AcpiTbInitGenericAddress ( 207 ACPI_GENERIC_ADDRESS *GenericAddress, 208 UINT8 SpaceId, 209 UINT8 ByteWidth, | 207AcpiTbInitGenericAddress ( 208 ACPI_GENERIC_ADDRESS *GenericAddress, 209 UINT8 SpaceId, 210 UINT8 ByteWidth, |
210 UINT64 Address) | 211 UINT64 Address, 212 char *RegisterName) |
211{ | 213{ |
214 UINT8 BitWidth; |
|
212 | 215 |
216 217 /* Bit width field in the GAS is only one byte long, 255 max */ 218 219 BitWidth = (UINT8) (ByteWidth * 8); 220 221 if (ByteWidth > 31) /* (31*8)=248 */ 222 { 223 ACPI_ERROR ((AE_INFO, 224 "%s - 32-bit FADT register is too long (%u bytes, %u bits) " 225 "to convert to GAS struct - 255 bits max, truncating", 226 RegisterName, ByteWidth, (ByteWidth * 8))); 227 228 BitWidth = 255; 229 } 230 |
|
213 /* 214 * The 64-bit Address field is non-aligned in the byte packed 215 * GAS struct. 216 */ 217 ACPI_MOVE_64_TO_64 (&GenericAddress->Address, &Address); 218 219 /* All other fields are byte-wide */ 220 221 GenericAddress->SpaceId = SpaceId; | 231 /* 232 * The 64-bit Address field is non-aligned in the byte packed 233 * GAS struct. 234 */ 235 ACPI_MOVE_64_TO_64 (&GenericAddress->Address, &Address); 236 237 /* All other fields are byte-wide */ 238 239 GenericAddress->SpaceId = SpaceId; |
222 GenericAddress->BitWidth = (UINT8) ACPI_MUL_8 (ByteWidth); | 240 GenericAddress->BitWidth = BitWidth; |
223 GenericAddress->BitOffset = 0; 224 GenericAddress->AccessWidth = 0; /* Access width ANY */ 225} 226 227 228/******************************************************************************* 229 * 230 * FUNCTION: AcpiTbParseFadt --- 248 unchanged lines hidden (view full) --- 479 if (Address32) 480 { 481 /* 482 * Copy the 32-bit address to the 64-bit GAS structure. The 483 * Space ID is always I/O for 32-bit legacy address fields 484 */ 485 AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO, 486 *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length), | 241 GenericAddress->BitOffset = 0; 242 GenericAddress->AccessWidth = 0; /* Access width ANY */ 243} 244 245 246/******************************************************************************* 247 * 248 * FUNCTION: AcpiTbParseFadt --- 248 unchanged lines hidden (view full) --- 497 if (Address32) 498 { 499 /* 500 * Copy the 32-bit address to the 64-bit GAS structure. The 501 * Space ID is always I/O for 32-bit legacy address fields 502 */ 503 AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO, 504 *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length), |
487 (UINT64) Address32); | 505 (UINT64) Address32, FadtInfoTable[i].Name); |
488 } 489 } 490} 491 492 493/******************************************************************************* 494 * 495 * FUNCTION: AcpiTbValidateFadt --- 199 unchanged lines hidden (view full) --- 695 Source64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, 696 FadtPmInfoTable[i].Source); 697 698 if (Source64->Address) 699 { 700 AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target, 701 Source64->SpaceId, Pm1RegisterByteWidth, 702 Source64->Address + | 506 } 507 } 508} 509 510 511/******************************************************************************* 512 * 513 * FUNCTION: AcpiTbValidateFadt --- 199 unchanged lines hidden (view full) --- 713 Source64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, 714 FadtPmInfoTable[i].Source); 715 716 if (Source64->Address) 717 { 718 AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target, 719 Source64->SpaceId, Pm1RegisterByteWidth, 720 Source64->Address + |
703 (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth)); | 721 (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth), 722 "PmRegisters"); |
704 } 705 } 706} 707 | 723 } 724 } 725} 726 |