]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | DxeMain.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Revision History\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _DXE_MAIN_H_\r | |
23 | #define _DXE_MAIN_H_\r | |
24 | \r | |
25 | \r | |
26 | #include "DebugImageInfo.h"\r | |
27 | #include "Library.h"\r | |
28 | #include "FwVolBlock.h"\r | |
29 | #include "FwVolDriver.h"\r | |
30 | #include "gcd.h"\r | |
31 | #include "imem.h"\r | |
32 | #include "Image.h"\r | |
33 | #include "Exec.h"\r | |
34 | #include "hand.h"\r | |
35 | \r | |
36 | typedef struct {\r | |
37 | EFI_GUID *ProtocolGuid;\r | |
38 | VOID **Protocol;\r | |
39 | EFI_EVENT Event;\r | |
40 | VOID *Registration;\r | |
41 | BOOLEAN Present;\r | |
42 | } ARCHITECTURAL_PROTOCOL_ENTRY;\r | |
43 | \r | |
44 | \r | |
45 | //\r | |
46 | // DXE Dispatcher Data structures\r | |
47 | //\r | |
48 | \r | |
49 | #define KNOWN_HANDLE_SIGNATURE EFI_SIGNATURE_32('k','n','o','w')\r | |
50 | typedef struct {\r | |
51 | UINTN Signature;\r | |
52 | LIST_ENTRY Link; // mFvHandleList \r | |
53 | EFI_HANDLE Handle;\r | |
54 | } KNOWN_HANDLE;\r | |
55 | \r | |
56 | \r | |
57 | #define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')\r | |
58 | typedef struct {\r | |
59 | UINTN Signature;\r | |
60 | LIST_ENTRY Link; // mDriverList\r | |
61 | \r | |
62 | LIST_ENTRY ScheduledLink; // mScheduledQueue\r | |
63 | \r | |
64 | EFI_HANDLE FvHandle;\r | |
65 | EFI_GUID FileName;\r | |
66 | EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r | |
67 | EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;\r | |
68 | \r | |
69 | VOID *Depex;\r | |
70 | UINTN DepexSize;\r | |
71 | \r | |
72 | BOOLEAN Before;\r | |
73 | BOOLEAN After;\r | |
74 | EFI_GUID BeforeAfterGuid;\r | |
75 | \r | |
76 | BOOLEAN Dependent;\r | |
77 | BOOLEAN Unrequested;\r | |
78 | BOOLEAN Scheduled;\r | |
79 | BOOLEAN Untrusted;\r | |
80 | BOOLEAN Initialized;\r | |
81 | BOOLEAN DepexProtocolError;\r | |
82 | \r | |
83 | EFI_HANDLE ImageHandle;\r | |
84 | \r | |
85 | } EFI_CORE_DRIVER_ENTRY;\r | |
86 | \r | |
87 | //\r | |
88 | //The data structure of GCD memory map entry\r | |
89 | //\r | |
90 | #define EFI_GCD_MAP_SIGNATURE EFI_SIGNATURE_32('g','c','d','m')\r | |
91 | typedef struct {\r | |
92 | UINTN Signature;\r | |
93 | LIST_ENTRY Link;\r | |
94 | EFI_PHYSICAL_ADDRESS BaseAddress;\r | |
95 | UINT64 EndAddress;\r | |
96 | UINT64 Capabilities;\r | |
97 | UINT64 Attributes;\r | |
98 | EFI_GCD_MEMORY_TYPE GcdMemoryType;\r | |
99 | EFI_GCD_IO_TYPE GcdIoType;\r | |
100 | EFI_HANDLE ImageHandle;\r | |
101 | EFI_HANDLE DeviceHandle;\r | |
102 | } EFI_GCD_MAP_ENTRY;\r | |
103 | \r | |
104 | //\r | |
105 | // DXE Core Global Variables\r | |
106 | //\r | |
107 | extern EFI_SYSTEM_TABLE *gST;\r | |
108 | extern EFI_BOOT_SERVICES *gBS;\r | |
109 | extern EFI_RUNTIME_SERVICES *gRT;\r | |
110 | extern EFI_DXE_SERVICES *gDS;\r | |
111 | extern EFI_HANDLE gDxeCoreImageHandle;\r | |
112 | \r | |
113 | extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r | |
114 | extern EFI_PEI_PE_COFF_LOADER_PROTOCOL *gEfiPeiPeCoffLoader;\r | |
115 | \r | |
116 | extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;\r | |
117 | extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r | |
118 | extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;\r | |
119 | extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;\r | |
120 | extern EFI_TIMER_ARCH_PROTOCOL *gTimer;\r | |
121 | extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;\r | |
122 | extern EFI_BDS_ARCH_PROTOCOL *gBds;\r | |
123 | extern EFI_STATUS_CODE_PROTOCOL *gStatusCode;\r | |
124 | \r | |
125 | extern EFI_TPL gEfiCurrentTpl;\r | |
126 | \r | |
127 | extern EFI_GUID *gDxeCoreFileName;\r | |
128 | extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;\r | |
129 | \r | |
130 | extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];\r | |
131 | \r | |
132 | extern BOOLEAN gDispatcherRunning;\r | |
133 | \r | |
134 | //\r | |
135 | // Service Initialization Functions\r | |
136 | //\r | |
137 | \r | |
138 | \r | |
139 | VOID\r | |
140 | CoreInitializePool (\r | |
141 | VOID\r | |
142 | )\r | |
143 | /*++\r | |
144 | \r | |
145 | Routine Description:\r | |
146 | \r | |
147 | Called to initialize the pool.\r | |
148 | \r | |
149 | Arguments:\r | |
150 | \r | |
151 | None\r | |
152 | \r | |
153 | Returns:\r | |
154 | \r | |
155 | None\r | |
156 | \r | |
157 | --*/\r | |
158 | ;\r | |
159 | \r | |
160 | VOID\r | |
161 | CoreAddMemoryDescriptor (\r | |
162 | IN EFI_MEMORY_TYPE Type,\r | |
163 | IN EFI_PHYSICAL_ADDRESS Start,\r | |
164 | IN UINT64 NumberOfPages,\r | |
165 | IN UINT64 Attribute\r | |
166 | )\r | |
167 | /*++\r | |
168 | \r | |
169 | Routine Description:\r | |
170 | \r | |
171 | Called to initialize the memory map and add descriptors to\r | |
172 | the current descriptor list.\r | |
173 | \r | |
174 | The first descriptor that is added must be general usable\r | |
175 | memory as the addition allocates heap.\r | |
176 | \r | |
177 | Arguments:\r | |
178 | \r | |
179 | Type - The type of memory to add\r | |
180 | \r | |
181 | Start - The starting address in the memory range\r | |
182 | Must be page aligned\r | |
183 | \r | |
184 | NumberOfPages - The number of pages in the range\r | |
185 | \r | |
186 | Attribute - Attributes of the memory to add\r | |
187 | \r | |
188 | Returns:\r | |
189 | \r | |
190 | None. The range is added to the memory map\r | |
191 | \r | |
192 | --*/\r | |
193 | ;\r | |
194 | \r | |
195 | VOID\r | |
196 | CoreReleaseGcdMemoryLock (\r | |
197 | VOID\r | |
198 | )\r | |
199 | /*++\r | |
200 | \r | |
201 | Routine Description:\r | |
202 | Release memory lock on mGcdMemorySpaceLock\r | |
203 | \r | |
204 | Arguments:\r | |
205 | None\r | |
206 | \r | |
207 | Returns:\r | |
208 | None\r | |
209 | \r | |
210 | --*/\r | |
211 | ;\r | |
212 | \r | |
213 | VOID\r | |
214 | CoreAcquireGcdMemoryLock (\r | |
215 | VOID\r | |
216 | )\r | |
217 | /*++\r | |
218 | \r | |
219 | Routine Description:\r | |
220 | Acquire memory lock on mGcdMemorySpaceLock\r | |
221 | \r | |
222 | Arguments:\r | |
223 | None\r | |
224 | \r | |
225 | Returns:\r | |
226 | None\r | |
227 | \r | |
228 | --*/\r | |
229 | ;\r | |
230 | \r | |
231 | EFI_STATUS\r | |
232 | CoreInitializeMemoryServices (\r | |
233 | IN VOID **HobStart,\r | |
234 | IN EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,\r | |
235 | IN UINT64 *MemoryLength\r | |
236 | )\r | |
237 | /*++\r | |
238 | \r | |
239 | Routine Description:\r | |
240 | \r | |
241 | External function. Initializes the GCD and memory services based on the memory \r | |
242 | descriptor HOBs. This function is responsible for priming the GCD map and the\r | |
243 | memory map, so memory allocations and resource allocations can be made. The first\r | |
244 | part of this function can not depend on any memory services until at least one\r | |
245 | memory descriptor is provided to the memory services. Then the memory services\r | |
246 | can be used to intialize the GCD map.\r | |
247 | \r | |
248 | Arguments:\r | |
249 | \r | |
250 | HobStart - The start address of the HOB.\r | |
251 | \r | |
252 | MemoryBaseAddress - Start address of memory region found to init DXE core.\r | |
253 | \r | |
254 | MemoryLength - Length of memory region found to init DXE core.\r | |
255 | \r | |
256 | Returns:\r | |
257 | \r | |
258 | EFI_SUCCESS - Memory services successfully initialized.\r | |
259 | \r | |
260 | --*/\r | |
261 | ;\r | |
262 | \r | |
263 | \r | |
264 | EFI_STATUS\r | |
265 | CoreInitializeGcdServices (\r | |
266 | IN VOID **HobStart,\r | |
267 | IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,\r | |
268 | IN UINT64 MemoryLength\r | |
269 | )\r | |
270 | /*++\r | |
271 | \r | |
272 | Routine Description:\r | |
273 | \r | |
274 | External function. Initializes the GCD and memory services based on the memory \r | |
275 | descriptor HOBs. This function is responsible for priming the GCD map and the\r | |
276 | memory map, so memory allocations and resource allocations can be made. The first\r | |
277 | part of this function can not depend on any memory services until at least one\r | |
278 | memory descriptor is provided to the memory services. Then the memory services\r | |
279 | can be used to intialize the GCD map.\r | |
280 | \r | |
281 | Arguments:\r | |
282 | \r | |
283 | HobStart - The start address of the HOB\r | |
284 | \r | |
285 | MemoryBaseAddress - Start address of memory region found to init DXE core.\r | |
286 | \r | |
287 | MemoryLength - Length of memory region found to init DXE core.\r | |
288 | \r | |
289 | \r | |
290 | Returns:\r | |
291 | \r | |
292 | EFI_SUCCESS - GCD services successfully initialized.\r | |
293 | \r | |
294 | --*/\r | |
295 | ;\r | |
296 | \r | |
297 | EFI_STATUS\r | |
298 | CoreInitializeEventServices (\r | |
299 | VOID\r | |
300 | )\r | |
301 | /*++\r | |
302 | \r | |
303 | Routine Description:\r | |
304 | \r | |
305 | Initializes "event" support and populates parts of the System and Runtime Table.\r | |
306 | \r | |
307 | Arguments:\r | |
308 | \r | |
309 | None\r | |
310 | \r | |
311 | Returns:\r | |
312 | \r | |
313 | EFI_SUCCESS - Always return success\r | |
314 | \r | |
315 | --*/\r | |
316 | ;\r | |
317 | \r | |
318 | EFI_STATUS\r | |
319 | CoreShutdownEventServices (\r | |
320 | VOID\r | |
321 | )\r | |
322 | /*++\r | |
323 | \r | |
324 | Routine Description:\r | |
325 | \r | |
326 | Register all runtime events to make sure they are still available after ExitBootService.\r | |
327 | \r | |
328 | Arguments:\r | |
329 | \r | |
330 | None\r | |
331 | \r | |
332 | Returns:\r | |
333 | \r | |
334 | EFI_SUCCESS - Always return success\r | |
335 | \r | |
336 | --*/\r | |
337 | ;\r | |
338 | \r | |
339 | EFI_STATUS\r | |
340 | CoreInitializeImageServices (\r | |
341 | IN VOID *HobStart\r | |
342 | )\r | |
343 | /*++\r | |
344 | \r | |
345 | Routine Description:\r | |
346 | \r | |
347 | Add the Image Services to EFI Boot Services Table and install the protocol\r | |
348 | interfaces for this image.\r | |
349 | \r | |
350 | Arguments:\r | |
351 | \r | |
352 | HobStart - The HOB to initialize\r | |
353 | \r | |
354 | Returns:\r | |
355 | \r | |
356 | Status code.\r | |
357 | \r | |
358 | --*/\r | |
359 | ;\r | |
360 | \r | |
361 | EFI_STATUS\r | |
362 | CoreShutdownImageServices (\r | |
363 | VOID\r | |
364 | )\r | |
365 | /*++\r | |
366 | \r | |
367 | Routine Description:\r | |
368 | \r | |
369 | Transfer control of runtime images to runtime service\r | |
370 | \r | |
371 | Arguments:\r | |
372 | \r | |
373 | None\r | |
374 | \r | |
375 | Returns:\r | |
376 | \r | |
377 | EFI_SUCCESS - Function successfully returned\r | |
378 | \r | |
379 | --*/\r | |
380 | ;\r | |
381 | \r | |
382 | VOID\r | |
383 | CoreNotifyOnArchProtocolInstallation (\r | |
384 | VOID\r | |
385 | )\r | |
386 | /*++\r | |
387 | \r | |
388 | Routine Description:\r | |
389 | Creates an event that is fired everytime a Protocol of a specific type is installed\r | |
390 | \r | |
391 | Arguments:\r | |
392 | NONE\r | |
393 | \r | |
394 | Returns:\r | |
395 | NONE\r | |
396 | \r | |
397 | --*/\r | |
398 | ;\r | |
399 | \r | |
400 | EFI_STATUS\r | |
401 | CoreAllEfiServicesAvailable (\r | |
402 | VOID\r | |
403 | )\r | |
404 | /*++\r | |
405 | \r | |
406 | Routine Description:\r | |
407 | Return TRUE if all AP services are availible.\r | |
408 | \r | |
409 | Arguments:\r | |
410 | NONE\r | |
411 | \r | |
412 | Returns:\r | |
413 | EFI_SUCCESS - All AP services are available\r | |
414 | EFI_NOT_FOUND - At least one AP service is not available \r | |
415 | \r | |
416 | --*/\r | |
417 | ;\r | |
418 | \r | |
419 | VOID\r | |
420 | CalculateEfiHdrCrc (\r | |
421 | IN OUT EFI_TABLE_HEADER *Hdr\r | |
422 | )\r | |
423 | /*++\r | |
424 | \r | |
425 | Routine Description:\r | |
426 | \r | |
427 | Calcualte the 32-bit CRC in a EFI table using the service provided by the\r | |
428 | gRuntime service.\r | |
429 | \r | |
430 | Arguments:\r | |
431 | \r | |
432 | Hdr - Pointer to an EFI standard header\r | |
433 | \r | |
434 | Returns:\r | |
435 | \r | |
436 | None\r | |
437 | \r | |
438 | --*/\r | |
439 | ;\r | |
440 | \r | |
441 | VOID\r | |
442 | EFIAPI\r | |
443 | CoreTimerTick (\r | |
444 | IN UINT64 Duration\r | |
445 | )\r | |
446 | /*++\r | |
447 | \r | |
448 | Routine Description:\r | |
449 | \r | |
450 | Called by the platform code to process a tick.\r | |
451 | \r | |
452 | Arguments:\r | |
453 | \r | |
454 | Duration - The number of 100ns elasped since the last call to TimerTick\r | |
455 | \r | |
456 | Returns:\r | |
457 | \r | |
458 | None\r | |
459 | \r | |
460 | --*/\r | |
461 | ;\r | |
462 | \r | |
463 | VOID\r | |
464 | CoreInitializeDispatcher (\r | |
465 | VOID\r | |
466 | )\r | |
467 | /*++\r | |
468 | \r | |
469 | Routine Description:\r | |
470 | \r | |
471 | Initialize the dispatcher. Initialize the notification function that runs when\r | |
472 | a FV protocol is added to the system.\r | |
473 | \r | |
474 | Arguments:\r | |
475 | \r | |
476 | NONE\r | |
477 | \r | |
478 | Returns:\r | |
479 | \r | |
480 | NONE \r | |
481 | \r | |
482 | --*/\r | |
483 | ;\r | |
484 | \r | |
485 | BOOLEAN\r | |
486 | CoreIsSchedulable (\r | |
487 | IN EFI_CORE_DRIVER_ENTRY *DriverEntry \r | |
488 | )\r | |
489 | /*++\r | |
490 | \r | |
491 | Routine Description:\r | |
492 | \r | |
493 | This is the POSTFIX version of the dependency evaluator. This code does \r | |
494 | not need to handle Before or After, as it is not valid to call this \r | |
495 | routine in this case. The SOR is just ignored and is a nop in the grammer.\r | |
496 | \r | |
497 | POSTFIX means all the math is done on top of the stack.\r | |
498 | \r | |
499 | Arguments:\r | |
500 | \r | |
501 | DriverEntry - DriverEntry element to update\r | |
502 | \r | |
503 | Returns:\r | |
504 | \r | |
505 | TRUE - If driver is ready to run.\r | |
506 | \r | |
507 | FALSE - If driver is not ready to run or some fatal error was found.\r | |
508 | \r | |
509 | --*/\r | |
510 | ;\r | |
511 | \r | |
512 | EFI_STATUS\r | |
513 | CorePreProcessDepex (\r | |
514 | IN EFI_CORE_DRIVER_ENTRY *DriverEntry \r | |
515 | )\r | |
516 | /*++\r | |
517 | \r | |
518 | Routine Description:\r | |
519 | \r | |
520 | Preprocess dependency expression and update DriverEntry to reflect the\r | |
521 | state of Before, After, and SOR dependencies. If DriverEntry->Before\r | |
522 | or DriverEntry->After is set it will never be cleared. If SOR is set\r | |
523 | it will be cleared by CoreSchedule(), and then the driver can be \r | |
524 | dispatched.\r | |
525 | \r | |
526 | Arguments:\r | |
527 | \r | |
528 | DriverEntry - DriverEntry element to update\r | |
529 | \r | |
530 | Returns:\r | |
531 | \r | |
532 | EFI_SUCCESS - It always works.\r | |
533 | \r | |
534 | --*/\r | |
535 | ;\r | |
536 | \r | |
537 | \r | |
538 | EFI_STATUS\r | |
539 | EFIAPI\r | |
540 | CoreExitBootServices (\r | |
541 | IN EFI_HANDLE ImageHandle,\r | |
542 | IN UINTN MapKey\r | |
543 | )\r | |
544 | /*++\r | |
545 | \r | |
546 | Routine Description:\r | |
547 | \r | |
548 | EFI 1.0 API to terminate Boot Services\r | |
549 | \r | |
550 | Arguments:\r | |
551 | \r | |
552 | ImageHandle - Handle that represents the identity of the calling image\r | |
553 | \r | |
554 | MapKey -Key to the latest memory map.\r | |
555 | \r | |
556 | Returns:\r | |
557 | \r | |
558 | EFI_SUCCESS - Boot Services terminated\r | |
559 | EFI_INVALID_PARAMETER - MapKey is incorrect.\r | |
560 | \r | |
561 | --*/\r | |
562 | ;\r | |
563 | \r | |
564 | EFI_STATUS\r | |
565 | CoreTerminateMemoryMap (\r | |
566 | IN UINTN MapKey\r | |
567 | )\r | |
568 | /*++\r | |
569 | \r | |
570 | Routine Description:\r | |
571 | \r | |
572 | Make sure the memory map is following all the construction rules, \r | |
573 | it is the last time to check memory map error before exit boot services.\r | |
574 | \r | |
575 | Arguments:\r | |
576 | \r | |
577 | MapKey - Memory map key\r | |
578 | \r | |
579 | Returns:\r | |
580 | \r | |
581 | EFI_INVALID_PARAMETER - Memory map not consistent with construction rules.\r | |
582 | \r | |
583 | EFI_SUCCESS - Valid memory map.\r | |
584 | \r | |
585 | --*/\r | |
586 | ;\r | |
587 | \r | |
588 | VOID\r | |
589 | CoreNotifySignalList (\r | |
590 | IN EFI_GUID *EventGroup\r | |
591 | )\r | |
592 | /*++\r | |
593 | \r | |
594 | Routine Description:\r | |
595 | \r | |
596 | Signals all events on the requested list\r | |
597 | \r | |
598 | Arguments:\r | |
599 | \r | |
600 | SignalType - The list to signal\r | |
601 | \r | |
602 | Returns:\r | |
603 | \r | |
604 | None\r | |
605 | \r | |
606 | --*/\r | |
607 | ;\r | |
608 | \r | |
609 | \r | |
610 | EFI_STATUS\r | |
611 | EFIAPI\r | |
612 | CoreInstallConfigurationTable (\r | |
613 | IN EFI_GUID *Guid,\r | |
614 | IN VOID *Table\r | |
615 | )\r | |
616 | /*++\r | |
617 | \r | |
618 | Routine Description:\r | |
619 | \r | |
620 | Boot Service called to add, modify, or remove a system configuration table from \r | |
621 | the EFI System Table.\r | |
622 | \r | |
623 | Arguments:\r | |
624 | \r | |
625 | Guid: Pointer to the GUID for the entry to add, update, or remove\r | |
626 | Table: Pointer to the configuration table for the entry to add, update, or\r | |
627 | remove, may be NULL.\r | |
628 | \r | |
629 | Returns:\r | |
630 | \r | |
631 | EFI_SUCCESS Guid, Table pair added, updated, or removed.\r | |
632 | EFI_INVALID_PARAMETER Input GUID not valid.\r | |
633 | EFI_NOT_FOUND Attempted to delete non-existant entry\r | |
634 | EFI_OUT_OF_RESOURCES Not enough memory available\r | |
635 | \r | |
636 | --*/\r | |
637 | ;\r | |
638 | \r | |
639 | \r | |
640 | EFI_TPL\r | |
641 | EFIAPI\r | |
642 | CoreRaiseTpl (\r | |
643 | IN EFI_TPL NewTpl\r | |
644 | )\r | |
645 | /*++\r | |
646 | \r | |
647 | Routine Description:\r | |
648 | \r | |
649 | Raise the task priority level to the new level.\r | |
650 | High level is implemented by disabling processor interrupts.\r | |
651 | \r | |
652 | Arguments:\r | |
653 | \r | |
654 | NewTpl - New task priority level\r | |
655 | \r | |
656 | Returns:\r | |
657 | \r | |
658 | The previous task priority level\r | |
659 | \r | |
660 | --*/\r | |
661 | ;\r | |
662 | \r | |
663 | \r | |
664 | VOID\r | |
665 | EFIAPI\r | |
666 | CoreRestoreTpl (\r | |
667 | IN EFI_TPL NewTpl\r | |
668 | )\r | |
669 | /*++\r | |
670 | \r | |
671 | Routine Description:\r | |
672 | \r | |
673 | Lowers the task priority to the previous value. If the new \r | |
674 | priority unmasks events at a higher priority, they are dispatched.\r | |
675 | \r | |
676 | Arguments:\r | |
677 | \r | |
678 | NewTpl - New, lower, task priority\r | |
679 | \r | |
680 | Returns:\r | |
681 | \r | |
682 | None\r | |
683 | \r | |
684 | --*/\r | |
685 | ;\r | |
686 | \r | |
687 | \r | |
688 | EFI_STATUS\r | |
689 | EFIAPI\r | |
690 | CoreStall (\r | |
691 | IN UINTN Microseconds\r | |
692 | )\r | |
693 | /*++\r | |
694 | \r | |
695 | Routine Description:\r | |
696 | \r | |
697 | Introduces a fine-grained stall.\r | |
698 | \r | |
699 | Arguments:\r | |
700 | \r | |
701 | Microseconds The number of microseconds to stall execution\r | |
702 | \r | |
703 | Returns:\r | |
704 | \r | |
705 | EFI_SUCCESS - Execution was stalled for at least the requested amount\r | |
706 | of microseconds.\r | |
707 | \r | |
708 | EFI_NOT_AVAILABLE_YET - gMetronome is not available yet\r | |
709 | \r | |
710 | --*/\r | |
711 | ;\r | |
712 | \r | |
713 | \r | |
714 | EFI_STATUS\r | |
715 | EFIAPI\r | |
716 | CoreSetWatchdogTimer (\r | |
717 | IN UINTN Timeout,\r | |
718 | IN UINT64 WatchdogCode,\r | |
719 | IN UINTN DataSize,\r | |
720 | IN CHAR16 *WatchdogData OPTIONAL\r | |
721 | )\r | |
722 | /*++\r | |
723 | \r | |
724 | Routine Description:\r | |
725 | \r | |
726 | Sets the system's watchdog timer.\r | |
727 | \r | |
728 | Arguments:\r | |
729 | \r | |
730 | Timeout The number of seconds. Zero disables the timer.\r | |
731 | \r | |
732 | ///////following three parameters are left for platform specific using \r | |
733 | \r | |
734 | WatchdogCode The numberic code to log. 0x0 to 0xffff are firmware\r | |
735 | DataSize Size of the optional data\r | |
736 | WatchdogData Optional Null terminated unicode string followed by binary \r | |
737 | data.\r | |
738 | \r | |
739 | Returns:\r | |
740 | \r | |
741 | EFI_SUCCESS Timeout has been set\r | |
742 | EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet \r | |
743 | EFI_UNSUPPORTED System does not have a timer (currently not used)\r | |
744 | EFI_DEVICE_ERROR Could not complete due to hardware error\r | |
745 | \r | |
746 | --*/\r | |
747 | ;\r | |
748 | \r | |
749 | \r | |
750 | EFI_STATUS\r | |
751 | EFIAPI\r | |
752 | CoreInstallProtocolInterface (\r | |
753 | IN OUT EFI_HANDLE *UserHandle,\r | |
754 | IN EFI_GUID *Protocol,\r | |
755 | IN EFI_INTERFACE_TYPE InterfaceType,\r | |
756 | IN VOID *Interface\r | |
757 | )\r | |
758 | /*++\r | |
759 | \r | |
760 | Routine Description:\r | |
761 | \r | |
762 | Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r | |
763 | Calls the private one which contains a BOOLEAN parameter for notifications\r | |
764 | \r | |
765 | Arguments:\r | |
766 | \r | |
767 | UserHandle - The handle to install the protocol handler on,\r | |
768 | or NULL if a new handle is to be allocated\r | |
769 | \r | |
770 | Protocol - The protocol to add to the handle\r | |
771 | \r | |
772 | InterfaceType - Indicates whether Interface is supplied in native form.\r | |
773 | \r | |
774 | Interface - The interface for the protocol being added\r | |
775 | \r | |
776 | Returns:\r | |
777 | \r | |
778 | Status code \r | |
779 | \r | |
780 | --*/\r | |
781 | ;\r | |
782 | \r | |
783 | EFI_STATUS\r | |
784 | CoreInstallProtocolInterfaceNotify (\r | |
785 | IN OUT EFI_HANDLE *UserHandle,\r | |
786 | IN EFI_GUID *Protocol,\r | |
787 | IN EFI_INTERFACE_TYPE InterfaceType,\r | |
788 | IN VOID *Interface,\r | |
789 | IN BOOLEAN Notify\r | |
790 | )\r | |
791 | /*++\r | |
792 | \r | |
793 | Routine Description:\r | |
794 | \r | |
795 | Installs a protocol interface into the boot services environment.\r | |
796 | \r | |
797 | Arguments:\r | |
798 | \r | |
799 | UserHandle - The handle to install the protocol handler on,\r | |
800 | or NULL if a new handle is to be allocated\r | |
801 | \r | |
802 | Protocol - The protocol to add to the handle\r | |
803 | \r | |
804 | InterfaceType - Indicates whether Interface is supplied in native form.\r | |
805 | \r | |
806 | Interface - The interface for the protocol being added\r | |
807 | \r | |
808 | Notify - Whether to notify the notification list for this protocol \r | |
809 | \r | |
810 | Returns:\r | |
811 | \r | |
812 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
813 | \r | |
814 | EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r | |
815 | \r | |
816 | EFI_SUCCESS - Protocol interface successfully installed\r | |
817 | \r | |
818 | --*/\r | |
819 | ;\r | |
820 | \r | |
821 | \r | |
822 | EFI_STATUS\r | |
823 | EFIAPI\r | |
824 | CoreInstallMultipleProtocolInterfaces (\r | |
825 | IN OUT EFI_HANDLE *Handle,\r | |
826 | ...\r | |
827 | )\r | |
828 | /*++\r | |
829 | \r | |
830 | Routine Description:\r | |
831 | \r | |
832 | Installs a list of protocol interface into the boot services environment.\r | |
833 | This function calls InstallProtocolInterface() in a loop. If any error\r | |
834 | occures all the protocols added by this function are removed. This is \r | |
835 | basically a lib function to save space.\r | |
836 | \r | |
837 | Arguments:\r | |
838 | \r | |
839 | Handle - The handle to install the protocol handlers on,\r | |
840 | or NULL if a new handle is to be allocated\r | |
841 | ... - EFI_GUID followed by protocol instance. A NULL terminates the \r | |
842 | list. The pairs are the arguments to InstallProtocolInterface().\r | |
843 | All the protocols are added to Handle.\r | |
844 | \r | |
845 | Returns:\r | |
846 | \r | |
847 | EFI_INVALID_PARAMETER - Handle is NULL.\r | |
848 | \r | |
849 | EFI_SUCCESS - Protocol interfaces successfully installed.\r | |
850 | \r | |
851 | --*/\r | |
852 | ;\r | |
853 | \r | |
854 | \r | |
855 | EFI_STATUS\r | |
856 | EFIAPI\r | |
857 | CoreUninstallMultipleProtocolInterfaces (\r | |
858 | IN EFI_HANDLE Handle,\r | |
859 | ...\r | |
860 | )\r | |
861 | /*++\r | |
862 | \r | |
863 | Routine Description:\r | |
864 | \r | |
865 | Uninstalls a list of protocol interface in the boot services environment. \r | |
866 | This function calls UnisatllProtocolInterface() in a loop. This is \r | |
867 | basically a lib function to save space.\r | |
868 | \r | |
869 | Arguments:\r | |
870 | \r | |
871 | Handle - The handle to uninstall the protocol\r | |
872 | \r | |
873 | ... - EFI_GUID followed by protocol instance. A NULL terminates the \r | |
874 | list. The pairs are the arguments to UninstallProtocolInterface().\r | |
875 | All the protocols are added to Handle.\r | |
876 | \r | |
877 | Returns:\r | |
878 | \r | |
879 | Status code \r | |
880 | \r | |
881 | --*/\r | |
882 | ;\r | |
883 | \r | |
884 | \r | |
885 | EFI_STATUS\r | |
886 | EFIAPI\r | |
887 | CoreReinstallProtocolInterface (\r | |
888 | IN EFI_HANDLE UserHandle,\r | |
889 | IN EFI_GUID *Protocol,\r | |
890 | IN VOID *OldInterface,\r | |
891 | IN VOID *NewInterface\r | |
892 | )\r | |
893 | /*++\r | |
894 | \r | |
895 | Routine Description:\r | |
896 | \r | |
897 | Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.\r | |
898 | \r | |
899 | Arguments:\r | |
900 | \r | |
901 | UserHandle - Handle on which the interface is to be reinstalled\r | |
902 | Protocol - The numeric ID of the interface\r | |
903 | OldInterface - A pointer to the old interface\r | |
904 | NewInterface - A pointer to the new interface \r | |
905 | \r | |
906 | \r | |
907 | Returns:\r | |
908 | \r | |
909 | Status code.\r | |
910 | \r | |
911 | On EFI_SUCCESS The protocol interface was installed\r | |
912 | On EFI_NOT_FOUND The OldInterface on the handle was not found\r | |
913 | On EFI_INVALID_PARAMETER One of the parameters has an invalid value\r | |
914 | \r | |
915 | --*/\r | |
916 | ;\r | |
917 | \r | |
918 | \r | |
919 | EFI_STATUS\r | |
920 | EFIAPI\r | |
921 | CoreUninstallProtocolInterface (\r | |
922 | IN EFI_HANDLE UserHandle,\r | |
923 | IN EFI_GUID *Protocol,\r | |
924 | IN VOID *Interface\r | |
925 | )\r | |
926 | /*++\r | |
927 | \r | |
928 | Routine Description:\r | |
929 | \r | |
930 | Uninstalls all instances of a protocol:interfacer from a handle. \r | |
931 | If the last protocol interface is remove from the handle, the \r | |
932 | handle is freed.\r | |
933 | \r | |
934 | Arguments:\r | |
935 | \r | |
936 | UserHandle - The handle to remove the protocol handler from\r | |
937 | \r | |
938 | Protocol - The protocol, of protocol:interface, to remove\r | |
939 | \r | |
940 | Interface - The interface, of protocol:interface, to remove\r | |
941 | \r | |
942 | Returns:\r | |
943 | \r | |
944 | EFI_INVALID_PARAMETER - Protocol is NULL.\r | |
945 | \r | |
946 | EFI_SUCCESS - Protocol interface successfully uninstalled.\r | |
947 | \r | |
948 | --*/\r | |
949 | ;\r | |
950 | \r | |
951 | \r | |
952 | EFI_STATUS\r | |
953 | EFIAPI\r | |
954 | CoreHandleProtocol (\r | |
955 | IN EFI_HANDLE UserHandle,\r | |
956 | IN EFI_GUID *Protocol,\r | |
957 | OUT VOID **Interface\r | |
958 | )\r | |
959 | /*++\r | |
960 | \r | |
961 | Routine Description:\r | |
962 | \r | |
963 | Queries a handle to determine if it supports a specified protocol.\r | |
964 | \r | |
965 | Arguments:\r | |
966 | \r | |
967 | UserHandle - The handle being queried.\r | |
968 | \r | |
969 | Protocol - The published unique identifier of the protocol.\r | |
970 | \r | |
971 | Interface - Supplies the address where a pointer to the corresponding Protocol\r | |
972 | Interface is returned.\r | |
973 | \r | |
974 | Returns:\r | |
975 | \r | |
976 | The requested protocol interface for the handle\r | |
977 | \r | |
978 | --*/ \r | |
979 | ;\r | |
980 | \r | |
981 | \r | |
982 | EFI_STATUS\r | |
983 | EFIAPI\r | |
984 | CoreOpenProtocol (\r | |
985 | IN EFI_HANDLE UserHandle,\r | |
986 | IN EFI_GUID *Protocol,\r | |
987 | OUT VOID **Interface OPTIONAL,\r | |
988 | IN EFI_HANDLE ImageHandle,\r | |
989 | IN EFI_HANDLE ControllerHandle,\r | |
990 | IN UINT32 Attributes\r | |
991 | )\r | |
992 | /*++\r | |
993 | \r | |
994 | Routine Description:\r | |
995 | \r | |
996 | Locates the installed protocol handler for the handle, and\r | |
997 | invokes it to obtain the protocol interface. Usage information\r | |
998 | is registered in the protocol data base.\r | |
999 | \r | |
1000 | Arguments:\r | |
1001 | \r | |
1002 | UserHandle - The handle to obtain the protocol interface on\r | |
1003 | \r | |
1004 | Protocol - The ID of the protocol \r | |
1005 | \r | |
1006 | Interface - The location to return the protocol interface\r | |
1007 | \r | |
1008 | ImageHandle - The handle of the Image that is opening the protocol interface\r | |
1009 | specified by Protocol and Interface.\r | |
1010 | \r | |
1011 | ControllerHandle - The controller handle that is requiring this interface.\r | |
1012 | \r | |
1013 | Attributes - The open mode of the protocol interface specified by Handle\r | |
1014 | and Protocol.\r | |
1015 | \r | |
1016 | Returns:\r | |
1017 | \r | |
1018 | EFI_INVALID_PARAMETER - Protocol is NULL.\r | |
1019 | \r | |
1020 | EFI_SUCCESS - Get the protocol interface.\r | |
1021 | \r | |
1022 | --*/\r | |
1023 | ;\r | |
1024 | \r | |
1025 | \r | |
1026 | EFI_STATUS\r | |
1027 | EFIAPI\r | |
1028 | CoreOpenProtocolInformation (\r | |
1029 | IN EFI_HANDLE UserHandle,\r | |
1030 | IN EFI_GUID *Protocol,\r | |
1031 | OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r | |
1032 | OUT UINTN *EntryCount\r | |
1033 | )\r | |
1034 | /*++\r | |
1035 | \r | |
1036 | Routine Description:\r | |
1037 | \r | |
1038 | Return information about Opened protocols in the system\r | |
1039 | \r | |
1040 | Arguments:\r | |
1041 | \r | |
1042 | UserHandle - The handle to close the protocol interface on\r | |
1043 | \r | |
1044 | Protocol - The ID of the protocol \r | |
1045 | \r | |
1046 | EntryBuffer - A pointer to a buffer of open protocol information in the form of\r | |
1047 | EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r | |
1048 | \r | |
1049 | EntryCount - Number of EntryBuffer entries\r | |
1050 | \r | |
1051 | Returns:\r | |
1052 | \r | |
1053 | \r | |
1054 | --*/\r | |
1055 | ;\r | |
1056 | \r | |
1057 | \r | |
1058 | EFI_STATUS\r | |
1059 | EFIAPI\r | |
1060 | CoreCloseProtocol (\r | |
1061 | IN EFI_HANDLE UserHandle,\r | |
1062 | IN EFI_GUID *Protocol,\r | |
1063 | IN EFI_HANDLE ImageHandle,\r | |
1064 | IN EFI_HANDLE ControllerHandle\r | |
1065 | )\r | |
1066 | /*++\r | |
1067 | \r | |
1068 | Routine Description:\r | |
1069 | \r | |
1070 | Close Protocol\r | |
1071 | \r | |
1072 | Arguments:\r | |
1073 | \r | |
1074 | UserHandle - The handle to close the protocol interface on\r | |
1075 | \r | |
1076 | Protocol - The ID of the protocol \r | |
1077 | \r | |
1078 | ImageHandle - The user of the protocol to close\r | |
1079 | \r | |
1080 | ControllerHandle - The user of the protocol to close\r | |
1081 | \r | |
1082 | Returns:\r | |
1083 | \r | |
1084 | EFI_INVALID_PARAMETER - Protocol is NULL.\r | |
1085 | \r | |
1086 | --*/\r | |
1087 | ;\r | |
1088 | \r | |
1089 | \r | |
1090 | EFI_STATUS\r | |
1091 | EFIAPI\r | |
1092 | CoreProtocolsPerHandle (\r | |
1093 | IN EFI_HANDLE UserHandle,\r | |
1094 | OUT EFI_GUID ***ProtocolBuffer,\r | |
1095 | OUT UINTN *ProtocolBufferCount\r | |
1096 | )\r | |
1097 | /*++\r | |
1098 | \r | |
1099 | Routine Description:\r | |
1100 | \r | |
1101 | Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r | |
1102 | from pool.\r | |
1103 | \r | |
1104 | Arguments:\r | |
1105 | \r | |
1106 | UserHandle - The handle from which to retrieve the list of protocol interface\r | |
1107 | GUIDs.\r | |
1108 | \r | |
1109 | ProtocolBuffer - A pointer to the list of protocol interface GUID pointers that are\r | |
1110 | installed on Handle.\r | |
1111 | \r | |
1112 | ProtocolBufferCount - A pointer to the number of GUID pointers present in\r | |
1113 | ProtocolBuffer.\r | |
1114 | \r | |
1115 | Returns:\r | |
1116 | EFI_SUCCESS - The list of protocol interface GUIDs installed on Handle was returned in\r | |
1117 | ProtocolBuffer. The number of protocol interface GUIDs was\r | |
1118 | returned in ProtocolBufferCount.\r | |
1119 | EFI_INVALID_PARAMETER - Handle is NULL.\r | |
1120 | EFI_INVALID_PARAMETER - Handle is not a valid EFI_HANDLE.\r | |
1121 | EFI_INVALID_PARAMETER - ProtocolBuffer is NULL.\r | |
1122 | EFI_INVALID_PARAMETER - ProtocolBufferCount is NULL.\r | |
1123 | EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the results.\r | |
1124 | \r | |
1125 | --*/\r | |
1126 | ;\r | |
1127 | \r | |
1128 | \r | |
1129 | EFI_STATUS\r | |
1130 | EFIAPI\r | |
1131 | CoreRegisterProtocolNotify (\r | |
1132 | IN EFI_GUID *Protocol,\r | |
1133 | IN EFI_EVENT Event,\r | |
1134 | OUT VOID **Registration\r | |
1135 | )\r | |
1136 | /*++\r | |
1137 | \r | |
1138 | Routine Description:\r | |
1139 | \r | |
1140 | Add a new protocol notification record for the request protocol.\r | |
1141 | \r | |
1142 | Arguments:\r | |
1143 | \r | |
1144 | Protocol - The requested protocol to add the notify registration\r | |
1145 | \r | |
1146 | Event - The event to signal \r | |
1147 | \r | |
1148 | Registration - Returns the registration record\r | |
1149 | \r | |
1150 | \r | |
1151 | Returns:\r | |
1152 | \r | |
1153 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1154 | \r | |
1155 | EFI_SUCCESS - Successfully returned the registration record that has been added\r | |
1156 | \r | |
1157 | --*/\r | |
1158 | ;\r | |
1159 | \r | |
1160 | \r | |
1161 | EFI_STATUS\r | |
1162 | EFIAPI\r | |
1163 | CoreLocateHandle (\r | |
1164 | IN EFI_LOCATE_SEARCH_TYPE SearchType,\r | |
1165 | IN EFI_GUID *Protocol OPTIONAL,\r | |
1166 | IN VOID *SearchKey OPTIONAL,\r | |
1167 | IN OUT UINTN *BufferSize,\r | |
1168 | OUT EFI_HANDLE *Buffer\r | |
1169 | )\r | |
1170 | /*++\r | |
1171 | \r | |
1172 | Routine Description:\r | |
1173 | \r | |
1174 | Locates the requested handle(s) and returns them in Buffer.\r | |
1175 | \r | |
1176 | Arguments:\r | |
1177 | \r | |
1178 | SearchType - The type of search to perform to locate the handles\r | |
1179 | \r | |
1180 | Protocol - The protocol to search for\r | |
1181 | \r | |
1182 | SearchKey - Dependant on SearchType\r | |
1183 | \r | |
1184 | BufferSize - On input the size of Buffer. On output the \r | |
1185 | size of data returned. \r | |
1186 | \r | |
1187 | Buffer - The buffer to return the results in\r | |
1188 | \r | |
1189 | \r | |
1190 | Returns:\r | |
1191 | \r | |
1192 | EFI_BUFFER_TOO_SMALL - Buffer too small, required buffer size is returned in BufferSize.\r | |
1193 | \r | |
1194 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1195 | \r | |
1196 | EFI_SUCCESS - Successfully found the requested handle(s) and returns them in Buffer.\r | |
1197 | \r | |
1198 | --*/\r | |
1199 | ;\r | |
1200 | \r | |
1201 | \r | |
1202 | EFI_STATUS\r | |
1203 | EFIAPI\r | |
1204 | CoreLocateDevicePath (\r | |
1205 | IN EFI_GUID *Protocol,\r | |
1206 | IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r | |
1207 | OUT EFI_HANDLE *Device\r | |
1208 | )\r | |
1209 | /*++\r | |
1210 | \r | |
1211 | Routine Description:\r | |
1212 | \r | |
1213 | Locates the handle to a device on the device path that supports the specified protocol.\r | |
1214 | \r | |
1215 | Arguments:\r | |
1216 | \r | |
1217 | Protocol - The protocol to search for.\r | |
1218 | FilePath - On input, a pointer to a pointer to the device path. On output, the device\r | |
1219 | path pointer is modified to point to the remaining part of the devicepath.\r | |
1220 | Device - A pointer to the returned device handle. \r | |
1221 | \r | |
1222 | Returns:\r | |
1223 | \r | |
1224 | EFI_SUCCESS - The resulting handle was returned.\r | |
1225 | EFI_NOT_FOUND - No handles matched the search.\r | |
1226 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r | |
1227 | \r | |
1228 | --*/\r | |
1229 | ;\r | |
1230 | \r | |
1231 | \r | |
1232 | EFI_STATUS\r | |
1233 | EFIAPI\r | |
1234 | CoreLocateHandleBuffer (\r | |
1235 | IN EFI_LOCATE_SEARCH_TYPE SearchType,\r | |
1236 | IN EFI_GUID *Protocol OPTIONAL,\r | |
1237 | IN VOID *SearchKey OPTIONAL,\r | |
1238 | IN OUT UINTN *NumberHandles,\r | |
1239 | OUT EFI_HANDLE **Buffer\r | |
1240 | )\r | |
1241 | /*++\r | |
1242 | \r | |
1243 | Routine Description:\r | |
1244 | \r | |
1245 | Function returns an array of handles that support the requested protocol \r | |
1246 | in a buffer allocated from pool. This is a version of CoreLocateHandle()\r | |
1247 | that allocates a buffer for the caller.\r | |
1248 | \r | |
1249 | Arguments:\r | |
1250 | \r | |
1251 | SearchType - Specifies which handle(s) are to be returned.\r | |
1252 | Protocol - Provides the protocol to search by. \r | |
1253 | This parameter is only valid for SearchType ByProtocol.\r | |
1254 | SearchKey - Supplies the search key depending on the SearchType.\r | |
1255 | NumberHandles - The number of handles returned in Buffer.\r | |
1256 | Buffer - A pointer to the buffer to return the requested array of \r | |
1257 | handles that support Protocol.\r | |
1258 | \r | |
1259 | Returns:\r | |
1260 | \r | |
1261 | EFI_SUCCESS - The result array of handles was returned.\r | |
1262 | EFI_NOT_FOUND - No handles match the search. \r | |
1263 | EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the matching results.\r | |
1264 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1265 | \r | |
1266 | --*/\r | |
1267 | ;\r | |
1268 | \r | |
1269 | \r | |
1270 | EFI_STATUS\r | |
1271 | EFIAPI\r | |
1272 | CoreLocateProtocol (\r | |
1273 | IN EFI_GUID *Protocol,\r | |
1274 | IN VOID *Registration OPTIONAL,\r | |
1275 | OUT VOID **Interface\r | |
1276 | )\r | |
1277 | /*++\r | |
1278 | \r | |
1279 | Routine Description:\r | |
1280 | \r | |
1281 | Return the first Protocol Interface that matches the Protocol GUID. If\r | |
1282 | Registration is pasased in return a Protocol Instance that was just add\r | |
1283 | to the system. If Retistration is NULL return the first Protocol Interface\r | |
1284 | you find.\r | |
1285 | \r | |
1286 | Arguments:\r | |
1287 | \r | |
1288 | Protocol - The protocol to search for\r | |
1289 | \r | |
1290 | Registration - Optional Registration Key returned from RegisterProtocolNotify() \r | |
1291 | \r | |
1292 | Interface - Return the Protocol interface (instance).\r | |
1293 | \r | |
1294 | Returns:\r | |
1295 | \r | |
1296 | EFI_SUCCESS - If a valid Interface is returned\r | |
1297 | \r | |
1298 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1299 | \r | |
1300 | EFI_NOT_FOUND - Protocol interface not found\r | |
1301 | \r | |
1302 | --*/\r | |
1303 | ;\r | |
1304 | \r | |
1305 | UINT64\r | |
1306 | CoreGetHandleDatabaseKey (\r | |
1307 | VOID\r | |
1308 | )\r | |
1309 | /*++\r | |
1310 | \r | |
1311 | Routine Description:\r | |
1312 | \r | |
1313 | return handle database key.\r | |
1314 | \r | |
1315 | Arguments:\r | |
1316 | \r | |
1317 | None\r | |
1318 | \r | |
1319 | Returns:\r | |
1320 | \r | |
1321 | Handle database key.\r | |
1322 | \r | |
1323 | --*/\r | |
1324 | ;\r | |
1325 | \r | |
1326 | VOID\r | |
1327 | CoreConnectHandlesByKey (\r | |
1328 | UINT64 Key\r | |
1329 | )\r | |
1330 | /*++\r | |
1331 | \r | |
1332 | Routine Description:\r | |
1333 | \r | |
1334 | Go connect any handles that were created or modified while a image executed.\r | |
1335 | \r | |
1336 | Arguments:\r | |
1337 | \r | |
1338 | Key - The Key to show that the handle has been created/modified\r | |
1339 | \r | |
1340 | Returns:\r | |
1341 | \r | |
1342 | None\r | |
1343 | --*/\r | |
1344 | ;\r | |
1345 | \r | |
1346 | \r | |
1347 | EFI_STATUS \r | |
1348 | EFIAPI\r | |
1349 | CoreConnectController (\r | |
1350 | IN EFI_HANDLE ControllerHandle,\r | |
1351 | IN EFI_HANDLE *DriverImageHandle OPTIONAL,\r | |
1352 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r | |
1353 | IN BOOLEAN Recursive\r | |
1354 | )\r | |
1355 | /*++\r | |
1356 | \r | |
1357 | Routine Description:\r | |
1358 | \r | |
1359 | Connects one or more drivers to a controller.\r | |
1360 | \r | |
1361 | Arguments:\r | |
1362 | \r | |
1363 | ControllerHandle - Handle of the controller to be connected.\r | |
1364 | \r | |
1365 | DriverImageHandle - DriverImageHandle A pointer to an ordered list of driver image handles.\r | |
1366 | \r | |
1367 | RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child of the\r | |
1368 | controller specified by ControllerHandle.\r | |
1369 | \r | |
1370 | Recursive - - Whether the function would be called recursively or not.\r | |
1371 | \r | |
1372 | Returns:\r | |
1373 | \r | |
1374 | Status code.\r | |
1375 | \r | |
1376 | --*/\r | |
1377 | ;\r | |
1378 | \r | |
1379 | \r | |
1380 | EFI_STATUS \r | |
1381 | EFIAPI\r | |
1382 | CoreDisconnectController (\r | |
1383 | IN EFI_HANDLE ControllerHandle,\r | |
1384 | IN EFI_HANDLE DriverImageHandle OPTIONAL,\r | |
1385 | IN EFI_HANDLE ChildHandle OPTIONAL\r | |
1386 | )\r | |
1387 | /*++\r | |
1388 | \r | |
1389 | Routine Description:\r | |
1390 | \r | |
1391 | Disonnects a controller from a driver\r | |
1392 | \r | |
1393 | Arguments:\r | |
1394 | \r | |
1395 | ControllerHandle - ControllerHandle The handle of the controller from which driver(s) \r | |
1396 | are to be disconnected.\r | |
1397 | DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.\r | |
1398 | ChildHandle - ChildHandle The handle of the child to destroy.\r | |
1399 | \r | |
1400 | Returns:\r | |
1401 | \r | |
1402 | EFI_SUCCESS - One or more drivers were disconnected from the controller.\r | |
1403 | EFI_SUCCESS - On entry, no drivers are managing ControllerHandle.\r | |
1404 | EFI_SUCCESS - DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.\r | |
1405 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
1406 | EFI_INVALID_PARAMETER - DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.\r | |
1407 | EFI_INVALID_PARAMETER - ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r | |
1408 | EFI_OUT_OF_RESOURCES - There are not enough resources available to disconnect any drivers from ControllerHandle.\r | |
1409 | EFI_DEVICE_ERROR - The controller could not be disconnected because of a device error.\r | |
1410 | \r | |
1411 | --*/\r | |
1412 | ;\r | |
1413 | \r | |
1414 | \r | |
1415 | EFI_STATUS\r | |
1416 | EFIAPI\r | |
1417 | CoreAllocatePages (\r | |
1418 | IN EFI_ALLOCATE_TYPE Type,\r | |
1419 | IN EFI_MEMORY_TYPE MemoryType,\r | |
1420 | IN UINTN NumberOfPages,\r | |
1421 | IN OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
1422 | )\r | |
1423 | /*++\r | |
1424 | \r | |
1425 | Routine Description:\r | |
1426 | \r | |
1427 | Allocates pages from the memory map.\r | |
1428 | \r | |
1429 | Arguments:\r | |
1430 | \r | |
1431 | Type - The type of allocation to perform\r | |
1432 | \r | |
1433 | MemoryType - The type of memory to turn the allocated pages into\r | |
1434 | \r | |
1435 | NumberOfPages - The number of pages to allocate\r | |
1436 | \r | |
1437 | Memory - A pointer to receive the base allocated memory address\r | |
1438 | \r | |
1439 | Returns:\r | |
1440 | \r | |
1441 | Status. On success, Memory is filled in with the base address allocated\r | |
1442 | \r | |
1443 | EFI_INVALID_PARAMETER - Parameters violate checking rules defined in spec.\r | |
1444 | \r | |
1445 | EFI_NOT_FOUND - Could not allocate pages match the requirement.\r | |
1446 | \r | |
1447 | EFI_OUT_OF_RESOURCES - No enough pages to allocate.\r | |
1448 | \r | |
1449 | EFI_SUCCESS - Pages successfully allocated.\r | |
1450 | \r | |
1451 | --*/\r | |
1452 | ;\r | |
1453 | \r | |
1454 | \r | |
1455 | EFI_STATUS \r | |
1456 | EFIAPI\r | |
1457 | CoreFreePages (\r | |
1458 | IN EFI_PHYSICAL_ADDRESS Memory,\r | |
1459 | IN UINTN NumberOfPages\r | |
1460 | )\r | |
1461 | /*++\r | |
1462 | \r | |
1463 | Routine Description:\r | |
1464 | \r | |
1465 | Frees previous allocated pages.\r | |
1466 | \r | |
1467 | Arguments:\r | |
1468 | \r | |
1469 | Memory - Base address of memory being freed\r | |
1470 | \r | |
1471 | NumberOfPages - The number of pages to free\r | |
1472 | \r | |
1473 | Returns:\r | |
1474 | \r | |
1475 | EFI_NOT_FOUND - Could not find the entry that covers the range\r | |
1476 | \r | |
1477 | EFI_INVALID_PARAMETER - Address not aligned\r | |
1478 | \r | |
1479 | EFI_SUCCESS -Pages successfully freed.\r | |
1480 | \r | |
1481 | --*/\r | |
1482 | ;\r | |
1483 | \r | |
1484 | \r | |
1485 | EFI_STATUS\r | |
1486 | EFIAPI\r | |
1487 | CoreGetMemoryMap (\r | |
1488 | IN OUT UINTN *MemoryMapSize,\r | |
1489 | IN OUT EFI_MEMORY_DESCRIPTOR *Desc,\r | |
1490 | OUT UINTN *MapKey,\r | |
1491 | OUT UINTN *DescriptorSize,\r | |
1492 | OUT UINT32 *DescriptorVersion\r | |
1493 | )\r | |
1494 | /*++\r | |
1495 | \r | |
1496 | Routine Description:\r | |
1497 | \r | |
1498 | Returns the current memory map.\r | |
1499 | \r | |
1500 | Arguments:\r | |
1501 | \r | |
1502 | MemoryMapSize - On input the buffer size of MemoryMap allocated by caller\r | |
1503 | On output the required buffer size to contain the memory map \r | |
1504 | \r | |
1505 | Desc - The buffer to return the current memory map\r | |
1506 | \r | |
1507 | MapKey - The address to return the current map key\r | |
1508 | \r | |
1509 | DescriptorSize - The size in bytes for an individual EFI_MEMORY_DESCRIPTOR\r | |
1510 | \r | |
1511 | DescriptorVersion - The version number associated with the EFI_MEMORY_DESCRIPTOR\r | |
1512 | \r | |
1513 | Returns:\r | |
1514 | \r | |
1515 | EFI_SUCCESS The current memory map was returned successfully\r | |
1516 | \r | |
1517 | EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small\r | |
1518 | \r | |
1519 | EFI_INVALID_PARAMETER One of the parameters has an invalid value\r | |
1520 | \r | |
1521 | --*/\r | |
1522 | ;\r | |
1523 | \r | |
1524 | \r | |
1525 | EFI_STATUS\r | |
1526 | EFIAPI\r | |
1527 | CoreAllocatePool (\r | |
1528 | IN EFI_MEMORY_TYPE PoolType,\r | |
1529 | IN UINTN Size,\r | |
1530 | OUT VOID **Buffer\r | |
1531 | )\r | |
1532 | /*++\r | |
1533 | \r | |
1534 | Routine Description:\r | |
1535 | \r | |
1536 | Allocate pool of a particular type.\r | |
1537 | \r | |
1538 | Arguments:\r | |
1539 | \r | |
1540 | PoolType - Type of pool to allocate\r | |
1541 | \r | |
1542 | Size - The amount of pool to allocate\r | |
1543 | \r | |
1544 | Buffer - The address to return a pointer to the allocated pool\r | |
1545 | \r | |
1546 | Returns:\r | |
1547 | \r | |
1548 | EFI_INVALID_PARAMETER - PoolType not valid\r | |
1549 | \r | |
1550 | EFI_OUT_OF_RESOURCES - Size exceeds max pool size or allocation failed. \r | |
1551 | \r | |
1552 | EFI_SUCCESS - Pool successfully allocated.\r | |
1553 | \r | |
1554 | --*/\r | |
1555 | ;\r | |
1556 | \r | |
1557 | \r | |
1558 | EFI_STATUS\r | |
1559 | EFIAPI\r | |
1560 | CoreFreePool (\r | |
1561 | IN VOID *Buffer\r | |
1562 | )\r | |
1563 | /*++\r | |
1564 | \r | |
1565 | Routine Description:\r | |
1566 | \r | |
1567 | Frees pool.\r | |
1568 | \r | |
1569 | Arguments:\r | |
1570 | \r | |
1571 | Buffer - The allocated pool entry to free\r | |
1572 | \r | |
1573 | Returns:\r | |
1574 | \r | |
1575 | EFI_INVALID_PARAMETER - Buffer is not a valid value.\r | |
1576 | \r | |
1577 | EFI_SUCCESS - Pool successfully freed.\r | |
1578 | \r | |
1579 | --*/\r | |
1580 | ;\r | |
1581 | \r | |
1582 | \r | |
1583 | EFI_STATUS\r | |
1584 | EFIAPI\r | |
1585 | CoreLoadImage (\r | |
1586 | IN BOOLEAN BootPolicy,\r | |
1587 | IN EFI_HANDLE ParentImageHandle,\r | |
1588 | IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r | |
1589 | IN VOID *SourceBuffer OPTIONAL,\r | |
1590 | IN UINTN SourceSize,\r | |
1591 | OUT EFI_HANDLE *ImageHandle\r | |
1592 | )\r | |
1593 | /*++\r | |
1594 | \r | |
1595 | Routine Description:\r | |
1596 | \r | |
1597 | Loads an EFI image into memory and returns a handle to the image.\r | |
1598 | \r | |
1599 | Arguments:\r | |
1600 | \r | |
1601 | BootPolicy - If TRUE, indicates that the request originates from the boot manager,\r | |
1602 | and that the boot manager is attempting to load FilePath as a boot selection.\r | |
1603 | ParentImageHandle - The caller's image handle.\r | |
1604 | FilePath - The specific file path from which the image is loaded.\r | |
1605 | SourceBuffer - If not NULL, a pointer to the memory location containing a copy of \r | |
1606 | the image to be loaded.\r | |
1607 | SourceSize - The size in bytes of SourceBuffer.\r | |
1608 | ImageHandle - Pointer to the returned image handle that is created when the image \r | |
1609 | is successfully loaded.\r | |
1610 | \r | |
1611 | Returns:\r | |
1612 | \r | |
1613 | EFI_SUCCESS - The image was loaded into memory.\r | |
1614 | EFI_NOT_FOUND - The FilePath was not found.\r | |
1615 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r | |
1616 | EFI_UNSUPPORTED - The image type is not supported, or the device path cannot be \r | |
1617 | parsed to locate the proper protocol for loading the file.\r | |
1618 | EFI_OUT_OF_RESOURCES - Image was not loaded due to insufficient resources.\r | |
1619 | --*/\r | |
1620 | ;\r | |
1621 | \r | |
1622 | \r | |
1623 | EFI_STATUS\r | |
1624 | EFIAPI\r | |
1625 | CoreUnloadImage (\r | |
1626 | IN EFI_HANDLE ImageHandle\r | |
1627 | )\r | |
1628 | /*++\r | |
1629 | \r | |
1630 | Routine Description:\r | |
1631 | \r | |
1632 | Unload the specified image.\r | |
1633 | \r | |
1634 | Arguments:\r | |
1635 | \r | |
1636 | ImageHandle - The specified image handle.\r | |
1637 | \r | |
1638 | Returns:\r | |
1639 | \r | |
1640 | EFI_INVALID_PARAMETER - Image handle is NULL.\r | |
1641 | \r | |
1642 | EFI_UNSUPPORTED - Attempt to unload an unsupported image.\r | |
1643 | \r | |
1644 | EFI_SUCCESS - Image successfully unloaded.\r | |
1645 | \r | |
1646 | --*/\r | |
1647 | ;\r | |
1648 | \r | |
1649 | \r | |
1650 | EFI_STATUS\r | |
1651 | EFIAPI\r | |
1652 | CoreStartImage (\r | |
1653 | IN EFI_HANDLE ImageHandle,\r | |
1654 | OUT UINTN *ExitDataSize,\r | |
1655 | OUT CHAR16 **ExitData OPTIONAL\r | |
1656 | )\r | |
1657 | /*++\r | |
1658 | \r | |
1659 | Routine Description:\r | |
1660 | \r | |
1661 | Transfer control to a loaded image's entry point.\r | |
1662 | \r | |
1663 | Arguments:\r | |
1664 | \r | |
1665 | ImageHandle - Handle of image to be started.\r | |
1666 | \r | |
1667 | ExitDataSize - Pointer of the size to ExitData\r | |
1668 | \r | |
1669 | ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated\r | |
1670 | Unicode string, optionally followed by additional binary data. The string\r | |
1671 | is a description that the caller may use to further indicate the reason for\r | |
1672 |