Skip to content

Commit

Permalink
Divergences: reduce access size definitions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lv Zheng committed Jul 10, 2017
1 parent 41e7b35 commit cf27b3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/components/hardware/hwregs.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ AcpiHwGetAccessBitWidth (
}
else if (Reg->AccessWidth)
{
AccessBitWidth = (1 << (Reg->AccessWidth + 2));
AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth);
}
else
{
Expand Down
7 changes: 7 additions & 0 deletions source/include/actypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))


/*******************************************************************************
*
Expand Down

0 comments on commit cf27b3c

Please sign in to comment.