]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePcdLibNull/PcdLib.c
MdePkg: Change OPTIONAL keyword usage style
[mirror_edk2.git] / MdePkg / Library / BasePcdLibNull / PcdLib.c
CommitLineData
bbfaace4 1/** @file\r
2 A emptry template implementation of PCD Library.\r
3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
bbfaace4 6\r
7**/\r
8\r
afa22326 9#include <Base.h>\r
10\r
bbfaace4 11#include <Library/DebugLib.h>\r
12#include <Library/PcdLib.h>\r
13#include <Library/BaseMemoryLib.h>\r
14\r
15\r
16/**\r
efb23117 17 This function provides a means by which SKU support can be established in the PCD infrastructure.\r
18\r
bbfaace4 19 Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.\r
20\r
9095d37b 21 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and\r
efb23117 22 set values associated with a PCD token.\r
bbfaace4 23\r
f73e0ad2 24 @return Return the SKU ID that just be set.\r
bbfaace4 25\r
26**/\r
efb23117 27UINTN\r
bbfaace4 28EFIAPI\r
29LibPcdSetSku (\r
efb23117 30 IN UINTN SkuId\r
bbfaace4 31 )\r
32{\r
afa22326 33 ASSERT (FALSE);\r
bbfaace4 34\r
cdebf6c6 35 return 0;\r
bbfaace4 36}\r
37\r
bbfaace4 38/**\r
efb23117 39 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
40\r
41 Returns the 8-bit value for the token specified by TokenNumber.\r
bbfaace4 42\r
23a36779 43 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
bbfaace4 44\r
9095d37b 45 @return Returns the 8-bit value for the token specified by TokenNumber.\r
bbfaace4 46\r
47**/\r
48UINT8\r
49EFIAPI\r
50LibPcdGet8 (\r
51 IN UINTN TokenNumber\r
52 )\r
53{\r
afa22326 54 ASSERT (FALSE);\r
cdebf6c6 55\r
bbfaace4 56 return 0;\r
57}\r
58\r
59\r
60\r
61/**\r
efb23117 62 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
63\r
64 Returns the 16-bit value for the token specified by TokenNumber.\r
bbfaace4 65\r
efb23117 66 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
bbfaace4 67\r
9095d37b 68 @return Returns the 16-bit value for the token specified by TokenNumber.\r
bbfaace4 69\r
70**/\r
71UINT16\r
72EFIAPI\r
73LibPcdGet16 (\r
74 IN UINTN TokenNumber\r
75 )\r
76{\r
afa22326 77 ASSERT (FALSE);\r
cdebf6c6 78\r
bbfaace4 79 return 0;\r
80}\r
81\r
82\r
83\r
84/**\r
efb23117 85 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
86\r
87 Returns the 32-bit value for the token specified by TokenNumber.\r
bbfaace4 88\r
89 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
90\r
f73e0ad2 91 @return Returns the 32-bit value for the token specified by TokenNumber.\r
bbfaace4 92\r
93**/\r
94UINT32\r
95EFIAPI\r
96LibPcdGet32 (\r
97 IN UINTN TokenNumber\r
98 )\r
99{\r
afa22326 100 ASSERT (FALSE);\r
cdebf6c6 101\r
bbfaace4 102 return 0;\r
103}\r
104\r
105\r
106\r
107/**\r
efb23117 108 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 109\r
bbfaace4 110 Returns the 64-bit value for the token specified by TokenNumber.\r
111\r
112 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
113\r
f73e0ad2 114 @return Returns the 64-bit value for the token specified by TokenNumber.\r
bbfaace4 115\r
116**/\r
117UINT64\r
118EFIAPI\r
119LibPcdGet64 (\r
120 IN UINTN TokenNumber\r
121 )\r
122{\r
afa22326 123 ASSERT (FALSE);\r
cdebf6c6 124\r
bbfaace4 125 return 0;\r
126}\r
127\r
128\r
129\r
130/**\r
efb23117 131 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 132\r
bbfaace4 133 Returns the pointer to the buffer of the token specified by TokenNumber.\r
134\r
135 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
136\r
f73e0ad2 137 @return Returns the pointer to the token specified by TokenNumber.\r
bbfaace4 138\r
139**/\r
140VOID *\r
141EFIAPI\r
142LibPcdGetPtr (\r
143 IN UINTN TokenNumber\r
144 )\r
145{\r
afa22326 146 ASSERT (FALSE);\r
cdebf6c6 147\r
bbfaace4 148 return 0;\r
149}\r
150\r
151\r
152\r
153/**\r
efb23117 154 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b
LG
155\r
156 Returns the Boolean value of the token specified by TokenNumber.\r
bbfaace4 157\r
158 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
159\r
9095d37b 160 @return Returns the Boolean value of the token specified by TokenNumber.\r
bbfaace4 161\r
162**/\r
9095d37b 163BOOLEAN\r
bbfaace4 164EFIAPI\r
165LibPcdGetBool (\r
166 IN UINTN TokenNumber\r
167 )\r
168{\r
afa22326 169 ASSERT (FALSE);\r
cdebf6c6 170\r
bbfaace4 171 return 0;\r
172}\r
173\r
174\r
175\r
176/**\r
efb23117 177 This function provides a means by which to retrieve the size of a given PCD token.\r
bbfaace4 178\r
179 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
180\r
9095d37b 181 @return Returns the size of the token specified by TokenNumber.\r
bbfaace4 182\r
183**/\r
184UINTN\r
185EFIAPI\r
186LibPcdGetSize (\r
187 IN UINTN TokenNumber\r
188 )\r
189{\r
afa22326 190 ASSERT (FALSE);\r
cdebf6c6 191\r
bbfaace4 192 return 0;\r
193}\r
194\r
195\r
196\r
197/**\r
efb23117 198 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 199\r
bbfaace4 200 Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
bbfaace4 201\r
9095d37b
LG
202 If Guid is NULL, then ASSERT().\r
203\r
204 @param[in] Guid The pointer to a 128-bit unique value that designates\r
bbfaace4 205 which namespace to retrieve a value from.\r
206 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
207\r
f73e0ad2 208 @return Return the UINT8.\r
bbfaace4 209\r
210**/\r
211UINT8\r
212EFIAPI\r
213LibPcdGetEx8 (\r
214 IN CONST GUID *Guid,\r
215 IN UINTN TokenNumber\r
216 )\r
217{\r
afa22326 218 ASSERT (FALSE);\r
bbfaace4 219\r
220 return 0;\r
221}\r
222\r
223\r
224\r
225/**\r
efb23117 226 This function provides a means by which to retrieve a value for a given PCD token.\r
227\r
bbfaace4 228 Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
bbfaace4 229\r
9095d37b
LG
230 If Guid is NULL, then ASSERT().\r
231\r
232 @param[in] Guid The pointer to a 128-bit unique value that designates\r
bbfaace4 233 which namespace to retrieve a value from.\r
234 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
235\r
f73e0ad2 236 @return Return the UINT16.\r
bbfaace4 237\r
238**/\r
239UINT16\r
240EFIAPI\r
241LibPcdGetEx16 (\r
242 IN CONST GUID *Guid,\r
243 IN UINTN TokenNumber\r
244 )\r
245{\r
afa22326 246 ASSERT (FALSE);\r
bbfaace4 247\r
248 return 0;\r
249}\r
250\r
251\r
252\r
253/**\r
254 Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
9095d37b 255 If Guid is NULL, then ASSERT().\r
bbfaace4 256\r
9095d37b 257 @param[in] Guid The pointer to a 128-bit unique value that designates\r
bbfaace4 258 which namespace to retrieve a value from.\r
259 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
260\r
f73e0ad2 261 @return Return the UINT32.\r
bbfaace4 262\r
263**/\r
264UINT32\r
265EFIAPI\r
266LibPcdGetEx32 (\r
267 IN CONST GUID *Guid,\r
268 IN UINTN TokenNumber\r
269 )\r
270{\r
afa22326 271 ASSERT (FALSE);\r
bbfaace4 272\r
273 return 0;\r
274}\r
275\r
276\r
277\r
278/**\r
efb23117 279 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 280\r
bbfaace4 281 Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
bbfaace4 282\r
9095d37b
LG
283 If Guid is NULL, then ASSERT().\r
284\r
285 @param[in] Guid The pointer to a 128-bit unique value that designates\r
efb23117 286 which namespace to retrieve a value from.\r
287 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
bbfaace4 288\r
f73e0ad2 289 @return Return the UINT64.\r
bbfaace4 290\r
291**/\r
292UINT64\r
293EFIAPI\r
294LibPcdGetEx64 (\r
295 IN CONST GUID *Guid,\r
296 IN UINTN TokenNumber\r
297 )\r
298{\r
afa22326 299 ASSERT (FALSE);\r
bbfaace4 300\r
301 return 0;\r
302}\r
303\r
304\r
305\r
306/**\r
efb23117 307 This function provides a means by which to retrieve a value for a given PCD token.\r
9095d37b 308\r
efb23117 309 Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
bbfaace4 310\r
9095d37b
LG
311 If Guid is NULL, then ASSERT().\r
312\r
313 @param[in] Guid The pointer to a 128-bit unique value that designates\r
efb23117 314 which namespace to retrieve a value from.\r
315 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
bbfaace4 316\r
f73e0ad2 317 @return Return the VOID* pointer.\r
bbfaace4 318\r
319**/\r
320VOID *\r
321EFIAPI\r
322LibPcdGetExPtr (\r
323 IN CONST GUID *Guid,\r
324 IN UINTN TokenNumber\r
325 )\r
326{\r
afa22326 327 ASSERT (FALSE);\r
bbfaace4 328\r
329 return 0;\r
330}\r
331\r
332\r
333\r
334/**\r
efb23117 335 This function provides a means by which to retrieve a value for a given PCD token.\r
bbfaace4 336\r
9095d37b
LG
337 Returns the Boolean value of the token specified by TokenNumber and Guid.\r
338\r
339 If Guid is NULL, then ASSERT().\r
340\r
341 @param[in] Guid The pointer to a 128-bit unique value that designates\r
efb23117 342 which namespace to retrieve a value from.\r
343 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
bbfaace4 344\r
f73e0ad2 345 @return Return the BOOLEAN.\r
bbfaace4 346\r
347**/\r
348BOOLEAN\r
349EFIAPI\r
350LibPcdGetExBool (\r
351 IN CONST GUID *Guid,\r
352 IN UINTN TokenNumber\r
353 )\r
354{\r
afa22326 355 ASSERT (FALSE);\r
bbfaace4 356\r
357 return 0;\r
358}\r
359\r
360\r
361\r
362/**\r
efb23117 363 This function provides a means by which to retrieve the size of a given PCD token.\r
bbfaace4 364\r
9095d37b
LG
365 Returns the size of the token specified by TokenNumber and Guid.\r
366\r
367 If Guid is NULL, then ASSERT().\r
368\r
369 @param[in] Guid The pointer to a 128-bit unique value that designates\r
efb23117 370 which namespace to retrieve a value from.\r
371 @param[in] TokenNumber The PCD token number to retrieve a current value for.\r
bbfaace4 372\r
f73e0ad2 373 @return Return the size.\r
bbfaace4 374\r
375**/\r
376UINTN\r
377EFIAPI\r
378LibPcdGetExSize (\r
379 IN CONST GUID *Guid,\r
380 IN UINTN TokenNumber\r
381 )\r
382{\r
afa22326 383 ASSERT (FALSE);\r
bbfaace4 384\r
385 return 0;\r
386}\r
387\r
388\r
9a355841
SZ
389/**\r
390 This function provides a means by which to set a value for a given PCD token.\r
391\r
392 Sets the 8-bit value for the token specified by TokenNumber\r
393 to the value specified by Value.\r
394\r
395 @param[in] TokenNumber The PCD token number to set a current value for.\r
396 @param[in] Value The 8-bit value to set.\r
397\r
398 @return The status of the set operation.\r
399\r
400**/\r
401RETURN_STATUS\r
402EFIAPI\r
403LibPcdSet8S (\r
404 IN UINTN TokenNumber,\r
405 IN UINT8 Value\r
406 )\r
407{\r
408 ASSERT (FALSE);\r
409\r
410 return RETURN_INVALID_PARAMETER;\r
411}\r
412\r
413/**\r
414 This function provides a means by which to set a value for a given PCD token.\r
415\r
416 Sets the 16-bit value for the token specified by TokenNumber\r
417 to the value specified by Value.\r
418\r
419 @param[in] TokenNumber The PCD token number to set a current value for.\r
420 @param[in] Value The 16-bit value to set.\r
421\r
422 @return The status of the set operation.\r
423\r
424**/\r
425RETURN_STATUS\r
426EFIAPI\r
427LibPcdSet16S (\r
428 IN UINTN TokenNumber,\r
429 IN UINT16 Value\r
430 )\r
431{\r
432 ASSERT (FALSE);\r
433\r
434 return RETURN_INVALID_PARAMETER;\r
435}\r
436\r
437/**\r
438 This function provides a means by which to set a value for a given PCD token.\r
439\r
440 Sets the 32-bit value for the token specified by TokenNumber\r
441 to the value specified by Value.\r
442\r
443 @param[in] TokenNumber The PCD token number to set a current value for.\r
444 @param[in] Value The 32-bit value to set.\r
445\r
446 @return The status of the set operation.\r
447\r
448**/\r
449RETURN_STATUS\r
450EFIAPI\r
451LibPcdSet32S (\r
452 IN UINTN TokenNumber,\r
453 IN UINT32 Value\r
454 )\r
455{\r
456 ASSERT (FALSE);\r
457\r
458 return RETURN_INVALID_PARAMETER;\r
459}\r
460\r
461/**\r
462 This function provides a means by which to set a value for a given PCD token.\r
463\r
464 Sets the 64-bit value for the token specified by TokenNumber\r
465 to the value specified by Value.\r
466\r
467 @param[in] TokenNumber The PCD token number to set a current value for.\r
468 @param[in] Value The 64-bit value to set.\r
469\r
470 @return The status of the set operation.\r
471\r
472**/\r
473RETURN_STATUS\r
474EFIAPI\r
475LibPcdSet64S (\r
476 IN UINTN TokenNumber,\r
477 IN UINT64 Value\r
478 )\r
479{\r
480 ASSERT (FALSE);\r
481\r
482 return RETURN_INVALID_PARAMETER;\r
483}\r
484\r
485/**\r
486 This function provides a means by which to set a value for a given PCD token.\r
487\r
488 Sets a buffer for the token specified by TokenNumber to the value specified\r
489 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size\r
490 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by\r
491 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation\r
492 was not actually performed.\r
493\r
494 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the\r
495 maximum size supported by TokenName and EFI_INVALID_PARAMETER must be returned.\r
496\r
497 If SizeOfBuffer is NULL, then ASSERT().\r
498 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
499\r
500 @param[in] TokenNumber The PCD token number to set a current value for.\r
501 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
502 @param[in] Buffer A pointer to the buffer to set.\r
503\r
504 @return The status of the set operation.\r
bbfaace4 505\r
9a355841
SZ
506**/\r
507RETURN_STATUS\r
508EFIAPI\r
509LibPcdSetPtrS (\r
510 IN UINTN TokenNumber,\r
511 IN OUT UINTN *SizeOfBuffer,\r
512 IN CONST VOID *Buffer\r
513 )\r
514{\r
515 ASSERT (FALSE);\r
bbfaace4 516\r
9a355841
SZ
517 return RETURN_INVALID_PARAMETER;\r
518}\r
519\r
520/**\r
521 This function provides a means by which to set a value for a given PCD token.\r
522\r
523 Sets the boolean value for the token specified by TokenNumber\r
524 to the value specified by Value.\r
525\r
526 @param[in] TokenNumber The PCD token number to set a current value for.\r
527 @param[in] Value The boolean value to set.\r
528\r
529 @return The status of the set operation.\r
530\r
531**/\r
532RETURN_STATUS\r
533EFIAPI\r
534LibPcdSetBoolS (\r
535 IN UINTN TokenNumber,\r
536 IN BOOLEAN Value\r
537 )\r
538{\r
539 ASSERT (FALSE);\r
540\r
541 return RETURN_INVALID_PARAMETER;\r
542}\r
543\r
544/**\r
545 This function provides a means by which to set a value for a given PCD token.\r
546\r
547 Sets the 8-bit value for the token specified by TokenNumber\r
548 to the value specified by Value.\r
549\r
550 If Guid is NULL, then ASSERT().\r
551\r
552 @param[in] Guid The pointer to a 128-bit unique value that\r
553 designates which namespace to set a value from.\r
554 @param[in] TokenNumber The PCD token number to set a current value for.\r
555 @param[in] Value The 8-bit value to set.\r
556\r
557 @return The status of the set operation.\r
558\r
559**/\r
560RETURN_STATUS\r
561EFIAPI\r
562LibPcdSetEx8S (\r
563 IN CONST GUID *Guid,\r
564 IN UINTN TokenNumber,\r
565 IN UINT8 Value\r
566 )\r
567{\r
568 ASSERT (FALSE);\r
569\r
570 return RETURN_INVALID_PARAMETER;\r
571}\r
572\r
573/**\r
574 This function provides a means by which to set a value for a given PCD token.\r
575\r
576 Sets the 16-bit value for the token specified by TokenNumber\r
577 to the value specified by Value.\r
578\r
579 If Guid is NULL, then ASSERT().\r
580\r
581 @param[in] Guid The pointer to a 128-bit unique value that\r
582 designates which namespace to set a value from.\r
583 @param[in] TokenNumber The PCD token number to set a current value for.\r
584 @param[in] Value The 16-bit value to set.\r
585\r
586 @return The status of the set operation.\r
587\r
588**/\r
589RETURN_STATUS\r
590EFIAPI\r
591LibPcdSetEx16S (\r
592 IN CONST GUID *Guid,\r
593 IN UINTN TokenNumber,\r
594 IN UINT16 Value\r
595 )\r
596{\r
597 ASSERT (FALSE);\r
598\r
599 return RETURN_INVALID_PARAMETER;\r
600}\r
601\r
602/**\r
603 This function provides a means by which to set a value for a given PCD token.\r
604\r
605 Sets the 32-bit value for the token specified by TokenNumber\r
606 to the value specified by Value.\r
607\r
608 If Guid is NULL, then ASSERT().\r
609\r
610 @param[in] Guid The pointer to a 128-bit unique value that\r
611 designates which namespace to set a value from.\r
612 @param[in] TokenNumber The PCD token number to set a current value for.\r
613 @param[in] Value The 32-bit value to set.\r
614\r
615 @return The status of the set operation.\r
616\r
617**/\r
618RETURN_STATUS\r
619EFIAPI\r
620LibPcdSetEx32S (\r
621 IN CONST GUID *Guid,\r
622 IN UINTN TokenNumber,\r
623 IN UINT32 Value\r
624 )\r
625{\r
626 ASSERT (FALSE);\r
627\r
628 return RETURN_INVALID_PARAMETER;\r
629}\r
630\r
631/**\r
632 This function provides a means by which to set a value for a given PCD token.\r
633\r
634 Sets the 64-bit value for the token specified by TokenNumber\r
635 to the value specified by Value.\r
636\r
637 If Guid is NULL, then ASSERT().\r
638\r
639 @param[in] Guid The pointer to a 128-bit unique value that\r
640 designates which namespace to set a value from.\r
641 @param[in] TokenNumber The PCD token number to set a current value for.\r
642 @param[in] Value The 64-bit value to set.\r
643\r
644 @return The status of the set operation.\r
645\r
646**/\r
647RETURN_STATUS\r
648EFIAPI\r
649LibPcdSetEx64S (\r
650 IN CONST GUID *Guid,\r
651 IN UINTN TokenNumber,\r
652 IN UINT64 Value\r
653 )\r
654{\r
655 ASSERT (FALSE);\r
656\r
657 return RETURN_INVALID_PARAMETER;\r
658}\r
659\r
660/**\r
661 This function provides a means by which to set a value for a given PCD token.\r
662\r
663 Sets a buffer for the token specified by TokenNumber to the value specified by\r
664 Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size\r
665 support by TokenNumber, then set SizeOfBuffer to the maximum size supported by\r
666 TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation\r
667 was not actually performed.\r
668\r
669 If Guid is NULL, then ASSERT().\r
670 If SizeOfBuffer is NULL, then ASSERT().\r
671 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
672\r
673 @param[in] Guid Pointer to a 128-bit unique value that\r
674 designates which namespace to set a value from.\r
675 @param[in] TokenNumber The PCD token number to set a current value for.\r
676 @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.\r
677 @param[in] Buffer A pointer to the buffer to set.\r
678\r
679 @return The status of the set operation.\r
680\r
681**/\r
682RETURN_STATUS\r
683EFIAPI\r
684LibPcdSetExPtrS (\r
685 IN CONST GUID *Guid,\r
686 IN UINTN TokenNumber,\r
687 IN OUT UINTN *SizeOfBuffer,\r
688 IN VOID *Buffer\r
689 )\r
690{\r
691 ASSERT (FALSE);\r
692\r
693 return RETURN_INVALID_PARAMETER;\r
694}\r
695\r
696/**\r
697 This function provides a means by which to set a value for a given PCD token.\r
698\r
699 Sets the boolean value for the token specified by TokenNumber\r
700 to the value specified by Value.\r
701\r
702 If Guid is NULL, then ASSERT().\r
703\r
704 @param[in] Guid The pointer to a 128-bit unique value that\r
705 designates which namespace to set a value from.\r
706 @param[in] TokenNumber The PCD token number to set a current value for.\r
707 @param[in] Value The boolean value to set.\r
708\r
709 @return The status of the set operation.\r
710\r
711**/\r
712RETURN_STATUS\r
713EFIAPI\r
714LibPcdSetExBoolS (\r
715 IN CONST GUID *Guid,\r
716 IN UINTN TokenNumber,\r
717 IN BOOLEAN Value\r
718 )\r
719{\r
720 ASSERT (FALSE);\r
721\r
722 return RETURN_INVALID_PARAMETER;\r
723}\r
bbfaace4 724\r
725/**\r
efb23117 726 Set up a notification function that is called when a specified token is set.\r
9095d37b
LG
727\r
728 When the token specified by TokenNumber and Guid is set,\r
729 then notification function specified by NotificationFunction is called.\r
730 If Guid is NULL, then the default token space is used.\r
731\r
bbfaace4 732 If NotificationFunction is NULL, then ASSERT().\r
733\r
9095d37b
LG
734 @param[in] Guid The pointer to a 128-bit unique value that designates which\r
735 namespace to set a value from. If NULL, then the default\r
efb23117 736 token space is used.\r
737 @param[in] TokenNumber The PCD token number to monitor.\r
9095d37b 738 @param[in] NotificationFunction The function to call when the token\r
efb23117 739 specified by Guid and TokenNumber is set.\r
bbfaace4 740\r
bbfaace4 741**/\r
742VOID\r
743EFIAPI\r
744LibPcdCallbackOnSet (\r
d0e2f823 745 IN CONST GUID *Guid OPTIONAL,\r
bbfaace4 746 IN UINTN TokenNumber,\r
747 IN PCD_CALLBACK NotificationFunction\r
748 )\r
749{\r
afa22326 750 ASSERT (FALSE);\r
bbfaace4 751}\r
752\r
753\r
754\r
755/**\r
756 Disable a notification function that was established with LibPcdCallbackonSet().\r
9095d37b
LG
757\r
758 Disable a notification function that was previously established with LibPcdCallbackOnSet().\r
759\r
bbfaace4 760 If NotificationFunction is NULL, then ASSERT().\r
9095d37b 761 If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,\r
efb23117 762 and NotificationFunction, then ASSERT().\r
9095d37b 763\r
efb23117 764 @param[in] Guid Specify the GUID token space.\r
765 @param[in] TokenNumber Specify the token number.\r
bbfaace4 766 @param[in] NotificationFunction The callback function to be unregistered.\r
767\r
bbfaace4 768**/\r
769VOID\r
770EFIAPI\r
771LibPcdCancelCallback (\r
d0e2f823 772 IN CONST GUID *Guid OPTIONAL,\r
bbfaace4 773 IN UINTN TokenNumber,\r
774 IN PCD_CALLBACK NotificationFunction\r
775 )\r
776{\r
afa22326 777 ASSERT (FALSE);\r
bbfaace4 778}\r
779\r
780\r
781\r
782/**\r
efb23117 783 Retrieves the next token in a token space.\r
9095d37b
LG
784\r
785 Retrieves the next PCD token number from the token space specified by Guid.\r
786 If Guid is NULL, then the default token space is used. If TokenNumber is 0,\r
787 then the first token number is returned. Otherwise, the token number that\r
788 follows TokenNumber in the token space is returned. If TokenNumber is the last\r
789 token number in the token space, then 0 is returned.\r
790\r
efb23117 791 If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().\r
bbfaace4 792\r
9095d37b 793 @param[in] Guid The pointer to a 128-bit unique value that designates which namespace\r
efb23117 794 to set a value from. If NULL, then the default token space is used.\r
9095d37b 795 @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD\r
efb23117 796 token number.\r
bbfaace4 797\r
f73e0ad2 798 @return The next valid token number.\r
bbfaace4 799\r
800**/\r
9095d37b 801UINTN\r
bbfaace4 802EFIAPI\r
803LibPcdGetNextToken (\r
d0e2f823 804 IN CONST GUID *Guid OPTIONAL,\r
efb23117 805 IN UINTN TokenNumber\r
bbfaace4 806 )\r
807{\r
afa22326 808 ASSERT (FALSE);\r
cdebf6c6 809\r
bbfaace4 810 return 0;\r
811}\r
812\r
813\r
814\r
815/**\r
efb23117 816 Used to retrieve the list of available PCD token space GUIDs.\r
9095d37b 817\r
8f0dd97e 818 Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces\r
819 in the platform.\r
820 If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.\r
821 If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.\r
9095d37b 822\r
2fc59a00 823 @param TokenSpaceGuid The pointer to a PCD token space GUID.\r
bbfaace4 824\r
f73e0ad2 825 @return The next valid token namespace.\r
bbfaace4 826\r
827**/\r
9095d37b 828GUID *\r
bbfaace4 829EFIAPI\r
830LibPcdGetNextTokenSpace (\r
efb23117 831 IN CONST GUID *TokenSpaceGuid\r
bbfaace4 832 )\r
833{\r
afa22326 834 ASSERT (FALSE);\r
cdebf6c6 835\r
bbfaace4 836 return NULL;\r
837}\r
838\r
839\r
bbfaace4 840/**\r
9638ba6d 841 Sets a value of a patchable PCD entry that is type pointer.\r
9095d37b
LG
842\r
843 Sets the PCD entry specified by PatchVariable to the value specified by Buffer\r
844 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than\r
845 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return\r
846 NULL to indicate that the set operation was not actually performed.\r
847 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
bbfaace4 848 MaximumDatumSize and NULL must be returned.\r
9095d37b 849\r
bbfaace4 850 If PatchVariable is NULL, then ASSERT().\r
9638ba6d 851 If SizeOfBuffer is NULL, then ASSERT().\r
852 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
bbfaace4 853\r
9095d37b 854 @param[out] PatchVariable A pointer to the global variable in a module that is\r
bbfaace4 855 the target of the set operation.\r
856 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
857 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
858 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
9095d37b 859\r
2fc59a00 860 @return Return the pointer to the buffer that was set.\r
bbfaace4 861\r
862**/\r
863VOID *\r
864EFIAPI\r
865LibPatchPcdSetPtr (\r
f8308f0a 866 OUT VOID *PatchVariable,\r
bbfaace4 867 IN UINTN MaximumDatumSize,\r
868 IN OUT UINTN *SizeOfBuffer,\r
869 IN CONST VOID *Buffer\r
870 )\r
871{\r
872 ASSERT (PatchVariable != NULL);\r
873 ASSERT (SizeOfBuffer != NULL);\r
9095d37b 874\r
bbfaace4 875 if (*SizeOfBuffer > 0) {\r
876 ASSERT (Buffer != NULL);\r
877 }\r
878\r
879 if ((*SizeOfBuffer > MaximumDatumSize) ||\r
880 (*SizeOfBuffer == MAX_ADDRESS)) {\r
881 *SizeOfBuffer = MaximumDatumSize;\r
882 return NULL;\r
883 }\r
9095d37b 884\r
bbfaace4 885 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
9095d37b 886\r
bbfaace4 887 return (VOID *) Buffer;\r
888}\r
889\r
9a355841
SZ
890/**\r
891 Sets a value of a patchable PCD entry that is type pointer.\r
892\r
893 Sets the PCD entry specified by PatchVariable to the value specified\r
894 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
895 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
896 to indicate that the set operation was not actually performed.\r
897 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
898 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
899\r
900 If PatchVariable is NULL, then ASSERT().\r
901 If SizeOfBuffer is NULL, then ASSERT().\r
902 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
903\r
f8308f0a 904 @param[out] PatchVariable A pointer to the global variable in a module that is\r
9a355841
SZ
905 the target of the set operation.\r
906 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
907 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
908 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
9095d37b 909\r
9a355841
SZ
910 @return The status of the set operation.\r
911\r
912**/\r
913RETURN_STATUS\r
914EFIAPI\r
915LibPatchPcdSetPtrS (\r
f8308f0a 916 OUT VOID *PatchVariable,\r
9a355841
SZ
917 IN UINTN MaximumDatumSize,\r
918 IN OUT UINTN *SizeOfBuffer,\r
919 IN CONST VOID *Buffer\r
920 )\r
921{\r
922 ASSERT (PatchVariable != NULL);\r
923 ASSERT (SizeOfBuffer != NULL);\r
9095d37b 924\r
9a355841
SZ
925 if (*SizeOfBuffer > 0) {\r
926 ASSERT (Buffer != NULL);\r
927 }\r
928\r
929 if ((*SizeOfBuffer > MaximumDatumSize) ||\r
930 (*SizeOfBuffer == MAX_ADDRESS)) {\r
931 *SizeOfBuffer = MaximumDatumSize;\r
932 return RETURN_INVALID_PARAMETER;\r
933 }\r
934\r
935 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
936\r
937 return RETURN_SUCCESS;\r
938}\r
939\r
f8308f0a
LG
940/**\r
941 Sets a value and size of a patchable PCD entry that is type pointer.\r
9095d37b
LG
942\r
943 Sets the PCD entry specified by PatchVariable to the value specified by Buffer\r
944 and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than\r
945 MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return\r
946 NULL to indicate that the set operation was not actually performed.\r
947 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
f8308f0a 948 MaximumDatumSize and NULL must be returned.\r
9095d37b 949\r
f8308f0a
LG
950 If PatchVariable is NULL, then ASSERT().\r
951 If SizeOfPatchVariable is NULL, then ASSERT().\r
952 If SizeOfBuffer is NULL, then ASSERT().\r
953 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
954\r
9095d37b 955 @param[out] PatchVariable A pointer to the global variable in a module that is\r
f8308f0a
LG
956 the target of the set operation.\r
957 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
958 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
959 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
960 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
9095d37b 961\r
f8308f0a
LG
962 @return Return the pointer to the buffer been set.\r
963\r
964**/\r
965VOID *\r
966EFIAPI\r
967LibPatchPcdSetPtrAndSize (\r
968 OUT VOID *PatchVariable,\r
969 OUT UINTN *SizeOfPatchVariable,\r
970 IN UINTN MaximumDatumSize,\r
971 IN OUT UINTN *SizeOfBuffer,\r
972 IN CONST VOID *Buffer\r
973 )\r
974{\r
975 ASSERT (PatchVariable != NULL);\r
976 ASSERT (SizeOfPatchVariable != NULL);\r
977 ASSERT (SizeOfBuffer != NULL);\r
9095d37b 978\r
f8308f0a
LG
979 if (*SizeOfBuffer > 0) {\r
980 ASSERT (Buffer != NULL);\r
981 }\r
982\r
983 if ((*SizeOfBuffer > MaximumDatumSize) ||\r
984 (*SizeOfBuffer == MAX_ADDRESS)) {\r
985 *SizeOfBuffer = MaximumDatumSize;\r
986 return NULL;\r
987 }\r
9095d37b 988\r
f8308f0a
LG
989 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
990 *SizeOfPatchVariable = *SizeOfBuffer;\r
9095d37b 991\r
f8308f0a
LG
992 return (VOID *) Buffer;\r
993}\r
994\r
995/**\r
996 Sets a value and size of a patchable PCD entry that is type pointer.\r
997\r
998 Sets the PCD entry specified by PatchVariable to the value specified\r
999 by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,\r
1000 then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER\r
1001 to indicate that the set operation was not actually performed.\r
1002 If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to\r
1003 MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.\r
1004\r
1005 If PatchVariable is NULL, then ASSERT().\r
1006 If SizeOfPatchVariable is NULL, then ASSERT().\r
1007 If SizeOfBuffer is NULL, then ASSERT().\r
1008 If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().\r
1009\r
1010 @param[out] PatchVariable A pointer to the global variable in a module that is\r
1011 the target of the set operation.\r
1012 @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.\r
1013 @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.\r
1014 @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.\r
1015 @param[in] Buffer A pointer to the buffer to used to set the target variable.\r
9095d37b 1016\r
f8308f0a
LG
1017 @return The status of the set operation.\r
1018\r
1019**/\r
1020RETURN_STATUS\r
1021EFIAPI\r
1022LibPatchPcdSetPtrAndSizeS (\r
1023 OUT VOID *PatchVariable,\r
1024 OUT UINTN *SizeOfPatchVariable,\r
1025 IN UINTN MaximumDatumSize,\r
1026 IN OUT UINTN *SizeOfBuffer,\r
1027 IN CONST VOID *Buffer\r
1028 )\r
1029{\r
1030 ASSERT (PatchVariable != NULL);\r
1031 ASSERT (SizeOfPatchVariable != NULL);\r
1032 ASSERT (SizeOfBuffer != NULL);\r
9095d37b 1033\r
f8308f0a
LG
1034 if (*SizeOfBuffer > 0) {\r
1035 ASSERT (Buffer != NULL);\r
1036 }\r
1037\r
1038 if ((*SizeOfBuffer > MaximumDatumSize) ||\r
1039 (*SizeOfBuffer == MAX_ADDRESS)) {\r
1040 *SizeOfBuffer = MaximumDatumSize;\r
1041 return RETURN_INVALID_PARAMETER;\r
1042 }\r
1043\r
1044 CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
1045 *SizeOfPatchVariable = *SizeOfBuffer;\r
1046\r
1047 return RETURN_SUCCESS;\r
1048}\r
1049\r
96d6d004
SZ
1050/**\r
1051 Retrieve additional information associated with a PCD token.\r
1052\r
1053 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
1054 human readable name that is associated with the token.\r
1055\r
1056 If TokenNumber is not in the default token space specified, then ASSERT().\r
1057\r
1058 @param[in] TokenNumber The PCD token number.\r
1059 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
1060 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
1061**/\r
1062VOID\r
1063EFIAPI\r
1064LibPcdGetInfo (\r
1065 IN UINTN TokenNumber,\r
1066 OUT PCD_INFO *PcdInfo\r
1067 )\r
1068{\r
1069 ASSERT (FALSE);\r
1070}\r
1071\r
1072/**\r
1073 Retrieve additional information associated with a PCD token.\r
1074\r
1075 This includes information such as the type of value the TokenNumber is associated with as well as possible\r
1076 human readable name that is associated with the token.\r
1077\r
1078 If TokenNumber is not in the token space specified by Guid, then ASSERT().\r
1079\r
1080 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
1081 @param[in] TokenNumber The PCD token number.\r
1082 @param[out] PcdInfo The returned information associated with the requested TokenNumber.\r
1083 The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
1084**/\r
1085VOID\r
1086EFIAPI\r
1087LibPcdGetInfoEx (\r
1088 IN CONST GUID *Guid,\r
1089 IN UINTN TokenNumber,\r
1090 OUT PCD_INFO *PcdInfo\r
1091 )\r
1092{\r
1093 ASSERT (FALSE);\r
1094}\r
1095\r
1096/**\r
1097 Retrieve the currently set SKU Id.\r
1098\r
96d6d004
SZ
1099 @return The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
1100 default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
1101 Id is returned.\r
1102**/\r
1103UINTN\r
1104EFIAPI\r
1105LibPcdGetSku (\r
1106 VOID\r
1107 )\r
1108{\r
1109 ASSERT (FALSE);\r
1110\r
1111 return 0;\r
1112}\r