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