acapps.h (26f3cdf0) acapps.h (7b1019a6)
1/******************************************************************************
2 *
3 * Module Name: acapps - common include for ACPI applications/tools
4 *
5 *****************************************************************************/
6
7/*
1/******************************************************************************
2 *
3 * Module Name: acapps - common include for ACPI applications/tools
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2011, Intel Corp.
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.

--- 22 unchanged lines hidden (view full) ---

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 _ACAPPS
45#define _ACAPPS
46
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.

--- 22 unchanged lines hidden (view full) ---

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 _ACAPPS
45#define _ACAPPS
46
47#include <stdio.h>
47
48#ifdef _MSC_VER /* disable some level-4 warnings */
49#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
50#endif
51
52/* Common info for tool signons */
53
54#define ACPICA_NAME "Intel ACPI Component Architecture"
48
49#ifdef _MSC_VER /* disable some level-4 warnings */
50#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
51#endif
52
53/* Common info for tool signons */
54
55#define ACPICA_NAME "Intel ACPI Component Architecture"
55#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2011 Intel Corporation"
56#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2016 Intel Corporation"
56
57#if ACPI_MACHINE_WIDTH == 64
58#define ACPI_WIDTH "-64"
59
60#elif ACPI_MACHINE_WIDTH == 32
61#define ACPI_WIDTH "-32"
62
63#else
64#error unknown ACPI_MACHINE_WIDTH
65#define ACPI_WIDTH "-??"
66
67#endif
68
69/* Macros for signons and file headers */
70
71#define ACPI_COMMON_SIGNON(UtilityName) \
57
58#if ACPI_MACHINE_WIDTH == 64
59#define ACPI_WIDTH "-64"
60
61#elif ACPI_MACHINE_WIDTH == 32
62#define ACPI_WIDTH "-32"
63
64#else
65#error unknown ACPI_MACHINE_WIDTH
66#define ACPI_WIDTH "-??"
67
68#endif
69
70/* Macros for signons and file headers */
71
72#define ACPI_COMMON_SIGNON(UtilityName) \
72 "\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \
73 "\n%s\n%s version %8.8X%s\n%s\n\n", \
73 ACPICA_NAME, \
74 ACPICA_NAME, \
74 UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
75 UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
75 ACPICA_COPYRIGHT
76
77#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
76 ACPICA_COPYRIGHT
77
78#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
78 "%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \
79 "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \
79 Prefix, ACPICA_NAME, \
80 Prefix, ACPICA_NAME, \
80 Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
81 Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
81 Prefix, ACPICA_COPYRIGHT, \
82 Prefix
83
82 Prefix, ACPICA_COPYRIGHT, \
83 Prefix
84
85/* Macros for usage messages */
86
87#define ACPI_USAGE_HEADER(Usage) \
88 AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
89
90#define ACPI_USAGE_TEXT(Description) \
91 AcpiOsPrintf (Description);
92
93#define ACPI_OPTION(Name, Description) \
94 AcpiOsPrintf (" %-20s%s\n", Name, Description);
95
96
97/* Check for unexpected exceptions */
98
99#define ACPI_CHECK_STATUS(Name, Status, Expected) \
100 if (Status != Expected) \
101 { \
102 AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
103 AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
104 }
105
106/* Check for unexpected non-AE_OK errors */
107
108
109#define ACPI_CHECK_OK(Name, Status) ACPI_CHECK_STATUS (Name, Status, AE_OK);
110
84#define FILE_SUFFIX_DISASSEMBLY "dsl"
111#define FILE_SUFFIX_DISASSEMBLY "dsl"
85#define ACPI_TABLE_FILE_SUFFIX ".dat"
112#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */
86
87
113
114
115/* acfileio */
116
117ACPI_STATUS
118AcGetAllTablesFromFile (
119 char *Filename,
120 UINT8 GetOnlyAmlTables,
121 ACPI_NEW_TABLE_DESC **ReturnListHead);
122
123BOOLEAN
124AcIsFileBinary (
125 FILE *File);
126
127ACPI_STATUS
128AcValidateTableHeader (
129 FILE *File,
130 long TableOffset);
131
132
133/* Values for GetOnlyAmlTables */
134
135#define ACPI_GET_ONLY_AML_TABLES TRUE
136#define ACPI_GET_ALL_TABLES FALSE
137
138
88/*
89 * getopt
90 */
91int
92AcpiGetopt(
93 int argc,
94 char **argv,
95 char *opts);
96
139/*
140 * getopt
141 */
142int
143AcpiGetopt(
144 int argc,
145 char **argv,
146 char *opts);
147
148int
149AcpiGetoptArgument (
150 int argc,
151 char **argv);
152
97extern int AcpiGbl_Optind;
98extern int AcpiGbl_Opterr;
153extern int AcpiGbl_Optind;
154extern int AcpiGbl_Opterr;
155extern int AcpiGbl_SubOptChar;
99extern char *AcpiGbl_Optarg;
100
101
102/*
156extern char *AcpiGbl_Optarg;
157
158
159/*
103 * adisasm
160 * cmfsize - Common get file size function
104 */
161 */
105ACPI_STATUS
106AdAmlDisassemble (
107 BOOLEAN OutToFile,
108 char *Filename,
109 char *Prefix,
110 char **OutFilename,
111 BOOLEAN GetAllTables);
162UINT32
163CmGetFileSize (
164 ACPI_FILE File);
112
165
113void
114AdPrintStatistics (
115 void);
116
166
117ACPI_STATUS
118AdFindDsdt(
119 UINT8 **DsdtPtr,
120 UINT32 *DsdtLength);
121
122void
123AdDumpTables (
124 void);
125
126ACPI_STATUS
127AdGetLocalTables (
128 char *Filename,
129 BOOLEAN GetAllTables);
130
131ACPI_STATUS
132AdParseTable (
133 ACPI_TABLE_HEADER *Table,
134 ACPI_OWNER_ID *OwnerId,
135 BOOLEAN LoadTable,
136 BOOLEAN External);
137
138ACPI_STATUS
139AdDisplayTables (
140 char *Filename,
141 ACPI_TABLE_HEADER *Table);
142
143ACPI_STATUS
144AdDisplayStatistics (
145 void);
146
147
148/*
149 * adwalk
150 */
151void
152AcpiDmCrossReferenceNamespace (
153 ACPI_PARSE_OBJECT *ParseTreeRoot,
154 ACPI_NAMESPACE_NODE *NamespaceRoot,
155 ACPI_OWNER_ID OwnerId);

--- 44 unchanged lines hidden (view full) ---

200void
201AdWriteTable (
202 ACPI_TABLE_HEADER *Table,
203 UINT32 Length,
204 char *TableName,
205 char *OemTableId);
206
207#endif /* _ACAPPS */
167/*
168 * adwalk
169 */
170void
171AcpiDmCrossReferenceNamespace (
172 ACPI_PARSE_OBJECT *ParseTreeRoot,
173 ACPI_NAMESPACE_NODE *NamespaceRoot,
174 ACPI_OWNER_ID OwnerId);

--- 44 unchanged lines hidden (view full) ---

219void
220AdWriteTable (
221 ACPI_TABLE_HEADER *Table,
222 UINT32 Length,
223 char *TableName,
224 char *OemTableId);
225
226#endif /* _ACAPPS */
208