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