From cbab1f831cf92411c71b88cd179ec8c93bb3f045 Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Sat, 11 May 2019 00:51:46 +0800 Subject: [PATCH] HV: remove acpi_priv.h Keep acpi.h as the only acpi api interface; Tracked-On: #3107 Signed-off-by: Victor Sun Acked-by: Eddie Dong --- hypervisor/acpi_parser/dmar_parse.c | 9 +++++++- hypervisor/boot/acpi.c | 9 +------- hypervisor/boot/include/acpi.h | 23 +++++++++++++++++++++ hypervisor/boot/include/acpi_priv.h | 32 ----------------------------- 4 files changed, 32 insertions(+), 41 deletions(-) delete mode 100644 hypervisor/boot/include/acpi_priv.h diff --git a/hypervisor/acpi_parser/dmar_parse.c b/hypervisor/acpi_parser/dmar_parse.c index 2902c9971..137db6348 100644 --- a/hypervisor/acpi_parser/dmar_parse.c +++ b/hypervisor/acpi_parser/dmar_parse.c @@ -11,7 +11,9 @@ #include #include "pci.h" #include "vtd.h" -#include "acpi_priv.h" +#include "acpi.h" + +#define ACPI_SIG_DMAR "DMAR" enum acpi_dmar_type { ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, @@ -68,6 +70,11 @@ typedef int32_t (*dmar_iter_t)(struct acpi_dmar_header*, void*); static int32_t dmar_unit_cnt; +static void *get_dmar_table(void) +{ + return get_acpi_tbl(ACPI_SIG_DMAR); +} + static void dmar_iterate_tbl(dmar_iter_t iter, void *arg) { diff --git a/hypervisor/boot/acpi.c b/hypervisor/boot/acpi.c index 2350c40a8..38418395b 100644 --- a/hypervisor/boot/acpi.c +++ b/hypervisor/boot/acpi.c @@ -29,7 +29,6 @@ #include #include #include -#include "acpi_priv.h" #include "acpi.h" #include #include @@ -41,7 +40,6 @@ #define ACPI_OEM_ID_SIZE 6 #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ -#define ACPI_SIG_DMAR "DMAR" #define RSDP_CHECKSUM_LENGTH 20 #define ACPI_NAME_SIZE 4U #define ACPI_MADT_TYPE_LOCAL_APIC 0U @@ -181,7 +179,7 @@ static bool probe_table(uint64_t address, const char *signature) return ret; } -static void *get_acpi_tbl(const char *signature) +void *get_acpi_tbl(const char *signature) { struct acpi_table_rsdp *rsdp; struct acpi_table_rsdt *rsdt; @@ -323,11 +321,6 @@ uint16_t parse_madt_ioapic(struct ioapic_info *ioapic_id_array) return ioapic_parse_madt(madt, ioapic_id_array); } -void *get_dmar_table(void) -{ - return get_acpi_tbl(ACPI_SIG_DMAR); -} - #ifndef CONFIG_CONSTANT_ACPI /* Per ACPI spec: * There are two fundamental types of ACPI tables: diff --git a/hypervisor/boot/include/acpi.h b/hypervisor/boot/include/acpi.h index af644d4c8..13e4eff2c 100644 --- a/hypervisor/boot/include/acpi.h +++ b/hypervisor/boot/include/acpi.h @@ -9,6 +9,29 @@ #include +struct acpi_table_header { + /* ASCII table signature */ + char signature[4]; + /* Length of table in bytes, including this header */ + uint32_t length; + /* ACPI Specification minor version number */ + uint8_t revision; + /* To make sum of entire table == 0 */ + uint8_t checksum; + /* ASCII OEM identification */ + char oem_id[6]; + /* ASCII OEM table identification */ + char oem_table_id[8]; + /* OEM revision number */ + uint32_t oem_revision; + /* ASCII ASL compiler vendor ID */ + char asl_compiler_id[4]; + /* ASL compiler version */ + uint32_t asl_compiler_revision; +}; + +void *get_acpi_tbl(const char *signature); + struct ioapic_info; uint16_t parse_madt(uint32_t lapic_id_array[CONFIG_MAX_PCPU_NUM]); uint16_t parse_madt_ioapic(struct ioapic_info *ioapic_id_array); diff --git a/hypervisor/boot/include/acpi_priv.h b/hypervisor/boot/include/acpi_priv.h deleted file mode 100644 index fa060377a..000000000 --- a/hypervisor/boot/include/acpi_priv.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2018 Intel Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ACPI_PRIV_H -#define ACPI_PRIV_H - -struct acpi_table_header { - /* ASCII table signature */ - char signature[4]; - /* Length of table in bytes, including this header */ - uint32_t length; - /* ACPI Specification minor version number */ - uint8_t revision; - /* To make sum of entire table == 0 */ - uint8_t checksum; - /* ASCII OEM identification */ - char oem_id[6]; - /* ASCII OEM table identification */ - char oem_table_id[8]; - /* OEM revision number */ - uint32_t oem_revision; - /* ASCII ASL compiler vendor ID */ - char asl_compiler_id[4]; - /* ASL compiler version */ - uint32_t asl_compiler_revision; -}; - -void *get_dmar_table(void); -#endif /* !ACPI_PRIV_H */