1 /******************************************************************************
3 * Module Name: acapps - common include for ACPI applications/tools
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, 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.
48 #ifdef _MSC_VER /* disable some level-4 warnings */
49 #pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
52 /* Common info for tool signons */
54 #define ACPICA_NAME "Intel ACPI Component Architecture"
55 #define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2013 Intel Corporation"
57 #if ACPI_MACHINE_WIDTH == 64
58 #define ACPI_WIDTH "-64"
60 #elif ACPI_MACHINE_WIDTH == 32
61 #define ACPI_WIDTH "-32"
64 #error unknown ACPI_MACHINE_WIDTH
65 #define ACPI_WIDTH "-??"
69 /* Macros for signons and file headers */
71 #define ACPI_COMMON_SIGNON(UtilityName) \
72 "\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \
74 UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
77 #define ACPI_COMMON_HEADER(UtilityName, Prefix) \
78 "%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \
79 Prefix, ACPICA_NAME, \
80 Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
81 Prefix, ACPICA_COPYRIGHT, \
84 /* Macros for usage messages */
86 #define ACPI_USAGE_HEADER(Usage) \
87 printf ("Usage: %s\nOptions:\n", Usage);
89 #define ACPI_OPTION(Name, Description) \
90 printf (" %-18s%s\n", Name, Description);
93 #define FILE_SUFFIX_DISASSEMBLY "dsl"
94 #define ACPI_TABLE_FILE_SUFFIX ".dat"
111 extern int AcpiGbl_Optind
;
112 extern int AcpiGbl_Opterr
;
113 extern int AcpiGbl_SubOptChar
;
114 extern char *AcpiGbl_Optarg
;
117 #ifndef ACPI_DUMP_APP
127 BOOLEAN GetAllTables
);
145 BOOLEAN GetAllTables
);
149 ACPI_TABLE_HEADER
*Table
,
150 ACPI_OWNER_ID
*OwnerId
,
157 ACPI_TABLE_HEADER
*Table
);
160 AdDisplayStatistics (
168 AcpiDmCrossReferenceNamespace (
169 ACPI_PARSE_OBJECT
*ParseTreeRoot
,
170 ACPI_NAMESPACE_NODE
*NamespaceRoot
,
171 ACPI_OWNER_ID OwnerId
);
175 ACPI_PARSE_OBJECT
*Origin
);
178 AcpiDmFindOrphanMethods (
179 ACPI_PARSE_OBJECT
*Origin
);
182 AcpiDmFinishNamespaceLoad (
183 ACPI_PARSE_OBJECT
*ParseTreeRoot
,
184 ACPI_NAMESPACE_NODE
*NamespaceRoot
,
185 ACPI_OWNER_ID OwnerId
);
188 AcpiDmConvertResourceIndexes (
189 ACPI_PARSE_OBJECT
*ParseTreeRoot
,
190 ACPI_NAMESPACE_NODE
*NamespaceRoot
);
206 FlSplitInputPathname (
208 char **OutDirectoryPath
,
218 ACPI_TABLE_HEADER
*Table
,