Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 317 of file hwxface.c.
Referenced by AcpiWrite().
{ UINT32 Width; UINT64 Address; ACPI_STATUS Status; ACPI_FUNCTION_NAME (AcpiWrite); /* Validate contents of the GAS register. Allow 64-bit transfers */ Status = AcpiHwValidateRegister (Reg, 64, &Address); if (ACPI_FAILURE (Status)) { return (Status); } Width = Reg->BitWidth; if (Width == 64) { Width = 32; /* Break into two 32-bit transfers */ } /* * Two address spaces supported: Memory or IO. PCI_Config is * not supported here because the GAS structure is insufficient */ if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) Address, ACPI_LODWORD (Value), Width); if (ACPI_FAILURE (Status)) { return (Status); } if (Reg->BitWidth == 64) { Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) (Address + 4), ACPI_HIDWORD (Value), 32); if (ACPI_FAILURE (Status)) { return (Status); } } } else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ { Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) Address, ACPI_LODWORD (Value), Width); if (ACPI_FAILURE (Status)) { return (Status); } if (Reg->BitWidth == 64) { Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) (Address + 4), ACPI_HIDWORD (Value), 32); if (ACPI_FAILURE (Status)) { return (Status); } } } ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\n", ACPI_FORMAT_UINT64 (Value), Reg->BitWidth, ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); return (Status); }