From patchwork Fri Apr 28 12:03:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikos Nikoleris X-Patchwork-Id: 13226305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 545B7C77B60 for ; Fri, 28 Apr 2023 12:05:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345959AbjD1MFB (ORCPT ); Fri, 28 Apr 2023 08:05:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233029AbjD1MEz (ORCPT ); Fri, 28 Apr 2023 08:04:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D31561FF0 for ; Fri, 28 Apr 2023 05:04:54 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AF7801477; Fri, 28 Apr 2023 05:05:38 -0700 (PDT) Received: from godel.lab.cambridge.arm.com (godel.lab.cambridge.arm.com [10.7.66.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BDE1A3F5A1; Fri, 28 Apr 2023 05:04:53 -0700 (PDT) From: Nikos Nikoleris To: kvm@vger.kernel.org, kvmarm@lists.linux.dev, andrew.jones@linux.dev Cc: Alexandru Elisei , pbonzini@redhat.com, ricarkol@google.com Subject: [kvm-unit-tests PATCH v5 05/29] lib/acpi: Convert table names to Linux style Date: Fri, 28 Apr 2023 13:03:41 +0100 Message-Id: <20230428120405.3770496-6-nikos.nikoleris@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230428120405.3770496-1-nikos.nikoleris@arm.com> References: <20230428120405.3770496-1-nikos.nikoleris@arm.com> MIME-Version: 1.0 X-ARM-No-Footer: FoSSMail Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Alexandru Elisei kvm-unit-tests is about to import several table struct definitions from Linux, convert the names of the existing tables to follow the Linux style. This is purely a cosmetic change and no functional change is intended. Signed-off-by: Nikos Nikoleris --- lib/acpi.h | 10 +++++----- lib/acpi.c | 16 ++++++++-------- lib/x86/setup.c | 2 +- x86/s3.c | 4 ++-- x86/vmexit.c | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/acpi.h b/lib/acpi.h index 2da49451..f9a344e9 100644 --- a/lib/acpi.h +++ b/lib/acpi.h @@ -17,7 +17,7 @@ #define RSDP_SIGNATURE_8BYTE (ACPI_SIGNATURE_8BYTE('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')) -struct rsdp_descriptor { /* Root System Descriptor Pointer */ +struct acpi_table_rsdp { /* Root System Descriptor Pointer */ u64 signature; /* ACPI signature, contains "RSD PTR " */ u8 checksum; /* To make sum of struct == 0 */ u8 oem_id[6]; /* OEM identification */ @@ -45,12 +45,12 @@ struct acpi_table { char data[]; }; -struct rsdt_descriptor_rev1 { +struct acpi_table_rsdt_rev1 { ACPI_TABLE_HEADER_DEF u32 table_offset_entry[]; }; -struct fadt_descriptor_rev1 { +struct acpi_table_fadt_rev1 { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ u32 firmware_ctrl; /* Physical address of FACS */ u32 dsdt; /* Physical address of DSDT */ @@ -92,7 +92,7 @@ struct fadt_descriptor_rev1 { u8 reserved4b; /* Reserved */ }; -struct facs_descriptor_rev1 { +struct acpi_table_facs_rev1 { u32 signature; /* ACPI Signature */ u32 length; /* Length of structure, in bytes */ u32 hardware_signature; /* Hardware configuration signature */ @@ -103,7 +103,7 @@ struct facs_descriptor_rev1 { u8 reserved3[40]; /* Reserved - must be zero */ }; -void set_efi_rsdp(struct rsdp_descriptor *rsdp); +void set_efi_rsdp(struct acpi_table_rsdp *rsdp); void *find_acpi_table_addr(u32 sig); #endif diff --git a/lib/acpi.c b/lib/acpi.c index 3f87711a..166ffd14 100644 --- a/lib/acpi.c +++ b/lib/acpi.c @@ -2,14 +2,14 @@ #include "acpi.h" #ifdef CONFIG_EFI -struct rsdp_descriptor *efi_rsdp = NULL; +struct acpi_table_rsdp *efi_rsdp = NULL; -void set_efi_rsdp(struct rsdp_descriptor *rsdp) +void set_efi_rsdp(struct acpi_table_rsdp *rsdp) { efi_rsdp = rsdp; } -static struct rsdp_descriptor *get_rsdp(void) +static struct acpi_table_rsdp *get_rsdp(void) { if (efi_rsdp == NULL) printf("Can't find RSDP from UEFI, maybe set_efi_rsdp() was not called\n"); @@ -17,9 +17,9 @@ static struct rsdp_descriptor *get_rsdp(void) return efi_rsdp; } #else -static struct rsdp_descriptor *get_rsdp(void) +static struct acpi_table_rsdp *get_rsdp(void) { - struct rsdp_descriptor *rsdp; + struct acpi_table_rsdp *rsdp; unsigned long addr; for (addr = 0xe0000; addr < 0x100000; addr += 16) { @@ -37,14 +37,14 @@ static struct rsdp_descriptor *get_rsdp(void) void *find_acpi_table_addr(u32 sig) { - struct rsdt_descriptor_rev1 *rsdt; - struct rsdp_descriptor *rsdp; + struct acpi_table_rsdt_rev1 *rsdt; + struct acpi_table_rsdp *rsdp; void *end; int i; /* FACS is special... */ if (sig == FACS_SIGNATURE) { - struct fadt_descriptor_rev1 *fadt; + struct acpi_table_fadt_rev1 *fadt; fadt = find_acpi_table_addr(FACP_SIGNATURE); if (!fadt) diff --git a/lib/x86/setup.c b/lib/x86/setup.c index dd150300..d509a248 100644 --- a/lib/x86/setup.c +++ b/lib/x86/setup.c @@ -245,7 +245,7 @@ static efi_status_t setup_memory_allocator(efi_bootinfo_t *efi_bootinfo) static efi_status_t setup_rsdp(efi_bootinfo_t *efi_bootinfo) { efi_status_t status; - struct rsdp_descriptor *rsdp; + struct acpi_table_rsdp *rsdp; /* * RSDP resides in an EFI_ACPI_RECLAIM_MEMORY region, which is not used diff --git a/x86/s3.c b/x86/s3.c index 378d37ae..96db728c 100644 --- a/x86/s3.c +++ b/x86/s3.c @@ -4,7 +4,7 @@ static u32* find_resume_vector_addr(void) { - struct facs_descriptor_rev1 *facs = find_acpi_table_addr(FACS_SIGNATURE); + struct acpi_table_facs_rev1 *facs = find_acpi_table_addr(FACS_SIGNATURE); if (!facs) return 0; printf("FACS is at %p\n", facs); @@ -39,7 +39,7 @@ extern char resume_start, resume_end; int main(int argc, char **argv) { - struct fadt_descriptor_rev1 *fadt = find_acpi_table_addr(FACP_SIGNATURE); + struct acpi_table_fadt_rev1 *fadt = find_acpi_table_addr(FACP_SIGNATURE); volatile u32 *resume_vector_ptr = find_resume_vector_addr(); char *addr, *resume_vec = (void*)0x1000; diff --git a/x86/vmexit.c b/x86/vmexit.c index 9260accc..12234f9e 100644 --- a/x86/vmexit.c +++ b/x86/vmexit.c @@ -206,7 +206,7 @@ int pm_tmr_blk; static void inl_pmtimer(void) { if (!pm_tmr_blk) { - struct fadt_descriptor_rev1 *fadt; + struct acpi_table_fadt_rev1 *fadt; fadt = find_acpi_table_addr(FACP_SIGNATURE); pm_tmr_blk = fadt->pm_tmr_blk;