]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePcdLibNull/PcdLib.c
Add BasePcdLibNull in MdePkg.
[mirror_edk2.git] / MdePkg / Library / BasePcdLibNull / PcdLib.c
CommitLineData
bbfaace4 1/** @file\r
2 A emptry template implementation of PCD Library.\r
3\r
4 Copyright (c) 2006, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <PiPei.h>\r
16#include <Library/DebugLib.h>\r
17#include <Library/PcdLib.h>\r
18#include <Library/BaseMemoryLib.h>\r
19\r
20\r
21/**\r
22 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
23\r
24 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r
25 set values associated with a PCD token.\r
26\r
27 @retval SKU_ID Return the SKU ID that just be set.\r
28\r
29**/\r
30UINTN \r
31EFIAPI\r
32LibPcdSetSku (\r
33 IN UINTN SkuId\r
34 )\r
35{\r
36 ASSERT (SkuId < 0x100);\r
37\r
38 return SkuId;\r
39}\r
40\r
41\r
42\r
43/**\r
44 Returns the 8-bit value for the token specified by TokenNumber. \r
45\r
46 @param[in] The PCD token number to retrieve a current value for.\r
47\r
48 @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber. \r
49\r
50**/\r
51UINT8\r
52EFIAPI\r
53LibPcdGet8 (\r
54 IN UINTN TokenNumber\r
55 )\r
56{\r
57 return 0;\r
58}\r
59\r
60\r
61\r
62/**\r
63 Returns the 16-bit value for the token specified by TokenNumber. \r
64\r
65 @param[in] The PCD token number to retrieve a current value for.\r
66\r
67 @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber. \r
68\r
69**/\r
70UINT16\r
71EFIAPI\r
72LibPcdGet16 (\r
73 IN UINTN TokenNumber\r
74 )\r
75{\r
76 return 0;\r
77}\r
78\r
79\r
80\r
81/**\r
82 Returns the 32-bit value for the token specified by TokenNumber. \r
83\r
84 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
85\r
86 @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.\r
87\r
88**/\r
89UINT32\r
90EFIAPI\r
91LibPcdGet32 (\r
92 IN UINTN TokenNumber\r
93 )\r
94{\r
95 return 0;\r
96}\r
97\r
98\r
99\r
100/**\r
101 Returns the 64-bit value for the token specified by TokenNumber.\r
102\r
103 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
104\r
105 @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.\r
106\r
107**/\r
108UINT64\r
109EFIAPI\r
110LibPcdGet64 (\r
111 IN UINTN TokenNumber\r
112 )\r
113{\r
114 return 0;\r
115}\r
116\r
117\r
118\r
119/**\r
120 Returns the pointer to the buffer of the token specified by TokenNumber.\r
121\r
122 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
123\r
124 @retval VOID* Returns the pointer to the token specified by TokenNumber.\r
125\r
126**/\r
127VOID *\r
128EFIAPI\r
129LibPcdGetPtr (\r
130 IN UINTN TokenNumber\r
131 )\r
132{\r
133 return 0;\r
134}\r
135\r
136\r
137\r
138/**\r
139 Returns the Boolean value of the token specified by TokenNumber. \r
140\r
141 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
142\r
143 @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber. \r
144\r
145**/\r
146BOOLEAN \r
147EFIAPI\r
148LibPcdGetBool (\r
149 IN UINTN TokenNumber\r
150 )\r
151{\r
152 return 0;\r
153}\r
154\r
155\r
156\r
157/**\r
158 Returns the size of the token specified by TokenNumber. \r
159\r
160 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
161\r
162 @retval UINTN Returns the size of the token specified by TokenNumber. \r
163\r
164**/\r
165UINTN\r
166EFIAPI\r
167LibPcdGetSize (\r
168 IN UINTN TokenNumber\r
169 )\r
170{\r
171 return 0;\r
172}\r
173\r
174\r
175\r
176/**\r
177 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
178 If Guid is NULL, then ASSERT(). \r
179\r
180 @param[in] Guid Pointer to a 128-bit unique value that designates \r
181 which namespace to retrieve a value from.\r
182 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
183\r
184 @retval UINT8 Return the UINT8.\r
185\r
186**/\r
187UINT8\r
188EFIAPI\r
189LibPcdGetEx8 (\r
190 IN CONST GUID *Guid,\r
191 IN UINTN TokenNumber\r
192 )\r
193{\r
194 ASSERT (Guid != NULL);\r
195\r
196 return 0;\r
197}\r
198\r
199\r
200\r
201/**\r
202 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
203 If Guid is NULL, then ASSERT(). \r
204\r
205 @param[in] Guid Pointer to a 128-bit unique value that designates \r
206 which namespace to retrieve a value from.\r
207 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
208\r
209 @retval UINT16 Return the UINT16.\r
210\r
211**/\r
212UINT16\r
213EFIAPI\r
214LibPcdGetEx16 (\r
215 IN CONST GUID *Guid,\r
216 IN UINTN TokenNumber\r
217 )\r
218{\r
219 ASSERT (Guid != NULL);\r
220\r
221 return 0;\r
222}\r
223\r
224\r
225\r
226/**\r
227 Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
228 If Guid is NULL, then ASSERT(). \r
229\r
230 @param[in] Guid Pointer to a 128-bit unique value that designates \r
231 which namespace to retrieve a value from.\r
232 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
233\r
234 @retval UINT32 Return the UINT32.\r
235\r
236**/\r
237UINT32\r
238EFIAPI\r
239LibPcdGetEx32 (\r
240 IN CONST GUID *Guid,\r
241 IN UINTN TokenNumber\r
242 )\r
243{\r
244 ASSERT (Guid != NULL);\r
245\r
246 return 0;\r
247}\r
248\r
249\r
250\r
251/**\r
252 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
253 If Guid is NULL, then ASSERT(). \r
254\r
255 @param[in] Guid Pointer to a 128-bit unique value that designates \r
256 which namespace to retrieve a value from.\r
257 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
258\r
259 @retval UINT64 Return the UINT64.\r
260\r
261**/\r
262UINT64\r
263EFIAPI\r
264LibPcdGetEx64 (\r
265 IN CONST GUID *Guid,\r
266 IN UINTN TokenNumber\r
267 )\r
268{\r
269 ASSERT (Guid != NULL);\r
270\r
271 return 0;\r
272}\r
273\r
274\r
275\r
276/**\r
277 Returns the pointer to the buffer of the token specified by TokenNumber and Guid.\r
278 If Guid is NULL, then ASSERT(). \r
279\r
280 @param[in] Guid Pointer to a 128-bit unique value that designates \r
281 which namespace to retrieve a value from.\r
282 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
283\r
284 @retval VOID* Return the VOID* pointer.\r
285\r
286**/\r
287VOID *\r
288EFIAPI\r
289LibPcdGetExPtr (\r
290 IN CONST GUID *Guid,\r
291 IN UINTN TokenNumber\r
292 )\r
293{\r
294 ASSERT (Guid != NULL);\r
295\r
296 return 0;\r
297}\r
298\r
299\r
300\r
301/**\r
302 Returns the Boolean value of the token specified by TokenNumber and Guid. \r
303 If Guid is NULL, then ASSERT(). \r
304\r
305 @param[in] Guid Pointer to a 128-bit unique value that designates \r
306 which namespace to retrieve a value from.\r
307 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
308\r
309 @retval BOOLEAN Return the BOOLEAN.\r
310\r
311**/\r
312BOOLEAN\r
313EFIAPI\r
314LibPcdGetExBool (\r
315 IN CONST GUID *Guid,\r
316 IN UINTN TokenNumber\r
317 )\r
318{\r
319 ASSERT (Guid != NULL);\r
320\r
321 return 0;\r
322}\r
323\r
324\r
325\r
326/**\r
327 Returns the size of the token specified by TokenNumber and Guid. \r
328 If Guid is NULL, then ASSERT(). \r
329\r
330 @param[in] Guid Pointer to a 128-bit unique value that designates \r
331 which namespace to retrieve a value from.\r
332 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
333\r
334 @retval UINTN Return the size.\r
335\r
336**/\r
337UINTN\r
338EFIAPI\r
339LibPcdGetExSize (\r
340 IN CONST GUID *Guid,\r
341 IN UINTN TokenNumber\r
342 )\r
343{\r
344 ASSERT (Guid != NULL);\r
345\r
346 return 0;\r
347}\r
348\r
349\r
350\r
351/**\r
352 Sets the 8-bit value for the token specified by TokenNumber \r
353 to the value specified by Value. Value is returned.\r
354 \r
355 @param[in] TokenNumber The PCD token number to set a current value for.\r
356 @param[in] Value The 8-bit value to set.\r
357\r
358 @retval UINT8 Return the value been set.\r
359\r
360**/\r
361UINT8\r
362EFIAPI\r
363LibPcdSet8 (\r
364 IN UINTN TokenNumber,\r
365 IN UINT8 Value\r
366 )\r
367{\r
368 return Value;\r
369}\r
370\r
371\r
372\r
373/**\r
374 Sets the 16-bit value for the token specified by TokenNumber \r
375 to the value specified by Value. Value is returned.\r
376 \r
377 @param[in] TokenNumber The PCD token number to set a current value for.\r
378 @param[in] Value The 16-bit value to set.\r
379\r
380 @retval UINT16 Return the value been set.\r
381\r
382**/\r
383UINT16\r
384EFIAPI\r
385LibPcdSet16 (\r
386 IN UINTN TokenNumber,\r
387 IN UINT16 Value\r
388 )\r
389{\r
390 return Value;\r
391}\r
392\r
393\r
394\r
395/**\r
396 Sets the 32-bit value for the token specified by TokenNumber \r
397 to the value specified by Value. Value is returned.\r
398 \r
399 @param[in] TokenNumber The PCD token number to set a current value for.\r
400 @param[in] Value The 32-bit value to set.\r
401\r
402 @retval UINT32 Return the value been set.\r
403\r
404**/\r
405UINT32\r
406EFIAPI\r
407LibPcdSet32 (\r
408 IN UINTN TokenNumber,\r
409 IN UINT32 Value\r
410 )\r
411{\r
412 return Value;\r
413}\r
414\r
415\r
416\r
417/**\r
418 Sets the 64-bit value for the token specified by TokenNumber \r
419 to the value specified by Value. Value is returned.\r
420 \r
421 @param[in] TokenNumber The PCD token number to set a current value for.\r
422 @param[in] Value The 64-bit value to set.\r
423\r
424 @retval UINT64 Return the value been set.\r
425\r
426**/\r
427UINT64\r
428EFIAPI\r
429LibPcdSet64 (\r
430 IN UINTN TokenNumber,\r
431 IN UINT64 Value\r
432 )\r
433{\r
434 return Value;\r
435}\r
436\r
437\r
438\r
439/**\r
440 Sets a buffer for the token specified by TokenNumber to \r
441 the value specified by Buffer and SizeOfValue. Buffer to\r
442 be set is returned. The content of the buffer could be \r
443 overwritten if a Callback on SET is registered with this\r
444 TokenNumber.\r
445 \r
446 If SizeOfValue is greater than the maximum \r
447 size support by TokenNumber, then set SizeOfValue to the \r
448 maximum size supported by TokenNumber and return NULL to \r
449 indicate that the set operation was not actually performed. \r
450 \r
451 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
452 \r
453 @param[in] TokenNumber The PCD token number to set a current value for.\r
454 @param[in,out] SizeOfBuffer The size, in bytes, of Buffer.\r
455 @param[in] Value A pointer to the buffer to set.\r
456\r
457 @retval VOID* Return the pointer for the buffer been set.\r
458\r
459**/\r
460VOID *\r
461EFIAPI\r
462LibPcdSetPtr (\r
463 IN UINTN TokenNumber,\r
464 IN OUT UINTN *SizeOfBuffer,\r
465 IN VOID *Buffer\r
466 )\r
467{\r
468 ASSERT (SizeOfBuffer != NULL);\r
469\r
470 if (*SizeOfBuffer > 0) {\r
471 ASSERT (Buffer != NULL);\r
472 }\r
473\r
474 return Buffer;\r
475}\r
476\r
477\r
478\r
479/**\r
480 Sets the Boolean value for the token specified by TokenNumber \r
481 to the value specified by Value. Value is returned.\r
482 \r
483 @param[in] TokenNumber The PCD token number to set a current value for.\r
484 @param[in] Value The boolean value to set.\r
485\r
486 @retval BOOLEAN Return the value been set.\r
487\r
488**/\r
489BOOLEAN\r
490EFIAPI\r
491LibPcdSetBool (\r
492 IN UINTN TokenNumber,\r
493 IN BOOLEAN Value\r
494 )\r
495{\r
496 return Value;\r
497}\r
498\r
499\r
500\r
501/**\r
502 Sets the 8-bit value for the token specified by TokenNumber and \r
503 Guid to the value specified by Value. Value is returned.\r
504 If Guid is NULL, then ASSERT().\r
505 \r
506 @param[in] Guid Pointer to a 128-bit unique value that \r
507 designates which namespace to set a value from.\r
508 @param[in] TokenNumber The PCD token number to set a current value for.\r
509 @param[in] Value The 8-bit value to set.\r
510\r
511 @retval UINT8 Return the value been set.\r
512\r
513**/\r
514UINT8\r
515EFIAPI\r
516LibPcdSetEx8 (\r
517 IN CONST GUID *Guid,\r
518 IN UINTN TokenNumber,\r
519 IN UINT8 Value\r
520 )\r
521{\r
522 ASSERT (Guid != NULL);\r
523\r
524 return Value;\r
525}\r
526\r
527\r
528\r
529/**\r
530 Sets the 16-bit value for the token specified by TokenNumber and \r
531 Guid to the value specified by Value. Value is returned.\r
532 If Guid is NULL, then ASSERT().\r
533 \r
534 @param[in] Guid Pointer to a 128-bit unique value that \r
535 designates which namespace to set a value from.\r
536 @param[in] TokenNumber The PCD token number to set a current value for.\r
537 @param[in] Value The 16-bit value to set.\r
538\r
539 @retval UINT8 Return the value been set.\r
540\r
541**/\r
542UINT16\r
543EFIAPI\r
544LibPcdSetEx16 (\r
545 IN CONST GUID *Guid,\r
546 IN UINTN TokenNumber,\r
547 IN UINT16 Value\r
548 )\r
549{\r
550 ASSERT (Guid != NULL);\r
551\r
552 return Value;\r
553}\r
554\r
555\r
556\r
557/**\r
558 Sets the 32-bit value for the token specified by TokenNumber and \r
559 Guid to the value specified by Value. Value is returned.\r
560 If Guid is NULL, then ASSERT().\r
561 \r
562 @param[in] Guid Pointer to a 128-bit unique value that \r
563 designates which namespace to set a value from.\r
564 @param[in] TokenNumber The PCD token number to set a current value for.\r
565 @param[in] Value The 32-bit value to set.\r
566\r
567 @retval UINT32 Return the value been set.\r
568\r
569**/\r
570UINT32\r
571EFIAPI\r
572LibPcdSetEx32 (\r
573 IN CONST GUID *Guid,\r
574 IN UINTN TokenNumber,\r
575 IN UINT32 Value\r
576 )\r
577{\r
578 ASSERT (Guid != NULL);\r
579\r
580 return Value;\r
581}\r
582\r
583\r
584\r
585/**\r
586 Sets the 64-bit value for the token specified by TokenNumber and \r
587 Guid to the value specified by Value. Value is returned.\r
588 If Guid is NULL, then ASSERT().\r
589 \r
590 @param[in] Guid Pointer to a 128-bit unique value that \r
591 designates which namespace to set a value from.\r
592 @param[in] TokenNumber The PCD token number to set a current value for.\r
593 @param[in] Value The 64-bit value to set.\r
594\r
595 @retval UINT64 Return the value been set.\r
596\r
597**/\r
598UINT64\r
599EFIAPI\r
600LibPcdSetEx64 (\r
601 IN CONST GUID *Guid,\r
602 IN UINTN TokenNumber,\r
603 IN UINT64 Value\r
604 )\r
605{\r
606 ASSERT (Guid != NULL);\r
607\r
608 return Value;\r
609}\r
610\r
611\r
612\r
613/**\r
614 Sets a buffer for the token specified by TokenNumber to the value specified by \r
615 Buffer and SizeOfValue. Buffer is returned. If SizeOfValue is greater than \r
616 the maximum size support by TokenNumber, then set SizeOfValue to the maximum size \r
617 supported by TokenNumber and return NULL to indicate that the set operation \r
618 was not actually performed. \r
619 \r
620 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
621 \r
622 @param[in] Guid Pointer to a 128-bit unique value that \r
623 designates which namespace to set a value from.\r
624 @param[in] TokenNumber The PCD token number to set a current value for.\r
625 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
626 @param[in] Buffer A pointer to the buffer to set.\r
627\r
628 @retval VOID * Return the pinter to the buffer been set.\r
629\r
630**/\r
631VOID *\r
632EFIAPI\r
633LibPcdSetExPtr (\r
634 IN CONST GUID *Guid,\r
635 IN UINTN TokenNumber,\r
636 IN OUT UINTN *SizeOfBuffer,\r
637 IN VOID *Buffer\r
638 )\r
639{\r
640 ASSERT (Guid != NULL);\r
641\r
642 ASSERT (SizeOfBuffer != NULL);\r
643 \r
644 if (*SizeOfBuffer > 0) {\r
645 ASSERT (Buffer != NULL);\r
646 }\r
647\r
648 return Buffer;\r
649}\r
650\r
651\r
652\r
653/**\r
654 Sets the Boolean value for the token specified by TokenNumber and \r
655 Guid to the value specified by Value. Value is returned.\r
656 If Guid is NULL, then ASSERT().\r
657 \r
658 @param[in] Guid Pointer to a 128-bit unique value that \r
659 designates which namespace to set a value from.\r
660 @param[in] TokenNumber The PCD token number to set a current value for.\r
661 @param[in] Value The Boolean value to set.\r
662\r
663 @retval Boolean Return the value been set.\r
664\r
665**/\r
666BOOLEAN\r
667EFIAPI\r
668LibPcdSetExBool (\r
669 IN CONST GUID *Guid,\r
670 IN UINTN TokenNumber,\r
671 IN BOOLEAN Value\r
672 )\r
673{\r
674 ASSERT (Guid != NULL);\r
675\r
676 return Value;\r
677}\r
678\r
679\r
680\r
681/**\r
682 When the token specified by TokenNumber and Guid is set, \r
683 then notification function specified by NotificationFunction is called. \r
684 If Guid is NULL, then the default token space is used. \r
685 If NotificationFunction is NULL, then ASSERT().\r
686\r
687 @param[in] Guid Pointer to a 128-bit unique value that designates which \r
688 namespace to set a value from. If NULL, then the default \r
689 token space is used.\r
690 @param[in] TokenNumber The PCD token number to monitor.\r
691 @param[in] NotificationFunction The function to call when the token \r
692 specified by Guid and TokenNumber is set.\r
693\r
694 @retval VOID\r
695\r
696**/\r
697VOID\r
698EFIAPI\r
699LibPcdCallbackOnSet (\r
700 IN CONST GUID *Guid, OPTIONAL\r
701 IN UINTN TokenNumber,\r
702 IN PCD_CALLBACK NotificationFunction\r
703 )\r
704{\r
705 ASSERT (NotificationFunction != NULL);\r
706}\r
707\r
708\r
709\r
710/**\r
711 Disable a notification function that was established with LibPcdCallbackonSet().\r
712 If NotificationFunction is NULL, then ASSERT().\r
713\r
714 @param[in] Guid Specify the GUID token space.\r
715 @param[in] TokenNumber Specify the token number.\r
716 @param[in] NotificationFunction The callback function to be unregistered.\r
717\r
718 @retval VOID\r
719\r
720**/\r
721VOID\r
722EFIAPI\r
723LibPcdCancelCallback (\r
724 IN CONST GUID *Guid, OPTIONAL\r
725 IN UINTN TokenNumber,\r
726 IN PCD_CALLBACK NotificationFunction\r
727 )\r
728{\r
729 ASSERT (NotificationFunction != NULL);\r
730}\r
731\r
732\r
733\r
734/**\r
735 Retrieves the next PCD token number from the token space specified by Guid. \r
736 If Guid is NULL, then the default token space is used. If TokenNumber is 0, \r
737 then the first token number is returned. Otherwise, the token number that \r
738 follows TokenNumber in the token space is returned. If TokenNumber is the last \r
739 token number in the token space, then 0 is returned. If TokenNumber is not 0 and \r
740 is not in the token space specified by Guid, then ASSERT().\r
741\r
742 @param[in] Pointer to a 128-bit unique value that designates which namespace \r
743 to set a value from. If NULL, then the default token space is used.\r
744 @param[in] The previous PCD token number. If 0, then retrieves the first PCD \r
745 token number.\r
746\r
747 @retval UINTN The next valid token number.\r
748\r
749**/\r
750UINTN \r
751EFIAPI\r
752LibPcdGetNextToken (\r
753 IN CONST GUID *Guid, OPTIONAL\r
754 IN UINTN TokenNumber\r
755 )\r
756{\r
757 return 0;\r
758}\r
759\r
760\r
761\r
762/**\r
763 Retrieves the next PCD token space from a token space specified by Guid.\r
764 Guid of NULL is reserved to mark the default local token namespace on the current\r
765 platform. If Guid is NULL, then the GUID of the first non-local token space of the \r
766 current platform is returned. If Guid is the last non-local token space, \r
767 then NULL is returned. \r
768\r
769 If Guid is not NULL and is not a valid token space in the current platform, then ASSERT().\r
770\r
771\r
772 \r
773 @param[in] Pointer to a 128-bit unique value that designates from which namespace \r
774 to start the search.\r
775\r
776 @retval CONST GUID * The next valid token namespace.\r
777\r
778**/\r
779GUID * \r
780EFIAPI\r
781LibPcdGetNextTokenSpace (\r
782 IN CONST GUID *Guid\r
783 )\r
784{\r
785 return NULL;\r
786}\r
787\r
788\r
789\r
790/**\r
791 Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
792 and SizeOfValue. Buffer is returned. If SizeOfValue is greater than \r
793 MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
794 NULL to indicate that the set operation was not actually performed. \r
795 If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
796 MaximumDatumSize and NULL must be returned.\r
797 \r
798 If PatchVariable is NULL, then ASSERT().\r
799 If SizeOfValue is NULL, then ASSERT().\r
800 If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
801\r
802 @param[in] PatchVariable A pointer to the global variable in a module that is \r
803 the target of the set operation.\r
804 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
805 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
806 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
807\r
808**/\r
809VOID *\r
810EFIAPI\r
811LibPatchPcdSetPtr (\r
812 IN VOID *PatchVariable,\r
813 IN UINTN MaximumDatumSize,\r
814 IN OUT UINTN *SizeOfBuffer,\r
815 IN CONST VOID *Buffer\r
816 )\r
817{\r
818 ASSERT (PatchVariable != NULL);\r
819 ASSERT (SizeOfBuffer != NULL);\r
820 \r
821 if (*SizeOfBuffer > 0) {\r
822 ASSERT (Buffer != NULL);\r
823 }\r
824\r
825 if ((*SizeOfBuffer > MaximumDatumSize) ||\r
826 (*SizeOfBuffer == MAX_ADDRESS)) {\r
827 *SizeOfBuffer = MaximumDatumSize;\r
828 return NULL;\r
829 }\r
830 \r
831 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
832 \r
833 return (VOID *) Buffer;\r
834}\r
835\r