hv: cosmetic fixes in acpi.h

Minor cosmetic fixes in acpi.h:
 Move and group similar defines together
 Rename RSDP_CHECKSUM_LENGTH to ACPI_RSDP_CHECKSUM_LENGTH
 Add post fix 'U' to define as unsinged int and change code accordingly

Tracked-On: #3601
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
dongshen 2019-08-20 15:56:36 -07:00 committed by wenlingz
parent 216c19f4a0
commit 81e2152af8
2 changed files with 24 additions and 22 deletions

View File

@ -41,7 +41,8 @@ static struct acpi_table_rsdp *found_rsdp(char *base, int32_t length)
{
struct acpi_table_rsdp *rsdp, *ret = NULL;
uint8_t *cp, sum;
int32_t ofs, idx;
int32_t ofs;
uint32_t idx;
/* search on 16-byte boundaries */
for (ofs = 0; ofs < length; ofs += 16) {
@ -51,7 +52,7 @@ static struct acpi_table_rsdp *found_rsdp(char *base, int32_t length)
if (strncmp(rsdp->signature, ACPI_SIG_RSDP, strnlen_s(ACPI_SIG_RSDP, 8U)) == 0) {
cp = (uint8_t *)rsdp;
sum = 0U;
for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) {
for (idx = 0; idx < ACPI_RSDP_CHECKSUM_LENGTH; idx++) {
sum += *(cp + idx);
}

View File

@ -9,15 +9,16 @@
#include <vm_configurations.h>
#define ACPI_OEM_ID_SIZE 6
#define RSDP_CHECKSUM_LENGTH 20
#define ACPI_RSDP_CHECKSUM_LENGTH 20U
#define ACPI_NAME_SIZE 4U
#define ACPI_OEM_ID_SIZE 6U
#define ACPI_OEM_TABLE_ID_SIZE 8U
#define ACPI_MADT_TYPE_LOCAL_APIC 0U
#define ACPI_MADT_TYPE_IOAPIC 1U
#define ACPI_MADT_ENABLED 1U
#define ACPI_OEM_TABLE_ID_SIZE 8
/* FACP field offsets */
#define OFFSET_FACS_ADDR 36U