Print this page
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/executer/exstore.c
+++ new/usr/src/common/acpica/components/executer/exstore.c
1 1 /******************************************************************************
2 2 *
3 3 * Module Name: exstore - AML Interpreter object store support
4 4 *
5 5 *****************************************************************************/
6 6
7 7 /*
8 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2013, Intel Corp.
9 9 * All rights reserved.
10 10 *
11 11 * Redistribution and use in source and binary forms, with or without
12 12 * modification, are permitted provided that the following conditions
13 13 * are met:
14 14 * 1. Redistributions of source code must retain the above copyright
15 15 * notice, this list of conditions, and the following disclaimer,
16 16 * without modification.
17 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 20 * including a substantially similar Disclaimer requirement for further
21 21 * binary redistribution.
22 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 23 * of any contributors may be used to endorse or promote products derived
24 24 * from this software without specific prior written permission.
25 25 *
26 26 * Alternatively, this software may be distributed under the terms of the
27 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 28 * Software Foundation.
29 29 *
30 30 * NO WARRANTY
31 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 41 * POSSIBILITY OF SUCH DAMAGES.
42 42 */
43 43
44 44 #define __EXSTORE_C__
45 45
46 46 #include "acpi.h"
47 47 #include "accommon.h"
48 48 #include "acdispat.h"
49 49 #include "acinterp.h"
50 50 #include "amlcode.h"
51 51 #include "acnamesp.h"
52 52
53 53
54 54 #define _COMPONENT ACPI_EXECUTER
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
55 55 ACPI_MODULE_NAME ("exstore")
56 56
57 57 /* Local prototypes */
58 58
59 59 static ACPI_STATUS
60 60 AcpiExStoreObjectToIndex (
61 61 ACPI_OPERAND_OBJECT *ValDesc,
62 62 ACPI_OPERAND_OBJECT *DestDesc,
63 63 ACPI_WALK_STATE *WalkState);
64 64
65 +static ACPI_STATUS
66 +AcpiExStoreDirectToNode (
67 + ACPI_OPERAND_OBJECT *SourceDesc,
68 + ACPI_NAMESPACE_NODE *Node,
69 + ACPI_WALK_STATE *WalkState);
65 70
71 +
66 72 /*******************************************************************************
67 73 *
68 74 * FUNCTION: AcpiExStore
69 75 *
70 76 * PARAMETERS: *SourceDesc - Value to be stored
71 - * *DestDesc - Where to store it. Must be an NS node
72 - * or an ACPI_OPERAND_OBJECT of type
77 + * *DestDesc - Where to store it. Must be an NS node
78 + * or ACPI_OPERAND_OBJECT of type
73 79 * Reference;
74 80 * WalkState - Current walk state
75 81 *
76 82 * RETURN: Status
77 83 *
78 84 * DESCRIPTION: Store the value described by SourceDesc into the location
79 - * described by DestDesc. Called by various interpreter
85 + * described by DestDesc. Called by various interpreter
80 86 * functions to store the result of an operation into
81 87 * the destination operand -- not just simply the actual "Store"
82 88 * ASL operator.
83 89 *
84 90 ******************************************************************************/
85 91
86 92 ACPI_STATUS
87 93 AcpiExStore (
88 94 ACPI_OPERAND_OBJECT *SourceDesc,
89 95 ACPI_OPERAND_OBJECT *DestDesc,
90 96 ACPI_WALK_STATE *WalkState)
91 97 {
92 98 ACPI_STATUS Status = AE_OK;
93 99 ACPI_OPERAND_OBJECT *RefDesc = DestDesc;
94 100
95 101
96 102 ACPI_FUNCTION_TRACE_PTR (ExStore, DestDesc);
97 103
98 104
99 105 /* Validate parameters */
100 106
101 107 if (!SourceDesc || !DestDesc)
102 108 {
103 109 ACPI_ERROR ((AE_INFO, "Null parameter"));
104 110 return_ACPI_STATUS (AE_AML_NO_OPERAND);
105 111 }
106 112
107 113 /* DestDesc can be either a namespace node or an ACPI object */
108 114
109 115 if (ACPI_GET_DESCRIPTOR_TYPE (DestDesc) == ACPI_DESC_TYPE_NAMED)
110 116 {
111 117 /*
112 118 * Dest is a namespace node,
113 119 * Storing an object into a Named node.
114 120 */
115 121 Status = AcpiExStoreObjectToNode (SourceDesc,
116 122 (ACPI_NAMESPACE_NODE *) DestDesc, WalkState,
↓ open down ↓ |
27 lines elided |
↑ open up ↑ |
117 123 ACPI_IMPLICIT_CONVERSION);
118 124
119 125 return_ACPI_STATUS (Status);
120 126 }
121 127
122 128 /* Destination object must be a Reference or a Constant object */
123 129
124 130 switch (DestDesc->Common.Type)
125 131 {
126 132 case ACPI_TYPE_LOCAL_REFERENCE:
133 +
127 134 break;
128 135
129 136 case ACPI_TYPE_INTEGER:
130 137
131 138 /* Allow stores to Constants -- a Noop as per ACPI spec */
132 139
133 140 if (DestDesc->Common.Flags & AOPOBJ_AML_CONSTANT)
134 141 {
135 142 return_ACPI_STATUS (AE_OK);
136 143 }
137 144
138 145 /*lint -fallthrough */
139 146
140 147 default:
141 148
142 149 /* Destination is not a Reference object */
143 150
144 151 ACPI_ERROR ((AE_INFO,
145 152 "Target is not a Reference or Constant object - %s [%p]",
146 153 AcpiUtGetObjectTypeName (DestDesc), DestDesc));
147 154
148 155 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
149 156 }
150 157
151 158 /*
152 159 * Examine the Reference class. These cases are handled:
153 160 *
154 161 * 1) Store to Name (Change the object associated with a name)
155 162 * 2) Store to an indexed area of a Buffer or Package
156 163 * 3) Store to a Method Local or Arg
157 164 * 4) Store to the debug object
158 165 */
159 166 switch (RefDesc->Reference.Class)
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
160 167 {
161 168 case ACPI_REFCLASS_REFOF:
162 169
163 170 /* Storing an object into a Name "container" */
164 171
165 172 Status = AcpiExStoreObjectToNode (SourceDesc,
166 173 RefDesc->Reference.Object,
167 174 WalkState, ACPI_IMPLICIT_CONVERSION);
168 175 break;
169 176
170 -
171 177 case ACPI_REFCLASS_INDEX:
172 178
173 179 /* Storing to an Index (pointer into a packager or buffer) */
174 180
175 181 Status = AcpiExStoreObjectToIndex (SourceDesc, RefDesc, WalkState);
176 182 break;
177 183
178 -
179 184 case ACPI_REFCLASS_LOCAL:
180 185 case ACPI_REFCLASS_ARG:
181 186
182 187 /* Store to a method local/arg */
183 188
184 189 Status = AcpiDsStoreObjectToLocal (RefDesc->Reference.Class,
185 190 RefDesc->Reference.Value, SourceDesc, WalkState);
186 191 break;
187 192
188 -
189 193 case ACPI_REFCLASS_DEBUG:
190 -
191 194 /*
192 195 * Storing to the Debug object causes the value stored to be
193 196 * displayed and otherwise has no effect -- see ACPI Specification
194 197 */
195 198 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
196 199 "**** Write to Debug Object: Object %p %s ****:\n\n",
197 200 SourceDesc, AcpiUtGetObjectTypeName (SourceDesc)));
198 201
199 202 ACPI_DEBUG_OBJECT (SourceDesc, 0, 0);
200 203 break;
201 204
202 -
203 205 default:
204 206
205 207 ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X",
206 208 RefDesc->Reference.Class));
207 209 ACPI_DUMP_ENTRY (RefDesc, ACPI_LV_INFO);
208 210
209 211 Status = AE_AML_INTERNAL;
210 212 break;
211 213 }
212 214
213 215 return_ACPI_STATUS (Status);
214 216 }
215 217
216 218
217 219 /*******************************************************************************
218 220 *
219 221 * FUNCTION: AcpiExStoreObjectToIndex
220 222 *
221 223 * PARAMETERS: *SourceDesc - Value to be stored
222 224 * *DestDesc - Named object to receive the value
223 225 * WalkState - Current walk state
224 226 *
225 227 * RETURN: Status
226 228 *
227 229 * DESCRIPTION: Store the object to indexed Buffer or Package element
228 230 *
229 231 ******************************************************************************/
230 232
231 233 static ACPI_STATUS
232 234 AcpiExStoreObjectToIndex (
233 235 ACPI_OPERAND_OBJECT *SourceDesc,
234 236 ACPI_OPERAND_OBJECT *IndexDesc,
235 237 ACPI_WALK_STATE *WalkState)
236 238 {
237 239 ACPI_STATUS Status = AE_OK;
238 240 ACPI_OPERAND_OBJECT *ObjDesc;
239 241 ACPI_OPERAND_OBJECT *NewDesc;
240 242 UINT8 Value = 0;
241 243 UINT32 i;
242 244
243 245
244 246 ACPI_FUNCTION_TRACE (ExStoreObjectToIndex);
245 247
246 248
247 249 /*
248 250 * Destination must be a reference pointer, and
249 251 * must point to either a buffer or a package
250 252 */
251 253 switch (IndexDesc->Reference.TargetType)
252 254 {
253 255 case ACPI_TYPE_PACKAGE:
254 256 /*
255 257 * Storing to a package element. Copy the object and replace
256 258 * any existing object with the new object. No implicit
257 259 * conversion is performed.
258 260 *
259 261 * The object at *(IndexDesc->Reference.Where) is the
260 262 * element within the package that is to be modified.
261 263 * The parent package object is at IndexDesc->Reference.Object
262 264 */
263 265 ObjDesc = *(IndexDesc->Reference.Where);
264 266
265 267 if (SourceDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE &&
266 268 SourceDesc->Reference.Class == ACPI_REFCLASS_TABLE)
267 269 {
268 270 /* This is a DDBHandle, just add a reference to it */
269 271
270 272 AcpiUtAddReference (SourceDesc);
271 273 NewDesc = SourceDesc;
272 274 }
273 275 else
274 276 {
275 277 /* Normal object, copy it */
276 278
277 279 Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
278 280 if (ACPI_FAILURE (Status))
279 281 {
280 282 return_ACPI_STATUS (Status);
281 283 }
282 284 }
283 285
284 286 if (ObjDesc)
285 287 {
286 288 /* Decrement reference count by the ref count of the parent package */
287 289
288 290 for (i = 0;
289 291 i < ((ACPI_OPERAND_OBJECT *)
290 292 IndexDesc->Reference.Object)->Common.ReferenceCount;
291 293 i++)
292 294 {
293 295 AcpiUtRemoveReference (ObjDesc);
294 296 }
295 297 }
296 298
297 299 *(IndexDesc->Reference.Where) = NewDesc;
298 300
299 301 /* Increment ref count by the ref count of the parent package-1 */
300 302
↓ open down ↓ |
88 lines elided |
↑ open up ↑ |
301 303 for (i = 1;
302 304 i < ((ACPI_OPERAND_OBJECT *)
303 305 IndexDesc->Reference.Object)->Common.ReferenceCount;
304 306 i++)
305 307 {
306 308 AcpiUtAddReference (NewDesc);
307 309 }
308 310
309 311 break;
310 312
311 -
312 313 case ACPI_TYPE_BUFFER_FIELD:
313 -
314 314 /*
315 315 * Store into a Buffer or String (not actually a real BufferField)
316 316 * at a location defined by an Index.
317 317 *
318 318 * The first 8-bit element of the source object is written to the
319 319 * 8-bit Buffer location defined by the Index destination object,
320 320 * according to the ACPI 2.0 specification.
321 321 */
322 322
323 323 /*
324 324 * Make sure the target is a Buffer or String. An error should
325 325 * not happen here, since the ReferenceObject was constructed
326 326 * by the INDEX_OP code.
327 327 */
328 328 ObjDesc = IndexDesc->Reference.Object;
329 329 if ((ObjDesc->Common.Type != ACPI_TYPE_BUFFER) &&
330 330 (ObjDesc->Common.Type != ACPI_TYPE_STRING))
331 331 {
332 332 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
333 333 }
334 334
335 335 /*
336 336 * The assignment of the individual elements will be slightly
337 337 * different for each source type.
338 338 */
339 339 switch (SourceDesc->Common.Type)
340 340 {
341 341 case ACPI_TYPE_INTEGER:
342 342
343 343 /* Use the least-significant byte of the integer */
344 344
345 345 Value = (UINT8) (SourceDesc->Integer.Value);
346 346 break;
347 347
348 348 case ACPI_TYPE_BUFFER:
349 349 case ACPI_TYPE_STRING:
350 350
351 351 /* Note: Takes advantage of common string/buffer fields */
352 352
353 353 Value = SourceDesc->Buffer.Pointer[0];
354 354 break;
355 355
356 356 default:
357 357
358 358 /* All other types are invalid */
359 359
360 360 ACPI_ERROR ((AE_INFO,
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
361 361 "Source must be Integer/Buffer/String type, not %s",
362 362 AcpiUtGetObjectTypeName (SourceDesc)));
363 363 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
364 364 }
365 365
366 366 /* Store the source value into the target buffer byte */
367 367
368 368 ObjDesc->Buffer.Pointer[IndexDesc->Reference.Value] = Value;
369 369 break;
370 370
371 -
372 371 default:
373 372 ACPI_ERROR ((AE_INFO,
374 373 "Target is not a Package or BufferField"));
375 374 Status = AE_AML_OPERAND_TYPE;
376 375 break;
377 376 }
378 377
379 378 return_ACPI_STATUS (Status);
380 379 }
381 380
382 381
383 382 /*******************************************************************************
384 383 *
385 384 * FUNCTION: AcpiExStoreObjectToNode
386 385 *
387 386 * PARAMETERS: SourceDesc - Value to be stored
388 387 * Node - Named object to receive the value
389 388 * WalkState - Current walk state
390 389 * ImplicitConversion - Perform implicit conversion (yes/no)
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
391 390 *
392 391 * RETURN: Status
393 392 *
394 393 * DESCRIPTION: Store the object to the named object.
395 394 *
396 395 * The Assignment of an object to a named object is handled here
397 396 * The value passed in will replace the current value (if any)
398 397 * with the input value.
399 398 *
400 399 * When storing into an object the data is converted to the
401 - * target object type then stored in the object. This means
400 + * target object type then stored in the object. This means
402 401 * that the target object type (for an initialized target) will
403 - * not be changed by a store operation.
402 + * not be changed by a store operation. A CopyObject can change
403 + * the target type, however.
404 404 *
405 + * The ImplicitConversion flag is set to NO/FALSE only when
406 + * storing to an ArgX -- as per the rules of the ACPI spec.
407 + *
405 408 * Assumes parameters are already validated.
406 409 *
407 410 ******************************************************************************/
408 411
409 412 ACPI_STATUS
410 413 AcpiExStoreObjectToNode (
411 414 ACPI_OPERAND_OBJECT *SourceDesc,
412 415 ACPI_NAMESPACE_NODE *Node,
413 416 ACPI_WALK_STATE *WalkState,
414 417 UINT8 ImplicitConversion)
415 418 {
416 419 ACPI_STATUS Status = AE_OK;
417 420 ACPI_OPERAND_OBJECT *TargetDesc;
418 421 ACPI_OPERAND_OBJECT *NewDesc;
419 422 ACPI_OBJECT_TYPE TargetType;
↓ open down ↓ |
5 lines elided |
↑ open up ↑ |
420 423
421 424
422 425 ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToNode, SourceDesc);
423 426
424 427
425 428 /* Get current type of the node, and object attached to Node */
426 429
427 430 TargetType = AcpiNsGetType (Node);
428 431 TargetDesc = AcpiNsGetAttachedObject (Node);
429 432
430 - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
433 + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
431 434 SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),
432 435 Node, AcpiUtGetTypeName (TargetType)));
433 436
434 437 /*
435 438 * Resolve the source object to an actual value
436 439 * (If it is a reference object)
437 440 */
438 441 Status = AcpiExResolveObject (&SourceDesc, TargetType, WalkState);
439 442 if (ACPI_FAILURE (Status))
440 443 {
441 444 return_ACPI_STATUS (Status);
442 445 }
443 446
444 - /* If no implicit conversion, drop into the default case below */
445 -
446 - if ((!ImplicitConversion) ||
447 - ((WalkState->Opcode == AML_COPY_OP) &&
448 - (TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) &&
449 - (TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) &&
450 - (TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD)))
451 - {
452 - /*
453 - * Force execution of default (no implicit conversion). Note:
454 - * CopyObject does not perform an implicit conversion, as per the ACPI
455 - * spec -- except in case of region/bank/index fields -- because these
456 - * objects must retain their original type permanently.
457 - */
458 - TargetType = ACPI_TYPE_ANY;
459 - }
460 -
461 447 /* Do the actual store operation */
462 448
463 449 switch (TargetType)
464 450 {
465 - case ACPI_TYPE_BUFFER_FIELD:
466 - case ACPI_TYPE_LOCAL_REGION_FIELD:
467 - case ACPI_TYPE_LOCAL_BANK_FIELD:
468 - case ACPI_TYPE_LOCAL_INDEX_FIELD:
469 -
470 - /* For fields, copy the source data to the target field. */
471 -
472 - Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
473 - &WalkState->ResultObj);
474 - break;
475 -
476 -
477 451 case ACPI_TYPE_INTEGER:
478 452 case ACPI_TYPE_STRING:
479 453 case ACPI_TYPE_BUFFER:
480 -
481 454 /*
482 - * These target types are all of type Integer/String/Buffer, and
483 - * therefore support implicit conversion before the store.
484 - *
485 - * Copy and/or convert the source object to a new target object
455 + * The simple data types all support implicit source operand
456 + * conversion before the store.
486 457 */
458 +
459 + if ((WalkState->Opcode == AML_COPY_OP) ||
460 + !ImplicitConversion)
461 + {
462 + /*
463 + * However, CopyObject and Stores to ArgX do not perform
464 + * an implicit conversion, as per the ACPI specification.
465 + * A direct store is performed instead.
466 + */
467 + Status = AcpiExStoreDirectToNode (SourceDesc, Node,
468 + WalkState);
469 + break;
470 + }
471 +
472 + /* Store with implicit source operand conversion support */
473 +
487 474 Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc,
488 - &NewDesc, WalkState);
475 + &NewDesc, WalkState);
489 476 if (ACPI_FAILURE (Status))
490 477 {
491 478 return_ACPI_STATUS (Status);
492 479 }
493 480
494 481 if (NewDesc != TargetDesc)
495 482 {
496 483 /*
497 484 * Store the new NewDesc as the new value of the Name, and set
498 485 * the Name's type to that of the value being stored in it.
499 486 * SourceDesc reference count is incremented by AttachObject.
500 487 *
501 - * Note: This may change the type of the node if an explicit store
502 - * has been performed such that the node/object type has been
503 - * changed.
488 + * Note: This may change the type of the node if an explicit
489 + * store has been performed such that the node/object type
490 + * has been changed.
504 491 */
505 - Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
492 + Status = AcpiNsAttachObject (Node, NewDesc,
493 + NewDesc->Common.Type);
506 494
507 495 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
508 496 "Store %s into %s via Convert/Attach\n",
509 497 AcpiUtGetObjectTypeName (SourceDesc),
510 498 AcpiUtGetObjectTypeName (NewDesc)));
511 499 }
512 500 break;
513 501
502 + case ACPI_TYPE_BUFFER_FIELD:
503 + case ACPI_TYPE_LOCAL_REGION_FIELD:
504 + case ACPI_TYPE_LOCAL_BANK_FIELD:
505 + case ACPI_TYPE_LOCAL_INDEX_FIELD:
506 + /*
507 + * For all fields, always write the source data to the target
508 + * field. Any required implicit source operand conversion is
509 + * performed in the function below as necessary. Note, field
510 + * objects must retain their original type permanently.
511 + */
512 + Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
513 + &WalkState->ResultObj);
514 + break;
514 515
515 516 default:
516 -
517 - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
518 - "Storing %s (%p) directly into node (%p) with no implicit conversion\n",
519 - AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, Node));
520 -
521 - /* No conversions for all other types. Just attach the source object */
522 -
523 - Status = AcpiNsAttachObject (Node, SourceDesc,
524 - SourceDesc->Common.Type);
517 + /*
518 + * No conversions for all other types. Directly store a copy of
519 + * the source object. This is the ACPI spec-defined behavior for
520 + * the CopyObject operator.
521 + *
522 + * NOTE: For the Store operator, this is a departure from the
523 + * ACPI spec, which states "If conversion is impossible, abort
524 + * the running control method". Instead, this code implements
525 + * "If conversion is impossible, treat the Store operation as
526 + * a CopyObject".
527 + */
528 + Status = AcpiExStoreDirectToNode (SourceDesc, Node,
529 + WalkState);
525 530 break;
526 531 }
527 532
528 533 return_ACPI_STATUS (Status);
529 534 }
530 535
531 536
537 +/*******************************************************************************
538 + *
539 + * FUNCTION: AcpiExStoreDirectToNode
540 + *
541 + * PARAMETERS: SourceDesc - Value to be stored
542 + * Node - Named object to receive the value
543 + * WalkState - Current walk state
544 + *
545 + * RETURN: Status
546 + *
547 + * DESCRIPTION: "Store" an object directly to a node. This involves a copy
548 + * and an attach.
549 + *
550 + ******************************************************************************/
551 +
552 +static ACPI_STATUS
553 +AcpiExStoreDirectToNode (
554 + ACPI_OPERAND_OBJECT *SourceDesc,
555 + ACPI_NAMESPACE_NODE *Node,
556 + ACPI_WALK_STATE *WalkState)
557 +{
558 + ACPI_STATUS Status;
559 + ACPI_OPERAND_OBJECT *NewDesc;
560 +
561 +
562 + ACPI_FUNCTION_TRACE (ExStoreDirectToNode);
563 +
564 +
565 + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
566 + "Storing [%s] (%p) directly into node [%s] (%p)"
567 + " with no implicit conversion\n",
568 + AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
569 + AcpiUtGetTypeName (Node->Type), Node));
570 +
571 + /* Copy the source object to a new object */
572 +
573 + Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
574 + if (ACPI_FAILURE (Status))
575 + {
576 + return_ACPI_STATUS (Status);
577 + }
578 +
579 + /* Attach the new object to the node */
580 +
581 + Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
582 + AcpiUtRemoveReference (NewDesc);
583 + return_ACPI_STATUS (Status);
584 +}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX