]> git.proxmox.com Git - mirror_edk2.git/blame - DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlNodeInterface.c
DynamicTablesPkg: Apply uncrustify changes
[mirror_edk2.git] / DynamicTablesPkg / Library / Common / AmlLib / Tree / AmlNodeInterface.c
CommitLineData
bcab901b
PG
1/** @file\r
2 AML Node Interface.\r
3\r
4 Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>\r
5\r
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
7**/\r
8\r
9#include <AmlNodeDefines.h>\r
10\r
11#include <AmlCoreInterface.h>\r
12#include <ResourceData/AmlResourceData.h>\r
13#include <String/AmlString.h>\r
14#include <Tree/AmlNode.h>\r
15#include <Tree/AmlTree.h>\r
16#include <Utils/AmlUtility.h>\r
17\r
18/** Returns the tree node type (Root/Object/Data).\r
19\r
20 @param [in] Node Pointer to a Node.\r
21\r
22 @return The node type.\r
23 EAmlNodeUnknown if invalid parameter.\r
24**/\r
25EAML_NODE_TYPE\r
26EFIAPI\r
27AmlGetNodeType (\r
731c67e1 28 IN AML_NODE_HEADER *Node\r
bcab901b
PG
29 )\r
30{\r
31 if (!IS_AML_NODE_VALID (Node)) {\r
32 ASSERT (0);\r
33 return EAmlNodeUnknown;\r
34 }\r
35\r
36 return Node->NodeType;\r
37}\r
38\r
39/** Get the RootNode information.\r
40 The Node must be a root node.\r
41\r
42 @param [in] RootNode Pointer to a root node.\r
43 @param [out] SdtHeaderBuffer Buffer to copy the ACPI DSDT/SSDT header to.\r
44\r
45 @retval EFI_SUCCESS The function completed successfully.\r
46 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
47**/\r
48EFI_STATUS\r
49EFIAPI\r
50AmlGetRootNodeInfo (\r
731c67e1
MK
51 IN AML_ROOT_NODE *RootNode,\r
52 OUT EFI_ACPI_DESCRIPTION_HEADER *SdtHeaderBuffer\r
bcab901b
PG
53 )\r
54{\r
55 if (!IS_AML_ROOT_NODE (RootNode) ||\r
731c67e1
MK
56 (SdtHeaderBuffer == NULL))\r
57 {\r
bcab901b
PG
58 ASSERT (0);\r
59 return EFI_INVALID_PARAMETER;\r
60 }\r
61\r
62 CopyMem (\r
63 SdtHeaderBuffer,\r
64 RootNode->SdtHeader,\r
65 sizeof (EFI_ACPI_DESCRIPTION_HEADER)\r
66 );\r
67\r
68 return EFI_SUCCESS;\r
69}\r
70\r
71/** Get the ObjectNode information.\r
72 The Node must be an object node.\r
73\r
74 @ingroup NodeInterfaceApi\r
75\r
76 @param [in] ObjectNode Pointer to an object node.\r
77 @param [out] OpCode Pointer holding the OpCode.\r
78 Optional, can be NULL.\r
79 @param [out] SubOpCode Pointer holding the SubOpCode.\r
80 Optional, can be NULL.\r
81 @param [out] PkgLen Pointer holding the PkgLen.\r
82 The PkgLen is 0 for nodes\r
83 not having the Pkglen attribute.\r
84 Optional, can be NULL.\r
85 @param [out] IsNameSpaceNode Pointer holding TRUE if the node is defining\r
86 or changing the NameSpace scope.\r
87 E.g.: The "Name ()" and "Scope ()" ASL\r
88 statements add/modify the NameSpace scope.\r
89 Their corresponding node are NameSpace nodes.\r
90 Optional, can be NULL.\r
91\r
92 @retval EFI_SUCCESS The function completed successfully.\r
93 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
94**/\r
95EFI_STATUS\r
96EFIAPI\r
97AmlGetObjectNodeInfo (\r
731c67e1
MK
98 IN AML_OBJECT_NODE *ObjectNode,\r
99 OUT UINT8 *OpCode OPTIONAL,\r
100 OUT UINT8 *SubOpCode OPTIONAL,\r
101 OUT UINT32 *PkgLen OPTIONAL,\r
102 OUT BOOLEAN *IsNameSpaceNode OPTIONAL\r
bcab901b
PG
103 )\r
104{\r
105 if (!IS_AML_OBJECT_NODE (ObjectNode)) {\r
106 ASSERT (0);\r
107 return EFI_INVALID_PARAMETER;\r
108 }\r
109\r
110 if (OpCode != NULL) {\r
111 *OpCode = ObjectNode->AmlByteEncoding->OpCode;\r
112 }\r
731c67e1 113\r
bcab901b
PG
114 if (SubOpCode != NULL) {\r
115 *SubOpCode = ObjectNode->AmlByteEncoding->SubOpCode;\r
116 }\r
731c67e1 117\r
bcab901b
PG
118 if (PkgLen != NULL) {\r
119 *PkgLen = ObjectNode->PkgLen;\r
120 }\r
731c67e1 121\r
bcab901b
PG
122 if (IsNameSpaceNode != NULL) {\r
123 *IsNameSpaceNode = AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE);\r
124 }\r
125\r
126 return EFI_SUCCESS;\r
127}\r
128\r
129/** Returns the count of the fixed arguments for the input Node.\r
130\r
131 @param [in] Node Pointer to an object node.\r
132\r
133 @return Number of fixed arguments of the object node.\r
134 Return 0 if the node is not an object node.\r
135**/\r
136UINT8\r
137AmlGetFixedArgumentCount (\r
731c67e1 138 IN AML_OBJECT_NODE *Node\r
bcab901b
PG
139 )\r
140{\r
141 if (IS_AML_OBJECT_NODE (Node) &&\r
731c67e1
MK
142 (Node->AmlByteEncoding != NULL))\r
143 {\r
bcab901b
PG
144 return (UINT8)Node->AmlByteEncoding->MaxIndex;\r
145 }\r
146\r
147 return 0;\r
148}\r
149\r
150/** Get the data type of the DataNode.\r
151 The Node must be a data node.\r
152\r
153 @param [in] DataNode Pointer to a data node.\r
154 @param [out] DataType Pointer holding the data type of the data buffer.\r
155\r
156 @retval EFI_SUCCESS The function completed successfully.\r
157 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
158**/\r
159EFI_STATUS\r
160EFIAPI\r
161AmlGetNodeDataType (\r
731c67e1
MK
162 IN AML_DATA_NODE *DataNode,\r
163 OUT EAML_NODE_DATA_TYPE *DataType\r
bcab901b
PG
164 )\r
165{\r
166 if (!IS_AML_DATA_NODE (DataNode) ||\r
731c67e1
MK
167 (DataType == NULL))\r
168 {\r
bcab901b
PG
169 ASSERT (0);\r
170 return EFI_INVALID_PARAMETER;\r
171 }\r
172\r
173 *DataType = DataNode->DataType;\r
174\r
175 return EFI_SUCCESS;\r
176}\r
177\r
178/** Get the descriptor Id of the resource data element\r
179 contained in the DataNode.\r
180\r
181 The Node must be a data node.\r
182 The Node must have the resource data type, i.e. have the\r
183 EAmlNodeDataTypeResourceData data type.\r
184\r
185 @param [in] DataNode Pointer to a data node containing a\r
186 resource data element.\r
187 @param [out] ResourceDataType Pointer holding the descriptor Id of\r
188 the resource data.\r
189\r
190 @retval EFI_SUCCESS The function completed successfully.\r
191 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
192**/\r
193EFI_STATUS\r
194EFIAPI\r
195AmlGetResourceDataType (\r
731c67e1
MK
196 IN AML_DATA_NODE *DataNode,\r
197 OUT AML_RD_HEADER *ResourceDataType\r
bcab901b
PG
198 )\r
199{\r
200 if (!IS_AML_DATA_NODE (DataNode) ||\r
201 (ResourceDataType == NULL) ||\r
731c67e1
MK
202 (DataNode->DataType != EAmlNodeDataTypeResourceData))\r
203 {\r
bcab901b
PG
204 ASSERT (0);\r
205 return EFI_INVALID_PARAMETER;\r
206 }\r
207\r
208 *ResourceDataType = AmlRdGetDescId (DataNode->Buffer);\r
209\r
210 return EFI_SUCCESS;\r
211}\r
212\r
213/** Get the data buffer and size of the DataNode.\r
214 The Node must be a data node.\r
215\r
216 BufferSize is always updated to the size of buffer of the DataNode.\r
217\r
218 If:\r
219 - the content of BufferSize is >= to the DataNode's buffer size;\r
220 - Buffer is not NULL;\r
221 then copy the content of the DataNode's buffer in Buffer.\r
222\r
223 @param [in] DataNode Pointer to a data node.\r
224 @param [out] Buffer Buffer to write the data to.\r
225 Optional, if NULL, only update BufferSize.\r
226 @param [in, out] BufferSize Pointer holding:\r
227 - At entry, the size of the Buffer;\r
228 - At exit, the size of the DataNode's\r
229 buffer size.\r
230\r
231 @retval EFI_SUCCESS The function completed successfully.\r
232 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
233**/\r
234EFI_STATUS\r
235EFIAPI\r
236AmlGetDataNodeBuffer (\r
731c67e1
MK
237 IN AML_DATA_NODE *DataNode,\r
238 OUT UINT8 *Buffer OPTIONAL,\r
239 IN OUT UINT32 *BufferSize\r
bcab901b
PG
240 )\r
241{\r
242 if (!IS_AML_DATA_NODE (DataNode) ||\r
731c67e1
MK
243 (BufferSize == NULL))\r
244 {\r
bcab901b
PG
245 ASSERT (0);\r
246 return EFI_INVALID_PARAMETER;\r
247 }\r
248\r
249 if ((*BufferSize >= DataNode->Size) &&\r
731c67e1
MK
250 (Buffer != NULL))\r
251 {\r
bcab901b
PG
252 CopyMem (Buffer, DataNode->Buffer, DataNode->Size);\r
253 }\r
254\r
255 *BufferSize = DataNode->Size;\r
256\r
257 return EFI_SUCCESS;\r
258}\r
259\r
260/** Update the ACPI DSDT/SSDT table header.\r
261\r
262 The input SdtHeader information is copied to the tree RootNode.\r
263 The table Length field is automatically updated.\r
264 The checksum field is only updated when serializing the tree.\r
265\r
266 @param [in] RootNode Pointer to a root node.\r
267 @param [in] SdtHeader Pointer to an ACPI DSDT/SSDT table header.\r
268\r
269 @retval EFI_SUCCESS The function completed successfully.\r
270 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
271**/\r
272EFI_STATUS\r
273EFIAPI\r
274AmlUpdateRootNode (\r
731c67e1
MK
275 IN AML_ROOT_NODE *RootNode,\r
276 IN CONST EFI_ACPI_DESCRIPTION_HEADER *SdtHeader\r
bcab901b
PG
277 )\r
278{\r
279 EFI_STATUS Status;\r
280 UINT32 Length;\r
281\r
282 if (!IS_AML_ROOT_NODE (RootNode) ||\r
283 (SdtHeader == NULL) ||\r
284 ((SdtHeader->Signature !=\r
285 EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) &&\r
286 (SdtHeader->Signature !=\r
731c67e1
MK
287 EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)))\r
288 {\r
bcab901b
PG
289 ASSERT (0);\r
290 return EFI_INVALID_PARAMETER;\r
291 }\r
292\r
293 CopyMem (\r
294 RootNode->SdtHeader,\r
295 SdtHeader,\r
296 sizeof (EFI_ACPI_DESCRIPTION_HEADER)\r
297 );\r
298\r
299 // Update the Length field.\r
731c67e1 300 Status = AmlComputeSize ((AML_NODE_HEADER *)RootNode, &Length);\r
bcab901b
PG
301 if (EFI_ERROR (Status)) {\r
302 ASSERT (0);\r
303 return Status;\r
304 }\r
305\r
306 RootNode->SdtHeader->Length = Length +\r
731c67e1 307 (UINT32)sizeof (EFI_ACPI_DESCRIPTION_HEADER);\r
bcab901b
PG
308\r
309 return Status;\r
310}\r
311\r
312/** Update an object node representing an integer with a new value.\r
313\r
314 The object node must have one of the following OpCodes:\r
315 - AML_BYTE_PREFIX\r
316 - AML_WORD_PREFIX\r
317 - AML_DWORD_PREFIX\r
318 - AML_QWORD_PREFIX\r
319 - AML_ZERO_OP\r
320 - AML_ONE_OP\r
321\r
322 The following OpCode is not supported:\r
323 - AML_ONES_OP\r
324\r
325 @param [in] IntegerOpNode Pointer an object node containing an integer.\r
326 Must not be an object node with an AML_ONES_OP\r
327 OpCode.\r
328 @param [in] NewInteger New integer value to set.\r
329\r
330 @retval EFI_SUCCESS The function completed successfully.\r
331 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
332**/\r
333EFI_STATUS\r
334EFIAPI\r
335AmlUpdateInteger (\r
731c67e1
MK
336 IN AML_OBJECT_NODE *IntegerOpNode,\r
337 IN UINT64 NewInteger\r
bcab901b
PG
338 )\r
339{\r
731c67e1 340 EFI_STATUS Status;\r
bcab901b 341\r
731c67e1 342 INT8 ValueWidthDiff;\r
bcab901b
PG
343\r
344 if (!IS_AML_OBJECT_NODE (IntegerOpNode) ||\r
345 (!IsIntegerNode (IntegerOpNode) &&\r
346 !IsSpecialIntegerNode (IntegerOpNode)) ||\r
731c67e1
MK
347 AmlNodeCompareOpCode (IntegerOpNode, AML_ONES_OP, 0))\r
348 {\r
bcab901b
PG
349 ASSERT (0);\r
350 return EFI_INVALID_PARAMETER;\r
351 }\r
352\r
353 Status = AmlNodeSetIntegerValue (IntegerOpNode, NewInteger, &ValueWidthDiff);\r
354 if (EFI_ERROR (Status)) {\r
355 ASSERT (0);\r
356 return Status;\r
357 }\r
358\r
359 // If the new size is different from the old size, propagate the new size.\r
360 if (ValueWidthDiff != 0) {\r
361 // Propagate the information.\r
362 Status = AmlPropagateInformation (\r
731c67e1 363 (AML_NODE_HEADER *)IntegerOpNode,\r
bcab901b
PG
364 (ValueWidthDiff > 0) ? TRUE : FALSE,\r
365 ABS (ValueWidthDiff),\r
366 0\r
367 );\r
368 if (EFI_ERROR (Status)) {\r
369 ASSERT (0);\r
370 }\r
371 }\r
372\r
373 return Status;\r
374}\r
375\r
376/** Update the buffer of a data node.\r
377\r
378 Note: The data type of the buffer's content must match the data type of the\r
379 DataNode. This is a hard restriction to prevent undesired behaviour.\r
380\r
381 @param [in] DataNode Pointer to a data node.\r
382 @param [in] DataType Data type of the Buffer's content.\r
383 @param [in] Buffer Buffer containing the new data. The content of\r
384 the Buffer is copied.\r
385 @param [in] Size Size of the Buffer.\r
386\r
387 @retval EFI_SUCCESS The function completed successfully.\r
388 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
389 @retval EFI_UNSUPPORTED Operation not supporter.\r
390**/\r
391EFI_STATUS\r
392EFIAPI\r
393AmlUpdateDataNode (\r
731c67e1
MK
394 IN AML_DATA_NODE *DataNode,\r
395 IN EAML_NODE_DATA_TYPE DataType,\r
396 IN UINT8 *Buffer,\r
397 IN UINT32 Size\r
bcab901b
PG
398 )\r
399{\r
731c67e1 400 EFI_STATUS Status;\r
bcab901b 401\r
731c67e1
MK
402 UINT32 ExpectedSize;\r
403 AML_OBJECT_NODE *ParentNode;\r
404 EAML_NODE_DATA_TYPE ExpectedArgType;\r
405 EAML_PARSE_INDEX Index;\r
bcab901b
PG
406\r
407 if (!IS_AML_DATA_NODE (DataNode) ||\r
408 (DataType > EAmlNodeDataTypeMax) ||\r
409 (Buffer == NULL) ||\r
731c67e1
MK
410 (Size == 0))\r
411 {\r
bcab901b
PG
412 ASSERT (0);\r
413 return EFI_INVALID_PARAMETER;\r
414 }\r
415\r
731c67e1 416 ParentNode = (AML_OBJECT_NODE *)AmlGetParent ((AML_NODE_HEADER *)DataNode);\r
bcab901b
PG
417 if (!IS_AML_OBJECT_NODE (ParentNode)) {\r
418 ASSERT (0);\r
419 return EFI_INVALID_PARAMETER;\r
420 }\r
421\r
422 // The NewNode and OldNode must have the same type.\r
423 // We do not allow to change the argument type of a data node.\r
424 // If required, the initial ASL template should be modified\r
425 // accordingly.\r
426 // It is however possible to interchange a raw buffer and a\r
427 // resource data element, since raw data can be misinterpreted\r
428 // as a resource data element.\r
429 ExpectedArgType = DataNode->DataType;\r
430 if ((ExpectedArgType != DataType) &&\r
431 (((ExpectedArgType != EAmlNodeDataTypeRaw) &&\r
432 (ExpectedArgType != EAmlNodeDataTypeResourceData)) ||\r
433 ((DataType != EAmlNodeDataTypeRaw) &&\r
731c67e1
MK
434 (DataType != EAmlNodeDataTypeResourceData))))\r
435 {\r
bcab901b
PG
436 ASSERT (0);\r
437 return EFI_UNSUPPORTED;\r
438 }\r
439\r
440 // Perform some compatibility checks.\r
441 switch (DataType) {\r
442 case EAmlNodeDataTypeNameString:\r
443 {\r
444 // Check the name contained in the Buffer is an AML name\r
445 // with the right size.\r
731c67e1 446 Status = AmlGetNameStringSize ((CONST CHAR8 *)Buffer, &ExpectedSize);\r
bcab901b 447 if (EFI_ERROR (Status) ||\r
731c67e1
MK
448 (Size != ExpectedSize))\r
449 {\r
bcab901b
PG
450 ASSERT (0);\r
451 return Status;\r
452 }\r
731c67e1 453\r
bcab901b
PG
454 break;\r
455 }\r
456 case EAmlNodeDataTypeString:\r
457 {\r
458 ExpectedSize = 0;\r
459 while (ExpectedSize < Size) {\r
460 // Cf ACPI 6.3 specification 20.2.3 Data Objects Encoding.\r
461 // AsciiCharList := Nothing | <AsciiChar AsciiCharList>\r
462 // AsciiChar := 0x01 - 0x7F\r
463 // NullChar := 0x00\r
464 if (Buffer[ExpectedSize] > 0x7F) {\r
465 ASSERT (0);\r
466 return EFI_INVALID_PARAMETER;\r
467 }\r
731c67e1 468\r
bcab901b
PG
469 ExpectedSize++;\r
470 }\r
471\r
472 if (ExpectedSize != Size) {\r
473 ASSERT (0);\r
474 return EFI_INVALID_PARAMETER;\r
475 }\r
731c67e1 476\r
bcab901b
PG
477 break;\r
478 }\r
479 case EAmlNodeDataTypeUInt:\r
480 {\r
731c67e1 481 if (AmlIsNodeFixedArgument ((CONST AML_NODE_HEADER *)DataNode, &Index)) {\r
bcab901b 482 if ((ParentNode->AmlByteEncoding == NULL) ||\r
731c67e1
MK
483 (ParentNode->AmlByteEncoding->Format == NULL))\r
484 {\r
bcab901b
PG
485 ASSERT (0);\r
486 return EFI_INVALID_PARAMETER;\r
487 }\r
488\r
489 // It is not possible to change the size of a fixed length UintX.\r
490 // E.g. for PackageOp the first fixed argument is of type EAmlUInt8\r
491 // and represents the count of elements. This type cannot be changed.\r
492 if ((ParentNode->AmlByteEncoding->Format[Index] != EAmlObject) &&\r
731c67e1
MK
493 (DataNode->Size != Size))\r
494 {\r
bcab901b
PG
495 ASSERT (0);\r
496 return EFI_UNSUPPORTED;\r
497 }\r
498 }\r
731c67e1 499\r
bcab901b
PG
500 break;\r
501 }\r
502 case EAmlNodeDataTypeRaw:\r
503 {\r
504 // Check if the parent node has the byte list flag set.\r
505 if (!AmlNodeHasAttribute (ParentNode, AML_HAS_BYTE_LIST)) {\r
506 ASSERT (0);\r
507 return EFI_INVALID_PARAMETER;\r
508 }\r
731c67e1 509\r
bcab901b
PG
510 break;\r
511 }\r
512 case EAmlNodeDataTypeResourceData:\r
513 {\r
514 // The resource data can be either small or large resource data.\r
515 // Small resource data must be at least 1 byte.\r
516 // Large resource data must be at least as long as the header\r
517 // of a large resource data.\r
518 if (AML_RD_IS_LARGE (Buffer) &&\r
731c67e1
MK
519 (Size < sizeof (ACPI_LARGE_RESOURCE_HEADER)))\r
520 {\r
bcab901b
PG
521 ASSERT (0);\r
522 return EFI_INVALID_PARAMETER;\r
523 }\r
524\r
525 // Check if the parent node has the byte list flag set.\r
526 if (!AmlNodeHasAttribute (ParentNode, AML_HAS_BYTE_LIST)) {\r
527 ASSERT (0);\r
528 return EFI_INVALID_PARAMETER;\r
529 }\r
530\r
531 // Check the size of the buffer is equal to the resource data size\r
532 // encoded in the input buffer.\r
533 ExpectedSize = AmlRdGetSize (Buffer);\r
534 if (ExpectedSize != Size) {\r
535 ASSERT (0);\r
536 return EFI_INVALID_PARAMETER;\r
537 }\r
7b2022d3
PG
538\r
539 Status = AmlSetRdListCheckSum (ParentNode, 0);\r
540 if (EFI_ERROR (Status)) {\r
541 ASSERT (0);\r
542 return Status;\r
543 }\r
544\r
bcab901b
PG
545 break;\r
546 }\r
547 case EAmlNodeDataTypeFieldPkgLen:\r
548 {\r
549 // Check the parent is a FieldNamed field element.\r
550 if (!AmlNodeCompareOpCode (ParentNode, AML_FIELD_NAMED_OP, 0)) {\r
551 ASSERT (0);\r
552 return EFI_INVALID_PARAMETER;\r
553 }\r
731c67e1 554\r
bcab901b
PG
555 break;\r
556 }\r
557 // None and reserved types.\r
558 default:\r
559 {\r
560 ASSERT (0);\r
561 return EFI_INVALID_PARAMETER;\r
562 break;\r
563 }\r
564 } // switch\r
565\r
566 // If the new size is different from the old size, propagate the new size.\r
567 if (DataNode->Size != Size) {\r
568 // Propagate the information.\r
569 Status = AmlPropagateInformation (\r
570 DataNode->NodeHeader.Parent,\r
571 (Size > DataNode->Size) ? TRUE : FALSE,\r
572 (Size > DataNode->Size) ?\r
731c67e1
MK
573 (Size - DataNode->Size) :\r
574 (DataNode->Size - Size),\r
bcab901b
PG
575 0\r
576 );\r
577 if (EFI_ERROR (Status)) {\r
578 ASSERT (0);\r
579 return Status;\r
580 }\r
581\r
582 // Free the old DataNode buffer and allocate a new buffer to store the\r
583 // new data.\r
584 FreePool (DataNode->Buffer);\r
585 DataNode->Buffer = AllocateZeroPool (Size);\r
586 if (DataNode->Buffer == NULL) {\r
587 ASSERT (0);\r
588 return EFI_OUT_OF_RESOURCES;\r
589 }\r
731c67e1 590\r
bcab901b
PG
591 DataNode->Size = Size;\r
592 }\r
593\r
594 CopyMem (DataNode->Buffer, Buffer, Size);\r
595\r
596 return EFI_SUCCESS;\r
597}\r