Lines Matching +full:acpi +full:- +full:based

3  * Module Name: hwregs - Read/write access functions for the various ACPI
12 * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
109 * any of its subsidiaries will export/re-export any technical data, process,
131 * 3. Neither the names of the above-listed copyright holders nor the names
153 #include <contrib/dev/acpica/include/acpi.h>
190 * PARAMETERS: Address - GAS register address
191 * Reg - GAS register structure
192 * MaxBitWidth - Max BitWidth supported (32 or 64)
223 if (!Reg->BitOffset && Reg->BitWidth &&
224 ACPI_IS_POWER_OF_TWO (Reg->BitWidth) &&
225 ACPI_IS_ALIGNED (Reg->BitWidth, 8))
227 AccessBitWidth = Reg->BitWidth;
229 else if (Reg->AccessWidth)
231 AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth);
236 Reg->BitOffset + Reg->BitWidth);
252 if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
260 * a 32-bit accesses.
274 * PARAMETERS: Reg - GAS register structure
275 * MaxBitWidth - Max BitWidth supported (32 or 64)
276 * Address - Pointer to where the gas->address
306 * ACPI register that is not supported, so no error message.
308 ACPI_MOVE_64_TO_64 (Address, &Reg->Address);
316 if ((Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
317 (Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_IO))
320 "Unsupported address space: 0x%X", Reg->SpaceId));
326 if (Reg->AccessWidth > 4)
329 "Unsupported register access width: 0x%X", Reg->AccessWidth));
336 BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth);
353 * PARAMETERS: Value - Where the value is returned
354 * Reg - GAS register structure
358 * DESCRIPTION: Read from either memory or IO space. This is a 64-bit max
393 * Initialize entire 64-bit return value to zero, convert AccessWidth
394 * into number of bits based
398 BitWidth = Reg->BitOffset + Reg->BitWidth;
399 BitOffset = Reg->BitOffset;
411 BitOffset -= AccessWidth;
415 if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
432 * ensured to be less than 64-bits by AcpiHwValidateRegister().
437 BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
444 ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId)));
454 * PARAMETERS: Value - Value to be written
455 * Reg - GAS register structure
459 * DESCRIPTION: Write to either memory or IO space. This is a 64-bit max
489 /* Convert AccessWidth into number of bits based */
492 BitWidth = Reg->BitOffset + Reg->BitWidth;
493 BitOffset = Reg->BitOffset;
504 * ensured to be less than 64-bits by AcpiHwValidateRegister().
511 BitOffset -= AccessWidth;
515 if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
530 * Index * AccessWidth is ensured to be less than 32-bits by
533 BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
540 ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId)));
601 * PARAMETERS: RegisterId - Index of ACPI Register to access
630 * PARAMETERS: Pm1aControl - Value to be written to PM1A control
631 * Pm1bControl - Value to be written to PM1B control
672 * PARAMETERS: RegisterId - ACPI Register ID
673 * ReturnValue - Where the register value is returned
677 * DESCRIPTION: Read from the specified ACPI register
696 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
703 case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
710 case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
717 * Zero the write-only bits. From the ACPI specification, "Hardware
718 * Write-Only Bits": "Upon reads to registers with write-only bits,
719 * software masks out all write-only bits."
724 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
733 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
743 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
769 * PARAMETERS: RegisterId - ACPI Register ID
770 * Value - The value to write
774 * DESCRIPTION: Write to the specified ACPI register
776 * NOTE: In accordance with the ACPI specification, this function automatically
784 * ACPI References:
806 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
808 * Handle the "ignored" bit in PM1 Status. According to the ACPI
815 * This behavior is clarified in the ACPI 4.0 specification.
824 case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
831 case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
833 * Perform a read first to preserve certain bits (per ACPI spec)
855 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
858 * as per the ACPI spec.
874 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
879 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
903 * PARAMETERS: Value - Where the register value is returned
904 * RegisterA - First ACPI register (required)
905 * RegisterB - Second ACPI register (optional)
909 * DESCRIPTION: Read from the specified two-part ACPI register (such as PM1 A/B)
936 if (RegisterB->Address)
948 * because of how the PM1 registers are defined in the ACPI specification:
965 * PARAMETERS: Value - The value to write
966 * RegisterA - First ACPI register (required)
967 * RegisterB - Second ACPI register (optional)
971 * DESCRIPTION: Write to the specified two-part ACPI register (such as PM1 A/B)
996 * registers are defined in the ACPI specification:
1004 if (RegisterB->Address)