aslhex.c revision 1.1.1.1.10.2 1 1.1.1.1.10.2 tls /******************************************************************************
2 1.1.1.1.10.2 tls *
3 1.1.1.1.10.2 tls * Module Name: aslhex - ASCII hex output file generation (C, ASM, and ASL)
4 1.1.1.1.10.2 tls *
5 1.1.1.1.10.2 tls *****************************************************************************/
6 1.1.1.1.10.2 tls
7 1.1.1.1.10.2 tls /*
8 1.1.1.1.10.2 tls * Copyright (C) 2000 - 2013, Intel Corp.
9 1.1.1.1.10.2 tls * All rights reserved.
10 1.1.1.1.10.2 tls *
11 1.1.1.1.10.2 tls * Redistribution and use in source and binary forms, with or without
12 1.1.1.1.10.2 tls * modification, are permitted provided that the following conditions
13 1.1.1.1.10.2 tls * are met:
14 1.1.1.1.10.2 tls * 1. Redistributions of source code must retain the above copyright
15 1.1.1.1.10.2 tls * notice, this list of conditions, and the following disclaimer,
16 1.1.1.1.10.2 tls * without modification.
17 1.1.1.1.10.2 tls * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1.1.1.10.2 tls * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1.1.1.10.2 tls * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1.1.1.10.2 tls * including a substantially similar Disclaimer requirement for further
21 1.1.1.1.10.2 tls * binary redistribution.
22 1.1.1.1.10.2 tls * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1.1.1.10.2 tls * of any contributors may be used to endorse or promote products derived
24 1.1.1.1.10.2 tls * from this software without specific prior written permission.
25 1.1.1.1.10.2 tls *
26 1.1.1.1.10.2 tls * Alternatively, this software may be distributed under the terms of the
27 1.1.1.1.10.2 tls * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1.1.1.10.2 tls * Software Foundation.
29 1.1.1.1.10.2 tls *
30 1.1.1.1.10.2 tls * NO WARRANTY
31 1.1.1.1.10.2 tls * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1.1.1.10.2 tls * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1.1.1.10.2 tls * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1.1.1.10.2 tls * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1.1.1.10.2 tls * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1.1.1.10.2 tls * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1.1.1.10.2 tls * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1.1.1.10.2 tls * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1.1.1.10.2 tls * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1.1.1.10.2 tls * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1.1.1.10.2 tls * POSSIBILITY OF SUCH DAMAGES.
42 1.1.1.1.10.2 tls */
43 1.1.1.1.10.2 tls
44 1.1.1.1.10.2 tls
45 1.1.1.1.10.2 tls #include "aslcompiler.h"
46 1.1.1.1.10.2 tls
47 1.1.1.1.10.2 tls #define _COMPONENT ACPI_COMPILER
48 1.1.1.1.10.2 tls ACPI_MODULE_NAME ("ashex")
49 1.1.1.1.10.2 tls
50 1.1.1.1.10.2 tls /*
51 1.1.1.1.10.2 tls * This module emits ASCII hex output files in either C, ASM, or ASL format
52 1.1.1.1.10.2 tls */
53 1.1.1.1.10.2 tls
54 1.1.1.1.10.2 tls
55 1.1.1.1.10.2 tls /* Local prototypes */
56 1.1.1.1.10.2 tls
57 1.1.1.1.10.2 tls static void
58 1.1.1.1.10.2 tls HxDoHexOutputC (
59 1.1.1.1.10.2 tls void);
60 1.1.1.1.10.2 tls
61 1.1.1.1.10.2 tls static void
62 1.1.1.1.10.2 tls HxDoHexOutputAsl (
63 1.1.1.1.10.2 tls void);
64 1.1.1.1.10.2 tls
65 1.1.1.1.10.2 tls static void
66 1.1.1.1.10.2 tls HxDoHexOutputAsm (
67 1.1.1.1.10.2 tls void);
68 1.1.1.1.10.2 tls
69 1.1.1.1.10.2 tls static UINT32
70 1.1.1.1.10.2 tls HxReadAmlOutputFile (
71 1.1.1.1.10.2 tls UINT8 *Buffer);
72 1.1.1.1.10.2 tls
73 1.1.1.1.10.2 tls
74 1.1.1.1.10.2 tls /*******************************************************************************
75 1.1.1.1.10.2 tls *
76 1.1.1.1.10.2 tls * FUNCTION: HxDoHexOutput
77 1.1.1.1.10.2 tls *
78 1.1.1.1.10.2 tls * PARAMETERS: None
79 1.1.1.1.10.2 tls *
80 1.1.1.1.10.2 tls * RETURN: None
81 1.1.1.1.10.2 tls *
82 1.1.1.1.10.2 tls * DESCRIPTION: Create the hex output file. Note: data is obtained by reading
83 1.1.1.1.10.2 tls * the entire AML output file that was previously generated.
84 1.1.1.1.10.2 tls *
85 1.1.1.1.10.2 tls ******************************************************************************/
86 1.1.1.1.10.2 tls
87 1.1.1.1.10.2 tls void
88 1.1.1.1.10.2 tls HxDoHexOutput (
89 1.1.1.1.10.2 tls void)
90 1.1.1.1.10.2 tls {
91 1.1.1.1.10.2 tls
92 1.1.1.1.10.2 tls switch (Gbl_HexOutputFlag)
93 1.1.1.1.10.2 tls {
94 1.1.1.1.10.2 tls case HEX_OUTPUT_C:
95 1.1.1.1.10.2 tls
96 1.1.1.1.10.2 tls HxDoHexOutputC ();
97 1.1.1.1.10.2 tls break;
98 1.1.1.1.10.2 tls
99 1.1.1.1.10.2 tls case HEX_OUTPUT_ASM:
100 1.1.1.1.10.2 tls
101 1.1.1.1.10.2 tls HxDoHexOutputAsm ();
102 1.1.1.1.10.2 tls break;
103 1.1.1.1.10.2 tls
104 1.1.1.1.10.2 tls case HEX_OUTPUT_ASL:
105 1.1.1.1.10.2 tls
106 1.1.1.1.10.2 tls HxDoHexOutputAsl ();
107 1.1.1.1.10.2 tls break;
108 1.1.1.1.10.2 tls
109 1.1.1.1.10.2 tls default:
110 1.1.1.1.10.2 tls
111 1.1.1.1.10.2 tls /* No other output types supported */
112 1.1.1.1.10.2 tls
113 1.1.1.1.10.2 tls break;
114 1.1.1.1.10.2 tls }
115 1.1.1.1.10.2 tls }
116 1.1.1.1.10.2 tls
117 1.1.1.1.10.2 tls
118 1.1.1.1.10.2 tls /*******************************************************************************
119 1.1.1.1.10.2 tls *
120 1.1.1.1.10.2 tls * FUNCTION: HxReadAmlOutputFile
121 1.1.1.1.10.2 tls *
122 1.1.1.1.10.2 tls * PARAMETERS: Buffer - Where to return data
123 1.1.1.1.10.2 tls *
124 1.1.1.1.10.2 tls * RETURN: None
125 1.1.1.1.10.2 tls *
126 1.1.1.1.10.2 tls * DESCRIPTION: Read a line of the AML output prior to formatting the data
127 1.1.1.1.10.2 tls *
128 1.1.1.1.10.2 tls ******************************************************************************/
129 1.1.1.1.10.2 tls
130 1.1.1.1.10.2 tls static UINT32
131 1.1.1.1.10.2 tls HxReadAmlOutputFile (
132 1.1.1.1.10.2 tls UINT8 *Buffer)
133 1.1.1.1.10.2 tls {
134 1.1.1.1.10.2 tls UINT32 Actual;
135 1.1.1.1.10.2 tls
136 1.1.1.1.10.2 tls
137 1.1.1.1.10.2 tls Actual = fread (Buffer, 1, HEX_TABLE_LINE_SIZE,
138 1.1.1.1.10.2 tls Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
139 1.1.1.1.10.2 tls
140 1.1.1.1.10.2 tls if (ferror (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle))
141 1.1.1.1.10.2 tls {
142 1.1.1.1.10.2 tls FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ);
143 1.1.1.1.10.2 tls AslAbort ();
144 1.1.1.1.10.2 tls }
145 1.1.1.1.10.2 tls
146 1.1.1.1.10.2 tls return (Actual);
147 1.1.1.1.10.2 tls }
148 1.1.1.1.10.2 tls
149 1.1.1.1.10.2 tls
150 1.1.1.1.10.2 tls /*******************************************************************************
151 1.1.1.1.10.2 tls *
152 1.1.1.1.10.2 tls * FUNCTION: HxDoHexOutputC
153 1.1.1.1.10.2 tls *
154 1.1.1.1.10.2 tls * PARAMETERS: None
155 1.1.1.1.10.2 tls *
156 1.1.1.1.10.2 tls * RETURN: None
157 1.1.1.1.10.2 tls *
158 1.1.1.1.10.2 tls * DESCRIPTION: Create the hex output file. This is the same data as the AML
159 1.1.1.1.10.2 tls * output file, but formatted into hex/ascii bytes suitable for
160 1.1.1.1.10.2 tls * inclusion into a C source file.
161 1.1.1.1.10.2 tls *
162 1.1.1.1.10.2 tls ******************************************************************************/
163 1.1.1.1.10.2 tls
164 1.1.1.1.10.2 tls static void
165 1.1.1.1.10.2 tls HxDoHexOutputC (
166 1.1.1.1.10.2 tls void)
167 1.1.1.1.10.2 tls {
168 1.1.1.1.10.2 tls UINT8 FileData[HEX_TABLE_LINE_SIZE];
169 1.1.1.1.10.2 tls UINT32 LineLength;
170 1.1.1.1.10.2 tls UINT32 Offset = 0;
171 1.1.1.1.10.2 tls UINT32 AmlFileSize;
172 1.1.1.1.10.2 tls UINT32 i;
173 1.1.1.1.10.2 tls
174 1.1.1.1.10.2 tls
175 1.1.1.1.10.2 tls /* Get AML size, seek back to start */
176 1.1.1.1.10.2 tls
177 1.1.1.1.10.2 tls AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
178 1.1.1.1.10.2 tls FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
179 1.1.1.1.10.2 tls
180 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n");
181 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
182 1.1.1.1.10.2 tls AmlFileSize);
183 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n");
184 1.1.1.1.10.2 tls
185 1.1.1.1.10.2 tls while (Offset < AmlFileSize)
186 1.1.1.1.10.2 tls {
187 1.1.1.1.10.2 tls /* Read enough bytes needed for one output line */
188 1.1.1.1.10.2 tls
189 1.1.1.1.10.2 tls LineLength = HxReadAmlOutputFile (FileData);
190 1.1.1.1.10.2 tls if (!LineLength)
191 1.1.1.1.10.2 tls {
192 1.1.1.1.10.2 tls break;
193 1.1.1.1.10.2 tls }
194 1.1.1.1.10.2 tls
195 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
196 1.1.1.1.10.2 tls
197 1.1.1.1.10.2 tls for (i = 0; i < LineLength; i++)
198 1.1.1.1.10.2 tls {
199 1.1.1.1.10.2 tls /*
200 1.1.1.1.10.2 tls * Print each hex byte.
201 1.1.1.1.10.2 tls * Add a comma until the very last byte of the AML file
202 1.1.1.1.10.2 tls * (Some C compilers complain about a trailing comma)
203 1.1.1.1.10.2 tls */
204 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]);
205 1.1.1.1.10.2 tls if ((Offset + i + 1) < AmlFileSize)
206 1.1.1.1.10.2 tls {
207 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
208 1.1.1.1.10.2 tls }
209 1.1.1.1.10.2 tls else
210 1.1.1.1.10.2 tls {
211 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
212 1.1.1.1.10.2 tls }
213 1.1.1.1.10.2 tls }
214 1.1.1.1.10.2 tls
215 1.1.1.1.10.2 tls /* Add fill spaces if needed for last line */
216 1.1.1.1.10.2 tls
217 1.1.1.1.10.2 tls if (LineLength < HEX_TABLE_LINE_SIZE)
218 1.1.1.1.10.2 tls {
219 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
220 1.1.1.1.10.2 tls 5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
221 1.1.1.1.10.2 tls }
222 1.1.1.1.10.2 tls
223 1.1.1.1.10.2 tls /* Emit the offset and ascii dump for the entire line */
224 1.1.1.1.10.2 tls
225 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset);
226 1.1.1.1.10.2 tls LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
227 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
228 1.1.1.1.10.2 tls HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
229 1.1.1.1.10.2 tls
230 1.1.1.1.10.2 tls Offset += LineLength;
231 1.1.1.1.10.2 tls }
232 1.1.1.1.10.2 tls
233 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n");
234 1.1.1.1.10.2 tls }
235 1.1.1.1.10.2 tls
236 1.1.1.1.10.2 tls
237 1.1.1.1.10.2 tls /*******************************************************************************
238 1.1.1.1.10.2 tls *
239 1.1.1.1.10.2 tls * FUNCTION: HxDoHexOutputAsl
240 1.1.1.1.10.2 tls *
241 1.1.1.1.10.2 tls * PARAMETERS: None
242 1.1.1.1.10.2 tls *
243 1.1.1.1.10.2 tls * RETURN: None
244 1.1.1.1.10.2 tls *
245 1.1.1.1.10.2 tls * DESCRIPTION: Create the hex output file. This is the same data as the AML
246 1.1.1.1.10.2 tls * output file, but formatted into hex/ascii bytes suitable for
247 1.1.1.1.10.2 tls * inclusion into a C source file.
248 1.1.1.1.10.2 tls *
249 1.1.1.1.10.2 tls ******************************************************************************/
250 1.1.1.1.10.2 tls
251 1.1.1.1.10.2 tls static void
252 1.1.1.1.10.2 tls HxDoHexOutputAsl (
253 1.1.1.1.10.2 tls void)
254 1.1.1.1.10.2 tls {
255 1.1.1.1.10.2 tls UINT8 FileData[HEX_TABLE_LINE_SIZE];
256 1.1.1.1.10.2 tls UINT32 LineLength;
257 1.1.1.1.10.2 tls UINT32 Offset = 0;
258 1.1.1.1.10.2 tls UINT32 AmlFileSize;
259 1.1.1.1.10.2 tls UINT32 i;
260 1.1.1.1.10.2 tls
261 1.1.1.1.10.2 tls
262 1.1.1.1.10.2 tls /* Get AML size, seek back to start */
263 1.1.1.1.10.2 tls
264 1.1.1.1.10.2 tls AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
265 1.1.1.1.10.2 tls FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
266 1.1.1.1.10.2 tls
267 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " * ASL source code output\n");
268 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
269 1.1.1.1.10.2 tls AmlFileSize);
270 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " Name (BUF1, Buffer()\n {\n");
271 1.1.1.1.10.2 tls
272 1.1.1.1.10.2 tls while (Offset < AmlFileSize)
273 1.1.1.1.10.2 tls {
274 1.1.1.1.10.2 tls /* Read enough bytes needed for one output line */
275 1.1.1.1.10.2 tls
276 1.1.1.1.10.2 tls LineLength = HxReadAmlOutputFile (FileData);
277 1.1.1.1.10.2 tls if (!LineLength)
278 1.1.1.1.10.2 tls {
279 1.1.1.1.10.2 tls break;
280 1.1.1.1.10.2 tls }
281 1.1.1.1.10.2 tls
282 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
283 1.1.1.1.10.2 tls
284 1.1.1.1.10.2 tls for (i = 0; i < LineLength; i++)
285 1.1.1.1.10.2 tls {
286 1.1.1.1.10.2 tls /*
287 1.1.1.1.10.2 tls * Print each hex byte.
288 1.1.1.1.10.2 tls * Add a comma until the very last byte of the AML file
289 1.1.1.1.10.2 tls * (Some C compilers complain about a trailing comma)
290 1.1.1.1.10.2 tls */
291 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]);
292 1.1.1.1.10.2 tls if ((Offset + i + 1) < AmlFileSize)
293 1.1.1.1.10.2 tls {
294 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
295 1.1.1.1.10.2 tls }
296 1.1.1.1.10.2 tls else
297 1.1.1.1.10.2 tls {
298 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
299 1.1.1.1.10.2 tls }
300 1.1.1.1.10.2 tls }
301 1.1.1.1.10.2 tls
302 1.1.1.1.10.2 tls /* Add fill spaces if needed for last line */
303 1.1.1.1.10.2 tls
304 1.1.1.1.10.2 tls if (LineLength < HEX_TABLE_LINE_SIZE)
305 1.1.1.1.10.2 tls {
306 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
307 1.1.1.1.10.2 tls 5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
308 1.1.1.1.10.2 tls }
309 1.1.1.1.10.2 tls
310 1.1.1.1.10.2 tls /* Emit the offset and ascii dump for the entire line */
311 1.1.1.1.10.2 tls
312 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset);
313 1.1.1.1.10.2 tls LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
314 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
315 1.1.1.1.10.2 tls HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
316 1.1.1.1.10.2 tls
317 1.1.1.1.10.2 tls Offset += LineLength;
318 1.1.1.1.10.2 tls }
319 1.1.1.1.10.2 tls
320 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " })\n");
321 1.1.1.1.10.2 tls }
322 1.1.1.1.10.2 tls
323 1.1.1.1.10.2 tls
324 1.1.1.1.10.2 tls /*******************************************************************************
325 1.1.1.1.10.2 tls *
326 1.1.1.1.10.2 tls * FUNCTION: HxDoHexOutputAsm
327 1.1.1.1.10.2 tls *
328 1.1.1.1.10.2 tls * PARAMETERS: None
329 1.1.1.1.10.2 tls *
330 1.1.1.1.10.2 tls * RETURN: None
331 1.1.1.1.10.2 tls *
332 1.1.1.1.10.2 tls * DESCRIPTION: Create the hex output file. This is the same data as the AML
333 1.1.1.1.10.2 tls * output file, but formatted into hex/ascii bytes suitable for
334 1.1.1.1.10.2 tls * inclusion into a ASM source file.
335 1.1.1.1.10.2 tls *
336 1.1.1.1.10.2 tls ******************************************************************************/
337 1.1.1.1.10.2 tls
338 1.1.1.1.10.2 tls static void
339 1.1.1.1.10.2 tls HxDoHexOutputAsm (
340 1.1.1.1.10.2 tls void)
341 1.1.1.1.10.2 tls {
342 1.1.1.1.10.2 tls UINT8 FileData[HEX_TABLE_LINE_SIZE];
343 1.1.1.1.10.2 tls UINT32 LineLength;
344 1.1.1.1.10.2 tls UINT32 Offset = 0;
345 1.1.1.1.10.2 tls UINT32 AmlFileSize;
346 1.1.1.1.10.2 tls UINT32 i;
347 1.1.1.1.10.2 tls
348 1.1.1.1.10.2 tls
349 1.1.1.1.10.2 tls /* Get AML size, seek back to start */
350 1.1.1.1.10.2 tls
351 1.1.1.1.10.2 tls AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
352 1.1.1.1.10.2 tls FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
353 1.1.1.1.10.2 tls
354 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n");
355 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "; AML code block contains 0x%X bytes\n;\n",
356 1.1.1.1.10.2 tls AmlFileSize);
357 1.1.1.1.10.2 tls
358 1.1.1.1.10.2 tls while (Offset < AmlFileSize)
359 1.1.1.1.10.2 tls {
360 1.1.1.1.10.2 tls /* Read enough bytes needed for one output line */
361 1.1.1.1.10.2 tls
362 1.1.1.1.10.2 tls LineLength = HxReadAmlOutputFile (FileData);
363 1.1.1.1.10.2 tls if (!LineLength)
364 1.1.1.1.10.2 tls {
365 1.1.1.1.10.2 tls break;
366 1.1.1.1.10.2 tls }
367 1.1.1.1.10.2 tls
368 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " db ");
369 1.1.1.1.10.2 tls
370 1.1.1.1.10.2 tls for (i = 0; i < LineLength; i++)
371 1.1.1.1.10.2 tls {
372 1.1.1.1.10.2 tls /*
373 1.1.1.1.10.2 tls * Print each hex byte.
374 1.1.1.1.10.2 tls * Add a comma until the last byte of the line
375 1.1.1.1.10.2 tls */
376 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "0%2.2Xh", FileData[i]);
377 1.1.1.1.10.2 tls if ((i + 1) < LineLength)
378 1.1.1.1.10.2 tls {
379 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
380 1.1.1.1.10.2 tls }
381 1.1.1.1.10.2 tls }
382 1.1.1.1.10.2 tls
383 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
384 1.1.1.1.10.2 tls
385 1.1.1.1.10.2 tls /* Add fill spaces if needed for last line */
386 1.1.1.1.10.2 tls
387 1.1.1.1.10.2 tls if (LineLength < HEX_TABLE_LINE_SIZE)
388 1.1.1.1.10.2 tls {
389 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
390 1.1.1.1.10.2 tls 5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
391 1.1.1.1.10.2 tls }
392 1.1.1.1.10.2 tls
393 1.1.1.1.10.2 tls /* Emit the offset and ascii dump for the entire line */
394 1.1.1.1.10.2 tls
395 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, " ; %8.8X", Offset);
396 1.1.1.1.10.2 tls LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
397 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
398 1.1.1.1.10.2 tls
399 1.1.1.1.10.2 tls Offset += LineLength;
400 1.1.1.1.10.2 tls }
401 1.1.1.1.10.2 tls
402 1.1.1.1.10.2 tls FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
403 1.1.1.1.10.2 tls }
404