]>
Commit | Line | Data |
---|---|---|
28a00297 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006 - 2007, 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 | |
ed7748fe | 26 | \r |
28a00297 | 27 | #include <PiDxe.h>\r |
28 | #include <FrameworkPei.h>\r | |
ed7748fe | 29 | \r |
28a00297 | 30 | #include <Protocol/LoadedImage.h>\r |
31 | #include <Protocol/GuidedSectionExtraction.h>\r | |
32 | #include <Protocol/SectionExtraction.h>\r | |
33 | #include <Guid/DebugImageInfoTable.h>\r | |
34 | #include <Protocol/DevicePath.h>\r | |
35 | #include <Protocol/Runtime.h>\r | |
36 | #include <Protocol/LoadFile.h>\r | |
37 | #include <Protocol/DriverBinding.h>\r | |
38 | #include <Protocol/VariableWrite.h>\r | |
39 | #include <Protocol/PlatformDriverOverride.h>\r | |
40 | #include <Protocol/Variable.h>\r | |
41 | #include <Guid/MemoryTypeInformation.h>\r | |
9767823f | 42 | #include <Guid/FirmwareFileSystem2.h>\r |
28a00297 | 43 | #include <Guid/HobList.h>\r |
44 | #include <Protocol/Timer.h>\r | |
45 | #include <Protocol/SimpleFileSystem.h>\r | |
46 | #include <Protocol/Bds.h>\r | |
47 | #include <Guid/FileInfo.h>\r | |
48 | #include <Protocol/RealTimeClock.h>\r | |
49 | #include <Guid/Apriori.h>\r | |
50 | #include <Protocol/WatchdogTimer.h>\r | |
51 | #include <Protocol/FirmwareVolume.h>\r | |
52 | #include <Protocol/MonotonicCounter.h>\r | |
53 | #include <Guid/DxeServices.h>\r | |
54 | #include <Guid/MemoryAllocationHob.h>\r | |
55 | #include <Protocol/StatusCode.h>\r | |
56 | #include <Protocol/CustomizedDecompress.h>\r | |
57 | #include <Protocol/Decompress.h>\r | |
58 | #include <Protocol/LoadPe32Image.h>\r | |
59 | #include <Protocol/FirmwareVolumeDispatch.h>\r | |
60 | #include <Protocol/Security.h>\r | |
61 | #include <Protocol/Ebc.h>\r | |
62 | #include <Guid/EventLegacyBios.h>\r | |
63 | #include <Protocol/Reset.h>\r | |
64 | #include <Protocol/EdkDecompress.h>\r | |
65 | #include <Protocol/Cpu.h>\r | |
66 | #include <Guid/EventGroup.h>\r | |
67 | #include <Protocol/Metronome.h>\r | |
68 | #include <Protocol/FirmwareVolumeBlock.h>\r | |
69 | #include <Protocol/Capsule.h>\r | |
70 | #include <Protocol/BusSpecificDriverOverride.h>\r | |
71 | #include <Protocol/Performance.h>\r | |
72 | #include <Guid/StatusCodeDataTypeId.h>\r | |
ed7748fe | 73 | \r |
28a00297 | 74 | #include <Library/DxeCoreEntryPoint.h>\r |
75 | #include <Library/DebugLib.h>\r | |
76 | #include <Library/UefiLib.h>\r | |
77 | #include <Library/BaseLib.h>\r | |
78 | #include <Library/HobLib.h>\r | |
79 | #include <Library/PerformanceLib.h>\r | |
80 | #include <Library/UefiDecompressLib.h>\r | |
81 | #include <Library/CustomDecompressLib.h>\r | |
82 | #include <Library/PeCoffLoaderLib.h>\r | |
83 | #include <Library/CacheMaintenanceLib.h>\r | |
84 | #include <Library/BaseMemoryLib.h>\r | |
85 | \r | |
86 | #include "DebugImageInfo.h"\r | |
87 | #include "Library.h"\r | |
88 | #include "FwVolBlock.h"\r | |
89 | #include "FwVolDriver.h"\r | |
90 | #include "gcd.h"\r | |
91 | #include "imem.h"\r | |
92 | #include "Image.h"\r | |
93 | #include "Exec.h"\r | |
94 | #include "hand.h"\r | |
95 | \r | |
96 | \r | |
97 | //\r | |
98 | // Modifier for EFI DXE Services\r | |
99 | //\r | |
100 | #define EFI_DXESERVICE\r | |
101 | \r | |
102 | //\r | |
103 | // attributes for reserved memory before it is promoted to system memory\r | |
104 | //\r | |
105 | #define EFI_MEMORY_PRESENT 0x0100000000000000ULL\r | |
106 | #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL\r | |
107 | #define EFI_MEMORY_TESTED 0x0400000000000000ULL\r | |
108 | \r | |
109 | //\r | |
110 | // range for memory mapped port I/O on IPF\r | |
111 | //\r | |
112 | #define EFI_MEMORY_PORT_IO 0x4000000000000000ULL\r | |
113 | \r | |
114 | \r | |
115 | ///\r | |
116 | /// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression\r | |
117 | /// to save time. A EFI_DEP_PUSH is evauated one an\r | |
118 | /// replaced with EFI_DEP_REPLACE_TRUE\r | |
119 | ///\r | |
120 | #define EFI_DEP_REPLACE_TRUE 0xff\r | |
121 | \r | |
122 | ///\r | |
123 | /// Define the initial size of the dependency expression evaluation stack\r | |
124 | ///\r | |
125 | #define DEPEX_STACK_SIZE_INCREMENT 0x1000\r | |
126 | \r | |
127 | typedef struct {\r | |
128 | EFI_GUID *ProtocolGuid;\r | |
129 | VOID **Protocol;\r | |
130 | EFI_EVENT Event;\r | |
131 | VOID *Registration;\r | |
132 | BOOLEAN Present;\r | |
133 | } ARCHITECTURAL_PROTOCOL_ENTRY;\r | |
134 | \r | |
135 | \r | |
136 | //\r | |
137 | // DXE Dispatcher Data structures\r | |
138 | //\r | |
139 | \r | |
140 | #define KNOWN_HANDLE_SIGNATURE EFI_SIGNATURE_32('k','n','o','w')\r | |
141 | typedef struct {\r | |
142 | UINTN Signature;\r | |
143 | LIST_ENTRY Link; // mFvHandleList \r | |
144 | EFI_HANDLE Handle;\r | |
145 | } KNOWN_HANDLE;\r | |
146 | \r | |
147 | \r | |
148 | #define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')\r | |
149 | typedef struct {\r | |
150 | UINTN Signature;\r | |
151 | LIST_ENTRY Link; // mDriverList\r | |
152 | \r | |
153 | LIST_ENTRY ScheduledLink; // mScheduledQueue\r | |
154 | \r | |
155 | EFI_HANDLE FvHandle;\r | |
156 | EFI_GUID FileName;\r | |
157 | EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r | |
158 | EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;\r | |
159 | \r | |
160 | VOID *Depex;\r | |
161 | UINTN DepexSize;\r | |
162 | \r | |
163 | BOOLEAN Before;\r | |
164 | BOOLEAN After;\r | |
165 | EFI_GUID BeforeAfterGuid;\r | |
166 | \r | |
167 | BOOLEAN Dependent;\r | |
168 | BOOLEAN Unrequested;\r | |
169 | BOOLEAN Scheduled;\r | |
170 | BOOLEAN Untrusted;\r | |
171 | BOOLEAN Initialized;\r | |
172 | BOOLEAN DepexProtocolError;\r | |
173 | \r | |
174 | EFI_HANDLE ImageHandle;\r | |
175 | \r | |
176 | } EFI_CORE_DRIVER_ENTRY;\r | |
177 | \r | |
178 | //\r | |
179 | //The data structure of GCD memory map entry\r | |
180 | //\r | |
181 | #define EFI_GCD_MAP_SIGNATURE EFI_SIGNATURE_32('g','c','d','m')\r | |
182 | typedef struct {\r | |
183 | UINTN Signature;\r | |
184 | LIST_ENTRY Link;\r | |
185 | EFI_PHYSICAL_ADDRESS BaseAddress;\r | |
186 | UINT64 EndAddress;\r | |
187 | UINT64 Capabilities;\r | |
188 | UINT64 Attributes;\r | |
189 | EFI_GCD_MEMORY_TYPE GcdMemoryType;\r | |
190 | EFI_GCD_IO_TYPE GcdIoType;\r | |
191 | EFI_HANDLE ImageHandle;\r | |
192 | EFI_HANDLE DeviceHandle;\r | |
193 | } EFI_GCD_MAP_ENTRY;\r | |
194 | \r | |
195 | //\r | |
196 | // DXE Core Global Variables\r | |
197 | //\r | |
198 | extern EFI_SYSTEM_TABLE *gDxeCoreST;\r | |
199 | extern EFI_BOOT_SERVICES *gDxeCoreBS;\r | |
200 | extern EFI_RUNTIME_SERVICES *gDxeCoreRT;\r | |
201 | extern EFI_DXE_SERVICES *gDxeCoreDS;\r | |
202 | extern EFI_HANDLE gDxeCoreImageHandle;\r | |
203 | \r | |
204 | extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r | |
205 | extern EFI_PEI_PE_COFF_LOADER_PROTOCOL *gEfiPeiPeCoffLoader;\r | |
206 | \r | |
207 | extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;\r | |
208 | extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r | |
209 | extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;\r | |
210 | extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;\r | |
211 | extern EFI_TIMER_ARCH_PROTOCOL *gTimer;\r | |
212 | extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;\r | |
213 | extern EFI_BDS_ARCH_PROTOCOL *gBds;\r | |
214 | extern EFI_STATUS_CODE_PROTOCOL *gStatusCode;\r | |
215 | \r | |
216 | extern EFI_TPL gEfiCurrentTpl;\r | |
217 | \r | |
218 | extern EFI_GUID *gDxeCoreFileName;\r | |
219 | extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;\r | |
220 | \r | |
221 | extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];\r | |
222 | \r | |
223 | extern BOOLEAN gDispatcherRunning;\r | |
224 | extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate;\r | |
225 | \r | |
226 | //\r | |
227 | // Service Initialization Functions\r | |
228 | //\r | |
229 | \r | |
230 | \r | |
231 | VOID\r | |
232 | CoreInitializePool (\r | |
233 | VOID\r | |
234 | )\r | |
235 | /*++\r | |
236 | \r | |
237 | Routine Description:\r | |
238 | \r | |
239 | Called to initialize the pool.\r | |
240 | \r | |
241 | Arguments:\r | |
242 | \r | |
243 | None\r | |
244 | \r | |
245 | Returns:\r | |
246 | \r | |
247 | None\r | |
248 | \r | |
249 | --*/\r | |
250 | ;\r | |
251 | \r | |
252 | VOID\r | |
253 | CoreAddMemoryDescriptor (\r | |
254 | IN EFI_MEMORY_TYPE Type,\r | |
255 | IN EFI_PHYSICAL_ADDRESS Start,\r | |
256 | IN UINT64 NumberOfPages,\r | |
257 | IN UINT64 Attribute\r | |
258 | )\r | |
259 | /*++\r | |
260 | \r | |
261 | Routine Description:\r | |
262 | \r | |
263 | Called to initialize the memory map and add descriptors to\r | |
264 | the current descriptor list.\r | |
265 | \r | |
266 | The first descriptor that is added must be general usable\r | |
267 | memory as the addition allocates heap.\r | |
268 | \r | |
269 | Arguments:\r | |
270 | \r | |
271 | Type - The type of memory to add\r | |
272 | \r | |
273 | Start - The starting address in the memory range\r | |
274 | Must be page aligned\r | |
275 | \r | |
276 | NumberOfPages - The number of pages in the range\r | |
277 | \r | |
278 | Attribute - Attributes of the memory to add\r | |
279 | \r | |
280 | Returns:\r | |
281 | \r | |
282 | None. The range is added to the memory map\r | |
283 | \r | |
284 | --*/\r | |
285 | ;\r | |
286 | \r | |
287 | VOID\r | |
288 | CoreReleaseGcdMemoryLock (\r | |
289 | VOID\r | |
290 | )\r | |
291 | /*++\r | |
292 | \r | |
293 | Routine Description:\r | |
294 | Release memory lock on mGcdMemorySpaceLock\r | |
295 | \r | |
296 | Arguments:\r | |
297 | None\r | |
298 | \r | |
299 | Returns:\r | |
300 | None\r | |
301 | \r | |
302 | --*/\r | |
303 | ;\r | |
304 | \r | |
305 | VOID\r | |
306 | CoreAcquireGcdMemoryLock (\r | |
307 | VOID\r | |
308 | )\r | |
309 | /*++\r | |
310 | \r | |
311 | Routine Description:\r | |
312 | Acquire memory lock on mGcdMemorySpaceLock\r | |
313 | \r | |
314 | Arguments:\r | |
315 | None\r | |
316 | \r | |
317 | Returns:\r | |
318 | None\r | |
319 | \r | |
320 | --*/\r | |
321 | ;\r | |
322 | \r | |
323 | EFI_STATUS\r | |
324 | CoreInitializeMemoryServices (\r | |
325 | IN VOID **HobStart,\r | |
326 | IN EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,\r | |
327 | IN UINT64 *MemoryLength\r | |
328 | )\r | |
329 | /*++\r | |
330 | \r | |
331 | Routine Description:\r | |
332 | \r | |
333 | External function. Initializes the GCD and memory services based on the memory \r | |
334 | descriptor HOBs. This function is responsible for priming the GCD map and the\r | |
335 | memory map, so memory allocations and resource allocations can be made. The first\r | |
336 | part of this function can not depend on any memory services until at least one\r | |
337 | memory descriptor is provided to the memory services. Then the memory services\r | |
338 | can be used to intialize the GCD map.\r | |
339 | \r | |
340 | Arguments:\r | |
341 | \r | |
342 | HobStart - The start address of the HOB.\r | |
343 | \r | |
344 | MemoryBaseAddress - Start address of memory region found to init DXE core.\r | |
345 | \r | |
346 | MemoryLength - Length of memory region found to init DXE core.\r | |
347 | \r | |
348 | Returns:\r | |
349 | \r | |
350 | EFI_SUCCESS - Memory services successfully initialized.\r | |
351 | \r | |
352 | --*/\r | |
353 | ;\r | |
354 | \r | |
355 | \r | |
356 | EFI_STATUS\r | |
357 | CoreInitializeGcdServices (\r | |
358 | IN VOID **HobStart,\r | |
359 | IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,\r | |
360 | IN UINT64 MemoryLength\r | |
361 | )\r | |
362 | /*++\r | |
363 | \r | |
364 | Routine Description:\r | |
365 | \r | |
366 | External function. Initializes the GCD and memory services based on the memory \r | |
367 | descriptor HOBs. This function is responsible for priming the GCD map and the\r | |
368 | memory map, so memory allocations and resource allocations can be made. The first\r | |
369 | part of this function can not depend on any memory services until at least one\r | |
370 | memory descriptor is provided to the memory services. Then the memory services\r | |
371 | can be used to intialize the GCD map.\r | |
372 | \r | |
373 | Arguments:\r | |
374 | \r | |
375 | HobStart - The start address of the HOB\r | |
376 | \r | |
377 | MemoryBaseAddress - Start address of memory region found to init DXE core.\r | |
378 | \r | |
379 | MemoryLength - Length of memory region found to init DXE core.\r | |
380 | \r | |
381 | \r | |
382 | Returns:\r | |
383 | \r | |
384 | EFI_SUCCESS - GCD services successfully initialized.\r | |
385 | \r | |
386 | --*/\r | |
387 | ;\r | |
388 | \r | |
389 | EFI_STATUS\r | |
390 | CoreInitializeEventServices (\r | |
391 | VOID\r | |
392 | )\r | |
393 | /*++\r | |
394 | \r | |
395 | Routine Description:\r | |
396 | \r | |
397 | Initializes "event" support and populates parts of the System and Runtime Table.\r | |
398 | \r | |
399 | Arguments:\r | |
400 | \r | |
401 | None\r | |
402 | \r | |
403 | Returns:\r | |
404 | \r | |
405 | EFI_SUCCESS - Always return success\r | |
406 | \r | |
407 | --*/\r | |
408 | ;\r | |
409 | \r | |
410 | EFI_STATUS\r | |
411 | CoreInitializeImageServices (\r | |
412 | IN VOID *HobStart\r | |
413 | )\r | |
414 | /*++\r | |
415 | \r | |
416 | Routine Description:\r | |
417 | \r | |
418 | Add the Image Services to EFI Boot Services Table and install the protocol\r | |
419 | interfaces for this image.\r | |
420 | \r | |
421 | Arguments:\r | |
422 | \r | |
423 | HobStart - The HOB to initialize\r | |
424 | \r | |
425 | Returns:\r | |
426 | \r | |
427 | Status code.\r | |
428 | \r | |
429 | --*/\r | |
430 | ;\r | |
431 | \r | |
432 | VOID\r | |
433 | CoreNotifyOnArchProtocolInstallation (\r | |
434 | VOID\r | |
435 | )\r | |
436 | /*++\r | |
437 | \r | |
438 | Routine Description:\r | |
439 | Creates an event that is fired everytime a Protocol of a specific type is installed\r | |
440 | \r | |
441 | Arguments:\r | |
442 | NONE\r | |
443 | \r | |
444 | Returns:\r | |
445 | NONE\r | |
446 | \r | |
447 | --*/\r | |
448 | ;\r | |
449 | \r | |
450 | EFI_STATUS\r | |
451 | CoreAllEfiServicesAvailable (\r | |
452 | VOID\r | |
453 | )\r | |
454 | /*++\r | |
455 | \r | |
456 | Routine Description:\r | |
457 | Return TRUE if all AP services are availible.\r | |
458 | \r | |
459 | Arguments:\r | |
460 | NONE\r | |
461 | \r | |
462 | Returns:\r | |
463 | EFI_SUCCESS - All AP services are available\r | |
464 | EFI_NOT_FOUND - At least one AP service is not available \r | |
465 | \r | |
466 | --*/\r | |
467 | ;\r | |
468 | \r | |
469 | VOID\r | |
470 | CalculateEfiHdrCrc (\r | |
471 | IN OUT EFI_TABLE_HEADER *Hdr\r | |
472 | )\r | |
473 | /*++\r | |
474 | \r | |
475 | Routine Description:\r | |
476 | \r | |
477 | Calcualte the 32-bit CRC in a EFI table using the service provided by the\r | |
478 | gRuntime service.\r | |
479 | \r | |
480 | Arguments:\r | |
481 | \r | |
482 | Hdr - Pointer to an EFI standard header\r | |
483 | \r | |
484 | Returns:\r | |
485 | \r | |
486 | None\r | |
487 | \r | |
488 | --*/\r | |
489 | ;\r | |
490 | \r | |
491 | VOID\r | |
492 | EFIAPI\r | |
493 | CoreTimerTick (\r | |
494 | IN UINT64 Duration\r | |
495 | )\r | |
496 | /*++\r | |
497 | \r | |
498 | Routine Description:\r | |
499 | \r | |
500 | Called by the platform code to process a tick.\r | |
501 | \r | |
502 | Arguments:\r | |
503 | \r | |
504 | Duration - The number of 100ns elasped since the last call to TimerTick\r | |
505 | \r | |
506 | Returns:\r | |
507 | \r | |
508 | None\r | |
509 | \r | |
510 | --*/\r | |
511 | ;\r | |
512 | \r | |
513 | VOID\r | |
514 | CoreInitializeDispatcher (\r | |
515 | VOID\r | |
516 | )\r | |
517 | /*++\r | |
518 | \r | |
519 | Routine Description:\r | |
520 | \r | |
521 | Initialize the dispatcher. Initialize the notification function that runs when\r | |
522 | a FV protocol is added to the system.\r | |
523 | \r | |
524 | Arguments:\r | |
525 | \r | |
526 | NONE\r | |
527 | \r | |
528 | Returns:\r | |
529 | \r | |
530 | NONE \r | |
531 | \r | |
532 | --*/\r | |
533 | ;\r | |
534 | \r | |
535 | BOOLEAN\r | |
536 | CoreIsSchedulable (\r | |
537 | IN EFI_CORE_DRIVER_ENTRY *DriverEntry \r | |
538 | )\r | |
539 | /*++\r | |
540 | \r | |
541 | Routine Description:\r | |
542 | \r | |
543 | This is the POSTFIX version of the dependency evaluator. This code does \r | |
544 | not need to handle Before or After, as it is not valid to call this \r | |
545 | routine in this case. The SOR is just ignored and is a nop in the grammer.\r | |
546 | \r | |
547 | POSTFIX means all the math is done on top of the stack.\r | |
548 | \r | |
549 | Arguments:\r | |
550 | \r | |
551 | DriverEntry - DriverEntry element to update\r | |
552 | \r | |
553 | Returns:\r | |
554 | \r | |
555 | TRUE - If driver is ready to run.\r | |
556 | \r | |
557 | FALSE - If driver is not ready to run or some fatal error was found.\r | |
558 | \r | |
559 | --*/\r | |
560 | ;\r | |
561 | \r | |
562 | EFI_STATUS\r | |
563 | CorePreProcessDepex (\r | |
564 | IN EFI_CORE_DRIVER_ENTRY *DriverEntry \r | |
565 | )\r | |
566 | /*++\r | |
567 | \r | |
568 | Routine Description:\r | |
569 | \r | |
570 | Preprocess dependency expression and update DriverEntry to reflect the\r | |
571 | state of Before, After, and SOR dependencies. If DriverEntry->Before\r | |
572 | or DriverEntry->After is set it will never be cleared. If SOR is set\r | |
573 | it will be cleared by CoreSchedule(), and then the driver can be \r | |
574 | dispatched.\r | |
575 | \r | |
576 | Arguments:\r | |
577 | \r | |
578 | DriverEntry - DriverEntry element to update\r | |
579 | \r | |
580 | Returns:\r | |
581 | \r | |
582 | EFI_SUCCESS - It always works.\r | |
583 | \r | |
584 | --*/\r | |
585 | ;\r | |
586 | \r | |
587 | \r | |
588 | EFI_STATUS\r | |
589 | EFIAPI\r | |
590 | CoreExitBootServices (\r | |
591 | IN EFI_HANDLE ImageHandle,\r | |
592 | IN UINTN MapKey\r | |
593 | )\r | |
594 | /*++\r | |
595 | \r | |
596 | Routine Description:\r | |
597 | \r | |
598 | EFI 1.0 API to terminate Boot Services\r | |
599 | \r | |
600 | Arguments:\r | |
601 | \r | |
602 | ImageHandle - Handle that represents the identity of the calling image\r | |
603 | \r | |
604 | MapKey -Key to the latest memory map.\r | |
605 | \r | |
606 | Returns:\r | |
607 | \r | |
608 | EFI_SUCCESS - Boot Services terminated\r | |
609 | EFI_INVALID_PARAMETER - MapKey is incorrect.\r | |
610 | \r | |
611 | --*/\r | |
612 | ;\r | |
613 | \r | |
614 | EFI_STATUS\r | |
615 | CoreTerminateMemoryMap (\r | |
616 | IN UINTN MapKey\r | |
617 | )\r | |
618 | /*++\r | |
619 | \r | |
620 | Routine Description:\r | |
621 | \r | |
622 | Make sure the memory map is following all the construction rules, \r | |
623 | it is the last time to check memory map error before exit boot services.\r | |
624 | \r | |
625 | Arguments:\r | |
626 | \r | |
627 | MapKey - Memory map key\r | |
628 | \r | |
629 | Returns:\r | |
630 | \r | |
631 | EFI_INVALID_PARAMETER - Memory map not consistent with construction rules.\r | |
632 | \r | |
633 | EFI_SUCCESS - Valid memory map.\r | |
634 | \r | |
635 | --*/\r | |
636 | ;\r | |
637 | \r | |
638 | VOID\r | |
639 | CoreNotifySignalList (\r | |
640 | IN EFI_GUID *EventGroup\r | |
641 | )\r | |
642 | /*++\r | |
643 | \r | |
644 | Routine Description:\r | |
645 | \r | |
646 | Signals all events on the requested list\r | |
647 | \r | |
648 | Arguments:\r | |
649 | \r | |
650 | SignalType - The list to signal\r | |
651 | \r | |
652 | Returns:\r | |
653 | \r | |
654 | None\r | |
655 | \r | |
656 | --*/\r | |
657 | ;\r | |
658 | \r | |
659 | \r | |
660 | EFI_STATUS\r | |
661 | EFIAPI\r | |
662 | CoreInstallConfigurationTable (\r | |
663 | IN EFI_GUID *Guid,\r | |
664 | IN VOID *Table\r | |
665 | )\r | |
666 | /*++\r | |
667 | \r | |
668 | Routine Description:\r | |
669 | \r | |
670 | Boot Service called to add, modify, or remove a system configuration table from \r | |
671 | the EFI System Table.\r | |
672 | \r | |
673 | Arguments:\r | |
674 | \r | |
675 | Guid: Pointer to the GUID for the entry to add, update, or remove\r | |
676 | Table: Pointer to the configuration table for the entry to add, update, or\r | |
677 | remove, may be NULL.\r | |
678 | \r | |
679 | Returns:\r | |
680 | \r | |
681 | EFI_SUCCESS Guid, Table pair added, updated, or removed.\r | |
682 | EFI_INVALID_PARAMETER Input GUID not valid.\r | |
683 | EFI_NOT_FOUND Attempted to delete non-existant entry\r | |
684 | EFI_OUT_OF_RESOURCES Not enough memory available\r | |
685 | \r | |
686 | --*/\r | |
687 | ;\r | |
688 | \r | |
689 | \r | |
690 | EFI_TPL\r | |
691 | EFIAPI\r | |
692 | CoreRaiseTpl (\r | |
693 | IN EFI_TPL NewTpl\r | |
694 | )\r | |
695 | /*++\r | |
696 | \r | |
697 | Routine Description:\r | |
698 | \r | |
699 | Raise the task priority level to the new level.\r | |
700 | High level is implemented by disabling processor interrupts.\r | |
701 | \r | |
702 | Arguments:\r | |
703 | \r | |
704 | NewTpl - New task priority level\r | |
705 | \r | |
706 | Returns:\r | |
707 | \r | |
708 | The previous task priority level\r | |
709 | \r | |
710 | --*/\r | |
711 | ;\r | |
712 | \r | |
713 | \r | |
714 | VOID\r | |
715 | EFIAPI\r | |
716 | CoreRestoreTpl (\r | |
717 | IN EFI_TPL NewTpl\r | |
718 | )\r | |
719 | /*++\r | |
720 | \r | |
721 | Routine Description:\r | |
722 | \r | |
723 | Lowers the task priority to the previous value. If the new \r | |
724 | priority unmasks events at a higher priority, they are dispatched.\r | |
725 | \r | |
726 | Arguments:\r | |
727 | \r | |
728 | NewTpl - New, lower, task priority\r | |
729 | \r | |
730 | Returns:\r | |
731 | \r | |
732 | None\r | |
733 | \r | |
734 | --*/\r | |
735 | ;\r | |
736 | \r | |
737 | \r | |
738 | EFI_STATUS\r | |
739 | EFIAPI\r | |
740 | CoreStall (\r | |
741 | IN UINTN Microseconds\r | |
742 | )\r | |
743 | /*++\r | |
744 | \r | |
745 | Routine Description:\r | |
746 | \r | |
747 | Introduces a fine-grained stall.\r | |
748 | \r | |
749 | Arguments:\r | |
750 | \r | |
751 | Microseconds The number of microseconds to stall execution\r | |
752 | \r | |
753 | Returns:\r | |
754 | \r | |
755 | EFI_SUCCESS - Execution was stalled for at least the requested amount\r | |
756 | of microseconds.\r | |
757 | \r | |
758 | EFI_NOT_AVAILABLE_YET - gMetronome is not available yet\r | |
759 | \r | |
760 | --*/\r | |
761 | ;\r | |
762 | \r | |
763 | \r | |
764 | EFI_STATUS\r | |
765 | EFIAPI\r | |
766 | CoreSetWatchdogTimer (\r | |
767 | IN UINTN Timeout,\r | |
768 | IN UINT64 WatchdogCode,\r | |
769 | IN UINTN DataSize,\r | |
770 | IN CHAR16 *WatchdogData OPTIONAL\r | |
771 | )\r | |
772 | /*++\r | |
773 | \r | |
774 | Routine Description:\r | |
775 | \r | |
776 | Sets the system's watchdog timer.\r | |
777 | \r | |
778 | Arguments:\r | |
779 | \r | |
780 | Timeout The number of seconds. Zero disables the timer.\r | |
781 | \r | |
782 | ///////following three parameters are left for platform specific using \r | |
783 | \r | |
784 | WatchdogCode The numberic code to log. 0x0 to 0xffff are firmware\r | |
785 | DataSize Size of the optional data\r | |
786 | WatchdogData Optional Null terminated unicode string followed by binary \r | |
787 | data.\r | |
788 | \r | |
789 | Returns:\r | |
790 | \r | |
791 | EFI_SUCCESS Timeout has been set\r | |
792 | EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet \r | |
793 | EFI_UNSUPPORTED System does not have a timer (currently not used)\r | |
794 | EFI_DEVICE_ERROR Could not complete due to hardware error\r | |
795 | \r | |
796 | --*/\r | |
797 | ;\r | |
798 | \r | |
799 | \r | |
800 | EFI_STATUS\r | |
801 | EFIAPI\r | |
802 | CoreInstallProtocolInterface (\r | |
803 | IN OUT EFI_HANDLE *UserHandle,\r | |
804 | IN EFI_GUID *Protocol,\r | |
805 | IN EFI_INTERFACE_TYPE InterfaceType,\r | |
806 | IN VOID *Interface\r | |
807 | )\r | |
808 | /*++\r | |
809 | \r | |
810 | Routine Description:\r | |
811 | \r | |
812 | Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r | |
813 | Calls the private one which contains a BOOLEAN parameter for notifications\r | |
814 | \r | |
815 | Arguments:\r | |
816 | \r | |
817 | UserHandle - The handle to install the protocol handler on,\r | |
818 | or NULL if a new handle is to be allocated\r | |
819 | \r | |
820 | Protocol - The protocol to add to the handle\r | |
821 | \r | |
822 | InterfaceType - Indicates whether Interface is supplied in native form.\r | |
823 | \r | |
824 | Interface - The interface for the protocol being added\r | |
825 | \r | |
826 | Returns:\r | |
827 | \r | |
828 | Status code \r | |
829 | \r | |
830 | --*/\r | |
831 | ;\r | |
832 | \r | |
833 | EFI_STATUS\r | |
834 | CoreInstallProtocolInterfaceNotify (\r | |
835 | IN OUT EFI_HANDLE *UserHandle,\r | |
836 | IN EFI_GUID *Protocol,\r | |
837 | IN EFI_INTERFACE_TYPE InterfaceType,\r | |
838 | IN VOID *Interface,\r | |
839 | IN BOOLEAN Notify\r | |
840 | )\r | |
841 | /*++\r | |
842 | \r | |
843 | Routine Description:\r | |
844 | \r | |
845 | Installs a protocol interface into the boot services environment.\r | |
846 | \r | |
847 | Arguments:\r | |
848 | \r | |
849 | UserHandle - The handle to install the protocol handler on,\r | |
850 | or NULL if a new handle is to be allocated\r | |
851 | \r | |
852 | Protocol - The protocol to add to the handle\r | |
853 | \r | |
854 | InterfaceType - Indicates whether Interface is supplied in native form.\r | |
855 | \r | |
856 | Interface - The interface for the protocol being added\r | |
857 | \r | |
858 | Notify - Whether to notify the notification list for this protocol \r | |
859 | \r | |
860 | Returns:\r | |
861 | \r | |
862 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
863 | \r | |
864 | EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r | |
865 | \r | |
866 | EFI_SUCCESS - Protocol interface successfully installed\r | |
867 | \r | |
868 | --*/\r | |
869 | ;\r | |
870 | \r | |
871 | \r | |
872 | EFI_STATUS\r | |
873 | EFIAPI\r | |
874 | CoreInstallMultipleProtocolInterfaces (\r | |
875 | IN OUT EFI_HANDLE *Handle,\r | |
876 | ...\r | |
877 | )\r | |
878 | /*++\r | |
879 | \r | |
880 | Routine Description:\r | |
881 | \r | |
882 | Installs a list of protocol interface into the boot services environment.\r | |
883 | This function calls InstallProtocolInterface() in a loop. If any error\r | |
884 | occures all the protocols added by this function are removed. This is \r | |
885 | basically a lib function to save space.\r | |
886 | \r | |
887 | Arguments:\r | |
888 | \r | |
889 | Handle - The handle to install the protocol handlers on,\r | |
890 | or NULL if a new handle is to be allocated\r | |
891 | ... - EFI_GUID followed by protocol instance. A NULL terminates the \r | |
892 | list. The pairs are the arguments to InstallProtocolInterface().\r | |
893 | All the protocols are added to Handle.\r | |
894 | \r | |
895 | Returns:\r | |
896 | \r | |
897 | EFI_INVALID_PARAMETER - Handle is NULL.\r | |
898 | \r | |
899 | EFI_SUCCESS - Protocol interfaces successfully installed.\r | |
900 | \r | |
901 | --*/\r | |
902 | ;\r | |
903 | \r | |
904 | \r | |
905 | EFI_STATUS\r | |
906 | EFIAPI\r | |
907 | CoreUninstallMultipleProtocolInterfaces (\r | |
908 | IN EFI_HANDLE Handle,\r | |
909 | ...\r | |
910 | )\r | |
911 | /*++\r | |
912 | \r | |
913 | Routine Description:\r | |
914 | \r | |
915 | Uninstalls a list of protocol interface in the boot services environment. \r | |
916 | This function calls UnisatllProtocolInterface() in a loop. This is \r | |
917 | basically a lib function to save space.\r | |
918 | \r | |
919 | Arguments:\r | |
920 | \r | |
921 | Handle - The handle to uninstall the protocol\r | |
922 | \r | |
923 | ... - EFI_GUID followed by protocol instance. A NULL terminates the \r | |
924 | list. The pairs are the arguments to UninstallProtocolInterface().\r | |
925 | All the protocols are added to Handle.\r | |
926 | \r | |
927 | Returns:\r | |
928 | \r | |
929 | Status code \r | |
930 | \r | |
931 | --*/\r | |
932 | ;\r | |
933 | \r | |
934 | \r | |
935 | EFI_STATUS\r | |
936 | EFIAPI\r | |
937 | CoreReinstallProtocolInterface (\r | |
938 | IN EFI_HANDLE UserHandle,\r | |
939 | IN EFI_GUID *Protocol,\r | |
940 | IN VOID *OldInterface,\r | |
941 | IN VOID *NewInterface\r | |
942 | )\r | |
943 | /*++\r | |
944 | \r | |
945 | Routine Description:\r | |
946 | \r | |
947 | Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.\r | |
948 | \r | |
949 | Arguments:\r | |
950 | \r | |
951 | UserHandle - Handle on which the interface is to be reinstalled\r | |
952 | Protocol - The numeric ID of the interface\r | |
953 | OldInterface - A pointer to the old interface\r | |
954 | NewInterface - A pointer to the new interface \r | |
955 | \r | |
956 | \r | |
957 | Returns:\r | |
958 | \r | |
959 | Status code.\r | |
960 | \r | |
961 | On EFI_SUCCESS The protocol interface was installed\r | |
962 | On EFI_NOT_FOUND The OldInterface on the handle was not found\r | |
963 | On EFI_INVALID_PARAMETER One of the parameters has an invalid value\r | |
964 | \r | |
965 | --*/\r | |
966 | ;\r | |
967 | \r | |
968 | \r | |
969 | EFI_STATUS\r | |
970 | EFIAPI\r | |
971 | CoreUninstallProtocolInterface (\r | |
972 | IN EFI_HANDLE UserHandle,\r | |
973 | IN EFI_GUID *Protocol,\r | |
974 | IN VOID *Interface\r | |
975 | )\r | |
976 | /*++\r | |
977 | \r | |
978 | Routine Description:\r | |
979 | \r | |
980 | Uninstalls all instances of a protocol:interfacer from a handle. \r | |
981 | If the last protocol interface is remove from the handle, the \r | |
982 | handle is freed.\r | |
983 | \r | |
984 | Arguments:\r | |
985 | \r | |
986 | UserHandle - The handle to remove the protocol handler from\r | |
987 | \r | |
988 | Protocol - The protocol, of protocol:interface, to remove\r | |
989 | \r | |
990 | Interface - The interface, of protocol:interface, to remove\r | |
991 | \r | |
992 | Returns:\r | |
993 | \r | |
994 | EFI_INVALID_PARAMETER - Protocol is NULL.\r | |
995 | \r | |
996 | EFI_SUCCESS - Protocol interface successfully uninstalled.\r | |
997 | \r | |
998 | --*/\r | |
999 | ;\r | |
1000 | \r | |
1001 | \r | |
1002 | EFI_STATUS\r | |
1003 | EFIAPI\r | |
1004 | CoreHandleProtocol (\r | |
1005 | IN EFI_HANDLE UserHandle,\r | |
1006 | IN EFI_GUID *Protocol,\r | |
1007 | OUT VOID **Interface\r | |
1008 | )\r | |
1009 | /*++\r | |
1010 | \r | |
1011 | Routine Description:\r | |
1012 | \r | |
1013 | Queries a handle to determine if it supports a specified protocol.\r | |
1014 | \r | |
1015 | Arguments:\r | |
1016 | \r | |
1017 | UserHandle - The handle being queried.\r | |
1018 | \r | |
1019 | Protocol - The published unique identifier of the protocol.\r | |
1020 | \r | |
1021 | Interface - Supplies the address where a pointer to the corresponding Protocol\r | |
1022 | Interface is returned.\r | |
1023 | \r | |
1024 | Returns:\r | |
1025 | \r | |
1026 | The requested protocol interface for the handle\r | |
1027 | \r | |
1028 | --*/ \r | |
1029 | ;\r | |
1030 | \r | |
1031 | \r | |
1032 | EFI_STATUS\r | |
1033 | EFIAPI\r | |
1034 | CoreOpenProtocol (\r | |
1035 | IN EFI_HANDLE UserHandle,\r | |
1036 | IN EFI_GUID *Protocol,\r | |
1037 | OUT VOID **Interface OPTIONAL,\r | |
1038 | IN EFI_HANDLE ImageHandle,\r | |
1039 | IN EFI_HANDLE ControllerHandle,\r | |
1040 | IN UINT32 Attributes\r | |
1041 | )\r | |
1042 | /*++\r | |
1043 | \r | |
1044 | Routine Description:\r | |
1045 | \r | |
1046 | Locates the installed protocol handler for the handle, and\r | |
1047 | invokes it to obtain the protocol interface. Usage information\r | |
1048 | is registered in the protocol data base.\r | |
1049 | \r | |
1050 | Arguments:\r | |
1051 | \r | |
1052 | UserHandle - The handle to obtain the protocol interface on\r | |
1053 | \r | |
1054 | Protocol - The ID of the protocol \r | |
1055 | \r | |
1056 | Interface - The location to return the protocol interface\r | |
1057 | \r | |
1058 | ImageHandle - The handle of the Image that is opening the protocol interface\r | |
1059 | specified by Protocol and Interface.\r | |
1060 | \r | |
1061 | ControllerHandle - The controller handle that is requiring this interface.\r | |
1062 | \r | |
1063 | Attributes - The open mode of the protocol interface specified by Handle\r | |
1064 | and Protocol.\r | |
1065 | \r | |
1066 | Returns:\r | |
1067 | \r | |
1068 | EFI_INVALID_PARAMETER - Protocol is NULL.\r | |
1069 | \r | |
1070 | EFI_SUCCESS - Get the protocol interface.\r | |
1071 | \r | |
1072 | --*/\r | |
1073 | ;\r | |
1074 | \r | |
1075 | \r | |
1076 | EFI_STATUS\r | |
1077 | EFIAPI\r | |
1078 | CoreOpenProtocolInformation (\r | |
1079 | IN EFI_HANDLE UserHandle,\r | |
1080 | IN EFI_GUID *Protocol,\r | |
1081 | OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r | |
1082 | OUT UINTN *EntryCount\r | |
1083 | )\r | |
1084 | /*++\r | |
1085 | \r | |
1086 | Routine Description:\r | |
1087 | \r | |
1088 | Return information about Opened protocols in the system\r | |
1089 | \r | |
1090 | Arguments:\r | |
1091 | \r | |
1092 | UserHandle - The handle to close the protocol interface on\r | |
1093 | \r | |
1094 | Protocol - The ID of the protocol \r | |
1095 | \r | |
1096 | EntryBuffer - A pointer to a buffer of open protocol information in the form of\r | |
1097 | EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r | |
1098 | \r | |
1099 | EntryCount - Number of EntryBuffer entries\r | |
1100 | \r | |
1101 | Returns:\r | |
1102 | \r | |
1103 | \r | |
1104 | --*/\r | |
1105 | ;\r | |
1106 | \r | |
1107 | \r | |
1108 | EFI_STATUS\r | |
1109 | EFIAPI\r | |
1110 | CoreCloseProtocol (\r | |
1111 | IN EFI_HANDLE UserHandle,\r | |
1112 | IN EFI_GUID *Protocol,\r | |
1113 | IN EFI_HANDLE ImageHandle,\r | |
1114 | IN EFI_HANDLE ControllerHandle\r | |
1115 | )\r | |
1116 | /*++\r | |
1117 | \r | |
1118 | Routine Description:\r | |
1119 | \r | |
1120 | Close Protocol\r | |
1121 | \r | |
1122 | Arguments:\r | |
1123 | \r | |
1124 | UserHandle - The handle to close the protocol interface on\r | |
1125 | \r | |
1126 | Protocol - The ID of the protocol \r | |
1127 | \r | |
1128 | ImageHandle - The user of the protocol to close\r | |
1129 | \r | |
1130 | ControllerHandle - The user of the protocol to close\r | |
1131 | \r | |
1132 | Returns:\r | |
1133 | \r | |
1134 | EFI_INVALID_PARAMETER - Protocol is NULL.\r | |
1135 | \r | |
1136 | --*/\r | |
1137 | ;\r | |
1138 | \r | |
1139 | \r | |
1140 | EFI_STATUS\r | |
1141 | EFIAPI\r | |
1142 | CoreProtocolsPerHandle (\r | |
1143 | IN EFI_HANDLE UserHandle,\r | |
1144 | OUT EFI_GUID ***ProtocolBuffer,\r | |
1145 | OUT UINTN *ProtocolBufferCount\r | |
1146 | )\r | |
1147 | /*++\r | |
1148 | \r | |
1149 | Routine Description:\r | |
1150 | \r | |
1151 | Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r | |
1152 | from pool.\r | |
1153 | \r | |
1154 | Arguments:\r | |
1155 | \r | |
1156 | UserHandle - The handle from which to retrieve the list of protocol interface\r | |
1157 | GUIDs.\r | |
1158 | \r | |
1159 | ProtocolBuffer - A pointer to the list of protocol interface GUID pointers that are\r | |
1160 | installed on Handle.\r | |
1161 | \r | |
1162 | ProtocolBufferCount - A pointer to the number of GUID pointers present in\r | |
1163 | ProtocolBuffer.\r | |
1164 | \r | |
1165 | Returns:\r | |
1166 | EFI_SUCCESS - The list of protocol interface GUIDs installed on Handle was returned in\r | |
1167 | ProtocolBuffer. The number of protocol interface GUIDs was\r | |
1168 | returned in ProtocolBufferCount.\r | |
1169 | EFI_INVALID_PARAMETER - Handle is NULL.\r | |
1170 | EFI_INVALID_PARAMETER - Handle is not a valid EFI_HANDLE.\r | |
1171 | EFI_INVALID_PARAMETER - ProtocolBuffer is NULL.\r | |
1172 | EFI_INVALID_PARAMETER - ProtocolBufferCount is NULL.\r | |
1173 | EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the results.\r | |
1174 | \r | |
1175 | --*/\r | |
1176 | ;\r | |
1177 | \r | |
1178 | \r | |
1179 | EFI_STATUS\r | |
1180 | EFIAPI\r | |
1181 | CoreRegisterProtocolNotify (\r | |
1182 | IN EFI_GUID *Protocol,\r | |
1183 | IN EFI_EVENT Event,\r | |
1184 | OUT VOID **Registration\r | |
1185 | )\r | |
1186 | /*++\r | |
1187 | \r | |
1188 | Routine Description:\r | |
1189 | \r | |
1190 | Add a new protocol notification record for the request protocol.\r | |
1191 | \r | |
1192 | Arguments:\r | |
1193 | \r | |
1194 | Protocol - The requested protocol to add the notify registration\r | |
1195 | \r | |
1196 | Event - The event to signal \r | |
1197 | \r | |
1198 | Registration - Returns the registration record\r | |
1199 | \r | |
1200 | \r | |
1201 | Returns:\r | |
1202 | \r | |
1203 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1204 | \r | |
1205 | EFI_SUCCESS - Successfully returned the registration record that has been added\r | |
1206 | \r | |
1207 | --*/\r | |
1208 | ;\r | |
1209 | \r | |
1210 | \r | |
1211 | EFI_STATUS\r | |
1212 | EFIAPI\r | |
1213 | CoreLocateHandle (\r | |
1214 | IN EFI_LOCATE_SEARCH_TYPE SearchType,\r | |
1215 | IN EFI_GUID *Protocol OPTIONAL,\r | |
1216 | IN VOID *SearchKey OPTIONAL,\r | |
1217 | IN OUT UINTN *BufferSize,\r | |
1218 | OUT EFI_HANDLE *Buffer\r | |
1219 | )\r | |
1220 | /*++\r | |
1221 | \r | |
1222 | Routine Description:\r | |
1223 | \r | |
1224 | Locates the requested handle(s) and returns them in Buffer.\r | |
1225 | \r | |
1226 | Arguments:\r | |
1227 | \r | |
1228 | SearchType - The type of search to perform to locate the handles\r | |
1229 | \r | |
1230 | Protocol - The protocol to search for\r | |
1231 | \r | |
1232 | SearchKey - Dependant on SearchType\r | |
1233 | \r | |
1234 | BufferSize - On input the size of Buffer. On output the \r | |
1235 | size of data returned. \r | |
1236 | \r | |
1237 | Buffer - The buffer to return the results in\r | |
1238 | \r | |
1239 | \r | |
1240 | Returns:\r | |
1241 | \r | |
1242 | EFI_BUFFER_TOO_SMALL - Buffer too small, required buffer size is returned in BufferSize.\r | |
1243 | \r | |
1244 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1245 | \r | |
1246 | EFI_SUCCESS - Successfully found the requested handle(s) and returns them in Buffer.\r | |
1247 | \r | |
1248 | --*/\r | |
1249 | ;\r | |
1250 | \r | |
1251 | \r | |
1252 | EFI_STATUS\r | |
1253 | EFIAPI\r | |
1254 | CoreLocateDevicePath (\r | |
1255 | IN EFI_GUID *Protocol,\r | |
1256 | IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r | |
1257 | OUT EFI_HANDLE *Device\r | |
1258 | )\r | |
1259 | /*++\r | |
1260 | \r | |
1261 | Routine Description:\r | |
1262 | \r | |
1263 | Locates the handle to a device on the device path that supports the specified protocol.\r | |
1264 | \r | |
1265 | Arguments:\r | |
1266 | \r | |
1267 | Protocol - The protocol to search for.\r | |
1268 | FilePath - On input, a pointer to a pointer to the device path. On output, the device\r | |
1269 | path pointer is modified to point to the remaining part of the devicepath.\r | |
1270 | Device - A pointer to the returned device handle. \r | |
1271 | \r | |
1272 | Returns:\r | |
1273 | \r | |
1274 | EFI_SUCCESS - The resulting handle was returned.\r | |
1275 | EFI_NOT_FOUND - No handles matched the search.\r | |
1276 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r | |
1277 | \r | |
1278 | --*/\r | |
1279 | ;\r | |
1280 | \r | |
1281 | \r | |
1282 | EFI_STATUS\r | |
1283 | EFIAPI\r | |
1284 | CoreLocateHandleBuffer (\r | |
1285 | IN EFI_LOCATE_SEARCH_TYPE SearchType,\r | |
1286 | IN EFI_GUID *Protocol OPTIONAL,\r | |
1287 | IN VOID *SearchKey OPTIONAL,\r | |
1288 | IN OUT UINTN *NumberHandles,\r | |
1289 | OUT EFI_HANDLE **Buffer\r | |
1290 | )\r | |
1291 | /*++\r | |
1292 | \r | |
1293 | Routine Description:\r | |
1294 | \r | |
1295 | Function returns an array of handles that support the requested protocol \r | |
1296 | in a buffer allocated from pool. This is a version of CoreLocateHandle()\r | |
1297 | that allocates a buffer for the caller.\r | |
1298 | \r | |
1299 | Arguments:\r | |
1300 | \r | |
1301 | SearchType - Specifies which handle(s) are to be returned.\r | |
1302 | Protocol - Provides the protocol to search by. \r | |
1303 | This parameter is only valid for SearchType ByProtocol.\r | |
1304 | SearchKey - Supplies the search key depending on the SearchType.\r | |
1305 | NumberHandles - The number of handles returned in Buffer.\r | |
1306 | Buffer - A pointer to the buffer to return the requested array of \r | |
1307 | handles that support Protocol.\r | |
1308 | \r | |
1309 | Returns:\r | |
1310 | \r | |
1311 | EFI_SUCCESS - The result array of handles was returned.\r | |
1312 | EFI_NOT_FOUND - No handles match the search. \r | |
1313 | EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the matching results.\r | |
1314 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1315 | \r | |
1316 | --*/\r | |
1317 | ;\r | |
1318 | \r | |
1319 | \r | |
1320 | EFI_STATUS\r | |
1321 | EFIAPI\r | |
1322 | CoreLocateProtocol (\r | |
1323 | IN EFI_GUID *Protocol,\r | |
1324 | IN VOID *Registration OPTIONAL,\r | |
1325 | OUT VOID **Interface\r | |
1326 | )\r | |
1327 | /*++\r | |
1328 | \r | |
1329 | Routine Description:\r | |
1330 | \r | |
1331 | Return the first Protocol Interface that matches the Protocol GUID. If\r | |
1332 | Registration is pasased in return a Protocol Instance that was just add\r | |
1333 | to the system. If Retistration is NULL return the first Protocol Interface\r | |
1334 | you find.\r | |
1335 | \r | |
1336 | Arguments:\r | |
1337 | \r | |
1338 | Protocol - The protocol to search for\r | |
1339 | \r | |
1340 | Registration - Optional Registration Key returned from RegisterProtocolNotify() \r | |
1341 | \r | |
1342 | Interface - Return the Protocol interface (instance).\r | |
1343 | \r | |
1344 | Returns:\r | |
1345 | \r | |
1346 | EFI_SUCCESS - If a valid Interface is returned\r | |
1347 | \r | |
1348 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1349 | \r | |
1350 | EFI_NOT_FOUND - Protocol interface not found\r | |
1351 | \r | |
1352 | --*/\r | |
1353 | ;\r | |
1354 | \r | |
1355 | UINT64\r | |
1356 | CoreGetHandleDatabaseKey (\r | |
1357 | VOID\r | |
1358 | )\r | |
1359 | /*++\r | |
1360 | \r | |
1361 | Routine Description:\r | |
1362 | \r | |
1363 | return handle database key.\r | |
1364 | \r | |
1365 | Arguments:\r | |
1366 | \r | |
1367 | None\r | |
1368 | \r | |
1369 | Returns:\r | |
1370 | \r | |
1371 | Handle database key.\r | |
1372 | \r | |
1373 | --*/\r | |
1374 | ;\r | |
1375 | \r | |
1376 | VOID\r | |
1377 | CoreConnectHandlesByKey (\r | |
1378 | UINT64 Key\r | |
1379 | )\r | |
1380 | /*++\r | |
1381 | \r | |
1382 | Routine Description:\r | |
1383 | \r | |
1384 | Go connect any handles that were created or modified while a image executed.\r | |
1385 | \r | |
1386 | Arguments:\r | |
1387 | \r | |
1388 | Key - The Key to show that the handle has been created/modified\r | |
1389 | \r | |
1390 | Returns:\r | |
1391 | \r | |
1392 | None\r | |
1393 | --*/\r | |
1394 | ;\r | |
1395 | \r | |
1396 | \r | |
1397 | EFI_STATUS \r | |
1398 | EFIAPI\r | |
1399 | CoreConnectController (\r | |
1400 | IN EFI_HANDLE ControllerHandle,\r | |
1401 | IN EFI_HANDLE *DriverImageHandle OPTIONAL,\r | |
1402 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r | |
1403 | IN BOOLEAN Recursive\r | |
1404 | )\r | |
1405 | /*++\r | |
1406 | \r | |
1407 | Routine Description:\r | |
1408 | \r | |
1409 | Connects one or more drivers to a controller.\r | |
1410 | \r | |
1411 | Arguments:\r | |
1412 | \r | |
1413 | ControllerHandle - Handle of the controller to be connected.\r | |
1414 | \r | |
1415 | DriverImageHandle - DriverImageHandle A pointer to an ordered list of driver image handles.\r | |
1416 | \r | |
1417 | RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child of the\r | |
1418 | controller specified by ControllerHandle.\r | |
1419 | \r | |
1420 | Recursive - - Whether the function would be called recursively or not.\r | |
1421 | \r | |
1422 | Returns:\r | |
1423 | \r | |
1424 | Status code.\r | |
1425 | \r | |
1426 | --*/\r | |
1427 | ;\r | |
1428 | \r | |
1429 | \r | |
1430 | EFI_STATUS \r | |
1431 | EFIAPI\r | |
1432 | CoreDisconnectController (\r | |
1433 | IN EFI_HANDLE ControllerHandle,\r | |
1434 | IN EFI_HANDLE DriverImageHandle OPTIONAL,\r | |
1435 | IN EFI_HANDLE ChildHandle OPTIONAL\r | |
1436 | )\r | |
1437 | /*++\r | |
1438 | \r | |
1439 | Routine Description:\r | |
1440 | \r | |
1441 | Disonnects a controller from a driver\r | |
1442 | \r | |
1443 | Arguments:\r | |
1444 | \r | |
1445 | ControllerHandle - ControllerHandle The handle of the controller from which driver(s) \r | |
1446 | are to be disconnected.\r | |
1447 | DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.\r | |
1448 | ChildHandle - ChildHandle The handle of the child to destroy.\r | |
1449 | \r | |
1450 | Returns:\r | |
1451 | \r | |
1452 | EFI_SUCCESS - One or more drivers were disconnected from the controller.\r | |
1453 | EFI_SUCCESS - On entry, no drivers are managing ControllerHandle.\r | |
1454 | EFI_SUCCESS - DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.\r | |
1455 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
1456 | EFI_INVALID_PARAMETER - DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.\r | |
1457 | EFI_INVALID_PARAMETER - ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r | |
1458 | EFI_OUT_OF_RESOURCES - There are not enough resources available to disconnect any drivers from ControllerHandle.\r | |
1459 | EFI_DEVICE_ERROR - The controller could not be disconnected because of a device error.\r | |
1460 | \r | |
1461 | --*/\r | |
1462 | ;\r | |
1463 | \r | |
1464 | \r | |
1465 | EFI_STATUS\r | |
1466 | EFIAPI\r | |
1467 | CoreAllocatePages (\r | |
1468 | IN EFI_ALLOCATE_TYPE Type,\r | |
1469 | IN EFI_MEMORY_TYPE MemoryType,\r | |
1470 | IN UINTN NumberOfPages,\r | |
1471 | IN OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
1472 | )\r | |
1473 | /*++\r | |
1474 | \r | |
1475 | Routine Description:\r | |
1476 | \r | |
1477 | Allocates pages from the memory map.\r | |
1478 | \r | |
1479 | Arguments:\r | |
1480 | \r | |
1481 | Type - The type of allocation to perform\r | |
1482 | \r | |
1483 | MemoryType - The type of memory to turn the allocated pages into\r | |
1484 | \r | |
1485 | NumberOfPages - The number of pages to allocate\r | |
1486 | \r | |
1487 | Memory - A pointer to receive the base allocated memory address\r | |
1488 | \r | |
1489 | Returns:\r | |
1490 | \r | |
1491 | Status. On success, Memory is filled in with the base address allocated\r | |
1492 | \r | |
1493 | EFI_INVALID_PARAMETER - Parameters violate checking rules defined in spec.\r | |
1494 | \r | |
1495 | EFI_NOT_FOUND - Could not allocate pages match the requirement.\r | |
1496 | \r | |
1497 | EFI_OUT_OF_RESOURCES - No enough pages to allocate.\r | |
1498 | \r | |
1499 | EFI_SUCCESS - Pages successfully allocated.\r | |
1500 | \r | |
1501 | --*/\r | |
1502 | ;\r | |
1503 | \r | |
1504 | \r | |
1505 | EFI_STATUS \r | |
1506 | EFIAPI\r | |
1507 | CoreFreePages (\r | |
1508 | IN EFI_PHYSICAL_ADDRESS Memory,\r | |
1509 | IN UINTN NumberOfPages\r | |
1510 | )\r | |
1511 | /*++\r | |
1512 | \r | |
1513 | Routine Description:\r | |
1514 | \r | |
1515 | Frees previous allocated pages.\r | |
1516 | \r | |
1517 | Arguments:\r | |
1518 | \r | |
1519 | Memory - Base address of memory being freed\r | |
1520 | \r | |
1521 | NumberOfPages - The number of pages to free\r | |
1522 | \r | |
1523 | Returns:\r | |
1524 | \r | |
1525 | EFI_NOT_FOUND - Could not find the entry that covers the range\r | |
1526 | \r | |
1527 | EFI_INVALID_PARAMETER - Address not aligned\r | |
1528 | \r | |
1529 | EFI_SUCCESS -Pages successfully freed.\r | |
1530 | \r | |
1531 | --*/\r | |
1532 | ;\r | |
1533 | \r | |
1534 | \r | |
1535 | EFI_STATUS\r | |
1536 | EFIAPI\r | |
1537 | CoreGetMemoryMap (\r | |
1538 | IN OUT UINTN *MemoryMapSize,\r | |
1539 | IN OUT EFI_MEMORY_DESCRIPTOR *Desc,\r | |
1540 | OUT UINTN *MapKey,\r | |
1541 | OUT UINTN *DescriptorSize,\r | |
1542 | OUT UINT32 *DescriptorVersion\r | |
1543 | )\r | |
1544 | /*++\r | |
1545 | \r | |
1546 | Routine Description:\r | |
1547 | \r | |
1548 | Returns the current memory map.\r | |
1549 | \r | |
1550 | Arguments:\r | |
1551 | \r | |
1552 | MemoryMapSize - On input the buffer size of MemoryMap allocated by caller\r | |
1553 | On output the required buffer size to contain the memory map \r | |
1554 | \r | |
1555 | Desc - The buffer to return the current memory map\r | |
1556 | \r | |
1557 | MapKey - The address to return the current map key\r | |
1558 | \r | |
1559 | DescriptorSize - The size in bytes for an individual EFI_MEMORY_DESCRIPTOR\r | |
1560 | \r | |
1561 | DescriptorVersion - The version number associated with the EFI_MEMORY_DESCRIPTOR\r | |
1562 | \r | |
1563 | Returns:\r | |
1564 | \r | |
1565 | EFI_SUCCESS The current memory map was returned successfully\r | |
1566 | \r | |
1567 | EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small\r | |
1568 | \r | |
1569 | EFI_INVALID_PARAMETER One of the parameters has an invalid value\r | |
1570 | \r | |
1571 | --*/\r | |
1572 | ;\r | |
1573 | \r | |
1574 | \r | |
1575 | EFI_STATUS\r | |
1576 | EFIAPI\r | |
1577 | CoreAllocatePool (\r | |
1578 | IN EFI_MEMORY_TYPE PoolType,\r | |
1579 | IN UINTN Size,\r | |
1580 | OUT VOID **Buffer\r | |
1581 | )\r | |
1582 | /*++\r | |
1583 | \r | |
1584 | Routine Description:\r | |
1585 | \r | |
1586 | Allocate pool of a particular type.\r | |
1587 | \r | |
1588 | Arguments:\r | |
1589 | \r | |
1590 | PoolType - Type of pool to allocate\r | |
1591 | \r | |
1592 | Size - The amount of pool to allocate\r | |
1593 | \r | |
1594 | Buffer - The address to return a pointer to the allocated pool\r | |
1595 | \r | |
1596 | Returns:\r | |
1597 | \r | |
1598 | EFI_INVALID_PARAMETER - PoolType not valid\r | |
1599 | \r | |
1600 | EFI_OUT_OF_RESOURCES - Size exceeds max pool size or allocation failed. \r | |
1601 | \r | |
1602 | EFI_SUCCESS - Pool successfully allocated.\r | |
1603 | \r | |
1604 | --*/\r | |
1605 | ;\r | |
1606 | \r | |
1607 | \r | |
1608 | EFI_STATUS\r | |
1609 | EFIAPI\r | |
1610 | CoreFreePool (\r | |
1611 | IN VOID *Buffer\r | |
1612 | )\r | |
1613 | /*++\r | |
1614 | \r | |
1615 | Routine Description:\r | |
1616 | \r | |
1617 | Frees pool.\r | |
1618 | \r | |
1619 | Arguments:\r | |
1620 | \r | |
1621 | Buffer - The allocated pool entry to free\r | |
1622 | \r | |
1623 | Returns:\r | |
1624 | \r | |
1625 | EFI_INVALID_PARAMETER - Buffer is not a valid value.\r | |
1626 | \r | |
1627 | EFI_SUCCESS - Pool successfully freed.\r | |
1628 | \r | |
1629 | --*/\r | |
1630 | ;\r | |
1631 | \r | |
1632 | \r | |
1633 | EFI_STATUS\r | |
1634 | EFIAPI\r | |
1635 | CoreLoadImage (\r | |
1636 | IN BOOLEAN BootPolicy,\r | |
1637 | IN EFI_HANDLE ParentImageHandle,\r | |
1638 | IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r | |
1639 | IN VOID *SourceBuffer OPTIONAL,\r | |
1640 | IN UINTN SourceSize,\r | |
1641 | OUT EFI_HANDLE *ImageHandle\r | |
1642 | )\r | |
1643 | /*++\r | |
1644 | \r | |
1645 | Routine Description:\r | |
1646 | \r | |
1647 | Loads an EFI image into memory and returns a handle to the image.\r | |
1648 | \r | |
1649 | Arguments:\r | |
1650 | \r | |
1651 | BootPolicy - If TRUE, indicates that the request originates from the boot manager,\r | |
1652 | and that the boot manager is attempting to load FilePath as a boot selection.\r | |
1653 | ParentImageHandle - The caller's image handle.\r | |
1654 | FilePath - The specific file path from which the image is loaded.\r | |
1655 | SourceBuffer - If not NULL, a pointer to the memory location containing a copy of \r | |
1656 | the image to be loaded.\r | |
1657 | SourceSize - The size in bytes of SourceBuffer.\r | |
1658 | ImageHandle - Pointer to the returned image handle that is created when the image \r | |
1659 | is successfully loaded.\r | |
1660 | \r | |
1661 | Returns:\r | |
1662 | \r | |
1663 | EFI_SUCCESS - The image was loaded into memory.\r | |
1664 | EFI_NOT_FOUND - The FilePath was not found.\r | |
1665 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r | |
1666 | EFI_UNSUPPORTED - The image type is not supported, or the device path cannot be \r | |
1667 | parsed to locate the proper protocol for loading the file.\r | |
1668 | EFI_OUT_OF_RESOURCES - Image was not loaded due to insufficient resources.\r | |
1669 | --*/\r | |
1670 | ;\r | |
1671 | \r | |
1672 | \r | |
1673 | EFI_STATUS\r | |
1674 | EFIAPI\r | |
1675 | CoreUnloadImage (\r | |
1676 | IN EFI_HANDLE ImageHandle\r | |
1677 | )\r | |
1678 | /*++\r | |
1679 | \r | |
1680 | Routine Description:\r | |
1681 | \r | |
1682 | Unload the specified image.\r | |
1683 | \r | |
1684 | Arguments:\r | |
1685 | \r | |
1686 | ImageHandle - The specified image handle.\r | |
1687 | \r | |
1688 | Returns:\r | |
1689 | \r | |
1690 | EFI_INVALID_PARAMETER - Image handle is NULL.\r | |
1691 | \r | |
1692 | EFI_UNSUPPORTED - Attempt to unload an unsupported image.\r | |
1693 | \r | |
1694 | EFI_SUCCESS - Image successfully unloaded.\r | |
1695 | \r | |
1696 | --*/\r | |
1697 | ;\r | |
1698 | \r | |
1699 | \r | |
1700 | EFI_STATUS\r | |
1701 | EFIAPI\r | |
1702 | CoreStartImage (\r | |
1703 | IN EFI_HANDLE ImageHandle,\r | |
1704 | OUT UINTN *ExitDataSize,\r | |
1705 | OUT CHAR16 **ExitData OPTIONAL\r | |
1706 | )\r | |
1707 | /*++\r | |
1708 | \r | |
1709 | Routine Description:\r | |
1710 | \r | |
1711 | Transfer control to a loaded image's entry point.\r | |
1712 | \r | |
1713 | Arguments:\r | |
1714 | \r | |
1715 | ImageHandle - Handle of image to be started.\r | |
1716 | \r | |
1717 | ExitDataSize - Pointer of the size to ExitData\r | |
1718 | \r | |
1719 | ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated\r | |
1720 | Unicode string, optionally followed by additional binary data. The string\r | |
1721 | is a description that the caller may use to further indicate the reason for\r | |
1722 | the image's exit.\r | |
1723 | \r | |
1724 | Returns:\r | |
1725 | \r | |
1726 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
1727 | \r | |
1728 | EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r | |
1729 | \r | |
1730 | EFI_SUCCESS - Successfully transfer control to the image's entry point.\r | |
1731 | \r | |
1732 | --*/\r | |
1733 | ;\r | |
1734 | \r | |
1735 | \r | |
1736 | EFI_STATUS\r | |
1737 | EFIAPI\r | |
1738 | CoreExit (\r | |
1739 | IN EFI_HANDLE ImageHandle,\r | |
1740 | IN EFI_STATUS Status,\r | |
1741 | IN UINTN ExitDataSize,\r | |
1742 | IN CHAR16 *ExitData OPTIONAL\r | |
1743 | )\r | |
1744 | /*++\r | |
1745 | \r | |
1746 | Routine Description:\r | |
1747 | \r | |
1748 | Terminates the currently loaded EFI image and returns control to boot services.\r | |
1749 | \r | |
1750 | Arguments:\r | |
1751 | \r | |
1752 | ImageHandle - Handle that identifies the image. This parameter is passed to the image \r | |
1753 | on entry.\r | |
1754 | Status - The image's exit code.\r | |
1755 | ExitDataSize - The size, in bytes, of ExitData. Ignored if ExitStatus is\r | |
1756 | EFI_SUCCESS.\r | |
1757 | ExitData - Pointer to a data buffer that includes a Null-terminated Unicode string,\r | |
1758 | optionally followed by additional binary data. The string is a \r | |
1759 | description that the caller may use to further indicate the reason for\r | |
1760 | the image's exit.\r | |
1761 | \r | |
1762 | Returns:\r | |
1763 | \r | |
1764 | EFI_INVALID_PARAMETER - Image handle is NULL or it is not current image.\r | |
1765 | \r | |
1766 | EFI_SUCCESS - Successfully terminates the currently loaded EFI image.\r | |
1767 | \r | |
1768 | EFI_ACCESS_DENIED - Should never reach there.\r | |
1769 | \r | |
1770 | --*/\r | |
1771 | ;\r | |
1772 | \r | |
1773 | \r | |
1774 | EFI_STATUS\r | |
1775 | EFIAPI\r | |
1776 | CoreCreateEvent (\r | |
1777 | IN UINT32 Type,\r | |
1778 | IN EFI_TPL NotifyTpl,\r | |
1779 | IN EFI_EVENT_NOTIFY NotifyFunction,\r | |
1780 | IN VOID *NotifyContext,\r | |
1781 | OUT EFI_EVENT *pEvent\r | |
1782 | )\r | |
1783 | /*++\r | |
1784 | \r | |
1785 | Routine Description:\r | |
1786 | \r | |
1787 | Creates a general-purpose event structure\r | |
1788 | \r | |
1789 | Arguments:\r | |
1790 | \r | |
1791 | Type - The type of event to create and its mode and attributes\r | |
1792 | NotifyTpl - The task priority level of event notifications\r | |
1793 | NotifyFunction - Pointer to the event's notification function\r | |
1794 | NotifyContext - Pointer to the notification function's context; corresponds to\r | |
1795 | parameter "Context" in the notification function\r | |
1796 | pEvent - Pointer to the newly created event if the call succeeds; undefined otherwise\r | |
1797 | \r | |
1798 | Returns:\r | |
1799 | \r | |
1800 | EFI_SUCCESS - The event structure was created\r | |
1801 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value\r | |
1802 | EFI_OUT_OF_RESOURCES - The event could not be allocated\r | |
1803 | \r | |
1804 | --*/\r | |
1805 | ;\r | |
1806 | \r | |
1807 | \r | |
1808 | EFI_STATUS\r | |
1809 | EFIAPI\r | |
1810 | CoreCreateEventEx (\r | |
1811 | IN UINT32 Type,\r | |
1812 | IN EFI_TPL NotifyTpl,\r | |
1813 | IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r | |
1814 | IN CONST VOID *NotifyContext, OPTIONAL\r | |
1815 | IN CONST EFI_GUID *EventGroup, OPTIONAL\r | |
1816 | OUT EFI_EVENT *Event\r | |
1817 | )\r | |
1818 | /*++\r | |
1819 | \r | |
1820 | Routine Description:\r | |
1821 | Creates a general-purpose event structure\r | |
1822 | \r | |
1823 | Arguments:\r | |
1824 | Type - The type of event to create and its mode and attributes\r | |
1825 | NotifyTpl - The task priority level of event notifications\r | |
1826 | NotifyFunction - Pointer to the events notification function\r | |
1827 | NotifyContext - Pointer to the notification functions context; corresponds to\r | |
1828 | parameter "Context" in the notification function\r | |
1829 | EventGrout - GUID for EventGroup if NULL act the same as gBS->CreateEvent().\r | |
1830 | Event - Pointer to the newly created event if the call succeeds; undefined otherwise\r | |
1831 | \r | |
1832 | Returns:\r | |
1833 | EFI_SUCCESS - The event structure was created\r | |
1834 | EFI_INVALID_PARAMETER - One of the parameters has an invalid value\r | |
1835 | EFI_OUT_OF_RESOURCES - The event could not be allocated\r | |
1836 | \r | |
1837 | --*/\r | |
1838 | ;\r | |
1839 | \r | |
1840 | \r | |
1841 | EFI_STATUS\r | |
1842 | EFIAPI\r | |
1843 | CoreSetTimer (\r | |
1844 | IN EFI_EVENT Event,\r | |
1845 | IN EFI_TIMER_DELAY Type,\r | |
1846 | IN UINT64 TriggerTime\r | |
1847 | )\r | |
1848 | /*++\r | |
1849 | \r | |
1850 | Routine Description:\r | |
1851 | \r | |
1852 | Sets the type of timer and the trigger time for a timer event.\r | |
1853 | \r | |
1854 | Arguments:\r | |
1855 | \r | |
1856 | UserEvent - The timer event that is to be signaled at the specified time\r | |
1857 | Type - The type of time that is specified in TriggerTime\r | |
1858 | TriggerTime - The number of 100ns units until the timer expires\r | |
1859 | \r | |
1860 | Returns:\r | |
1861 | \r | |
1862 | EFI_SUCCESS - The event has been set to be signaled at the requested time\r | |
1863 | EFI_INVALID_PARAMETER - Event or Type is not valid\r | |
1864 | \r | |
1865 | --*/\r | |
1866 | ;\r | |
1867 | \r | |
1868 | \r | |
1869 | EFI_STATUS\r | |
1870 | EFIAPI\r | |
1871 | CoreSignalEvent (\r | |
1872 | IN EFI_EVENT Event\r | |
1873 | )\r | |
1874 | /*++\r | |
1875 | \r | |
1876 | Routine Description:\r | |
1877 | \r | |
1878 | Signals the event. Queues the event to be notified if needed\r | |
1879 | \r | |
1880 | Arguments:\r | |
1881 | \r | |
1882 | Event - The event to signal\r | |
1883 | \r | |
1884 | Returns:\r | |
1885 | \r | |
1886 | EFI_INVALID_PARAMETER - Parameters are not valid.\r | |
1887 | \r | |
1888 | EFI_SUCCESS - The event was signaled.\r | |
1889 | \r | |
1890 | --*/\r | |
1891 | ;\r | |
1892 | \r | |
1893 | \r | |
1894 | EFI_STATUS\r | |
1895 | EFIAPI\r | |
1896 | CoreWaitForEvent (\r | |
1897 | IN UINTN NumberOfEvents,\r | |
1898 | IN EFI_EVENT *UserEvents,\r | |
1899 | OUT UINTN *UserIndex\r | |
1900 | )\r | |
1901 | /*++\r | |
1902 | \r | |
1903 | Routine Description:\r | |
1904 | \r | |
1905 | Stops execution until an event is signaled.\r | |
1906 | \r | |
1907 | Arguments:\r | |
1908 | \r | |
1909 | NumberOfEvents - The number of events in the UserEvents array\r | |
1910 | UserEvents - An array of EFI_EVENT\r | |
1911 | UserIndex - Pointer to the index of the event which satisfied the wait condition\r | |
1912 | \r | |
1913 | Returns:\r | |
1914 | \r | |
1915 | EFI_SUCCESS - The event indicated by Index was signaled.\r | |
1916 | EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or \r | |
1917 | Event was not a valid type\r | |
1918 | EFI_UNSUPPORTED - The current TPL is not TPL_APPLICATION\r | |
1919 | \r | |
1920 | --*/\r | |
1921 | ;\r | |
1922 | \r | |
1923 | \r | |
1924 | EFI_STATUS\r | |
1925 | EFIAPI\r | |
1926 | CoreCloseEvent (\r | |
1927 | IN EFI_EVENT Event\r | |
1928 | )\r | |
1929 | /*++\r | |
1930 | \r | |
1931 | Routine Description:\r | |
1932 | \r | |
1933 | Closes an event and frees the event structure.\r | |
1934 | \r | |
1935 | Arguments:\r | |
1936 | \r | |
1937 | UserEvent - Event to close\r | |
1938 | \r | |
1939 | Returns:\r | |
1940 | \r | |
1941 | EFI_INVALID_PARAMETER - Parameters are not valid.\r | |
1942 | \r | |
1943 | EFI_SUCCESS - The event has been closed\r | |
1944 | \r | |
1945 | --*/\r | |
1946 | ;\r | |
1947 | \r | |
1948 | \r | |
1949 | EFI_STATUS\r | |
1950 | EFIAPI\r | |
1951 | CoreCheckEvent (\r | |
1952 | IN EFI_EVENT Event\r | |
1953 | )\r | |
1954 | /*++\r | |
1955 | \r | |
1956 | Routine Description:\r | |
1957 | \r | |
1958 | Check the status of an event\r | |
1959 | \r | |
1960 | Arguments:\r | |
1961 | \r | |
1962 | UserEvent - The event to check\r | |
1963 | \r | |
1964 | Returns:\r | |
1965 | \r | |
1966 | EFI_SUCCESS - The event is in the signaled state\r | |
1967 | EFI_NOT_READY - The event is not in the signaled state\r | |
1968 | EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL\r | |
1969 | \r | |
1970 | --*/\r | |
1971 | ;\r | |
1972 | \r | |
1973 | EFI_STATUS\r | |
1974 | CoreAddMemorySpace (\r | |
1975 | IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r | |
1976 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
1977 | IN UINT64 Length,\r | |
1978 | IN UINT64 Capabilities\r | |
1979 | )\r | |
1980 | /*++\r | |
1981 | \r | |
1982 | Routine Description:\r | |
1983 | \r | |
1984 | Add a segment of memory space to GCD map and add all available pages in this segment \r | |
1985 | as memory descriptors.\r | |
1986 | \r | |
1987 | Arguments:\r | |
1988 | \r | |
1989 | GcdMemoryType - Memory type of the segment.\r | |
1990 | \r | |
1991 | BaseAddress - Base address of the segment.\r | |
1992 | \r | |
1993 | Length - Length of the segment.\r | |
1994 | \r | |
1995 | Capabilities - alterable attributes of the segment.\r | |
1996 | \r | |
1997 | Returns:\r | |
1998 | \r | |
1999 | EFI_SUCCESS - Merged this segment into GCD map.\r | |
2000 | \r | |
2001 | --*/\r | |
2002 | ;\r | |
2003 | \r | |
2004 | EFI_STATUS\r | |
2005 | CoreAllocateMemorySpace (\r | |
2006 | IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r | |
2007 | IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r | |
2008 | IN UINTN Alignment,\r | |
2009 | IN UINT64 Length,\r | |
2010 | IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r | |
2011 | IN EFI_HANDLE ImageHandle,\r | |
2012 | IN EFI_HANDLE DeviceHandle OPTIONAL\r | |
2013 | )\r | |
2014 | /*++\r | |
2015 | \r | |
2016 | Routine Description:\r | |
2017 | \r | |
2018 | Allocate memory space on GCD map.\r | |
2019 | \r | |
2020 | Arguments:\r | |
2021 | \r | |
2022 | GcdAllocateType - The type of allocate operation\r | |
2023 | \r | |
2024 | GcdMemoryType - The desired memory type\r | |
2025 | \r | |
2026 | Alignment - Align with 2^Alignment\r | |
2027 | \r | |
2028 | Length - Length to allocate\r | |
2029 | \r | |
2030 | BaseAddress - Base address to allocate\r | |
2031 | \r | |
2032 | ImageHandle - The image handle consume the allocated space.\r | |
2033 | \r | |
2034 | DeviceHandle - The device handle consume the allocated space.\r | |
2035 | \r | |
2036 | Returns:\r | |
2037 | \r | |
2038 | EFI_INVALID_PARAMETER - Invalid parameter.\r | |
2039 | \r | |
2040 | EFI_NOT_FOUND - No descriptor contains the desired space.\r | |
2041 | \r | |
2042 | EFI_SUCCESS - Memory space successfully allocated.\r | |
2043 | \r | |
2044 | --*/\r | |
2045 | ;\r | |
2046 | \r | |
2047 | EFI_STATUS\r | |
2048 | CoreFreeMemorySpace (\r | |
2049 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2050 | IN UINT64 Length\r | |
2051 | )\r | |
2052 | /*++\r | |
2053 | \r | |
2054 | Routine Description:Routine Description:\r | |
2055 | \r | |
2056 | Free a segment of memory space in GCD map.\r | |
2057 | \r | |
2058 | Arguments:\r | |
2059 | \r | |
2060 | BaseAddress - Base address of the segment.\r | |
2061 | \r | |
2062 | Length - Length of the segment.\r | |
2063 | \r | |
2064 | Returns:\r | |
2065 | \r | |
2066 | EFI_SUCCESS - Space successfully freed.\r | |
2067 | \r | |
2068 | --*/\r | |
2069 | ;\r | |
2070 | \r | |
2071 | EFI_STATUS\r | |
2072 | CoreRemoveMemorySpace (\r | |
2073 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2074 | IN UINT64 Length\r | |
2075 | )\r | |
2076 | /*++\r | |
2077 | \r | |
2078 | Routine Description:Routine Description:\r | |
2079 | \r | |
2080 | Remove a segment of memory space in GCD map.\r | |
2081 | \r | |
2082 | Arguments:\r | |
2083 | \r | |
2084 | BaseAddress - Base address of the segment.\r | |
2085 | \r | |
2086 | Length - Length of the segment.\r | |
2087 | \r | |
2088 | Returns:\r | |
2089 | \r | |
2090 | EFI_SUCCESS - Successfully a segment of memory space.\r | |
2091 | \r | |
2092 | --*/\r | |
2093 | ;\r | |
2094 | \r | |
2095 | EFI_STATUS\r | |
2096 | CoreGetMemorySpaceDescriptor (\r | |
2097 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2098 | OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r | |
2099 | )\r | |
2100 | /*++\r | |
2101 | \r | |
2102 | Routine Description:\r | |
2103 | \r | |
2104 | Search all entries in GCD map which contains specified segment and build it to a descriptor.\r | |
2105 | \r | |
2106 | Arguments:\r | |
2107 | \r | |
2108 | BaseAddress - Specified start address\r | |
2109 | \r | |
2110 | Descriptor - Specified length\r | |
2111 | \r | |
2112 | Returns:\r | |
2113 | \r | |
2114 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
2115 | \r | |
2116 | EFI_SUCCESS - Successfully get memory space descriptor.\r | |
2117 | \r | |
2118 | --*/\r | |
2119 | ;\r | |
2120 | \r | |
2121 | EFI_STATUS\r | |
2122 | CoreSetMemorySpaceAttributes (\r | |
2123 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2124 | IN UINT64 Length,\r | |
2125 | IN UINT64 Attributes\r | |
2126 | )\r | |
2127 | /*++\r | |
2128 | \r | |
2129 | Routine Description:\r | |
2130 | \r | |
2131 | Set memory space with specified attributes.\r | |
2132 | \r | |
2133 | Arguments:\r | |
2134 | \r | |
2135 | BaseAddress - Specified start address\r | |
2136 | \r | |
2137 | Length - Specified length\r | |
2138 | \r | |
2139 | Attributes - Specified attributes\r | |
2140 | \r | |
2141 | Returns:\r | |
2142 | \r | |
2143 | EFI_SUCCESS - Successfully set attribute of a segment of memory space.\r | |
2144 | \r | |
2145 | --*/\r | |
2146 | ;\r | |
2147 | \r | |
2148 | EFI_STATUS\r | |
2149 | CoreGetMemorySpaceMap (\r | |
2150 | OUT UINTN *NumberOfDescriptors,\r | |
2151 | OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r | |
2152 | )\r | |
2153 | /*++\r | |
2154 | \r | |
2155 | Routine Description:\r | |
2156 | \r | |
2157 | Transer all entries of GCD memory map into memory descriptors and pass to caller.\r | |
2158 | \r | |
2159 | Arguments:\r | |
2160 | \r | |
2161 | NumberOfDescriptors - Number of descriptors.\r | |
2162 | \r | |
2163 | MemorySpaceMap - Descriptor array\r | |
2164 | \r | |
2165 | Returns:\r | |
2166 | \r | |
2167 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
2168 | \r | |
2169 | EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r | |
2170 | \r | |
2171 | EFI_SUCCESS - Successfully get memory space map.\r | |
2172 | \r | |
2173 | --*/\r | |
2174 | ;\r | |
2175 | \r | |
2176 | EFI_STATUS\r | |
2177 | CoreAddIoSpace (\r | |
2178 | IN EFI_GCD_IO_TYPE GcdIoType,\r | |
2179 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2180 | IN UINT64 Length\r | |
2181 | )\r | |
2182 | /*++\r | |
2183 | \r | |
2184 | Routine Description:\r | |
2185 | \r | |
2186 | Add a segment of IO space to GCD map.\r | |
2187 | \r | |
2188 | Arguments:\r | |
2189 | \r | |
2190 | GcdIoType - IO type of the segment.\r | |
2191 | \r | |
2192 | BaseAddress - Base address of the segment.\r | |
2193 | \r | |
2194 | Length - Length of the segment.\r | |
2195 | \r | |
2196 | Returns:\r | |
2197 | \r | |
2198 | EFI_SUCCESS - Merged this segment into GCD map.\r | |
2199 | \r | |
2200 | --*/\r | |
2201 | ;\r | |
2202 | \r | |
2203 | EFI_STATUS\r | |
2204 | CoreAllocateIoSpace (\r | |
2205 | IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r | |
2206 | IN EFI_GCD_IO_TYPE GcdIoType,\r | |
2207 | IN UINTN Alignment,\r | |
2208 | IN UINT64 Length,\r | |
2209 | IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r | |
2210 | IN EFI_HANDLE ImageHandle,\r | |
2211 | IN EFI_HANDLE DeviceHandle OPTIONAL\r | |
2212 | )\r | |
2213 | /*++\r | |
2214 | \r | |
2215 | Routine Description:\r | |
2216 | \r | |
2217 | Allocate IO space on GCD map.\r | |
2218 | \r | |
2219 | Arguments:\r | |
2220 | \r | |
2221 | GcdAllocateType - The type of allocate operation\r | |
2222 | \r | |
2223 | GcdIoType - The desired IO type\r | |
2224 | \r | |
2225 | Alignment - Align with 2^Alignment\r | |
2226 | \r | |
2227 | Length - Length to allocate\r | |
2228 | \r | |
2229 | BaseAddress - Base address to allocate\r | |
2230 | \r | |
2231 | ImageHandle - The image handle consume the allocated space.\r | |
2232 | \r | |
2233 | DeviceHandle - The device handle consume the allocated space.\r | |
2234 | \r | |
2235 | Returns:\r | |
2236 | \r | |
2237 | EFI_INVALID_PARAMETER - Invalid parameter.\r | |
2238 | \r | |
2239 | EFI_NOT_FOUND - No descriptor contains the desired space.\r | |
2240 | \r | |
2241 | EFI_SUCCESS - IO space successfully allocated.\r | |
2242 | \r | |
2243 | --*/\r | |
2244 | ;\r | |
2245 | \r | |
2246 | EFI_STATUS\r | |
2247 | CoreFreeIoSpace (\r | |
2248 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2249 | IN UINT64 Length\r | |
2250 | )\r | |
2251 | /*++\r | |
2252 | \r | |
2253 | Routine Description:Routine Description:\r | |
2254 | \r | |
2255 | Free a segment of IO space in GCD map.\r | |
2256 | \r | |
2257 | Arguments:\r | |
2258 | \r | |
2259 | BaseAddress - Base address of the segment.\r | |
2260 | \r | |
2261 | Length - Length of the segment.\r | |
2262 | \r | |
2263 | Returns:\r | |
2264 | \r | |
2265 | EFI_SUCCESS - Space successfully freed.\r | |
2266 | \r | |
2267 | --*/\r | |
2268 | ;\r | |
2269 | \r | |
2270 | EFI_STATUS\r | |
2271 | CoreRemoveIoSpace (\r | |
2272 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2273 | IN UINT64 Length\r | |
2274 | )\r | |
2275 | /*++\r | |
2276 | \r | |
2277 | Routine Description:Routine Description:\r | |
2278 | \r | |
2279 | Remove a segment of IO space in GCD map.\r | |
2280 | \r | |
2281 | Arguments:\r | |
2282 | \r | |
2283 | BaseAddress - Base address of the segment.\r | |
2284 | \r | |
2285 | Length - Length of the segment.\r | |
2286 | \r | |
2287 | Returns:\r | |
2288 | \r | |
2289 | EFI_SUCCESS - Successfully removed a segment of IO space.\r | |
2290 | \r | |
2291 | --*/\r | |
2292 | ;\r | |
2293 | \r | |
2294 | EFI_STATUS\r | |
2295 | CoreGetIoSpaceDescriptor (\r | |
2296 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
2297 | OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r | |
2298 | )\r | |
2299 | /*++\r | |
2300 | \r | |
2301 | Routine Description:\r | |
2302 | \r | |
2303 | Search all entries in GCD map which contains specified segment and build it to a descriptor.\r | |
2304 | \r | |
2305 | Arguments:\r | |
2306 | \r | |
2307 | BaseAddress - Specified start address\r | |
2308 | \r | |
2309 | Descriptor - Specified length\r | |
2310 | \r | |
2311 | Returns:\r | |
2312 | \r | |
2313 | EFI_INVALID_PARAMETER - Descriptor is NULL.\r | |
2314 | \r | |
2315 | EFI_SUCCESS - Successfully get the IO space descriptor.\r | |
2316 | \r | |
2317 | --*/\r | |
2318 | ;\r | |
2319 | \r | |
2320 | EFI_STATUS\r | |
2321 | CoreGetIoSpaceMap (\r | |
2322 | OUT UINTN *NumberOfDescriptors,\r | |
2323 | OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r | |
2324 | )\r | |
2325 | /*++\r | |
2326 | \r | |
2327 | Routine Description:\r | |
2328 | \r | |
2329 | Transer all entries of GCD IO map into IO descriptors and pass to caller.\r | |
2330 | \r | |
2331 | Arguments:\r | |
2332 | \r | |
2333 | NumberOfDescriptors - Number of descriptors.\r | |
2334 | \r | |
2335 | IoSpaceMap - Descriptor array\r | |
2336 | \r | |
2337 | Returns:\r | |
2338 | \r | |
2339 | EFI_INVALID_PARAMETER - Invalid parameter\r | |
2340 | \r | |
2341 | EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r | |
2342 | \r | |
2343 | EFI_SUCCESS - Successfully get IO space map.\r | |
2344 | \r | |
2345 | --*/\r | |
2346 | ;\r | |
2347 | \r | |
2348 | EFI_DXESERVICE\r | |
2349 | EFI_STATUS\r | |
2350 | EFIAPI\r | |
2351 | CoreDispatcher (\r | |
2352 | VOID\r | |
2353 | )\r | |
2354 | /*++\r | |
2355 | \r | |
2356 | Routine Description:\r | |
2357 | \r | |
2358 | This is the main Dispatcher for DXE and it exits when there are no more \r | |
2359 | drivers to run. Drain the mScheduledQueue and load and start a PE\r | |
2360 | image for each driver. Search the mDiscoveredList to see if any driver can \r | |
2361 | be placed on the mScheduledQueue. If no drivers are placed on the\r | |
2362 | mScheduledQueue exit the function. On exit it is assumed the Bds()\r | |
2363 | will be called, and when the Bds() exits the Dispatcher will be called \r | |
2364 | again.\r | |
2365 | \r | |
2366 | Arguments:\r | |
2367 | \r | |
2368 | NONE\r | |
2369 | \r | |
2370 | Returns:\r | |
2371 | \r | |
2372 | EFI_ALREADY_STARTED - The DXE Dispatcher is already running\r | |
2373 | \r | |
2374 | EFI_NOT_FOUND - No DXE Drivers were dispatched\r | |
2375 | \r | |
2376 | EFI_SUCCESS - One or more DXE Drivers were dispatched\r | |
2377 | \r | |
2378 | --*/\r | |
2379 | ;\r | |
2380 | EFI_DXESERVICE\r | |
2381 | EFI_STATUS\r | |
2382 | EFIAPI\r | |
2383 | CoreSchedule (\r | |
2384 | IN EFI_HANDLE FirmwareVolumeHandle,\r | |
2385 | IN EFI_GUID *DriverName\r | |
2386 | )\r | |
2387 | /*++\r | |
2388 | \r | |
2389 | Routine Description:\r | |
2390 | \r | |
2391 | Check every driver and locate a matching one. If the driver is found, the Unrequested\r | |
2392 | state flag is cleared.\r | |
2393 | \r | |
2394 | Arguments:\r | |
2395 | \r | |
2396 | FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware \r | |
2397 | file specified by DriverName.\r | |
2398 | \r | |
2399 | DriverName - The Driver name to put in the Dependent state.\r | |
2400 | \r | |
2401 | Returns:\r | |
2402 | \r | |
2403 | EFI_SUCCESS - The DriverName was found and it's SOR bit was cleared\r | |
2404 | \r | |
2405 | EFI_NOT_FOUND - The DriverName does not exist or it's SOR bit was not set.\r | |
2406 | \r | |
2407 | --*/\r | |
2408 | ;\r | |
2409 | \r | |
2410 | EFI_DXESERVICE\r | |
2411 | EFI_STATUS\r | |
2412 | EFIAPI\r | |
2413 | CoreTrust (\r | |
2414 | IN EFI_HANDLE FirmwareVolumeHandle,\r | |
2415 | IN EFI_GUID *DriverName\r | |
2416 | )\r | |
2417 | /*++\r | |
2418 | \r | |
2419 | Routine Description:\r | |
2420 | \r | |
2421 | Convert a driver from the Untrused back to the Scheduled state\r | |
2422 | \r | |
2423 | Arguments:\r | |
2424 | \r | |
2425 | FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware \r | |
2426 | file specified by DriverName.\r | |
2427 | \r | |
2428 | DriverName - The Driver name to put in the Scheduled state\r | |
2429 | \r | |
2430 | Returns:\r | |
2431 | \r | |
2432 | EFI_SUCCESS - The file was found in the untrusted state, and it was promoted \r | |
2433 | to the trusted state.\r | |
2434 | \r | |
2435 | EFI_NOT_FOUND - The file was not found in the untrusted state.\r | |
2436 | \r | |
2437 | --*/\r | |
2438 | ;\r | |
2439 | \r | |
2440 | BOOLEAN\r | |
2441 | CoreGrowBuffer (\r | |
2442 | IN OUT EFI_STATUS *Status,\r | |
2443 | IN OUT VOID **Buffer,\r | |
2444 | IN UINTN BufferSize\r | |
2445 | )\r | |
2446 | /*++\r | |
2447 | \r | |
2448 | Routine Description:\r | |
2449 | \r | |
2450 | Helper function called as part of the code needed\r | |
2451 | to allocate the proper sized buffer for various \r | |
2452 | EFI interfaces.\r | |
2453 | \r | |
2454 | Arguments:\r | |
2455 | \r | |
2456 | Status - Current status\r | |
2457 | \r | |
2458 | Buffer - Current allocated buffer, or NULL\r | |
2459 | \r | |
2460 | BufferSize - Current buffer size needed\r | |
2461 | \r | |
2462 | Returns:\r | |
2463 | \r | |
2464 | TRUE - if the buffer was reallocated and the caller \r | |
2465 | should try the API again.\r | |
2466 | \r | |
2467 | FALSE - buffer could not be allocated and the caller\r | |
2468 | should not try the API again.\r | |
2469 | \r | |
2470 | --*/\r | |
2471 | ;\r | |
2472 | \r | |
2473 | EFI_STATUS\r | |
2474 | EFIAPI\r | |
2475 | FwVolDriverInit (\r | |
2476 | IN EFI_HANDLE ImageHandle,\r | |
2477 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
2478 | )\r | |
2479 | /*++\r | |
2480 | \r | |
2481 | Routine Description:\r | |
2482 | This routine is the driver initialization entry point. It initializes the\r | |
2483 | libraries, and registers two notification functions. These notification\r | |
2484 | functions are responsible for building the FV stack dynamically.\r | |
2485 | \r | |
2486 | Arguments:\r | |
2487 | ImageHandle - The image handle.\r | |
2488 | SystemTable - The system table.\r | |
2489 | \r | |
2490 | Returns:\r | |
2491 | EFI_SUCCESS - Function successfully returned.\r | |
2492 | \r | |
2493 | --*/\r | |
2494 | ;\r | |
2495 | \r | |
2496 | EFI_STATUS\r | |
2497 | EFIAPI\r | |
2498 | InitializeSectionExtraction (\r | |
2499 | IN EFI_HANDLE ImageHandle,\r | |
2500 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
2501 | )\r | |
2502 | /*++\r | |
2503 | \r | |
2504 | Routine Description: \r | |
2505 | Entry point of the section extraction code. Initializes an instance of the \r | |
2506 | section extraction interface and installs it on a new handle.\r | |
2507 | \r | |
2508 | Arguments: \r | |
2509 | ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver\r | |
2510 | SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table \r | |
2511 | \r | |
2512 | Returns: \r | |
2513 | EFI_SUCCESS: Driver initialized successfully\r | |
2514 | EFI_OUT_OF_RESOURCES: Could not allocate needed resources\r | |
2515 | \r | |
2516 | --*/\r | |
2517 | ;\r | |
2518 | \r | |
2519 | EFI_STATUS\r | |
2520 | CoreProcessFirmwareVolume (\r | |
2521 | IN VOID *FvHeader,\r | |
2522 | IN UINTN Size, \r | |
2523 | OUT EFI_HANDLE *FVProtocolHandle\r | |
2524 | )\r | |
2525 | /*++\r | |
2526 | \r | |
2527 | Routine Description:\r | |
2528 | This DXE service routine is used to process a firmware volume. In\r | |
2529 | particular, it can be called by BDS to process a single firmware\r | |
2530 | volume found in a capsule. \r | |
2531 | \r | |
2532 | Arguments:\r | |
2533 | FvHeader - pointer to a firmware volume header\r | |
2534 | Size - the size of the buffer pointed to by FvHeader\r | |
2535 | FVProtocolHandle - the handle on which a firmware volume protocol\r | |
2536 | was produced for the firmware volume passed in.\r | |
2537 | \r | |
2538 | Returns:\r | |
2539 | EFI_OUT_OF_RESOURCES - if an FVB could not be produced due to lack of \r | |
2540 | system resources\r | |
2541 | EFI_VOLUME_CORRUPTED - if the volume was corrupted\r | |
2542 | EFI_SUCCESS - a firmware volume protocol was produced for the\r | |
2543 | firmware volume\r | |
2544 | \r | |
2545 | --*/\r | |
2546 | ;\r | |
2547 | \r | |
2548 | //\r | |
2549 | //Functions used during debug buils\r | |
2550 | //\r | |
2551 | VOID\r | |
2552 | CoreDisplayMissingArchProtocols (\r | |
2553 | VOID\r | |
2554 | )\r | |
2555 | /*++\r | |
2556 | \r | |
2557 | Routine Description:\r | |
2558 | Displays Architectural protocols that were not loaded and are required for DXE core to function\r | |
2559 | Only used in Debug Builds\r | |
2560 | \r | |
2561 | Arguments:\r | |
2562 | NONE\r | |
2563 | \r | |
2564 | Returns:\r | |
2565 | NONE\r | |
2566 | \r | |
2567 | --*/;\r | |
2568 | \r | |
2569 | VOID\r | |
2570 | CoreDisplayDiscoveredNotDispatched (\r | |
2571 | VOID\r | |
2572 | )\r | |
2573 | /*++\r | |
2574 | \r | |
2575 | Routine Description:\r | |
2576 | \r | |
2577 | Traverse the discovered list for any drivers that were discovered but not loaded \r | |
2578 | because the dependency experessions evaluated to false\r | |
2579 | \r | |
2580 | Arguments:\r | |
2581 | \r | |
2582 | NONE\r | |
2583 | \r | |
2584 | Returns:\r | |
2585 | \r | |
2586 | NONE \r | |
2587 | \r | |
2588 | --*/;\r | |
2589 | \r | |
2590 | EFI_STATUS\r | |
2591 | EFIAPI\r | |
2592 | CoreEfiNotAvailableYetArg0 (\r | |
2593 | VOID\r | |
2594 | )\r | |
2595 | /*++\r | |
2596 | \r | |
2597 | Routine Description:\r | |
2598 | \r | |
2599 | Place holder function until all the Boot Services and Runtime Services are available\r | |
2600 | \r | |
2601 | Arguments:\r | |
2602 | \r | |
2603 | None\r | |
2604 | \r | |
2605 | Returns:\r | |
2606 | \r | |
2607 | EFI_NOT_AVAILABLE_YET\r | |
2608 | \r | |
2609 | --*/\r | |
2610 | ;\r | |
2611 | \r | |
2612 | EFI_STATUS\r | |
2613 | EFIAPI\r | |
2614 | CoreEfiNotAvailableYetArg1 (\r | |
2615 | UINTN Arg1\r | |
2616 | )\r | |
2617 | /*++\r | |
2618 | \r | |
2619 | Routine Description:\r | |
2620 | \r | |
2621 | Place holder function until all the Boot Services and Runtime Services are available\r | |
2622 | \r | |
2623 | Arguments:\r | |
2624 | \r | |
2625 | Arg1 - Undefined\r | |
2626 | \r | |
2627 | Returns:\r | |
2628 | \r | |
2629 | EFI_NOT_AVAILABLE_YET\r | |
2630 | \r | |
2631 | --*/\r | |
2632 | ;\r | |
2633 | \r | |
2634 | EFI_STATUS\r | |
2635 | EFIAPI\r | |
2636 | CoreEfiNotAvailableYetArg2 (\r | |
2637 | UINTN Arg1,\r | |
2638 | UINTN Arg2\r | |
2639 | )\r | |
2640 | /*++\r | |
2641 | \r | |
2642 | Routine Description:\r | |
2643 | \r | |
2644 | Place holder function until all the Boot Services and Runtime Services are available\r | |
2645 | \r | |
2646 | Arguments:\r | |
2647 | \r | |
2648 | Arg1 - Undefined\r | |
2649 | \r | |
2650 | Arg2 - Undefined\r | |
2651 | \r | |
2652 | Returns:\r | |
2653 | \r | |
2654 | EFI_NOT_AVAILABLE_YET\r | |
2655 | \r | |
2656 | --*/\r | |
2657 | ;\r | |
2658 | \r | |
2659 | EFI_STATUS\r | |
2660 | EFIAPI\r | |
2661 | CoreEfiNotAvailableYetArg3 (\r | |
2662 | UINTN Arg1,\r | |
2663 | UINTN Arg2,\r | |
2664 | UINTN Arg3\r | |
2665 | )\r | |
2666 | /*++\r | |
2667 | \r | |
2668 | Routine Description:\r | |
2669 | \r | |
2670 | Place holder function until all the Boot Services and Runtime Services are available\r | |
2671 | \r | |
2672 | Arguments:\r | |
2673 | \r | |
2674 | Arg1 - Undefined\r | |
2675 | \r | |
2676 | Arg2 - Undefined\r | |
2677 | \r | |
2678 | Arg3 - Undefined\r | |
2679 | \r | |
2680 | Returns:\r | |
2681 | \r | |
2682 | EFI_NOT_AVAILABLE_YET\r | |
2683 | \r | |
2684 | --*/\r | |
2685 | ;\r | |
2686 | \r | |
2687 | EFI_STATUS\r | |
2688 | EFIAPI\r | |
2689 | CoreEfiNotAvailableYetArg4 (\r | |
2690 | UINTN Arg1,\r | |
2691 | UINTN Arg2,\r | |
2692 | UINTN Arg3,\r | |
2693 | UINTN Arg4\r | |
2694 | )\r | |
2695 | /*++\r | |
2696 | \r | |
2697 | Routine Description:\r | |
2698 | \r | |
2699 | Place holder function until all the Boot Services and Runtime Services are available\r | |
2700 | \r | |
2701 | Arguments:\r | |
2702 | \r | |
2703 | Arg1 - Undefined\r | |
2704 | \r | |
2705 | Arg2 - Undefined\r | |
2706 | \r | |
2707 | Arg3 - Undefined\r | |
2708 | \r | |
2709 | Arg4 - Undefined\r | |
2710 | \r | |
2711 | Returns:\r | |
2712 | \r | |
2713 | EFI_NOT_AVAILABLE_YET\r | |
2714 | \r | |
2715 | --*/\r | |
2716 | ;\r | |
2717 | \r | |
2718 | EFI_STATUS\r | |
2719 | EFIAPI\r | |
2720 | CoreEfiNotAvailableYetArg5 (\r | |
2721 | UINTN Arg1,\r | |
2722 | UINTN Arg2,\r | |
2723 | UINTN Arg3,\r | |
2724 | UINTN Arg4,\r | |
2725 | UINTN Arg5\r | |
2726 | )\r | |
2727 | /*++\r | |
2728 | \r | |
2729 | Routine Description:\r | |
2730 | \r | |
2731 | Place holder function until all the Boot Services and Runtime Services are available\r | |
2732 | \r | |
2733 | Arguments:\r | |
2734 | \r | |
2735 | Arg1 - Undefined\r | |
2736 | \r | |
2737 | Arg2 - Undefined\r | |
2738 | \r | |
2739 | Arg3 - Undefined\r | |
2740 | \r | |
2741 | Arg4 - Undefined\r | |
2742 | \r | |
2743 | Arg5 - Undefined\r | |
2744 | \r | |
2745 | Returns:\r | |
2746 | \r | |
2747 | EFI_NOT_AVAILABLE_YET\r | |
2748 | \r | |
2749 | --*/\r | |
2750 | ;\r | |
2751 | \r | |
2752 | EFI_STATUS\r | |
2753 | CoreGetPeiProtocol (\r | |
2754 | IN EFI_GUID *ProtocolGuid,\r | |
2755 | IN VOID **Interface\r | |
2756 | )\r | |
2757 | /*++\r | |
2758 | \r | |
2759 | Routine Description:\r | |
2760 | \r | |
2761 | Searches for a Protocol Interface passed from PEI through a HOB\r | |
2762 | \r | |
2763 | Arguments:\r | |
2764 | \r | |
2765 | ProtocolGuid - The Protocol GUID to search for in the HOB List\r | |
2766 | \r | |
2767 | Interface - A pointer to the interface for the Protocol GUID\r | |
2768 | \r | |
2769 | Returns:\r | |
2770 | \r | |
2771 | EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface\r | |
2772 | \r | |
2773 | EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List\r | |
2774 | \r | |
2775 | --*/\r | |
2776 | ;\r | |
2777 | \r | |
2778 | EFI_STATUS\r | |
2779 | DxeMainUefiDecompressGetInfo (\r | |
2780 | IN EFI_DECOMPRESS_PROTOCOL *This,\r | |
2781 | IN VOID *Source,\r | |
2782 | IN UINT32 SourceSize,\r | |
2783 | OUT UINT32 *DestinationSize,\r | |
2784 | OUT UINT32 *ScratchSize\r | |
2785 | );\r | |
2786 | \r | |
2787 | EFI_STATUS\r | |
2788 | EFIAPI\r | |
2789 | DxeMainUefiDecompress (\r | |
2790 | IN EFI_DECOMPRESS_PROTOCOL *This,\r | |
2791 | IN VOID *Source,\r | |
2792 | IN UINT32 SourceSize,\r | |
2793 | IN OUT VOID *Destination,\r | |
2794 | IN UINT32 DestinationSize,\r | |
2795 | IN OUT VOID *Scratch,\r | |
2796 | IN UINT32 ScratchSize\r | |
2797 | );\r | |
2798 | \r | |
2799 | EFI_STATUS\r | |
2800 | DxeMainTianoDecompressGetInfo (\r | |
2801 | IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r | |
2802 | IN VOID *Source,\r | |
2803 | IN UINT32 SourceSize,\r | |
2804 | OUT UINT32 *DestinationSize,\r | |
2805 | OUT UINT32 *ScratchSize\r | |
2806 | );\r | |
2807 | \r | |
2808 | EFI_STATUS\r | |
2809 | EFIAPI\r | |
2810 | DxeMainTianoDecompress (\r | |
2811 | IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r | |
2812 | IN VOID *Source,\r | |
2813 | IN UINT32 SourceSize,\r | |
2814 | IN OUT VOID *Destination,\r | |
2815 | IN UINT32 DestinationSize,\r | |
2816 | IN OUT VOID *Scratch,\r | |
2817 | IN UINT32 ScratchSize\r | |
2818 | );\r | |
2819 | \r | |
2820 | EFI_STATUS\r | |
2821 | DxeMainCustomDecompressGetInfo (\r | |
2822 | IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,\r | |
2823 | IN VOID *Source,\r | |
2824 | IN UINT32 SourceSize,\r | |
2825 | OUT UINT32 *DestinationSize,\r | |
2826 | OUT UINT32 *ScratchSize\r | |
2827 | );\r | |
2828 | \r | |
2829 | EFI_STATUS\r | |
2830 | EFIAPI\r | |
2831 | DxeMainCustomDecompress (\r | |
2832 | IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,\r | |
2833 | IN VOID *Source,\r | |
2834 | IN UINT32 SourceSize,\r | |
2835 | IN OUT VOID *Destination,\r | |
2836 | IN UINT32 DestinationSize,\r | |
2837 | IN OUT VOID *Scratch,\r | |
2838 | IN UINT32 ScratchSize\r | |
2839 | );\r | |
2840 | \r | |
2841 | #endif\r |