forked from microsoft/WSL2-Linux-Kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
acpi: Move common tables helper functions to common lib
Some of the routines in ACPI driver/acpi/tables.c can be shared with parsing CDAT. CDAT is a device-provided data structure that is formatted similar to a platform provided ACPI table. CDAT is used by CXL and can exist on platforms that do not use ACPI. Split out the common routine from ACPI to accommodate platforms that do not support ACPI and move that to /lib. The common routines can be built outside of ACPI if FIRMWARE_TABLES is selected. Link: https://lore.kernel.org/linux-cxl/CAJZ5v0jipbtTNnsA0-o5ozOk8ZgWnOg34m34a9pPenTyRLj=6A@mail.gmail.com/ Suggested-by: "Rafael J. Wysocki" <rafael@kernel.org> Reviewed-by: Hanjun Guo <guohanjun@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Acked-by: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/169713683430.2205276.17899451119920103445.stgit@djiang5-mobl3 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
- Loading branch information
Showing
8 changed files
with
251 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* fw_tables.h - Parsing support for ACPI and ACPI-like tables provided by | ||
* platform or device firmware | ||
* | ||
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> | ||
* Copyright (C) 2023 Intel Corp. | ||
*/ | ||
#ifndef _FW_TABLE_H_ | ||
#define _FW_TABLE_H_ | ||
|
||
union acpi_subtable_headers; | ||
|
||
typedef int (*acpi_tbl_entry_handler)(union acpi_subtable_headers *header, | ||
const unsigned long end); | ||
|
||
typedef int (*acpi_tbl_entry_handler_arg)(union acpi_subtable_headers *header, | ||
void *arg, const unsigned long end); | ||
|
||
struct acpi_subtable_proc { | ||
int id; | ||
acpi_tbl_entry_handler handler; | ||
acpi_tbl_entry_handler_arg handler_arg; | ||
void *arg; | ||
int count; | ||
}; | ||
|
||
#include <linux/acpi.h> | ||
#include <acpi/acpi.h> | ||
|
||
union acpi_subtable_headers { | ||
struct acpi_subtable_header common; | ||
struct acpi_hmat_structure hmat; | ||
struct acpi_prmt_module_header prmt; | ||
struct acpi_cedt_header cedt; | ||
}; | ||
|
||
int acpi_parse_entries_array(char *id, unsigned long table_size, | ||
struct acpi_table_header *table_header, | ||
struct acpi_subtable_proc *proc, | ||
int proc_num, unsigned int max_entries); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -764,3 +764,6 @@ config ASN1_ENCODER | |
|
||
config POLYNOMIAL | ||
tristate | ||
|
||
config FIRMWARE_TABLE | ||
bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.