diff options
author | Dan Williams <dan.j.williams@intel.com> | 2021-10-29 12:51:32 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-11-15 11:02:59 -0800 |
commit | f64bd790b750dd281406964af40d16adfc88a074 (patch) | |
tree | 486d3003b8c9265179d9143304ee5fb922ab8c9d /include/linux/acpi.h | |
parent | 09eac2ca988a866225a174212765f77c85702206 (diff) | |
download | lwn-f64bd790b750dd281406964af40d16adfc88a074.tar.gz lwn-f64bd790b750dd281406964af40d16adfc88a074.zip |
ACPI: Keep sub-table parsing infrastructure available for modules
The NFIT driver and now the CXL ACPI driver have both open-coded ACPI
table parsing. Before another instance is added arrange for the core
ACPI sub-table parsing to be optionally available to drivers via the
CONFIG_ACPI_TABLE_LIB symbol. If no drivers select the symbol then the
infrastructure reverts back to being tagged __init via the
__init_or_acpilib annotation.
For now, only tag the core sub-table routines and data that the CEDT parsing in
the cxl_acpi driver would want to reuse, a CEDT parsing helper is added
in a later change.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Alison Schofield <alison.schofield@intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/163553709227.2509508.8215196520233473814.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r-- | include/linux/acpi.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 143ce7e0bee1..edfa3c8f3562 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -232,14 +232,22 @@ int acpi_locate_initial_tables (void); void acpi_reserve_initial_tables (void); void acpi_table_init_complete (void); int acpi_table_init (void); + +#ifdef CONFIG_ACPI_TABLE_LIB +#define __init_or_acpilib +#define __initdata_or_acpilib +#else +#define __init_or_acpilib __init +#define __initdata_or_acpilib __initdata +#endif + int acpi_table_parse(char *id, acpi_tbl_table_handler handler); -int __init acpi_table_parse_entries(char *id, unsigned long table_size, - int entry_id, - acpi_tbl_entry_handler handler, - unsigned int max_entries); -int __init acpi_table_parse_entries_array(char *id, unsigned long table_size, - struct acpi_subtable_proc *proc, int proc_num, - unsigned int max_entries); +int __init_or_acpilib acpi_table_parse_entries(char *id, + unsigned long table_size, int entry_id, + acpi_tbl_entry_handler handler, unsigned int max_entries); +int __init_or_acpilib acpi_table_parse_entries_array(char *id, + unsigned long table_size, struct acpi_subtable_proc *proc, + int proc_num, unsigned int max_entries); int acpi_table_parse_madt(enum acpi_madt_type id, acpi_tbl_entry_handler handler, unsigned int max_entries); |