From 3afc5113c4584ebfbf2c7a8d34d3c3f60259dba5 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Thu, 6 Dec 2018 00:03:02 +0800 Subject: [PATCH] hv: acpi: remove weak parse_madt Since it's discarded. Tracked-On: #861 Signed-off-by: Li, Fei1 --- hypervisor/arch/x86/cpu.c | 13 +----------- hypervisor/boot/acpi.c | 1 + hypervisor/boot/dmar_parse.c | 2 +- hypervisor/boot/include/acpi.h | 22 -------------------- hypervisor/boot/include/acpi_priv.h | 32 +++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 hypervisor/boot/include/acpi_priv.h diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index 2031dc5cc..d3d564fcd 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -271,18 +272,6 @@ static int hardware_detect_support(void) return 0; } -uint16_t __attribute__((weak)) parse_madt(uint32_t lapic_id_array[CONFIG_MAX_PCPU_NUM]) -{ - static const uint32_t lapic_id[] = {0U, 2U, 4U, 6U}; - uint32_t i; - - for (i = 0U; i < ARRAY_SIZE(lapic_id); i++) { - lapic_id_array[i] = lapic_id[i]; - } - - return ((uint16_t)ARRAY_SIZE(lapic_id)); -} - static void init_percpu_lapic_id(void) { uint16_t i; diff --git a/hypervisor/boot/acpi.c b/hypervisor/boot/acpi.c index e04846cf2..71939577b 100644 --- a/hypervisor/boot/acpi.c +++ b/hypervisor/boot/acpi.c @@ -28,6 +28,7 @@ */ #include +#include "acpi_priv.h" #include "acpi.h" #include diff --git a/hypervisor/boot/dmar_parse.c b/hypervisor/boot/dmar_parse.c index f061ad841..022258fed 100644 --- a/hypervisor/boot/dmar_parse.c +++ b/hypervisor/boot/dmar_parse.c @@ -8,7 +8,7 @@ #include #include "pci.h" #include "vtd.h" -#include "acpi.h" +#include "acpi_priv.h" enum acpi_dmar_type { ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, diff --git a/hypervisor/boot/include/acpi.h b/hypervisor/boot/include/acpi.h index 4e8125ca0..66d7d6fea 100644 --- a/hypervisor/boot/include/acpi.h +++ b/hypervisor/boot/include/acpi.h @@ -7,28 +7,6 @@ #ifndef ACPI_H #define ACPI_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; -}; - uint16_t parse_madt(uint32_t lapic_id_array[CONFIG_MAX_PCPU_NUM]); -void *get_dmar_table(void); #endif /* !ACPI_H */ diff --git a/hypervisor/boot/include/acpi_priv.h b/hypervisor/boot/include/acpi_priv.h new file mode 100644 index 000000000..fa060377a --- /dev/null +++ b/hypervisor/boot/include/acpi_priv.h @@ -0,0 +1,32 @@ +/* + * 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 */