acpihelp.h revision 1.1.1.7 1 /******************************************************************************
2 *
3 * Module Name: acpihelp.h - Include file for AcpiHelp utility
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
10 *
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.
25 *
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.
29 *
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.
42 */
43
44 #ifndef __ACPIHELP_H
45 #define __ACPIHELP_H
46
47
48 #include "acpi.h"
49 #include "accommon.h"
50 #include "acapps.h"
51
52 #include <sys/types.h>
53 #ifdef WIN32
54 #include <io.h>
55 #include <direct.h>
56 #endif
57
58
59 typedef enum
60 {
61 AH_DECODE_DEFAULT = 0,
62 AH_DECODE_ASL,
63 AH_DECODE_ASL_KEYWORD,
64 AH_DECODE_PREDEFINED_NAME,
65 AH_DECODE_AML,
66 AH_DECODE_AML_OPCODE,
67 AH_DECODE_AML_TYPE,
68 AH_DECODE_ASL_AML,
69 AH_DECODE_EXCEPTION,
70
71 AH_DISPLAY_DEVICE_IDS,
72 AH_DISPLAY_UUIDS,
73 AH_DISPLAY_TABLES,
74 AH_DISPLAY_DIRECTIVES
75
76 } AH_OPTION_TYPES;
77
78 #define AH_MAX_ASL_LINE_LENGTH 70
79 #define AH_MAX_AML_LINE_LENGTH 100
80
81
82 typedef struct ah_aml_opcode
83 {
84 UINT16 OpcodeRangeStart;
85 UINT16 OpcodeRangeEnd;
86 char *OpcodeString;
87 char *OpcodeName;
88 char *Type;
89 char *FixedArguments;
90 char *VariableArguments;
91 char *Grammar;
92
93 } AH_AML_OPCODE;
94
95 typedef struct ah_aml_type
96 {
97 char *Name;
98 char *Description;
99
100 } AH_AML_TYPE;
101
102 typedef struct ah_asl_operator
103 {
104 char *Name;
105 char *Syntax;
106 char *Description;
107
108 } AH_ASL_OPERATOR;
109
110 typedef struct ah_asl_keyword
111 {
112 char *Name;
113 char *Description;
114 char *KeywordList;
115
116 } AH_ASL_KEYWORD;
117
118 typedef struct ah_directive_info
119 {
120 char *Name;
121 char *Description;
122
123 } AH_DIRECTIVE_INFO;
124
125 extern const AH_AML_OPCODE AmlOpcodeInfo[];
126 extern const AH_AML_TYPE AmlTypesInfo[];
127 extern const AH_ASL_OPERATOR AslOperatorInfo[];
128 extern const AH_ASL_KEYWORD AslKeywordInfo[];
129 extern const AH_UUID AcpiUuids[];
130 extern const AH_DIRECTIVE_INFO PreprocessorDirectives[];
131 extern const AH_TABLE AcpiSupportedTables[];
132 extern BOOLEAN AhDisplayAll;
133
134 void
135 AhFindAmlOpcode (
136 char *Name);
137
138 void
139 AhDecodeAmlOpcode (
140 char *Name);
141
142 void
143 AhDecodeException (
144 char *Name);
145
146 void
147 AhFindPredefinedNames (
148 char *Name);
149
150 void
151 AhFindAslAndAmlOperators (
152 char *Name);
153
154 UINT32
155 AhFindAslOperators (
156 char *Name);
157
158 void
159 AhFindAslKeywords (
160 char *Name);
161
162 void
163 AhFindAmlTypes (
164 char *Name);
165
166 void
167 AhDisplayDeviceIds (
168 char *Name);
169
170 void
171 AhDisplayTables (
172 void);
173
174 const AH_TABLE *
175 AcpiAhGetTableInfo (
176 char *Signature);
177
178 void
179 AhDisplayUuids (
180 void);
181
182 void
183 AhDisplayDirectives (
184 void);
185
186 #endif /* __ACPIHELP_H */
187