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