dtexpress.c revision 1.1.1.1.4.2 1 1.1.1.1.4.2 rmind /******************************************************************************
2 1.1.1.1.4.2 rmind *
3 1.1.1.1.4.2 rmind * Module Name: dtexpress.c - Support for integer expressions and labels
4 1.1.1.1.4.2 rmind *
5 1.1.1.1.4.2 rmind *****************************************************************************/
6 1.1.1.1.4.2 rmind
7 1.1.1.1.4.2 rmind /*
8 1.1.1.1.4.2 rmind * Copyright (C) 2000 - 2011, Intel Corp.
9 1.1.1.1.4.2 rmind * All rights reserved.
10 1.1.1.1.4.2 rmind *
11 1.1.1.1.4.2 rmind * Redistribution and use in source and binary forms, with or without
12 1.1.1.1.4.2 rmind * modification, are permitted provided that the following conditions
13 1.1.1.1.4.2 rmind * are met:
14 1.1.1.1.4.2 rmind * 1. Redistributions of source code must retain the above copyright
15 1.1.1.1.4.2 rmind * notice, this list of conditions, and the following disclaimer,
16 1.1.1.1.4.2 rmind * without modification.
17 1.1.1.1.4.2 rmind * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1.1.1.4.2 rmind * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1.1.1.4.2 rmind * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1.1.1.4.2 rmind * including a substantially similar Disclaimer requirement for further
21 1.1.1.1.4.2 rmind * binary redistribution.
22 1.1.1.1.4.2 rmind * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1.1.1.4.2 rmind * of any contributors may be used to endorse or promote products derived
24 1.1.1.1.4.2 rmind * from this software without specific prior written permission.
25 1.1.1.1.4.2 rmind *
26 1.1.1.1.4.2 rmind * Alternatively, this software may be distributed under the terms of the
27 1.1.1.1.4.2 rmind * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1.1.1.4.2 rmind * Software Foundation.
29 1.1.1.1.4.2 rmind *
30 1.1.1.1.4.2 rmind * NO WARRANTY
31 1.1.1.1.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1.1.1.4.2 rmind * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1.1.1.4.2 rmind * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1.1.1.4.2 rmind * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1.1.1.4.2 rmind * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1.1.1.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1.1.1.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1.1.1.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1.1.1.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1.1.1.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1.1.1.4.2 rmind * POSSIBILITY OF SUCH DAMAGES.
42 1.1.1.1.4.2 rmind */
43 1.1.1.1.4.2 rmind
44 1.1.1.1.4.2 rmind #define __DTEXPRESS_C__
45 1.1.1.1.4.2 rmind
46 1.1.1.1.4.2 rmind #include "aslcompiler.h"
47 1.1.1.1.4.2 rmind #include "dtcompiler.h"
48 1.1.1.1.4.2 rmind
49 1.1.1.1.4.2 rmind #define _COMPONENT DT_COMPILER
50 1.1.1.1.4.2 rmind ACPI_MODULE_NAME ("dtexpress")
51 1.1.1.1.4.2 rmind
52 1.1.1.1.4.2 rmind
53 1.1.1.1.4.2 rmind /* Local prototypes */
54 1.1.1.1.4.2 rmind
55 1.1.1.1.4.2 rmind static UINT64
56 1.1.1.1.4.2 rmind DtResolveInteger (
57 1.1.1.1.4.2 rmind DT_FIELD *Field,
58 1.1.1.1.4.2 rmind char *IntegerString);
59 1.1.1.1.4.2 rmind
60 1.1.1.1.4.2 rmind static void
61 1.1.1.1.4.2 rmind DtInsertLabelField (
62 1.1.1.1.4.2 rmind DT_FIELD *Field);
63 1.1.1.1.4.2 rmind
64 1.1.1.1.4.2 rmind static DT_FIELD *
65 1.1.1.1.4.2 rmind DtLookupLabel (
66 1.1.1.1.4.2 rmind char *Name);
67 1.1.1.1.4.2 rmind
68 1.1.1.1.4.2 rmind
69 1.1.1.1.4.2 rmind /******************************************************************************
70 1.1.1.1.4.2 rmind *
71 1.1.1.1.4.2 rmind * FUNCTION: DtResolveIntegerExpression
72 1.1.1.1.4.2 rmind *
73 1.1.1.1.4.2 rmind * PARAMETERS: Field - Field object with Integer expression
74 1.1.1.1.4.2 rmind *
75 1.1.1.1.4.2 rmind * RETURN: A 64-bit integer value
76 1.1.1.1.4.2 rmind *
77 1.1.1.1.4.2 rmind * DESCRIPTION: Resolve an integer expression to a single value. Supports
78 1.1.1.1.4.2 rmind * both integer constants and labels. Supported operators are:
79 1.1.1.1.4.2 rmind * +,-,*,/,%,|,&,^
80 1.1.1.1.4.2 rmind *
81 1.1.1.1.4.2 rmind *****************************************************************************/
82 1.1.1.1.4.2 rmind
83 1.1.1.1.4.2 rmind UINT64
84 1.1.1.1.4.2 rmind DtResolveIntegerExpression (
85 1.1.1.1.4.2 rmind DT_FIELD *Field)
86 1.1.1.1.4.2 rmind {
87 1.1.1.1.4.2 rmind char *IntegerString;
88 1.1.1.1.4.2 rmind char *Operator;
89 1.1.1.1.4.2 rmind UINT64 Value;
90 1.1.1.1.4.2 rmind UINT64 Value2;
91 1.1.1.1.4.2 rmind
92 1.1.1.1.4.2 rmind
93 1.1.1.1.4.2 rmind DbgPrint (ASL_DEBUG_OUTPUT, "Full Integer expression: %s\n",
94 1.1.1.1.4.2 rmind Field->Value);
95 1.1.1.1.4.2 rmind
96 1.1.1.1.4.2 rmind strcpy (MsgBuffer, Field->Value); /* Must take a copy for strtok() */
97 1.1.1.1.4.2 rmind
98 1.1.1.1.4.2 rmind /* Obtain and resolve the first operand */
99 1.1.1.1.4.2 rmind
100 1.1.1.1.4.2 rmind IntegerString = strtok (MsgBuffer, " ");
101 1.1.1.1.4.2 rmind if (!IntegerString)
102 1.1.1.1.4.2 rmind {
103 1.1.1.1.4.2 rmind DtError (ASL_ERROR, ASL_MSG_INVALID_EXPRESSION, Field, Field->Value);
104 1.1.1.1.4.2 rmind return (0);
105 1.1.1.1.4.2 rmind }
106 1.1.1.1.4.2 rmind
107 1.1.1.1.4.2 rmind Value = DtResolveInteger (Field, IntegerString);
108 1.1.1.1.4.2 rmind DbgPrint (ASL_DEBUG_OUTPUT, "Integer resolved to V1: %8.8X%8.8X\n",
109 1.1.1.1.4.2 rmind ACPI_FORMAT_UINT64 (Value));
110 1.1.1.1.4.2 rmind
111 1.1.1.1.4.2 rmind /*
112 1.1.1.1.4.2 rmind * Consume the entire expression string. For the rest of the
113 1.1.1.1.4.2 rmind * expression string, values are of the form:
114 1.1.1.1.4.2 rmind * <operator> <integer>
115 1.1.1.1.4.2 rmind */
116 1.1.1.1.4.2 rmind while (1)
117 1.1.1.1.4.2 rmind {
118 1.1.1.1.4.2 rmind Operator = strtok (NULL, " ");
119 1.1.1.1.4.2 rmind if (!Operator)
120 1.1.1.1.4.2 rmind {
121 1.1.1.1.4.2 rmind /* Normal exit */
122 1.1.1.1.4.2 rmind
123 1.1.1.1.4.2 rmind DbgPrint (ASL_DEBUG_OUTPUT, "Expression Resolved to: %8.8X%8.8X\n",
124 1.1.1.1.4.2 rmind ACPI_FORMAT_UINT64 (Value));
125 1.1.1.1.4.2 rmind
126 1.1.1.1.4.2 rmind return (Value);
127 1.1.1.1.4.2 rmind }
128 1.1.1.1.4.2 rmind
129 1.1.1.1.4.2 rmind IntegerString = strtok (NULL, " ");
130 1.1.1.1.4.2 rmind if (!IntegerString ||
131 1.1.1.1.4.2 rmind (strlen (Operator) > 1))
132 1.1.1.1.4.2 rmind {
133 1.1.1.1.4.2 rmind /* No corresponding operand for operator or invalid operator */
134 1.1.1.1.4.2 rmind
135 1.1.1.1.4.2 rmind DtError (ASL_ERROR, ASL_MSG_INVALID_EXPRESSION, Field, Field->Value);
136 1.1.1.1.4.2 rmind return (0);
137 1.1.1.1.4.2 rmind }
138 1.1.1.1.4.2 rmind
139 1.1.1.1.4.2 rmind Value2 = DtResolveInteger (Field, IntegerString);
140 1.1.1.1.4.2 rmind DbgPrint (ASL_DEBUG_OUTPUT, "Integer resolved to V2: %8.8X%8.8X\n",
141 1.1.1.1.4.2 rmind ACPI_FORMAT_UINT64 (Value2));
142 1.1.1.1.4.2 rmind
143 1.1.1.1.4.2 rmind /* Perform the requested operation */
144 1.1.1.1.4.2 rmind
145 1.1.1.1.4.2 rmind switch (*Operator)
146 1.1.1.1.4.2 rmind {
147 1.1.1.1.4.2 rmind case '-':
148 1.1.1.1.4.2 rmind Value -= Value2;
149 1.1.1.1.4.2 rmind break;
150 1.1.1.1.4.2 rmind
151 1.1.1.1.4.2 rmind case '+':
152 1.1.1.1.4.2 rmind Value += Value2;
153 1.1.1.1.4.2 rmind break;
154 1.1.1.1.4.2 rmind
155 1.1.1.1.4.2 rmind case '*':
156 1.1.1.1.4.2 rmind Value *= Value2;
157 1.1.1.1.4.2 rmind break;
158 1.1.1.1.4.2 rmind
159 1.1.1.1.4.2 rmind case '|':
160 1.1.1.1.4.2 rmind Value |= Value2;
161 1.1.1.1.4.2 rmind break;
162 1.1.1.1.4.2 rmind
163 1.1.1.1.4.2 rmind case '&':
164 1.1.1.1.4.2 rmind Value &= Value2;
165 1.1.1.1.4.2 rmind break;
166 1.1.1.1.4.2 rmind
167 1.1.1.1.4.2 rmind case '^':
168 1.1.1.1.4.2 rmind Value ^= Value2;
169 1.1.1.1.4.2 rmind break;
170 1.1.1.1.4.2 rmind
171 1.1.1.1.4.2 rmind case '/':
172 1.1.1.1.4.2 rmind if (!Value2)
173 1.1.1.1.4.2 rmind {
174 1.1.1.1.4.2 rmind DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO, Field, Field->Value);
175 1.1.1.1.4.2 rmind return (0);
176 1.1.1.1.4.2 rmind }
177 1.1.1.1.4.2 rmind Value /= Value2;
178 1.1.1.1.4.2 rmind break;
179 1.1.1.1.4.2 rmind
180 1.1.1.1.4.2 rmind case '%':
181 1.1.1.1.4.2 rmind if (!Value2)
182 1.1.1.1.4.2 rmind {
183 1.1.1.1.4.2 rmind DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO, Field, Field->Value);
184 1.1.1.1.4.2 rmind return (0);
185 1.1.1.1.4.2 rmind }
186 1.1.1.1.4.2 rmind Value %= Value2;
187 1.1.1.1.4.2 rmind break;
188 1.1.1.1.4.2 rmind
189 1.1.1.1.4.2 rmind default:
190 1.1.1.1.4.2 rmind
191 1.1.1.1.4.2 rmind /* Unknown operator */
192 1.1.1.1.4.2 rmind
193 1.1.1.1.4.2 rmind DtFatal (ASL_MSG_INVALID_EXPRESSION, Field, Field->Value);
194 1.1.1.1.4.2 rmind break;
195 1.1.1.1.4.2 rmind }
196 1.1.1.1.4.2 rmind }
197 1.1.1.1.4.2 rmind
198 1.1.1.1.4.2 rmind return (Value);
199 1.1.1.1.4.2 rmind }
200 1.1.1.1.4.2 rmind
201 1.1.1.1.4.2 rmind
202 1.1.1.1.4.2 rmind /******************************************************************************
203 1.1.1.1.4.2 rmind *
204 1.1.1.1.4.2 rmind * FUNCTION: DtResolveInteger
205 1.1.1.1.4.2 rmind *
206 1.1.1.1.4.2 rmind * PARAMETERS: Field - Field object with string to be resolved
207 1.1.1.1.4.2 rmind * IntegerString - Integer to be resolved
208 1.1.1.1.4.2 rmind *
209 1.1.1.1.4.2 rmind * RETURN: A 64-bit integer value
210 1.1.1.1.4.2 rmind *
211 1.1.1.1.4.2 rmind * DESCRIPTION: Resolve a single integer string to a value. Supports both
212 1.1.1.1.4.2 rmind * integer constants and labels.
213 1.1.1.1.4.2 rmind *
214 1.1.1.1.4.2 rmind * NOTE: References to labels must begin with a dollar sign ($)
215 1.1.1.1.4.2 rmind *
216 1.1.1.1.4.2 rmind *****************************************************************************/
217 1.1.1.1.4.2 rmind
218 1.1.1.1.4.2 rmind static UINT64
219 1.1.1.1.4.2 rmind DtResolveInteger (
220 1.1.1.1.4.2 rmind DT_FIELD *Field,
221 1.1.1.1.4.2 rmind char *IntegerString)
222 1.1.1.1.4.2 rmind {
223 1.1.1.1.4.2 rmind DT_FIELD *LabelField;
224 1.1.1.1.4.2 rmind UINT64 Value = 0;
225 1.1.1.1.4.2 rmind char *Message = NULL;
226 1.1.1.1.4.2 rmind ACPI_STATUS Status;
227 1.1.1.1.4.2 rmind
228 1.1.1.1.4.2 rmind
229 1.1.1.1.4.2 rmind DbgPrint (ASL_DEBUG_OUTPUT, "Resolve Integer: %s\n", IntegerString);
230 1.1.1.1.4.2 rmind
231 1.1.1.1.4.2 rmind /* Resolve a label reference to an integer (table offset) */
232 1.1.1.1.4.2 rmind
233 1.1.1.1.4.2 rmind if (*IntegerString == '$')
234 1.1.1.1.4.2 rmind {
235 1.1.1.1.4.2 rmind LabelField = DtLookupLabel (IntegerString);
236 1.1.1.1.4.2 rmind if (!LabelField)
237 1.1.1.1.4.2 rmind {
238 1.1.1.1.4.2 rmind DtError (ASL_ERROR, ASL_MSG_UNKNOWN_LABEL, Field, IntegerString);
239 1.1.1.1.4.2 rmind return (0);
240 1.1.1.1.4.2 rmind }
241 1.1.1.1.4.2 rmind
242 1.1.1.1.4.2 rmind /* All we need from the label is the offset in the table */
243 1.1.1.1.4.2 rmind
244 1.1.1.1.4.2 rmind Value = LabelField->TableOffset;
245 1.1.1.1.4.2 rmind return (Value);
246 1.1.1.1.4.2 rmind }
247 1.1.1.1.4.2 rmind
248 1.1.1.1.4.2 rmind /* Convert string to an actual integer */
249 1.1.1.1.4.2 rmind
250 1.1.1.1.4.2 rmind Status = DtStrtoul64 (IntegerString, &Value);
251 1.1.1.1.4.2 rmind if (ACPI_FAILURE (Status))
252 1.1.1.1.4.2 rmind {
253 1.1.1.1.4.2 rmind if (Status == AE_LIMIT)
254 1.1.1.1.4.2 rmind {
255 1.1.1.1.4.2 rmind Message = "Constant larger than 64 bits";
256 1.1.1.1.4.2 rmind }
257 1.1.1.1.4.2 rmind else if (Status == AE_BAD_CHARACTER)
258 1.1.1.1.4.2 rmind {
259 1.1.1.1.4.2 rmind Message = "Invalid character in constant";
260 1.1.1.1.4.2 rmind }
261 1.1.1.1.4.2 rmind
262 1.1.1.1.4.2 rmind DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, Message);
263 1.1.1.1.4.2 rmind }
264 1.1.1.1.4.2 rmind
265 1.1.1.1.4.2 rmind return (Value);
266 1.1.1.1.4.2 rmind }
267 1.1.1.1.4.2 rmind
268 1.1.1.1.4.2 rmind
269 1.1.1.1.4.2 rmind /******************************************************************************
270 1.1.1.1.4.2 rmind *
271 1.1.1.1.4.2 rmind * FUNCTION: DtDetectAllLabels
272 1.1.1.1.4.2 rmind *
273 1.1.1.1.4.2 rmind * PARAMETERS: FieldList - Field object at start of generic list
274 1.1.1.1.4.2 rmind *
275 1.1.1.1.4.2 rmind * RETURN: None
276 1.1.1.1.4.2 rmind *
277 1.1.1.1.4.2 rmind * DESCRIPTION: Detect all labels in a list of "generic" opcodes (such as
278 1.1.1.1.4.2 rmind * a UEFI table.) and insert them into the global label list.
279 1.1.1.1.4.2 rmind *
280 1.1.1.1.4.2 rmind *****************************************************************************/
281 1.1.1.1.4.2 rmind
282 1.1.1.1.4.2 rmind void
283 1.1.1.1.4.2 rmind DtDetectAllLabels (
284 1.1.1.1.4.2 rmind DT_FIELD *FieldList)
285 1.1.1.1.4.2 rmind {
286 1.1.1.1.4.2 rmind ACPI_DMTABLE_INFO *Info;
287 1.1.1.1.4.2 rmind DT_FIELD *GenericField;
288 1.1.1.1.4.2 rmind UINT32 TableOffset;
289 1.1.1.1.4.2 rmind
290 1.1.1.1.4.2 rmind
291 1.1.1.1.4.2 rmind TableOffset = Gbl_CurrentTableOffset;
292 1.1.1.1.4.2 rmind GenericField = FieldList;
293 1.1.1.1.4.2 rmind
294 1.1.1.1.4.2 rmind /*
295 1.1.1.1.4.2 rmind * Process all "Label:" fields within the parse tree. We need
296 1.1.1.1.4.2 rmind * to know the offsets for all labels before we can compile
297 1.1.1.1.4.2 rmind * the parse tree in order to handle forward references. Traverse
298 1.1.1.1.4.2 rmind * tree and get/set all field lengths of all operators in order to
299 1.1.1.1.4.2 rmind * determine the label offsets.
300 1.1.1.1.4.2 rmind */
301 1.1.1.1.4.2 rmind while (GenericField)
302 1.1.1.1.4.2 rmind {
303 1.1.1.1.4.2 rmind Info = DtGetGenericTableInfo (GenericField->Name);
304 1.1.1.1.4.2 rmind if (Info)
305 1.1.1.1.4.2 rmind {
306 1.1.1.1.4.2 rmind /* Maintain table offsets */
307 1.1.1.1.4.2 rmind
308 1.1.1.1.4.2 rmind GenericField->TableOffset = TableOffset;
309 1.1.1.1.4.2 rmind TableOffset += DtGetFieldLength (GenericField, Info);
310 1.1.1.1.4.2 rmind
311 1.1.1.1.4.2 rmind /* Insert all labels in the global label list */
312 1.1.1.1.4.2 rmind
313 1.1.1.1.4.2 rmind if (Info->Opcode == ACPI_DMT_LABEL)
314 1.1.1.1.4.2 rmind {
315 1.1.1.1.4.2 rmind DtInsertLabelField (GenericField);
316 1.1.1.1.4.2 rmind }
317 1.1.1.1.4.2 rmind }
318 1.1.1.1.4.2 rmind
319 1.1.1.1.4.2 rmind GenericField = GenericField->Next;
320 1.1.1.1.4.2 rmind }
321 1.1.1.1.4.2 rmind }
322 1.1.1.1.4.2 rmind
323 1.1.1.1.4.2 rmind
324 1.1.1.1.4.2 rmind /******************************************************************************
325 1.1.1.1.4.2 rmind *
326 1.1.1.1.4.2 rmind * FUNCTION: DtInsertLabelField
327 1.1.1.1.4.2 rmind *
328 1.1.1.1.4.2 rmind * PARAMETERS: Field - Field object with Label to be inserted
329 1.1.1.1.4.2 rmind *
330 1.1.1.1.4.2 rmind * RETURN: None
331 1.1.1.1.4.2 rmind *
332 1.1.1.1.4.2 rmind * DESCRIPTION: Insert a label field into the global label list
333 1.1.1.1.4.2 rmind *
334 1.1.1.1.4.2 rmind *****************************************************************************/
335 1.1.1.1.4.2 rmind
336 1.1.1.1.4.2 rmind static void
337 1.1.1.1.4.2 rmind DtInsertLabelField (
338 1.1.1.1.4.2 rmind DT_FIELD *Field)
339 1.1.1.1.4.2 rmind {
340 1.1.1.1.4.2 rmind
341 1.1.1.1.4.2 rmind DbgPrint (ASL_DEBUG_OUTPUT,
342 1.1.1.1.4.2 rmind "DtInsertLabelField: Found Label : %s at output table offset %X\n",
343 1.1.1.1.4.2 rmind Field->Value, Field->TableOffset);
344 1.1.1.1.4.2 rmind
345 1.1.1.1.4.2 rmind Field->NextLabel = Gbl_LabelList;
346 1.1.1.1.4.2 rmind Gbl_LabelList = Field;
347 1.1.1.1.4.2 rmind }
348 1.1.1.1.4.2 rmind
349 1.1.1.1.4.2 rmind
350 1.1.1.1.4.2 rmind /******************************************************************************
351 1.1.1.1.4.2 rmind *
352 1.1.1.1.4.2 rmind * FUNCTION: DtLookupLabel
353 1.1.1.1.4.2 rmind *
354 1.1.1.1.4.2 rmind * PARAMETERS: Name - Label to be resolved
355 1.1.1.1.4.2 rmind *
356 1.1.1.1.4.2 rmind * RETURN: Field object associated with the label
357 1.1.1.1.4.2 rmind *
358 1.1.1.1.4.2 rmind * DESCRIPTION: Lookup a label in the global label list. Used during the
359 1.1.1.1.4.2 rmind * resolution of integer expressions.
360 1.1.1.1.4.2 rmind *
361 1.1.1.1.4.2 rmind *****************************************************************************/
362 1.1.1.1.4.2 rmind
363 1.1.1.1.4.2 rmind static DT_FIELD *
364 1.1.1.1.4.2 rmind DtLookupLabel (
365 1.1.1.1.4.2 rmind char *Name)
366 1.1.1.1.4.2 rmind {
367 1.1.1.1.4.2 rmind DT_FIELD *LabelField;
368 1.1.1.1.4.2 rmind
369 1.1.1.1.4.2 rmind
370 1.1.1.1.4.2 rmind /* Skip a leading $ */
371 1.1.1.1.4.2 rmind
372 1.1.1.1.4.2 rmind if (*Name == '$')
373 1.1.1.1.4.2 rmind {
374 1.1.1.1.4.2 rmind Name++;
375 1.1.1.1.4.2 rmind }
376 1.1.1.1.4.2 rmind
377 1.1.1.1.4.2 rmind /* Search global list */
378 1.1.1.1.4.2 rmind
379 1.1.1.1.4.2 rmind LabelField = Gbl_LabelList;
380 1.1.1.1.4.2 rmind while (LabelField)
381 1.1.1.1.4.2 rmind {
382 1.1.1.1.4.2 rmind if (!ACPI_STRCMP (Name, LabelField->Value))
383 1.1.1.1.4.2 rmind {
384 1.1.1.1.4.2 rmind return (LabelField);
385 1.1.1.1.4.2 rmind }
386 1.1.1.1.4.2 rmind LabelField = LabelField->NextLabel;
387 1.1.1.1.4.2 rmind }
388 1.1.1.1.4.2 rmind
389 1.1.1.1.4.2 rmind return (NULL);
390 1.1.1.1.4.2 rmind }
391