1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /******************************************************************************
4 * Module Name: acpidump.h - Include file for acpi_dump utility
6 * Copyright (C) 2000 - 2023, Intel Corp.
8 *****************************************************************************/
11 * Global variables. Defined in main.c only, externed in all other files
13 #ifdef _DECLARE_GLOBALS
15 #define INIT_GLOBAL(a,b) a=b
18 #define INIT_GLOBAL(a,b) a
21 #include <acpi/acpi.h>
28 EXTERN u8 INIT_GLOBAL(gbl_summary_mode, FALSE);
29 EXTERN u8 INIT_GLOBAL(gbl_verbose_mode, FALSE);
30 EXTERN u8 INIT_GLOBAL(gbl_binary_mode, FALSE);
31 EXTERN u8 INIT_GLOBAL(gbl_dump_customized_tables, TRUE);
32 EXTERN u8 INIT_GLOBAL(gbl_do_not_dump_xsdt, FALSE);
33 EXTERN ACPI_FILE INIT_GLOBAL(gbl_output_file, NULL);
34 EXTERN char INIT_GLOBAL(*gbl_output_filename, NULL);
35 EXTERN u64 INIT_GLOBAL(gbl_rsdp_base, 0);
37 /* Action table used to defer requested options */
39 struct ap_dump_action {
44 #define AP_MAX_ACTIONS 32
46 #define AP_DUMP_ALL_TABLES 0
47 #define AP_DUMP_TABLE_BY_ADDRESS 1
48 #define AP_DUMP_TABLE_BY_NAME 2
49 #define AP_DUMP_TABLE_BY_FILE 3
51 #define AP_MAX_ACPI_FILES 256 /* Prevent infinite loops */
53 /* Minimum FADT sizes for various table addresses */
55 #define MIN_FADT_FOR_DSDT (ACPI_FADT_OFFSET (dsdt) + sizeof (u32))
56 #define MIN_FADT_FOR_FACS (ACPI_FADT_OFFSET (facs) + sizeof (u32))
57 #define MIN_FADT_FOR_XDSDT (ACPI_FADT_OFFSET (Xdsdt) + sizeof (u64))
58 #define MIN_FADT_FOR_XFACS (ACPI_FADT_OFFSET (Xfacs) + sizeof (u64))
61 * apdump - Table get/dump routines
63 int ap_dump_table_from_file(char *pathname);
65 int ap_dump_table_by_name(char *signature);
67 int ap_dump_table_by_address(char *ascii_address);
69 int ap_dump_all_tables(void);
71 u8 ap_is_valid_header(struct acpi_table_header *table);
73 u8 ap_is_valid_checksum(struct acpi_table_header *table);
75 u32 ap_get_table_length(struct acpi_table_header *table);
78 * apfiles - File I/O utilities
80 int ap_open_output_file(char *pathname);
82 int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance);
84 struct acpi_table_header *ap_get_table_from_file(char *pathname,