sd: remove 'ssd' driver support
[unleashed/tickless.git] / arch / x86 / include / sys / acpi / acapps.h
blob87284f20b0da0e9de66a2753aa4c80e355fe6592
1 /******************************************************************************
3 * Module Name: acapps - common include for ACPI applications/tools
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
30 * NO WARRANTY
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.
44 #ifndef _ACAPPS
45 #define _ACAPPS
47 #include <stdio.h>
49 #ifdef _MSC_VER /* disable some level-4 warnings */
50 #pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
51 #endif
53 /* Common info for tool signons */
55 #define ACPICA_NAME "Intel ACPI Component Architecture"
56 #define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2016 Intel Corporation"
58 #if ACPI_MACHINE_WIDTH == 64
59 #define ACPI_WIDTH "-64"
61 #elif ACPI_MACHINE_WIDTH == 32
62 #define ACPI_WIDTH "-32"
64 #else
65 #error unknown ACPI_MACHINE_WIDTH
66 #define ACPI_WIDTH "-??"
68 #endif
70 /* Macros for signons and file headers */
72 #define ACPI_COMMON_SIGNON(UtilityName) \
73 "\n%s\n%s version %8.8X%s\n%s\n\n", \
74 ACPICA_NAME, \
75 UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
76 ACPICA_COPYRIGHT
78 #define ACPI_COMMON_HEADER(UtilityName, Prefix) \
79 "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \
80 Prefix, ACPICA_NAME, \
81 Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
82 Prefix, ACPICA_COPYRIGHT, \
83 Prefix
85 /* Macros for usage messages */
87 #define ACPI_USAGE_HEADER(Usage) \
88 AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
90 #define ACPI_USAGE_TEXT(Description) \
91 AcpiOsPrintf (Description);
93 #define ACPI_OPTION(Name, Description) \
94 AcpiOsPrintf (" %-20s%s\n", Name, Description);
97 /* Check for unexpected exceptions */
99 #define ACPI_CHECK_STATUS(Name, Status, Expected) \
100 if (Status != Expected) \
102 AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
103 AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
106 /* Check for unexpected non-AE_OK errors */
109 #define ACPI_CHECK_OK(Name, Status) ACPI_CHECK_STATUS (Name, Status, AE_OK);
111 #define FILE_SUFFIX_DISASSEMBLY "dsl"
112 #define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */
115 /* acfileio */
117 ACPI_STATUS
118 AcGetAllTablesFromFile (
119 char *Filename,
120 UINT8 GetOnlyAmlTables,
121 ACPI_NEW_TABLE_DESC **ReturnListHead);
123 BOOLEAN
124 AcIsFileBinary (
125 FILE *File);
127 ACPI_STATUS
128 AcValidateTableHeader (
129 FILE *File,
130 long TableOffset);
133 /* Values for GetOnlyAmlTables */
135 #define ACPI_GET_ONLY_AML_TABLES TRUE
136 #define ACPI_GET_ALL_TABLES FALSE
140 * getopt
143 AcpiGetopt(
144 int argc,
145 char **argv,
146 char *opts);
149 AcpiGetoptArgument (
150 int argc,
151 char **argv);
153 extern int AcpiGbl_Optind;
154 extern int AcpiGbl_Opterr;
155 extern int AcpiGbl_SubOptChar;
156 extern char *AcpiGbl_Optarg;
160 * cmfsize - Common get file size function
162 UINT32
163 CmGetFileSize (
164 ACPI_FILE File);
168 * adwalk
170 void
171 AcpiDmCrossReferenceNamespace (
172 ACPI_PARSE_OBJECT *ParseTreeRoot,
173 ACPI_NAMESPACE_NODE *NamespaceRoot,
174 ACPI_OWNER_ID OwnerId);
176 void
177 AcpiDmDumpTree (
178 ACPI_PARSE_OBJECT *Origin);
180 void
181 AcpiDmFindOrphanMethods (
182 ACPI_PARSE_OBJECT *Origin);
184 void
185 AcpiDmFinishNamespaceLoad (
186 ACPI_PARSE_OBJECT *ParseTreeRoot,
187 ACPI_NAMESPACE_NODE *NamespaceRoot,
188 ACPI_OWNER_ID OwnerId);
190 void
191 AcpiDmConvertResourceIndexes (
192 ACPI_PARSE_OBJECT *ParseTreeRoot,
193 ACPI_NAMESPACE_NODE *NamespaceRoot);
197 * adfile
199 ACPI_STATUS
200 AdInitialize (
201 void);
203 char *
204 FlGenerateFilename (
205 char *InputFilename,
206 char *Suffix);
208 ACPI_STATUS
209 FlSplitInputPathname (
210 char *InputPath,
211 char **OutDirectoryPath,
212 char **OutFilename);
214 char *
215 AdGenerateFilename (
216 char *Prefix,
217 char *TableId);
219 void
220 AdWriteTable (
221 ACPI_TABLE_HEADER *Table,
222 UINT32 Length,
223 char *TableName,
224 char *OemTableId);
226 #endif /* _ACAPPS */