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