Divergences: reduce access size definitions

Linux guys start to define access size values for
ACPI_RESOURCE_GENERIC_REGISTER, while it should be better to just define
the access_size -> access_bit_width algorithm and deply it for both
ACPI_RESOURCE_GENERIC_REGISTER and ACPI_GENERIC_ADDRESS types. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This commit is contained in:
Lv Zheng 2017-07-10 13:59:54 +08:00
parent 41e7b3575c
commit cf27b3c988
2 changed files with 8 additions and 1 deletions

View File

@ -228,7 +228,7 @@ AcpiHwGetAccessBitWidth (
}
else if (Reg->AccessWidth)
{
AccessBitWidth = (1 << (Reg->AccessWidth + 2));
AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth);
}
else
{

View File

@ -675,6 +675,13 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
/*
* Algorithm to obtain access bit width.
* Can be used with AccessWidth of ACPI_GENERIC_ADDRESS and AccessSize of
* ACPI_RESOURCE_GENERIC_REGISTER.
*/
#define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2))
/*******************************************************************************
*