xref: /linux-6.15/include/linux/fw_table.h (revision 542e893f)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  *  fw_tables.h - Parsing support for ACPI and ACPI-like tables provided by
4  *                platform or device firmware
5  *
6  *  Copyright (C) 2001 Paul Diefenbaugh <[email protected]>
7  *  Copyright (C) 2023 Intel Corp.
8  */
9 #ifndef _FW_TABLE_H_
10 #define _FW_TABLE_H_
11 
12 union acpi_subtable_headers;
13 
14 typedef int (*acpi_tbl_entry_handler)(union acpi_subtable_headers *header,
15 				      const unsigned long end);
16 
17 typedef int (*acpi_tbl_entry_handler_arg)(union acpi_subtable_headers *header,
18 					  void *arg, const unsigned long end);
19 
20 struct acpi_subtable_proc {
21 	int id;
22 	acpi_tbl_entry_handler handler;
23 	acpi_tbl_entry_handler_arg handler_arg;
24 	void *arg;
25 	int count;
26 };
27 
28 union acpi_subtable_headers {
29 	struct acpi_subtable_header common;
30 	struct acpi_hmat_structure hmat;
31 	struct acpi_prmt_module_header prmt;
32 	struct acpi_cedt_header cedt;
33 };
34 
35 int acpi_parse_entries_array(char *id, unsigned long table_size,
36 			     struct acpi_table_header *table_header,
37 			     struct acpi_subtable_proc *proc,
38 			     int proc_num, unsigned int max_entries);
39 
40 #endif
41