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
56AcpiTbInitGenericAddress (
57 ACPI_GENERIC_ADDRESS *GenericAddress,
58 UINT8 SpaceId,
59 UINT8 ByteWidth,
60 UINT64 Address);
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
205static ACPI_INLINE void
206AcpiTbInitGenericAddress (
207 ACPI_GENERIC_ADDRESS *GenericAddress,
208 UINT8 SpaceId,
209 UINT8 ByteWidth,
210 UINT64 Address)
211{
212
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;
222 GenericAddress->BitWidth = (UINT8) ACPI_MUL_8 (ByteWidth);
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),
487 (UINT64) Address32);
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 +
703 (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth));
704 }
705 }
706}
707
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
56AcpiTbInitGenericAddress (
57 ACPI_GENERIC_ADDRESS *GenericAddress,
58 UINT8 SpaceId,
59 UINT8 ByteWidth,
60 UINT64 Address);
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
205static ACPI_INLINE void
206AcpiTbInitGenericAddress (
207 ACPI_GENERIC_ADDRESS *GenericAddress,
208 UINT8 SpaceId,
209 UINT8 ByteWidth,
210 UINT64 Address)
211{
212
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;
222 GenericAddress->BitWidth = (UINT8) ACPI_MUL_8 (ByteWidth);
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),
487 (UINT64) Address32);
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 +
703 (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth));
704 }
705 }
706}
707