aslresource.c revision 1.1.1.2.2.2 1 1.1.1.2.2.2 bouyer
2 1.1.1.2.2.2 bouyer /******************************************************************************
3 1.1.1.2.2.2 bouyer *
4 1.1.1.2.2.2 bouyer * Module Name: aslresource - Resource template/descriptor utilities
5 1.1.1.2.2.2 bouyer *
6 1.1.1.2.2.2 bouyer *****************************************************************************/
7 1.1.1.2.2.2 bouyer
8 1.1.1.2.2.2 bouyer /*
9 1.1.1.2.2.2 bouyer * Copyright (C) 2000 - 2011, Intel Corp.
10 1.1.1.2.2.2 bouyer * All rights reserved.
11 1.1.1.2.2.2 bouyer *
12 1.1.1.2.2.2 bouyer * Redistribution and use in source and binary forms, with or without
13 1.1.1.2.2.2 bouyer * modification, are permitted provided that the following conditions
14 1.1.1.2.2.2 bouyer * are met:
15 1.1.1.2.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
16 1.1.1.2.2.2 bouyer * notice, this list of conditions, and the following disclaimer,
17 1.1.1.2.2.2 bouyer * without modification.
18 1.1.1.2.2.2 bouyer * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 1.1.1.2.2.2 bouyer * substantially similar to the "NO WARRANTY" disclaimer below
20 1.1.1.2.2.2 bouyer * ("Disclaimer") and any redistribution must be conditioned upon
21 1.1.1.2.2.2 bouyer * including a substantially similar Disclaimer requirement for further
22 1.1.1.2.2.2 bouyer * binary redistribution.
23 1.1.1.2.2.2 bouyer * 3. Neither the names of the above-listed copyright holders nor the names
24 1.1.1.2.2.2 bouyer * of any contributors may be used to endorse or promote products derived
25 1.1.1.2.2.2 bouyer * from this software without specific prior written permission.
26 1.1.1.2.2.2 bouyer *
27 1.1.1.2.2.2 bouyer * Alternatively, this software may be distributed under the terms of the
28 1.1.1.2.2.2 bouyer * GNU General Public License ("GPL") version 2 as published by the Free
29 1.1.1.2.2.2 bouyer * Software Foundation.
30 1.1.1.2.2.2 bouyer *
31 1.1.1.2.2.2 bouyer * NO WARRANTY
32 1.1.1.2.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 1.1.1.2.2.2 bouyer * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 1.1.1.2.2.2 bouyer * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 1.1.1.2.2.2 bouyer * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 1.1.1.2.2.2 bouyer * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 1.1.1.2.2.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 1.1.1.2.2.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 1.1.1.2.2.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 1.1.1.2.2.2 bouyer * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 1.1.1.2.2.2 bouyer * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 1.1.1.2.2.2 bouyer * POSSIBILITY OF SUCH DAMAGES.
43 1.1.1.2.2.2 bouyer */
44 1.1.1.2.2.2 bouyer
45 1.1.1.2.2.2 bouyer
46 1.1.1.2.2.2 bouyer #include "aslcompiler.h"
47 1.1.1.2.2.2 bouyer #include "aslcompiler.y.h"
48 1.1.1.2.2.2 bouyer #include "amlcode.h"
49 1.1.1.2.2.2 bouyer
50 1.1.1.2.2.2 bouyer
51 1.1.1.2.2.2 bouyer #define _COMPONENT ACPI_COMPILER
52 1.1.1.2.2.2 bouyer ACPI_MODULE_NAME ("aslresource")
53 1.1.1.2.2.2 bouyer
54 1.1.1.2.2.2 bouyer
55 1.1.1.2.2.2 bouyer /*******************************************************************************
56 1.1.1.2.2.2 bouyer *
57 1.1.1.2.2.2 bouyer * FUNCTION: RsSmallAddressCheck
58 1.1.1.2.2.2 bouyer *
59 1.1.1.2.2.2 bouyer * PARAMETERS: Minimum - Address Min value
60 1.1.1.2.2.2 bouyer * Maximum - Address Max value
61 1.1.1.2.2.2 bouyer * Length - Address range value
62 1.1.1.2.2.2 bouyer * Alignment - Address alignment value
63 1.1.1.2.2.2 bouyer * MinOp - Original Op for Address Min
64 1.1.1.2.2.2 bouyer * MaxOp - Original Op for Address Max
65 1.1.1.2.2.2 bouyer * LengthOp - Original Op for address range
66 1.1.1.2.2.2 bouyer * AlignOp - Original Op for address alignment. If
67 1.1.1.2.2.2 bouyer * NULL, means "zero value for alignment is
68 1.1.1.2.2.2 bouyer * OK, and means 64K alignment" (for
69 1.1.1.2.2.2 bouyer * Memory24 descriptor)
70 1.1.1.2.2.2 bouyer * Op - Parent Op for entire construct
71 1.1.1.2.2.2 bouyer *
72 1.1.1.2.2.2 bouyer * RETURN: None. Adds error messages to error log if necessary
73 1.1.1.2.2.2 bouyer *
74 1.1.1.2.2.2 bouyer * DESCRIPTION: Perform common value checks for "small" address descriptors.
75 1.1.1.2.2.2 bouyer * Currently:
76 1.1.1.2.2.2 bouyer * Io, Memory24, Memory32
77 1.1.1.2.2.2 bouyer *
78 1.1.1.2.2.2 bouyer ******************************************************************************/
79 1.1.1.2.2.2 bouyer
80 1.1.1.2.2.2 bouyer void
81 1.1.1.2.2.2 bouyer RsSmallAddressCheck (
82 1.1.1.2.2.2 bouyer UINT8 Type,
83 1.1.1.2.2.2 bouyer UINT32 Minimum,
84 1.1.1.2.2.2 bouyer UINT32 Maximum,
85 1.1.1.2.2.2 bouyer UINT32 Length,
86 1.1.1.2.2.2 bouyer UINT32 Alignment,
87 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *MinOp,
88 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *MaxOp,
89 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *LengthOp,
90 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *AlignOp,
91 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op)
92 1.1.1.2.2.2 bouyer {
93 1.1.1.2.2.2 bouyer
94 1.1.1.2.2.2 bouyer if (Gbl_NoResourceChecking)
95 1.1.1.2.2.2 bouyer {
96 1.1.1.2.2.2 bouyer return;
97 1.1.1.2.2.2 bouyer }
98 1.1.1.2.2.2 bouyer
99 1.1.1.2.2.2 bouyer /*
100 1.1.1.2.2.2 bouyer * Check for a so-called "null descriptor". These are descriptors that are
101 1.1.1.2.2.2 bouyer * created with most fields set to zero. The intent is that the descriptor
102 1.1.1.2.2.2 bouyer * will be updated/completed at runtime via a BufferField.
103 1.1.1.2.2.2 bouyer *
104 1.1.1.2.2.2 bouyer * If the descriptor does NOT have a resource tag, it cannot be referenced
105 1.1.1.2.2.2 bouyer * by a BufferField and we will flag this as an error. Conversely, if
106 1.1.1.2.2.2 bouyer * the descriptor has a resource tag, we will assume that a BufferField
107 1.1.1.2.2.2 bouyer * will be used to dynamically update it, so no error.
108 1.1.1.2.2.2 bouyer *
109 1.1.1.2.2.2 bouyer * A possible enhancement to this check would be to verify that in fact
110 1.1.1.2.2.2 bouyer * a BufferField is created using the resource tag, and perhaps even
111 1.1.1.2.2.2 bouyer * verify that a Store is performed to the BufferField.
112 1.1.1.2.2.2 bouyer *
113 1.1.1.2.2.2 bouyer * Note: for these descriptors, Alignment is allowed to be zero
114 1.1.1.2.2.2 bouyer */
115 1.1.1.2.2.2 bouyer if (!Minimum && !Maximum && !Length)
116 1.1.1.2.2.2 bouyer {
117 1.1.1.2.2.2 bouyer if (!Op->Asl.ExternalName)
118 1.1.1.2.2.2 bouyer {
119 1.1.1.2.2.2 bouyer /* No resource tag. Descriptor is fixed and is also illegal */
120 1.1.1.2.2.2 bouyer
121 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL);
122 1.1.1.2.2.2 bouyer }
123 1.1.1.2.2.2 bouyer
124 1.1.1.2.2.2 bouyer return;
125 1.1.1.2.2.2 bouyer }
126 1.1.1.2.2.2 bouyer
127 1.1.1.2.2.2 bouyer /* Special case for Memory24, values are compressed */
128 1.1.1.2.2.2 bouyer
129 1.1.1.2.2.2 bouyer if (Type == ACPI_RESOURCE_NAME_MEMORY24)
130 1.1.1.2.2.2 bouyer {
131 1.1.1.2.2.2 bouyer if (!Alignment) /* Alignment==0 means 64K - no invalid alignment */
132 1.1.1.2.2.2 bouyer {
133 1.1.1.2.2.2 bouyer Alignment = ACPI_UINT16_MAX + 1;
134 1.1.1.2.2.2 bouyer }
135 1.1.1.2.2.2 bouyer
136 1.1.1.2.2.2 bouyer Minimum <<= 8;
137 1.1.1.2.2.2 bouyer Maximum <<= 8;
138 1.1.1.2.2.2 bouyer Length *= 256;
139 1.1.1.2.2.2 bouyer }
140 1.1.1.2.2.2 bouyer
141 1.1.1.2.2.2 bouyer /* IO descriptor has different definition of min/max, don't check */
142 1.1.1.2.2.2 bouyer
143 1.1.1.2.2.2 bouyer if (Type != ACPI_RESOURCE_NAME_IO)
144 1.1.1.2.2.2 bouyer {
145 1.1.1.2.2.2 bouyer /* Basic checks on Min/Max/Length */
146 1.1.1.2.2.2 bouyer
147 1.1.1.2.2.2 bouyer if (Minimum > Maximum)
148 1.1.1.2.2.2 bouyer {
149 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_MIN_MAX, MinOp, NULL);
150 1.1.1.2.2.2 bouyer }
151 1.1.1.2.2.2 bouyer else if (Length > (Maximum - Minimum + 1))
152 1.1.1.2.2.2 bouyer {
153 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
154 1.1.1.2.2.2 bouyer }
155 1.1.1.2.2.2 bouyer }
156 1.1.1.2.2.2 bouyer
157 1.1.1.2.2.2 bouyer /* Alignment of zero is not in ACPI spec, but is used to mean byte acc */
158 1.1.1.2.2.2 bouyer
159 1.1.1.2.2.2 bouyer if (!Alignment)
160 1.1.1.2.2.2 bouyer {
161 1.1.1.2.2.2 bouyer Alignment = 1;
162 1.1.1.2.2.2 bouyer }
163 1.1.1.2.2.2 bouyer
164 1.1.1.2.2.2 bouyer /* Addresses must be an exact multiple of the alignment value */
165 1.1.1.2.2.2 bouyer
166 1.1.1.2.2.2 bouyer if (Minimum % Alignment)
167 1.1.1.2.2.2 bouyer {
168 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_ALIGNMENT, MinOp, NULL);
169 1.1.1.2.2.2 bouyer }
170 1.1.1.2.2.2 bouyer if (Maximum % Alignment)
171 1.1.1.2.2.2 bouyer {
172 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_ALIGNMENT, MaxOp, NULL);
173 1.1.1.2.2.2 bouyer }
174 1.1.1.2.2.2 bouyer }
175 1.1.1.2.2.2 bouyer
176 1.1.1.2.2.2 bouyer
177 1.1.1.2.2.2 bouyer /*******************************************************************************
178 1.1.1.2.2.2 bouyer *
179 1.1.1.2.2.2 bouyer * FUNCTION: RsLargeAddressCheck
180 1.1.1.2.2.2 bouyer *
181 1.1.1.2.2.2 bouyer * PARAMETERS: Minimum - Address Min value
182 1.1.1.2.2.2 bouyer * Maximum - Address Max value
183 1.1.1.2.2.2 bouyer * Length - Address range value
184 1.1.1.2.2.2 bouyer * Granularity - Address granularity value
185 1.1.1.2.2.2 bouyer * Flags - General flags for address descriptors:
186 1.1.1.2.2.2 bouyer * _MIF, _MAF, _DEC
187 1.1.1.2.2.2 bouyer * MinOp - Original Op for Address Min
188 1.1.1.2.2.2 bouyer * MaxOp - Original Op for Address Max
189 1.1.1.2.2.2 bouyer * LengthOp - Original Op for address range
190 1.1.1.2.2.2 bouyer * GranOp - Original Op for address granularity
191 1.1.1.2.2.2 bouyer * Op - Parent Op for entire construct
192 1.1.1.2.2.2 bouyer *
193 1.1.1.2.2.2 bouyer * RETURN: None. Adds error messages to error log if necessary
194 1.1.1.2.2.2 bouyer *
195 1.1.1.2.2.2 bouyer * DESCRIPTION: Perform common value checks for "large" address descriptors.
196 1.1.1.2.2.2 bouyer * Currently:
197 1.1.1.2.2.2 bouyer * WordIo, WordBusNumber, WordSpace
198 1.1.1.2.2.2 bouyer * DWordIo, DWordMemory, DWordSpace
199 1.1.1.2.2.2 bouyer * QWordIo, QWordMemory, QWordSpace
200 1.1.1.2.2.2 bouyer * ExtendedIo, ExtendedMemory, ExtendedSpace
201 1.1.1.2.2.2 bouyer *
202 1.1.1.2.2.2 bouyer * _MIF flag set means that the minimum address is fixed and is not relocatable
203 1.1.1.2.2.2 bouyer * _MAF flag set means that the maximum address is fixed and is not relocatable
204 1.1.1.2.2.2 bouyer * Length of zero means that the record size is variable
205 1.1.1.2.2.2 bouyer *
206 1.1.1.2.2.2 bouyer * This function implements the LEN/MIF/MAF/MIN/MAX/GRA rules within Table 6-40
207 1.1.1.2.2.2 bouyer * of the ACPI 4.0a specification. Added 04/2010.
208 1.1.1.2.2.2 bouyer *
209 1.1.1.2.2.2 bouyer ******************************************************************************/
210 1.1.1.2.2.2 bouyer
211 1.1.1.2.2.2 bouyer void
212 1.1.1.2.2.2 bouyer RsLargeAddressCheck (
213 1.1.1.2.2.2 bouyer UINT64 Minimum,
214 1.1.1.2.2.2 bouyer UINT64 Maximum,
215 1.1.1.2.2.2 bouyer UINT64 Length,
216 1.1.1.2.2.2 bouyer UINT64 Granularity,
217 1.1.1.2.2.2 bouyer UINT8 Flags,
218 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *MinOp,
219 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *MaxOp,
220 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *LengthOp,
221 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *GranOp,
222 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op)
223 1.1.1.2.2.2 bouyer {
224 1.1.1.2.2.2 bouyer
225 1.1.1.2.2.2 bouyer if (Gbl_NoResourceChecking)
226 1.1.1.2.2.2 bouyer {
227 1.1.1.2.2.2 bouyer return;
228 1.1.1.2.2.2 bouyer }
229 1.1.1.2.2.2 bouyer
230 1.1.1.2.2.2 bouyer /*
231 1.1.1.2.2.2 bouyer * Check for a so-called "null descriptor". These are descriptors that are
232 1.1.1.2.2.2 bouyer * created with most fields set to zero. The intent is that the descriptor
233 1.1.1.2.2.2 bouyer * will be updated/completed at runtime via a BufferField.
234 1.1.1.2.2.2 bouyer *
235 1.1.1.2.2.2 bouyer * If the descriptor does NOT have a resource tag, it cannot be referenced
236 1.1.1.2.2.2 bouyer * by a BufferField and we will flag this as an error. Conversely, if
237 1.1.1.2.2.2 bouyer * the descriptor has a resource tag, we will assume that a BufferField
238 1.1.1.2.2.2 bouyer * will be used to dynamically update it, so no error.
239 1.1.1.2.2.2 bouyer *
240 1.1.1.2.2.2 bouyer * A possible enhancement to this check would be to verify that in fact
241 1.1.1.2.2.2 bouyer * a BufferField is created using the resource tag, and perhaps even
242 1.1.1.2.2.2 bouyer * verify that a Store is performed to the BufferField.
243 1.1.1.2.2.2 bouyer */
244 1.1.1.2.2.2 bouyer if (!Minimum && !Maximum && !Length && !Granularity)
245 1.1.1.2.2.2 bouyer {
246 1.1.1.2.2.2 bouyer if (!Op->Asl.ExternalName)
247 1.1.1.2.2.2 bouyer {
248 1.1.1.2.2.2 bouyer /* No resource tag. Descriptor is fixed and is also illegal */
249 1.1.1.2.2.2 bouyer
250 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL);
251 1.1.1.2.2.2 bouyer }
252 1.1.1.2.2.2 bouyer
253 1.1.1.2.2.2 bouyer return;
254 1.1.1.2.2.2 bouyer }
255 1.1.1.2.2.2 bouyer
256 1.1.1.2.2.2 bouyer /* Basic checks on Min/Max/Length */
257 1.1.1.2.2.2 bouyer
258 1.1.1.2.2.2 bouyer if (Minimum > Maximum)
259 1.1.1.2.2.2 bouyer {
260 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_MIN_MAX, MinOp, NULL);
261 1.1.1.2.2.2 bouyer return;
262 1.1.1.2.2.2 bouyer }
263 1.1.1.2.2.2 bouyer else if (Length > (Maximum - Minimum + 1))
264 1.1.1.2.2.2 bouyer {
265 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
266 1.1.1.2.2.2 bouyer return;
267 1.1.1.2.2.2 bouyer }
268 1.1.1.2.2.2 bouyer
269 1.1.1.2.2.2 bouyer /* If specified (non-zero), ensure granularity is a power-of-two minus one */
270 1.1.1.2.2.2 bouyer
271 1.1.1.2.2.2 bouyer if (Granularity)
272 1.1.1.2.2.2 bouyer {
273 1.1.1.2.2.2 bouyer if ((Granularity + 1) &
274 1.1.1.2.2.2 bouyer Granularity)
275 1.1.1.2.2.2 bouyer {
276 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_GRANULARITY, GranOp, NULL);
277 1.1.1.2.2.2 bouyer return;
278 1.1.1.2.2.2 bouyer }
279 1.1.1.2.2.2 bouyer }
280 1.1.1.2.2.2 bouyer
281 1.1.1.2.2.2 bouyer /*
282 1.1.1.2.2.2 bouyer * Check the various combinations of Length, MinFixed, and MaxFixed
283 1.1.1.2.2.2 bouyer */
284 1.1.1.2.2.2 bouyer if (Length)
285 1.1.1.2.2.2 bouyer {
286 1.1.1.2.2.2 bouyer /* Fixed non-zero length */
287 1.1.1.2.2.2 bouyer
288 1.1.1.2.2.2 bouyer switch (Flags & (ACPI_RESOURCE_FLAG_MIF | ACPI_RESOURCE_FLAG_MAF))
289 1.1.1.2.2.2 bouyer {
290 1.1.1.2.2.2 bouyer case 0:
291 1.1.1.2.2.2 bouyer /*
292 1.1.1.2.2.2 bouyer * Fixed length, variable locations (both _MIN and _MAX).
293 1.1.1.2.2.2 bouyer * Length must be a multiple of granularity
294 1.1.1.2.2.2 bouyer */
295 1.1.1.2.2.2 bouyer if (Granularity & Length)
296 1.1.1.2.2.2 bouyer {
297 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_ALIGNMENT, LengthOp, NULL);
298 1.1.1.2.2.2 bouyer }
299 1.1.1.2.2.2 bouyer break;
300 1.1.1.2.2.2 bouyer
301 1.1.1.2.2.2 bouyer case (ACPI_RESOURCE_FLAG_MIF | ACPI_RESOURCE_FLAG_MAF):
302 1.1.1.2.2.2 bouyer
303 1.1.1.2.2.2 bouyer /* Fixed length, fixed location. Granularity must be zero */
304 1.1.1.2.2.2 bouyer
305 1.1.1.2.2.2 bouyer if (Granularity != 0)
306 1.1.1.2.2.2 bouyer {
307 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_GRAN_FIXED, GranOp, NULL);
308 1.1.1.2.2.2 bouyer }
309 1.1.1.2.2.2 bouyer
310 1.1.1.2.2.2 bouyer /* Length must be exactly the size of the min/max window */
311 1.1.1.2.2.2 bouyer
312 1.1.1.2.2.2 bouyer if (Length != (Maximum - Minimum + 1))
313 1.1.1.2.2.2 bouyer {
314 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH_FIXED, LengthOp, NULL);
315 1.1.1.2.2.2 bouyer }
316 1.1.1.2.2.2 bouyer break;
317 1.1.1.2.2.2 bouyer
318 1.1.1.2.2.2 bouyer /* All other combinations are invalid */
319 1.1.1.2.2.2 bouyer
320 1.1.1.2.2.2 bouyer case ACPI_RESOURCE_FLAG_MIF:
321 1.1.1.2.2.2 bouyer case ACPI_RESOURCE_FLAG_MAF:
322 1.1.1.2.2.2 bouyer default:
323 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_ADDR_FLAGS, LengthOp, NULL);
324 1.1.1.2.2.2 bouyer }
325 1.1.1.2.2.2 bouyer }
326 1.1.1.2.2.2 bouyer else
327 1.1.1.2.2.2 bouyer {
328 1.1.1.2.2.2 bouyer /* Variable length (length==0) */
329 1.1.1.2.2.2 bouyer
330 1.1.1.2.2.2 bouyer switch (Flags & (ACPI_RESOURCE_FLAG_MIF | ACPI_RESOURCE_FLAG_MAF))
331 1.1.1.2.2.2 bouyer {
332 1.1.1.2.2.2 bouyer case 0:
333 1.1.1.2.2.2 bouyer /*
334 1.1.1.2.2.2 bouyer * Both _MIN and _MAX are variable.
335 1.1.1.2.2.2 bouyer * No additional requirements, just exit
336 1.1.1.2.2.2 bouyer */
337 1.1.1.2.2.2 bouyer break;
338 1.1.1.2.2.2 bouyer
339 1.1.1.2.2.2 bouyer case ACPI_RESOURCE_FLAG_MIF:
340 1.1.1.2.2.2 bouyer
341 1.1.1.2.2.2 bouyer /* _MIN is fixed. _MIN must be multiple of _GRA */
342 1.1.1.2.2.2 bouyer
343 1.1.1.2.2.2 bouyer /*
344 1.1.1.2.2.2 bouyer * The granularity is defined by the ACPI specification to be a
345 1.1.1.2.2.2 bouyer * power-of-two minus one, therefore the granularity is a
346 1.1.1.2.2.2 bouyer * bitmask which can be used to easily validate the addresses.
347 1.1.1.2.2.2 bouyer */
348 1.1.1.2.2.2 bouyer if (Granularity & Minimum)
349 1.1.1.2.2.2 bouyer {
350 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_ALIGNMENT, MinOp, NULL);
351 1.1.1.2.2.2 bouyer }
352 1.1.1.2.2.2 bouyer break;
353 1.1.1.2.2.2 bouyer
354 1.1.1.2.2.2 bouyer case ACPI_RESOURCE_FLAG_MAF:
355 1.1.1.2.2.2 bouyer
356 1.1.1.2.2.2 bouyer /* _MAX is fixed. (_MAX + 1) must be multiple of _GRA */
357 1.1.1.2.2.2 bouyer
358 1.1.1.2.2.2 bouyer if (Granularity & (Maximum + 1))
359 1.1.1.2.2.2 bouyer {
360 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_ALIGNMENT, MaxOp, "-1");
361 1.1.1.2.2.2 bouyer }
362 1.1.1.2.2.2 bouyer break;
363 1.1.1.2.2.2 bouyer
364 1.1.1.2.2.2 bouyer /* Both MIF/MAF set is invalid if length is zero */
365 1.1.1.2.2.2 bouyer
366 1.1.1.2.2.2 bouyer case (ACPI_RESOURCE_FLAG_MIF | ACPI_RESOURCE_FLAG_MAF):
367 1.1.1.2.2.2 bouyer default:
368 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_INVALID_ADDR_FLAGS, LengthOp, NULL);
369 1.1.1.2.2.2 bouyer }
370 1.1.1.2.2.2 bouyer }
371 1.1.1.2.2.2 bouyer }
372 1.1.1.2.2.2 bouyer
373 1.1.1.2.2.2 bouyer
374 1.1.1.2.2.2 bouyer /*******************************************************************************
375 1.1.1.2.2.2 bouyer *
376 1.1.1.2.2.2 bouyer * FUNCTION: RsGetStringDataLength
377 1.1.1.2.2.2 bouyer *
378 1.1.1.2.2.2 bouyer * PARAMETERS: InitializerOp - Start of a subtree of init nodes
379 1.1.1.2.2.2 bouyer *
380 1.1.1.2.2.2 bouyer * RETURN: Valid string length if a string node is found (otherwise 0)
381 1.1.1.2.2.2 bouyer *
382 1.1.1.2.2.2 bouyer * DESCRIPTION: In a list of peer nodes, find the first one that contains a
383 1.1.1.2.2.2 bouyer * string and return the length of the string.
384 1.1.1.2.2.2 bouyer *
385 1.1.1.2.2.2 bouyer ******************************************************************************/
386 1.1.1.2.2.2 bouyer
387 1.1.1.2.2.2 bouyer UINT16
388 1.1.1.2.2.2 bouyer RsGetStringDataLength (
389 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *InitializerOp)
390 1.1.1.2.2.2 bouyer {
391 1.1.1.2.2.2 bouyer
392 1.1.1.2.2.2 bouyer while (InitializerOp)
393 1.1.1.2.2.2 bouyer {
394 1.1.1.2.2.2 bouyer if (InitializerOp->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)
395 1.1.1.2.2.2 bouyer {
396 1.1.1.2.2.2 bouyer return ((UINT16) (strlen (InitializerOp->Asl.Value.String) + 1));
397 1.1.1.2.2.2 bouyer }
398 1.1.1.2.2.2 bouyer InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
399 1.1.1.2.2.2 bouyer }
400 1.1.1.2.2.2 bouyer
401 1.1.1.2.2.2 bouyer return 0;
402 1.1.1.2.2.2 bouyer }
403 1.1.1.2.2.2 bouyer
404 1.1.1.2.2.2 bouyer
405 1.1.1.2.2.2 bouyer /*******************************************************************************
406 1.1.1.2.2.2 bouyer *
407 1.1.1.2.2.2 bouyer * FUNCTION: RsAllocateResourceNode
408 1.1.1.2.2.2 bouyer *
409 1.1.1.2.2.2 bouyer * PARAMETERS: Size - Size of node in bytes
410 1.1.1.2.2.2 bouyer *
411 1.1.1.2.2.2 bouyer * RETURN: The allocated node - aborts on allocation failure
412 1.1.1.2.2.2 bouyer *
413 1.1.1.2.2.2 bouyer * DESCRIPTION: Allocate a resource description node and the resource
414 1.1.1.2.2.2 bouyer * descriptor itself (the nodes are used to link descriptors).
415 1.1.1.2.2.2 bouyer *
416 1.1.1.2.2.2 bouyer ******************************************************************************/
417 1.1.1.2.2.2 bouyer
418 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *
419 1.1.1.2.2.2 bouyer RsAllocateResourceNode (
420 1.1.1.2.2.2 bouyer UINT32 Size)
421 1.1.1.2.2.2 bouyer {
422 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *Rnode;
423 1.1.1.2.2.2 bouyer
424 1.1.1.2.2.2 bouyer
425 1.1.1.2.2.2 bouyer /* Allocate the node */
426 1.1.1.2.2.2 bouyer
427 1.1.1.2.2.2 bouyer Rnode = UtLocalCalloc (sizeof (ASL_RESOURCE_NODE));
428 1.1.1.2.2.2 bouyer
429 1.1.1.2.2.2 bouyer /* Allocate the resource descriptor itself */
430 1.1.1.2.2.2 bouyer
431 1.1.1.2.2.2 bouyer Rnode->Buffer = UtLocalCalloc (Size);
432 1.1.1.2.2.2 bouyer Rnode->BufferLength = Size;
433 1.1.1.2.2.2 bouyer
434 1.1.1.2.2.2 bouyer return (Rnode);
435 1.1.1.2.2.2 bouyer }
436 1.1.1.2.2.2 bouyer
437 1.1.1.2.2.2 bouyer
438 1.1.1.2.2.2 bouyer /*******************************************************************************
439 1.1.1.2.2.2 bouyer *
440 1.1.1.2.2.2 bouyer * FUNCTION: RsCreateBitField
441 1.1.1.2.2.2 bouyer *
442 1.1.1.2.2.2 bouyer * PARAMETERS: Op - Resource field node
443 1.1.1.2.2.2 bouyer * Name - Name of the field (Used only to reference
444 1.1.1.2.2.2 bouyer * the field in the ASL, not in the AML)
445 1.1.1.2.2.2 bouyer * ByteOffset - Offset from the field start
446 1.1.1.2.2.2 bouyer * BitOffset - Additional bit offset
447 1.1.1.2.2.2 bouyer *
448 1.1.1.2.2.2 bouyer * RETURN: None, sets fields within the input node
449 1.1.1.2.2.2 bouyer *
450 1.1.1.2.2.2 bouyer * DESCRIPTION: Utility function to generate a named bit field within a
451 1.1.1.2.2.2 bouyer * resource descriptor. Mark a node as 1) a field in a resource
452 1.1.1.2.2.2 bouyer * descriptor, and 2) set the value to be a BIT offset
453 1.1.1.2.2.2 bouyer *
454 1.1.1.2.2.2 bouyer ******************************************************************************/
455 1.1.1.2.2.2 bouyer
456 1.1.1.2.2.2 bouyer void
457 1.1.1.2.2.2 bouyer RsCreateBitField (
458 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op,
459 1.1.1.2.2.2 bouyer char *Name,
460 1.1.1.2.2.2 bouyer UINT32 ByteOffset,
461 1.1.1.2.2.2 bouyer UINT32 BitOffset)
462 1.1.1.2.2.2 bouyer {
463 1.1.1.2.2.2 bouyer
464 1.1.1.2.2.2 bouyer Op->Asl.ExternalName = Name;
465 1.1.1.2.2.2 bouyer Op->Asl.Value.Integer = ((UINT64) ByteOffset * 8) + BitOffset;
466 1.1.1.2.2.2 bouyer Op->Asl.CompileFlags |= (NODE_IS_RESOURCE_FIELD | NODE_IS_BIT_OFFSET);
467 1.1.1.2.2.2 bouyer }
468 1.1.1.2.2.2 bouyer
469 1.1.1.2.2.2 bouyer
470 1.1.1.2.2.2 bouyer /*******************************************************************************
471 1.1.1.2.2.2 bouyer *
472 1.1.1.2.2.2 bouyer * FUNCTION: RsCreateByteField
473 1.1.1.2.2.2 bouyer *
474 1.1.1.2.2.2 bouyer * PARAMETERS: Op - Resource field node
475 1.1.1.2.2.2 bouyer * Name - Name of the field (Used only to reference
476 1.1.1.2.2.2 bouyer * the field in the ASL, not in the AML)
477 1.1.1.2.2.2 bouyer * ByteOffset - Offset from the field start
478 1.1.1.2.2.2 bouyer *
479 1.1.1.2.2.2 bouyer * RETURN: None, sets fields within the input node
480 1.1.1.2.2.2 bouyer *
481 1.1.1.2.2.2 bouyer * DESCRIPTION: Utility function to generate a named byte field within a
482 1.1.1.2.2.2 bouyer * resource descriptor. Mark a node as 1) a field in a resource
483 1.1.1.2.2.2 bouyer * descriptor, and 2) set the value to be a BYTE offset
484 1.1.1.2.2.2 bouyer *
485 1.1.1.2.2.2 bouyer ******************************************************************************/
486 1.1.1.2.2.2 bouyer
487 1.1.1.2.2.2 bouyer void
488 1.1.1.2.2.2 bouyer RsCreateByteField (
489 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op,
490 1.1.1.2.2.2 bouyer char *Name,
491 1.1.1.2.2.2 bouyer UINT32 ByteOffset)
492 1.1.1.2.2.2 bouyer {
493 1.1.1.2.2.2 bouyer
494 1.1.1.2.2.2 bouyer Op->Asl.ExternalName = Name;
495 1.1.1.2.2.2 bouyer Op->Asl.Value.Integer = ByteOffset;
496 1.1.1.2.2.2 bouyer Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
497 1.1.1.2.2.2 bouyer }
498 1.1.1.2.2.2 bouyer
499 1.1.1.2.2.2 bouyer
500 1.1.1.2.2.2 bouyer /*******************************************************************************
501 1.1.1.2.2.2 bouyer *
502 1.1.1.2.2.2 bouyer * FUNCTION: RsSetFlagBits
503 1.1.1.2.2.2 bouyer *
504 1.1.1.2.2.2 bouyer * PARAMETERS: *Flags - Pointer to the flag byte
505 1.1.1.2.2.2 bouyer * Op - Flag initialization node
506 1.1.1.2.2.2 bouyer * Position - Bit position within the flag byte
507 1.1.1.2.2.2 bouyer * Default - Used if the node is DEFAULT.
508 1.1.1.2.2.2 bouyer *
509 1.1.1.2.2.2 bouyer * RETURN: Sets bits within the *Flags output byte.
510 1.1.1.2.2.2 bouyer *
511 1.1.1.2.2.2 bouyer * DESCRIPTION: Set a bit in a cumulative flags word from an initialization
512 1.1.1.2.2.2 bouyer * node. Will use a default value if the node is DEFAULT, meaning
513 1.1.1.2.2.2 bouyer * that no value was specified in the ASL. Used to merge multiple
514 1.1.1.2.2.2 bouyer * keywords into a single flags byte.
515 1.1.1.2.2.2 bouyer *
516 1.1.1.2.2.2 bouyer ******************************************************************************/
517 1.1.1.2.2.2 bouyer
518 1.1.1.2.2.2 bouyer void
519 1.1.1.2.2.2 bouyer RsSetFlagBits (
520 1.1.1.2.2.2 bouyer UINT8 *Flags,
521 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op,
522 1.1.1.2.2.2 bouyer UINT8 Position,
523 1.1.1.2.2.2 bouyer UINT8 DefaultBit)
524 1.1.1.2.2.2 bouyer {
525 1.1.1.2.2.2 bouyer
526 1.1.1.2.2.2 bouyer if (Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
527 1.1.1.2.2.2 bouyer {
528 1.1.1.2.2.2 bouyer /* Use the default bit */
529 1.1.1.2.2.2 bouyer
530 1.1.1.2.2.2 bouyer *Flags |= (DefaultBit << Position);
531 1.1.1.2.2.2 bouyer }
532 1.1.1.2.2.2 bouyer else
533 1.1.1.2.2.2 bouyer {
534 1.1.1.2.2.2 bouyer /* Use the bit specified in the initialization node */
535 1.1.1.2.2.2 bouyer
536 1.1.1.2.2.2 bouyer *Flags |= (((UINT8) Op->Asl.Value.Integer) << Position);
537 1.1.1.2.2.2 bouyer }
538 1.1.1.2.2.2 bouyer }
539 1.1.1.2.2.2 bouyer
540 1.1.1.2.2.2 bouyer
541 1.1.1.2.2.2 bouyer /*******************************************************************************
542 1.1.1.2.2.2 bouyer *
543 1.1.1.2.2.2 bouyer * FUNCTION: RsCompleteNodeAndGetNext
544 1.1.1.2.2.2 bouyer *
545 1.1.1.2.2.2 bouyer * PARAMETERS: Op - Resource node to be completed
546 1.1.1.2.2.2 bouyer *
547 1.1.1.2.2.2 bouyer * RETURN: The next peer to the input node.
548 1.1.1.2.2.2 bouyer *
549 1.1.1.2.2.2 bouyer * DESCRIPTION: Mark the current node completed and return the next peer.
550 1.1.1.2.2.2 bouyer * The node ParseOpcode is set to DEFAULT_ARG, meaning that
551 1.1.1.2.2.2 bouyer * this node is to be ignored from now on.
552 1.1.1.2.2.2 bouyer *
553 1.1.1.2.2.2 bouyer ******************************************************************************/
554 1.1.1.2.2.2 bouyer
555 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *
556 1.1.1.2.2.2 bouyer RsCompleteNodeAndGetNext (
557 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op)
558 1.1.1.2.2.2 bouyer {
559 1.1.1.2.2.2 bouyer
560 1.1.1.2.2.2 bouyer /* Mark this node unused */
561 1.1.1.2.2.2 bouyer
562 1.1.1.2.2.2 bouyer Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
563 1.1.1.2.2.2 bouyer
564 1.1.1.2.2.2 bouyer /* Move on to the next peer node in the initializer list */
565 1.1.1.2.2.2 bouyer
566 1.1.1.2.2.2 bouyer return (ASL_GET_PEER_NODE (Op));
567 1.1.1.2.2.2 bouyer }
568 1.1.1.2.2.2 bouyer
569 1.1.1.2.2.2 bouyer
570 1.1.1.2.2.2 bouyer /*******************************************************************************
571 1.1.1.2.2.2 bouyer *
572 1.1.1.2.2.2 bouyer * FUNCTION: RsCheckListForDuplicates
573 1.1.1.2.2.2 bouyer *
574 1.1.1.2.2.2 bouyer * PARAMETERS: Op - First op in the initializer list
575 1.1.1.2.2.2 bouyer *
576 1.1.1.2.2.2 bouyer * RETURN: None
577 1.1.1.2.2.2 bouyer *
578 1.1.1.2.2.2 bouyer * DESCRIPTION: Check an initializer list for duplicate values. Emits an error
579 1.1.1.2.2.2 bouyer * if any duplicates are found.
580 1.1.1.2.2.2 bouyer *
581 1.1.1.2.2.2 bouyer ******************************************************************************/
582 1.1.1.2.2.2 bouyer
583 1.1.1.2.2.2 bouyer void
584 1.1.1.2.2.2 bouyer RsCheckListForDuplicates (
585 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op)
586 1.1.1.2.2.2 bouyer {
587 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *NextValueOp = Op;
588 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *NextOp;
589 1.1.1.2.2.2 bouyer UINT32 Value;
590 1.1.1.2.2.2 bouyer
591 1.1.1.2.2.2 bouyer
592 1.1.1.2.2.2 bouyer if (!Op)
593 1.1.1.2.2.2 bouyer {
594 1.1.1.2.2.2 bouyer return;
595 1.1.1.2.2.2 bouyer }
596 1.1.1.2.2.2 bouyer
597 1.1.1.2.2.2 bouyer /* Search list once for each value in the list */
598 1.1.1.2.2.2 bouyer
599 1.1.1.2.2.2 bouyer while (NextValueOp)
600 1.1.1.2.2.2 bouyer {
601 1.1.1.2.2.2 bouyer Value = (UINT32) NextValueOp->Asl.Value.Integer;
602 1.1.1.2.2.2 bouyer
603 1.1.1.2.2.2 bouyer /* Compare this value to all remaining values in the list */
604 1.1.1.2.2.2 bouyer
605 1.1.1.2.2.2 bouyer NextOp = ASL_GET_PEER_NODE (NextValueOp);
606 1.1.1.2.2.2 bouyer while (NextOp)
607 1.1.1.2.2.2 bouyer {
608 1.1.1.2.2.2 bouyer if (NextOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
609 1.1.1.2.2.2 bouyer {
610 1.1.1.2.2.2 bouyer /* Compare values */
611 1.1.1.2.2.2 bouyer
612 1.1.1.2.2.2 bouyer if (Value == (UINT32) NextOp->Asl.Value.Integer)
613 1.1.1.2.2.2 bouyer {
614 1.1.1.2.2.2 bouyer /* Emit error only once per duplicate node */
615 1.1.1.2.2.2 bouyer
616 1.1.1.2.2.2 bouyer if (!(NextOp->Asl.CompileFlags & NODE_IS_DUPLICATE))
617 1.1.1.2.2.2 bouyer {
618 1.1.1.2.2.2 bouyer NextOp->Asl.CompileFlags |= NODE_IS_DUPLICATE;
619 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_DUPLICATE_ITEM,
620 1.1.1.2.2.2 bouyer NextOp, NULL);
621 1.1.1.2.2.2 bouyer }
622 1.1.1.2.2.2 bouyer }
623 1.1.1.2.2.2 bouyer }
624 1.1.1.2.2.2 bouyer
625 1.1.1.2.2.2 bouyer NextOp = ASL_GET_PEER_NODE (NextOp);
626 1.1.1.2.2.2 bouyer }
627 1.1.1.2.2.2 bouyer
628 1.1.1.2.2.2 bouyer NextValueOp = ASL_GET_PEER_NODE (NextValueOp);
629 1.1.1.2.2.2 bouyer }
630 1.1.1.2.2.2 bouyer }
631 1.1.1.2.2.2 bouyer
632 1.1.1.2.2.2 bouyer
633 1.1.1.2.2.2 bouyer /*******************************************************************************
634 1.1.1.2.2.2 bouyer *
635 1.1.1.2.2.2 bouyer * FUNCTION: RsDoOneResourceDescriptor
636 1.1.1.2.2.2 bouyer *
637 1.1.1.2.2.2 bouyer * PARAMETERS: DescriptorTypeOp - Parent parse node of the descriptor
638 1.1.1.2.2.2 bouyer * CurrentByteOffset - Offset in the resource descriptor
639 1.1.1.2.2.2 bouyer * buffer.
640 1.1.1.2.2.2 bouyer *
641 1.1.1.2.2.2 bouyer * RETURN: A valid resource node for the descriptor
642 1.1.1.2.2.2 bouyer *
643 1.1.1.2.2.2 bouyer * DESCRIPTION: Dispatches the processing of one resource descriptor
644 1.1.1.2.2.2 bouyer *
645 1.1.1.2.2.2 bouyer ******************************************************************************/
646 1.1.1.2.2.2 bouyer
647 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *
648 1.1.1.2.2.2 bouyer RsDoOneResourceDescriptor (
649 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *DescriptorTypeOp,
650 1.1.1.2.2.2 bouyer UINT32 CurrentByteOffset,
651 1.1.1.2.2.2 bouyer UINT8 *State)
652 1.1.1.2.2.2 bouyer {
653 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *Rnode = NULL;
654 1.1.1.2.2.2 bouyer
655 1.1.1.2.2.2 bouyer
656 1.1.1.2.2.2 bouyer /* Construct the resource */
657 1.1.1.2.2.2 bouyer
658 1.1.1.2.2.2 bouyer switch (DescriptorTypeOp->Asl.ParseOpcode)
659 1.1.1.2.2.2 bouyer {
660 1.1.1.2.2.2 bouyer case PARSEOP_DMA:
661 1.1.1.2.2.2 bouyer Rnode = RsDoDmaDescriptor (DescriptorTypeOp,
662 1.1.1.2.2.2 bouyer CurrentByteOffset);
663 1.1.1.2.2.2 bouyer break;
664 1.1.1.2.2.2 bouyer
665 1.1.1.2.2.2 bouyer case PARSEOP_DWORDIO:
666 1.1.1.2.2.2 bouyer Rnode = RsDoDwordIoDescriptor (DescriptorTypeOp,
667 1.1.1.2.2.2 bouyer CurrentByteOffset);
668 1.1.1.2.2.2 bouyer break;
669 1.1.1.2.2.2 bouyer
670 1.1.1.2.2.2 bouyer case PARSEOP_DWORDMEMORY:
671 1.1.1.2.2.2 bouyer Rnode = RsDoDwordMemoryDescriptor (DescriptorTypeOp,
672 1.1.1.2.2.2 bouyer CurrentByteOffset);
673 1.1.1.2.2.2 bouyer break;
674 1.1.1.2.2.2 bouyer
675 1.1.1.2.2.2 bouyer case PARSEOP_DWORDSPACE:
676 1.1.1.2.2.2 bouyer Rnode = RsDoDwordSpaceDescriptor (DescriptorTypeOp,
677 1.1.1.2.2.2 bouyer CurrentByteOffset);
678 1.1.1.2.2.2 bouyer break;
679 1.1.1.2.2.2 bouyer
680 1.1.1.2.2.2 bouyer case PARSEOP_ENDDEPENDENTFN:
681 1.1.1.2.2.2 bouyer switch (*State)
682 1.1.1.2.2.2 bouyer {
683 1.1.1.2.2.2 bouyer case ACPI_RSTATE_NORMAL:
684 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_MISSING_STARTDEPENDENT,
685 1.1.1.2.2.2 bouyer DescriptorTypeOp, NULL);
686 1.1.1.2.2.2 bouyer break;
687 1.1.1.2.2.2 bouyer
688 1.1.1.2.2.2 bouyer case ACPI_RSTATE_START_DEPENDENT:
689 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
690 1.1.1.2.2.2 bouyer DescriptorTypeOp, NULL);
691 1.1.1.2.2.2 bouyer break;
692 1.1.1.2.2.2 bouyer
693 1.1.1.2.2.2 bouyer case ACPI_RSTATE_DEPENDENT_LIST:
694 1.1.1.2.2.2 bouyer default:
695 1.1.1.2.2.2 bouyer break;
696 1.1.1.2.2.2 bouyer }
697 1.1.1.2.2.2 bouyer
698 1.1.1.2.2.2 bouyer *State = ACPI_RSTATE_NORMAL;
699 1.1.1.2.2.2 bouyer Rnode = RsDoEndDependentDescriptor (DescriptorTypeOp,
700 1.1.1.2.2.2 bouyer CurrentByteOffset);
701 1.1.1.2.2.2 bouyer break;
702 1.1.1.2.2.2 bouyer
703 1.1.1.2.2.2 bouyer case PARSEOP_ENDTAG:
704 1.1.1.2.2.2 bouyer Rnode = RsDoEndTagDescriptor (DescriptorTypeOp,
705 1.1.1.2.2.2 bouyer CurrentByteOffset);
706 1.1.1.2.2.2 bouyer break;
707 1.1.1.2.2.2 bouyer
708 1.1.1.2.2.2 bouyer case PARSEOP_EXTENDEDIO:
709 1.1.1.2.2.2 bouyer Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
710 1.1.1.2.2.2 bouyer CurrentByteOffset);
711 1.1.1.2.2.2 bouyer break;
712 1.1.1.2.2.2 bouyer
713 1.1.1.2.2.2 bouyer case PARSEOP_EXTENDEDMEMORY:
714 1.1.1.2.2.2 bouyer Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp,
715 1.1.1.2.2.2 bouyer CurrentByteOffset);
716 1.1.1.2.2.2 bouyer break;
717 1.1.1.2.2.2 bouyer
718 1.1.1.2.2.2 bouyer case PARSEOP_EXTENDEDSPACE:
719 1.1.1.2.2.2 bouyer Rnode = RsDoExtendedSpaceDescriptor (DescriptorTypeOp,
720 1.1.1.2.2.2 bouyer CurrentByteOffset);
721 1.1.1.2.2.2 bouyer break;
722 1.1.1.2.2.2 bouyer
723 1.1.1.2.2.2 bouyer case PARSEOP_FIXEDIO:
724 1.1.1.2.2.2 bouyer Rnode = RsDoFixedIoDescriptor (DescriptorTypeOp,
725 1.1.1.2.2.2 bouyer CurrentByteOffset);
726 1.1.1.2.2.2 bouyer break;
727 1.1.1.2.2.2 bouyer
728 1.1.1.2.2.2 bouyer case PARSEOP_INTERRUPT:
729 1.1.1.2.2.2 bouyer Rnode = RsDoInterruptDescriptor (DescriptorTypeOp,
730 1.1.1.2.2.2 bouyer CurrentByteOffset);
731 1.1.1.2.2.2 bouyer break;
732 1.1.1.2.2.2 bouyer
733 1.1.1.2.2.2 bouyer case PARSEOP_IO:
734 1.1.1.2.2.2 bouyer Rnode = RsDoIoDescriptor (DescriptorTypeOp,
735 1.1.1.2.2.2 bouyer CurrentByteOffset);
736 1.1.1.2.2.2 bouyer break;
737 1.1.1.2.2.2 bouyer
738 1.1.1.2.2.2 bouyer case PARSEOP_IRQ:
739 1.1.1.2.2.2 bouyer Rnode = RsDoIrqDescriptor (DescriptorTypeOp,
740 1.1.1.2.2.2 bouyer CurrentByteOffset);
741 1.1.1.2.2.2 bouyer break;
742 1.1.1.2.2.2 bouyer
743 1.1.1.2.2.2 bouyer case PARSEOP_IRQNOFLAGS:
744 1.1.1.2.2.2 bouyer Rnode = RsDoIrqNoFlagsDescriptor (DescriptorTypeOp,
745 1.1.1.2.2.2 bouyer CurrentByteOffset);
746 1.1.1.2.2.2 bouyer break;
747 1.1.1.2.2.2 bouyer
748 1.1.1.2.2.2 bouyer case PARSEOP_MEMORY24:
749 1.1.1.2.2.2 bouyer Rnode = RsDoMemory24Descriptor (DescriptorTypeOp,
750 1.1.1.2.2.2 bouyer CurrentByteOffset);
751 1.1.1.2.2.2 bouyer break;
752 1.1.1.2.2.2 bouyer
753 1.1.1.2.2.2 bouyer case PARSEOP_MEMORY32:
754 1.1.1.2.2.2 bouyer Rnode = RsDoMemory32Descriptor (DescriptorTypeOp,
755 1.1.1.2.2.2 bouyer CurrentByteOffset);
756 1.1.1.2.2.2 bouyer break;
757 1.1.1.2.2.2 bouyer
758 1.1.1.2.2.2 bouyer case PARSEOP_MEMORY32FIXED:
759 1.1.1.2.2.2 bouyer Rnode = RsDoMemory32FixedDescriptor (DescriptorTypeOp,
760 1.1.1.2.2.2 bouyer CurrentByteOffset);
761 1.1.1.2.2.2 bouyer break;
762 1.1.1.2.2.2 bouyer
763 1.1.1.2.2.2 bouyer case PARSEOP_QWORDIO:
764 1.1.1.2.2.2 bouyer Rnode = RsDoQwordIoDescriptor (DescriptorTypeOp,
765 1.1.1.2.2.2 bouyer CurrentByteOffset);
766 1.1.1.2.2.2 bouyer break;
767 1.1.1.2.2.2 bouyer
768 1.1.1.2.2.2 bouyer case PARSEOP_QWORDMEMORY:
769 1.1.1.2.2.2 bouyer Rnode = RsDoQwordMemoryDescriptor (DescriptorTypeOp,
770 1.1.1.2.2.2 bouyer CurrentByteOffset);
771 1.1.1.2.2.2 bouyer break;
772 1.1.1.2.2.2 bouyer
773 1.1.1.2.2.2 bouyer case PARSEOP_QWORDSPACE:
774 1.1.1.2.2.2 bouyer Rnode = RsDoQwordSpaceDescriptor (DescriptorTypeOp,
775 1.1.1.2.2.2 bouyer CurrentByteOffset);
776 1.1.1.2.2.2 bouyer break;
777 1.1.1.2.2.2 bouyer
778 1.1.1.2.2.2 bouyer case PARSEOP_REGISTER:
779 1.1.1.2.2.2 bouyer Rnode = RsDoGeneralRegisterDescriptor (DescriptorTypeOp,
780 1.1.1.2.2.2 bouyer CurrentByteOffset);
781 1.1.1.2.2.2 bouyer break;
782 1.1.1.2.2.2 bouyer
783 1.1.1.2.2.2 bouyer case PARSEOP_STARTDEPENDENTFN:
784 1.1.1.2.2.2 bouyer switch (*State)
785 1.1.1.2.2.2 bouyer {
786 1.1.1.2.2.2 bouyer case ACPI_RSTATE_START_DEPENDENT:
787 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
788 1.1.1.2.2.2 bouyer DescriptorTypeOp, NULL);
789 1.1.1.2.2.2 bouyer break;
790 1.1.1.2.2.2 bouyer
791 1.1.1.2.2.2 bouyer case ACPI_RSTATE_NORMAL:
792 1.1.1.2.2.2 bouyer case ACPI_RSTATE_DEPENDENT_LIST:
793 1.1.1.2.2.2 bouyer default:
794 1.1.1.2.2.2 bouyer break;
795 1.1.1.2.2.2 bouyer }
796 1.1.1.2.2.2 bouyer
797 1.1.1.2.2.2 bouyer *State = ACPI_RSTATE_START_DEPENDENT;
798 1.1.1.2.2.2 bouyer Rnode = RsDoStartDependentDescriptor (DescriptorTypeOp,
799 1.1.1.2.2.2 bouyer CurrentByteOffset);
800 1.1.1.2.2.2 bouyer *State = ACPI_RSTATE_DEPENDENT_LIST;
801 1.1.1.2.2.2 bouyer break;
802 1.1.1.2.2.2 bouyer
803 1.1.1.2.2.2 bouyer case PARSEOP_STARTDEPENDENTFN_NOPRI:
804 1.1.1.2.2.2 bouyer switch (*State)
805 1.1.1.2.2.2 bouyer {
806 1.1.1.2.2.2 bouyer case ACPI_RSTATE_START_DEPENDENT:
807 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
808 1.1.1.2.2.2 bouyer DescriptorTypeOp, NULL);
809 1.1.1.2.2.2 bouyer break;
810 1.1.1.2.2.2 bouyer
811 1.1.1.2.2.2 bouyer case ACPI_RSTATE_NORMAL:
812 1.1.1.2.2.2 bouyer case ACPI_RSTATE_DEPENDENT_LIST:
813 1.1.1.2.2.2 bouyer default:
814 1.1.1.2.2.2 bouyer break;
815 1.1.1.2.2.2 bouyer }
816 1.1.1.2.2.2 bouyer
817 1.1.1.2.2.2 bouyer *State = ACPI_RSTATE_START_DEPENDENT;
818 1.1.1.2.2.2 bouyer Rnode = RsDoStartDependentNoPriDescriptor (DescriptorTypeOp,
819 1.1.1.2.2.2 bouyer CurrentByteOffset);
820 1.1.1.2.2.2 bouyer *State = ACPI_RSTATE_DEPENDENT_LIST;
821 1.1.1.2.2.2 bouyer break;
822 1.1.1.2.2.2 bouyer
823 1.1.1.2.2.2 bouyer case PARSEOP_VENDORLONG:
824 1.1.1.2.2.2 bouyer Rnode = RsDoVendorLargeDescriptor (DescriptorTypeOp,
825 1.1.1.2.2.2 bouyer CurrentByteOffset);
826 1.1.1.2.2.2 bouyer break;
827 1.1.1.2.2.2 bouyer
828 1.1.1.2.2.2 bouyer case PARSEOP_VENDORSHORT:
829 1.1.1.2.2.2 bouyer Rnode = RsDoVendorSmallDescriptor (DescriptorTypeOp,
830 1.1.1.2.2.2 bouyer CurrentByteOffset);
831 1.1.1.2.2.2 bouyer break;
832 1.1.1.2.2.2 bouyer
833 1.1.1.2.2.2 bouyer case PARSEOP_WORDBUSNUMBER:
834 1.1.1.2.2.2 bouyer Rnode = RsDoWordBusNumberDescriptor (DescriptorTypeOp,
835 1.1.1.2.2.2 bouyer CurrentByteOffset);
836 1.1.1.2.2.2 bouyer break;
837 1.1.1.2.2.2 bouyer
838 1.1.1.2.2.2 bouyer case PARSEOP_WORDIO:
839 1.1.1.2.2.2 bouyer Rnode = RsDoWordIoDescriptor (DescriptorTypeOp,
840 1.1.1.2.2.2 bouyer CurrentByteOffset);
841 1.1.1.2.2.2 bouyer break;
842 1.1.1.2.2.2 bouyer
843 1.1.1.2.2.2 bouyer case PARSEOP_WORDSPACE:
844 1.1.1.2.2.2 bouyer Rnode = RsDoWordSpaceDescriptor (DescriptorTypeOp,
845 1.1.1.2.2.2 bouyer CurrentByteOffset);
846 1.1.1.2.2.2 bouyer break;
847 1.1.1.2.2.2 bouyer
848 1.1.1.2.2.2 bouyer case PARSEOP_DEFAULT_ARG:
849 1.1.1.2.2.2 bouyer /* Just ignore any of these, they are used as fillers/placeholders */
850 1.1.1.2.2.2 bouyer break;
851 1.1.1.2.2.2 bouyer
852 1.1.1.2.2.2 bouyer default:
853 1.1.1.2.2.2 bouyer printf ("Unknown resource descriptor type [%s]\n",
854 1.1.1.2.2.2 bouyer DescriptorTypeOp->Asl.ParseOpName);
855 1.1.1.2.2.2 bouyer break;
856 1.1.1.2.2.2 bouyer }
857 1.1.1.2.2.2 bouyer
858 1.1.1.2.2.2 bouyer /*
859 1.1.1.2.2.2 bouyer * Mark original node as unused, but head of a resource descriptor.
860 1.1.1.2.2.2 bouyer * This allows the resource to be installed in the namespace so that
861 1.1.1.2.2.2 bouyer * references to the descriptor can be resolved.
862 1.1.1.2.2.2 bouyer */
863 1.1.1.2.2.2 bouyer DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
864 1.1.1.2.2.2 bouyer DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
865 1.1.1.2.2.2 bouyer DescriptorTypeOp->Asl.Value.Integer = CurrentByteOffset;
866 1.1.1.2.2.2 bouyer
867 1.1.1.2.2.2 bouyer if (Rnode)
868 1.1.1.2.2.2 bouyer {
869 1.1.1.2.2.2 bouyer DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
870 1.1.1.2.2.2 bouyer }
871 1.1.1.2.2.2 bouyer
872 1.1.1.2.2.2 bouyer return (Rnode);
873 1.1.1.2.2.2 bouyer }
874 1.1.1.2.2.2 bouyer
875 1.1.1.2.2.2 bouyer
876 1.1.1.2.2.2 bouyer /*******************************************************************************
877 1.1.1.2.2.2 bouyer *
878 1.1.1.2.2.2 bouyer * FUNCTION: RsLinkDescriptorChain
879 1.1.1.2.2.2 bouyer *
880 1.1.1.2.2.2 bouyer * PARAMETERS: PreviousRnode - Pointer to the node that will be previous
881 1.1.1.2.2.2 bouyer * to the linked node, At exit, set to the
882 1.1.1.2.2.2 bouyer * last node in the new chain.
883 1.1.1.2.2.2 bouyer * Rnode - Resource node to link into the list
884 1.1.1.2.2.2 bouyer *
885 1.1.1.2.2.2 bouyer * RETURN: Cumulative buffer byte offset of the new segment of chain
886 1.1.1.2.2.2 bouyer *
887 1.1.1.2.2.2 bouyer * DESCRIPTION: Link a descriptor chain at the end of an existing chain.
888 1.1.1.2.2.2 bouyer *
889 1.1.1.2.2.2 bouyer ******************************************************************************/
890 1.1.1.2.2.2 bouyer
891 1.1.1.2.2.2 bouyer UINT32
892 1.1.1.2.2.2 bouyer RsLinkDescriptorChain (
893 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE **PreviousRnode,
894 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *Rnode)
895 1.1.1.2.2.2 bouyer {
896 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *LastRnode;
897 1.1.1.2.2.2 bouyer UINT32 CurrentByteOffset;
898 1.1.1.2.2.2 bouyer
899 1.1.1.2.2.2 bouyer
900 1.1.1.2.2.2 bouyer /* Anything to do? */
901 1.1.1.2.2.2 bouyer
902 1.1.1.2.2.2 bouyer if (!Rnode)
903 1.1.1.2.2.2 bouyer {
904 1.1.1.2.2.2 bouyer return 0;
905 1.1.1.2.2.2 bouyer }
906 1.1.1.2.2.2 bouyer
907 1.1.1.2.2.2 bouyer /* Point the previous node to the new node */
908 1.1.1.2.2.2 bouyer
909 1.1.1.2.2.2 bouyer (*PreviousRnode)->Next = Rnode;
910 1.1.1.2.2.2 bouyer CurrentByteOffset = Rnode->BufferLength;
911 1.1.1.2.2.2 bouyer
912 1.1.1.2.2.2 bouyer /* Walk to the end of the chain headed by Rnode */
913 1.1.1.2.2.2 bouyer
914 1.1.1.2.2.2 bouyer LastRnode = Rnode;
915 1.1.1.2.2.2 bouyer while (LastRnode->Next)
916 1.1.1.2.2.2 bouyer {
917 1.1.1.2.2.2 bouyer LastRnode = LastRnode->Next;
918 1.1.1.2.2.2 bouyer CurrentByteOffset += LastRnode->BufferLength;
919 1.1.1.2.2.2 bouyer }
920 1.1.1.2.2.2 bouyer
921 1.1.1.2.2.2 bouyer /* Previous node becomes the last node in the chain */
922 1.1.1.2.2.2 bouyer
923 1.1.1.2.2.2 bouyer *PreviousRnode = LastRnode;
924 1.1.1.2.2.2 bouyer return CurrentByteOffset;
925 1.1.1.2.2.2 bouyer }
926 1.1.1.2.2.2 bouyer
927 1.1.1.2.2.2 bouyer
928 1.1.1.2.2.2 bouyer /*******************************************************************************
929 1.1.1.2.2.2 bouyer *
930 1.1.1.2.2.2 bouyer * FUNCTION: RsDoResourceTemplate
931 1.1.1.2.2.2 bouyer *
932 1.1.1.2.2.2 bouyer * PARAMETERS: Op - Parent of a resource template list
933 1.1.1.2.2.2 bouyer *
934 1.1.1.2.2.2 bouyer * RETURN: None. Sets input node to point to a list of AML code
935 1.1.1.2.2.2 bouyer *
936 1.1.1.2.2.2 bouyer * DESCRIPTION: Merge a list of resource descriptors into a single AML buffer,
937 1.1.1.2.2.2 bouyer * in preparation for output to the AML output file.
938 1.1.1.2.2.2 bouyer *
939 1.1.1.2.2.2 bouyer ******************************************************************************/
940 1.1.1.2.2.2 bouyer
941 1.1.1.2.2.2 bouyer void
942 1.1.1.2.2.2 bouyer RsDoResourceTemplate (
943 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *Op)
944 1.1.1.2.2.2 bouyer {
945 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *BufferLengthOp;
946 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *BufferOp;
947 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *DescriptorTypeOp;
948 1.1.1.2.2.2 bouyer ACPI_PARSE_OBJECT *LastOp = NULL;
949 1.1.1.2.2.2 bouyer UINT32 CurrentByteOffset = 0;
950 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE HeadRnode;
951 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *PreviousRnode;
952 1.1.1.2.2.2 bouyer ASL_RESOURCE_NODE *Rnode;
953 1.1.1.2.2.2 bouyer UINT8 State;
954 1.1.1.2.2.2 bouyer
955 1.1.1.2.2.2 bouyer
956 1.1.1.2.2.2 bouyer /* Mark parent as containing a resource template */
957 1.1.1.2.2.2 bouyer
958 1.1.1.2.2.2 bouyer if (Op->Asl.Parent)
959 1.1.1.2.2.2 bouyer {
960 1.1.1.2.2.2 bouyer Op->Asl.Parent->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
961 1.1.1.2.2.2 bouyer }
962 1.1.1.2.2.2 bouyer
963 1.1.1.2.2.2 bouyer /* ResourceTemplate Opcode is first (Op) */
964 1.1.1.2.2.2 bouyer /* Buffer Length node is first child */
965 1.1.1.2.2.2 bouyer
966 1.1.1.2.2.2 bouyer BufferLengthOp = ASL_GET_CHILD_NODE (Op);
967 1.1.1.2.2.2 bouyer
968 1.1.1.2.2.2 bouyer /* Buffer Op is first peer */
969 1.1.1.2.2.2 bouyer
970 1.1.1.2.2.2 bouyer BufferOp = ASL_GET_PEER_NODE (BufferLengthOp);
971 1.1.1.2.2.2 bouyer
972 1.1.1.2.2.2 bouyer /* First Descriptor type is next */
973 1.1.1.2.2.2 bouyer
974 1.1.1.2.2.2 bouyer DescriptorTypeOp = ASL_GET_PEER_NODE (BufferOp);
975 1.1.1.2.2.2 bouyer
976 1.1.1.2.2.2 bouyer /*
977 1.1.1.2.2.2 bouyer * Process all resource descriptors in the list
978 1.1.1.2.2.2 bouyer * Note: It is assumed that the EndTag node has been automatically
979 1.1.1.2.2.2 bouyer * inserted at the end of the template by the parser.
980 1.1.1.2.2.2 bouyer */
981 1.1.1.2.2.2 bouyer State = ACPI_RSTATE_NORMAL;
982 1.1.1.2.2.2 bouyer PreviousRnode = &HeadRnode;
983 1.1.1.2.2.2 bouyer while (DescriptorTypeOp)
984 1.1.1.2.2.2 bouyer {
985 1.1.1.2.2.2 bouyer DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
986 1.1.1.2.2.2 bouyer Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
987 1.1.1.2.2.2 bouyer &State);
988 1.1.1.2.2.2 bouyer
989 1.1.1.2.2.2 bouyer /*
990 1.1.1.2.2.2 bouyer * Update current byte offset to indicate the number of bytes from the
991 1.1.1.2.2.2 bouyer * start of the buffer. Buffer can include multiple descriptors, we
992 1.1.1.2.2.2 bouyer * must keep track of the offset of not only each descriptor, but each
993 1.1.1.2.2.2 bouyer * element (field) within each descriptor as well.
994 1.1.1.2.2.2 bouyer */
995 1.1.1.2.2.2 bouyer CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, Rnode);
996 1.1.1.2.2.2 bouyer
997 1.1.1.2.2.2 bouyer /* Get the next descriptor in the list */
998 1.1.1.2.2.2 bouyer
999 1.1.1.2.2.2 bouyer LastOp = DescriptorTypeOp;
1000 1.1.1.2.2.2 bouyer DescriptorTypeOp = ASL_GET_PEER_NODE (DescriptorTypeOp);
1001 1.1.1.2.2.2 bouyer }
1002 1.1.1.2.2.2 bouyer
1003 1.1.1.2.2.2 bouyer if (State == ACPI_RSTATE_DEPENDENT_LIST)
1004 1.1.1.2.2.2 bouyer {
1005 1.1.1.2.2.2 bouyer if (LastOp)
1006 1.1.1.2.2.2 bouyer {
1007 1.1.1.2.2.2 bouyer LastOp = LastOp->Asl.Parent;
1008 1.1.1.2.2.2 bouyer }
1009 1.1.1.2.2.2 bouyer AslError (ASL_ERROR, ASL_MSG_MISSING_ENDDEPENDENT, LastOp, NULL);
1010 1.1.1.2.2.2 bouyer }
1011 1.1.1.2.2.2 bouyer
1012 1.1.1.2.2.2 bouyer /*
1013 1.1.1.2.2.2 bouyer * Transform the nodes into the following
1014 1.1.1.2.2.2 bouyer *
1015 1.1.1.2.2.2 bouyer * Op -> AML_BUFFER_OP
1016 1.1.1.2.2.2 bouyer * First Child -> BufferLength
1017 1.1.1.2.2.2 bouyer * Second Child -> Descriptor Buffer (raw byte data)
1018 1.1.1.2.2.2 bouyer */
1019 1.1.1.2.2.2 bouyer Op->Asl.ParseOpcode = PARSEOP_BUFFER;
1020 1.1.1.2.2.2 bouyer Op->Asl.AmlOpcode = AML_BUFFER_OP;
1021 1.1.1.2.2.2 bouyer Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
1022 1.1.1.2.2.2 bouyer
1023 1.1.1.2.2.2 bouyer BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
1024 1.1.1.2.2.2 bouyer BufferLengthOp->Asl.Value.Integer = CurrentByteOffset;
1025 1.1.1.2.2.2 bouyer (void) OpcSetOptimalIntegerSize (BufferLengthOp);
1026 1.1.1.2.2.2 bouyer
1027 1.1.1.2.2.2 bouyer BufferOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
1028 1.1.1.2.2.2 bouyer BufferOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
1029 1.1.1.2.2.2 bouyer BufferOp->Asl.AmlOpcodeLength = 0;
1030 1.1.1.2.2.2 bouyer BufferOp->Asl.AmlLength = CurrentByteOffset;
1031 1.1.1.2.2.2 bouyer BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next;
1032 1.1.1.2.2.2 bouyer BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA;
1033 1.1.1.2.2.2 bouyer
1034 1.1.1.2.2.2 bouyer return;
1035 1.1.1.2.2.2 bouyer }
1036 1.1.1.2.2.2 bouyer
1037 1.1.1.2.2.2 bouyer
1038