Lines Matching +full:reg +full:- +full:spaces

3  * Module Name: hwregs - Read/write access functions for the various ACPI
12 * Some or all of this work - Copyright (c) 1999 - 2023, 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
168 ACPI_GENERIC_ADDRESS *Reg,
190 * PARAMETERS: Address - GAS register address
191 * Reg - GAS register structure
192 * MaxBitWidth - Max BitWidth supported (32 or 64)
203 ACPI_GENERIC_ADDRESS *Reg, in AcpiHwGetAccessBitWidth() argument
223 if (!Reg->BitOffset && Reg->BitWidth && in AcpiHwGetAccessBitWidth()
224 ACPI_IS_POWER_OF_TWO (Reg->BitWidth) && in AcpiHwGetAccessBitWidth()
225 ACPI_IS_ALIGNED (Reg->BitWidth, 8)) in AcpiHwGetAccessBitWidth()
227 AccessBitWidth = Reg->BitWidth; in AcpiHwGetAccessBitWidth()
229 else if (Reg->AccessWidth) in AcpiHwGetAccessBitWidth()
231 AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth); in AcpiHwGetAccessBitWidth()
236 Reg->BitOffset + Reg->BitWidth); in AcpiHwGetAccessBitWidth()
252 if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) in AcpiHwGetAccessBitWidth()
260 * a 32-bit accesses. in AcpiHwGetAccessBitWidth()
274 * PARAMETERS: Reg - GAS register structure
275 * MaxBitWidth - Max BitWidth supported (32 or 64)
276 * Address - Pointer to where the gas->address
288 ACPI_GENERIC_ADDRESS *Reg, in AcpiHwValidateRegister() argument
298 if (!Reg) in AcpiHwValidateRegister()
308 ACPI_MOVE_64_TO_64 (Address, &Reg->Address); in AcpiHwValidateRegister()
316 if ((Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) && in AcpiHwValidateRegister()
317 (Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_IO)) in AcpiHwValidateRegister()
320 "Unsupported address space: 0x%X", Reg->SpaceId)); in AcpiHwValidateRegister()
326 if (Reg->AccessWidth > 4) in AcpiHwValidateRegister()
329 "Unsupported register access width: 0x%X", Reg->AccessWidth)); in AcpiHwValidateRegister()
335 AccessWidth = AcpiHwGetAccessBitWidth (*Address, Reg, MaxBitWidth); in AcpiHwValidateRegister()
336 BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth); in AcpiHwValidateRegister()
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
369 ACPI_GENERIC_ADDRESS *Reg) in AcpiHwRead() argument
386 Status = AcpiHwValidateRegister (Reg, 64, &Address); in AcpiHwRead()
393 * Initialize entire 64-bit return value to zero, convert AccessWidth in AcpiHwRead()
397 AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 64); in AcpiHwRead()
398 BitWidth = Reg->BitOffset + Reg->BitWidth; in AcpiHwRead()
399 BitOffset = Reg->BitOffset; in AcpiHwRead()
402 * Two address spaces supported: Memory or IO. PCI_Config is in AcpiHwRead()
411 BitOffset -= AccessWidth; in AcpiHwRead()
415 if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) in AcpiHwRead()
432 * ensured to be less than 64-bits by AcpiHwValidateRegister(). in AcpiHwRead()
437 BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth; in AcpiHwRead()
444 ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); in AcpiHwRead()
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
467 ACPI_GENERIC_ADDRESS *Reg) in AcpiHwWrite() argument
483 Status = AcpiHwValidateRegister (Reg, 64, &Address); in AcpiHwWrite()
491 AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 64); in AcpiHwWrite()
492 BitWidth = Reg->BitOffset + Reg->BitWidth; in AcpiHwWrite()
493 BitOffset = Reg->BitOffset; in AcpiHwWrite()
496 * Two address spaces supported: Memory or IO. PCI_Config is in AcpiHwWrite()
504 * ensured to be less than 64-bits by AcpiHwValidateRegister(). in AcpiHwWrite()
511 BitOffset -= AccessWidth; in AcpiHwWrite()
515 if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) in AcpiHwWrite()
530 * Index * AccessWidth is ensured to be less than 32-bits by in AcpiHwWrite()
533 BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth; in AcpiHwWrite()
540 ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); in AcpiHwWrite()
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
696 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ in AcpiHwRegisterRead()
703 case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ in AcpiHwRegisterRead()
710 case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ in AcpiHwRegisterRead()
717 * Zero the write-only bits. From the ACPI specification, "Hardware in AcpiHwRegisterRead()
718 * Write-Only Bits": "Upon reads to registers with write-only bits, in AcpiHwRegisterRead()
719 * software masks out all write-only bits." in AcpiHwRegisterRead()
724 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ in AcpiHwRegisterRead()
733 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ in AcpiHwRegisterRead()
743 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ in AcpiHwRegisterRead()
769 * PARAMETERS: RegisterId - ACPI Register ID
770 * Value - The value to write
806 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ in AcpiHwRegisterWrite()
824 case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ in AcpiHwRegisterWrite()
831 case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ in AcpiHwRegisterWrite()
855 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ in AcpiHwRegisterWrite()
874 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ in AcpiHwRegisterWrite()
879 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ in AcpiHwRegisterWrite()
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) in AcpiHwReadMultiple()
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)
1004 if (RegisterB->Address) in AcpiHwWriteMultiple()