1 /******************************************************************************
3 * Module Name: acpixtract.h - Include for acpixtract utility
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
52 #ifdef DEFINE_ACPIXTRACT_GLOBALS
53 #define ACPI_GLOBAL(type,name) \
58 #define ACPI_GLOBAL(type,name) \
65 #define AX_EXTRACT_ALL 0
67 #define AX_EXTRACT_SIGNATURE 2
68 #define AX_EXTRACT_AML_TABLES 3
69 #define AX_EXTRACT_MULTI_TABLE 4
71 #define AX_OPTIONAL_TABLES 0
72 #define AX_REQUIRED_TABLE 1
74 #define AX_UTILITY_NAME "ACPI Binary Table Extraction Utility"
75 #define AX_SUPPORTED_OPTIONS "ahlms:v"
76 #define AX_MULTI_TABLE_FILENAME "amltables.dat"
77 #define AX_TABLE_INFO_FORMAT "Acpi table [%4.4s] - %7u bytes written to %s\n"
79 /* Extraction states */
81 #define AX_STATE_FIND_HEADER 0
82 #define AX_STATE_EXTRACT_DATA 1
84 /* Miscellaneous constants */
86 #define AX_LINE_BUFFER_SIZE 256
87 #define AX_MIN_BLOCK_HEADER_LENGTH 6 /* strlen ("DSDT @") */
90 typedef struct AxTableInfo
93 unsigned int Instances
;
94 unsigned int NextInstance
;
95 struct AxTableInfo
*Next
;
102 ACPI_GLOBAL (char, Gbl_LineBuffer
[AX_LINE_BUFFER_SIZE
]);
103 ACPI_GLOBAL (char, Gbl_HeaderBuffer
[AX_LINE_BUFFER_SIZE
]);
104 ACPI_GLOBAL (char, Gbl_InstanceBuffer
[AX_LINE_BUFFER_SIZE
]);
106 ACPI_GLOBAL (AX_TABLE_INFO
, *Gbl_TableListHead
);
107 ACPI_GLOBAL (char, Gbl_OutputFilename
[32]);
108 ACPI_GLOBAL (unsigned char, Gbl_BinaryData
[16]);
109 ACPI_GLOBAL (unsigned int, Gbl_TableCount
);
118 unsigned int MinimumInstances
);
121 AxExtractToMultiAmlFile (
122 char *InputPathname
);
126 char *InputPathname
);
135 unsigned char *OutputData
);
138 AxCountTableInstances (
148 AxNormalizeSignature (
161 AxIsDataBlockHeader (
165 AxProcessOneTextLine (
168 unsigned int ThisTableBytesWritten
);
173 unsigned char *OutputData
);