]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/Dxe/DxeMain.h
Add more comment for EFI_DEP_REPLACE_TRUE
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain.h
CommitLineData
162ed594 1/** @file\r
504214c4
LG
2 The internal header file includes the common header files, defines\r
3 internal structure and functions used by DxeCore module.\r
23c98c94 4\r
5Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
28a00297 13\r
797a9d67 14**/\r
28a00297 15\r
16#ifndef _DXE_MAIN_H_\r
17#define _DXE_MAIN_H_\r
18\r
19\r
ed7748fe 20\r
28a00297 21#include <PiDxe.h>\r
ed7748fe 22\r
28a00297 23#include <Protocol/LoadedImage.h>\r
24#include <Protocol/GuidedSectionExtraction.h>\r
28a00297 25#include <Protocol/DevicePath.h>\r
26#include <Protocol/Runtime.h>\r
27#include <Protocol/LoadFile.h>\r
28#include <Protocol/DriverBinding.h>\r
29#include <Protocol/VariableWrite.h>\r
30#include <Protocol/PlatformDriverOverride.h>\r
31#include <Protocol/Variable.h>\r
28a00297 32#include <Protocol/Timer.h>\r
33#include <Protocol/SimpleFileSystem.h>\r
34#include <Protocol/Bds.h>\r
28a00297 35#include <Protocol/RealTimeClock.h>\r
28a00297 36#include <Protocol/WatchdogTimer.h>\r
0c2b5da8 37#include <Protocol/FirmwareVolume2.h>\r
28a00297 38#include <Protocol/MonotonicCounter.h>\r
28a00297 39#include <Protocol/StatusCode.h>\r
28a00297 40#include <Protocol/Decompress.h>\r
41#include <Protocol/LoadPe32Image.h>\r
42#include <Protocol/FirmwareVolumeDispatch.h>\r
43#include <Protocol/Security.h>\r
44#include <Protocol/Ebc.h>\r
28a00297 45#include <Protocol/Reset.h>\r
28a00297 46#include <Protocol/Cpu.h>\r
28a00297 47#include <Protocol/Metronome.h>\r
48#include <Protocol/FirmwareVolumeBlock.h>\r
49#include <Protocol/Capsule.h>\r
50#include <Protocol/BusSpecificDriverOverride.h>\r
51#include <Protocol/Performance.h>\r
022c6d45 52#include <Protocol/TcgService.h>\r
822360ee 53#include <Protocol/TcgPlatform.h>\r
022c6d45 54#include <Guid/MemoryTypeInformation.h>\r
55#include <Guid/FirmwareFileSystem2.h>\r
56#include <Guid/HobList.h>\r
57#include <Guid/DebugImageInfoTable.h>\r
58#include <Guid/FileInfo.h>\r
59#include <Guid/Apriori.h>\r
60#include <Guid/DxeServices.h>\r
61#include <Guid/MemoryAllocationHob.h>\r
62#include <Guid/EventLegacyBios.h>\r
63#include <Guid/EventGroup.h>\r
64\r
ed7748fe 65\r
28a00297 66#include <Library/DxeCoreEntryPoint.h>\r
67#include <Library/DebugLib.h>\r
68#include <Library/UefiLib.h>\r
69#include <Library/BaseLib.h>\r
70#include <Library/HobLib.h>\r
71#include <Library/PerformanceLib.h>\r
72#include <Library/UefiDecompressLib.h>\r
18fd8d65 73#include <Library/ExtractGuidedSectionLib.h>\r
28a00297 74#include <Library/CacheMaintenanceLib.h>\r
75#include <Library/BaseMemoryLib.h>\r
3d7b0992 76#include <Library/PeCoffLib.h>\r
797a9d67 77#include <Library/PcdLib.h>\r
c4869732 78#include <Library/MemoryAllocationLib.h>\r
070f0cf7 79#include <Library/DevicePathLib.h>\r
0e9b156d 80#include <Library/UefiBootServicesTableLib.h>\r
2680a308 81#include <Library/ReportStatusCodeLib.h>\r
28a00297 82\r
83#include "DebugImageInfo.h"\r
84#include "Library.h"\r
85#include "FwVolBlock.h"\r
86#include "FwVolDriver.h"\r
3b1d9fd5 87#include "Gcd.h"\r
88#include "Imem.h"\r
28a00297 89#include "Image.h"\r
90#include "Exec.h"\r
3b1d9fd5 91#include "Hand.h"\r
28a00297 92\r
28a00297 93//\r
94// attributes for reserved memory before it is promoted to system memory\r
95//\r
96#define EFI_MEMORY_PRESENT 0x0100000000000000ULL\r
97#define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL\r
98#define EFI_MEMORY_TESTED 0x0400000000000000ULL\r
99\r
100//\r
101// range for memory mapped port I/O on IPF\r
102//\r
103#define EFI_MEMORY_PORT_IO 0x4000000000000000ULL\r
104\r
105\r
106///\r
107/// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression\r
108/// to save time. A EFI_DEP_PUSH is evauated one an\r
7f932291 109/// replaced with EFI_DEP_REPLACE_TRUE. If PI spec's Vol 2\r
110/// Driver Execution Environment Core Interface use 0xff\r
111/// as new DEPEX opcode. EFI_DEP_REPLACE_TRUE should be\r
112/// defined to a new value that is not conflicting with PI spec.\r
28a00297 113///\r
114#define EFI_DEP_REPLACE_TRUE 0xff\r
115\r
116///\r
117/// Define the initial size of the dependency expression evaluation stack\r
118///\r
119#define DEPEX_STACK_SIZE_INCREMENT 0x1000\r
120\r
121typedef struct {\r
122 EFI_GUID *ProtocolGuid;\r
123 VOID **Protocol;\r
124 EFI_EVENT Event;\r
125 VOID *Registration;\r
126 BOOLEAN Present;\r
127} ARCHITECTURAL_PROTOCOL_ENTRY;\r
128\r
28a00297 129//\r
130// DXE Dispatcher Data structures\r
131//\r
132\r
133#define KNOWN_HANDLE_SIGNATURE EFI_SIGNATURE_32('k','n','o','w')\r
134typedef struct {\r
135 UINTN Signature;\r
022c6d45 136 LIST_ENTRY Link; // mFvHandleList\r
28a00297 137 EFI_HANDLE Handle;\r
138} KNOWN_HANDLE;\r
139\r
140\r
141#define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')\r
142typedef struct {\r
143 UINTN Signature;\r
144 LIST_ENTRY Link; // mDriverList\r
145\r
146 LIST_ENTRY ScheduledLink; // mScheduledQueue\r
147\r
148 EFI_HANDLE FvHandle;\r
149 EFI_GUID FileName;\r
150 EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r
0c2b5da8 151 EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
28a00297 152\r
153 VOID *Depex;\r
154 UINTN DepexSize;\r
155\r
156 BOOLEAN Before;\r
157 BOOLEAN After;\r
158 EFI_GUID BeforeAfterGuid;\r
159\r
160 BOOLEAN Dependent;\r
161 BOOLEAN Unrequested;\r
162 BOOLEAN Scheduled;\r
163 BOOLEAN Untrusted;\r
164 BOOLEAN Initialized;\r
165 BOOLEAN DepexProtocolError;\r
166\r
167 EFI_HANDLE ImageHandle;\r
168\r
169} EFI_CORE_DRIVER_ENTRY;\r
170\r
171//\r
172//The data structure of GCD memory map entry\r
173//\r
174#define EFI_GCD_MAP_SIGNATURE EFI_SIGNATURE_32('g','c','d','m')\r
175typedef struct {\r
176 UINTN Signature;\r
177 LIST_ENTRY Link;\r
178 EFI_PHYSICAL_ADDRESS BaseAddress;\r
179 UINT64 EndAddress;\r
180 UINT64 Capabilities;\r
181 UINT64 Attributes;\r
182 EFI_GCD_MEMORY_TYPE GcdMemoryType;\r
183 EFI_GCD_IO_TYPE GcdIoType;\r
184 EFI_HANDLE ImageHandle;\r
185 EFI_HANDLE DeviceHandle;\r
186} EFI_GCD_MAP_ENTRY;\r
187\r
188//\r
189// DXE Core Global Variables\r
190//\r
191extern EFI_SYSTEM_TABLE *gDxeCoreST;\r
28a00297 192extern EFI_RUNTIME_SERVICES *gDxeCoreRT;\r
193extern EFI_DXE_SERVICES *gDxeCoreDS;\r
194extern EFI_HANDLE gDxeCoreImageHandle;\r
195\r
196extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r
28a00297 197\r
198extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;\r
199extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r
200extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;\r
201extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;\r
202extern EFI_TIMER_ARCH_PROTOCOL *gTimer;\r
203extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;\r
204extern EFI_BDS_ARCH_PROTOCOL *gBds;\r
28a00297 205\r
206extern EFI_TPL gEfiCurrentTpl;\r
207\r
208extern EFI_GUID *gDxeCoreFileName;\r
209extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;\r
210\r
211extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];\r
212\r
213extern BOOLEAN gDispatcherRunning;\r
214extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate;\r
215\r
216//\r
217// Service Initialization Functions\r
218//\r
219\r
220\r
162ed594 221\r
222/**\r
223 Called to initialize the pool.\r
224\r
225**/\r
28a00297 226VOID\r
227CoreInitializePool (\r
228 VOID\r
23c98c94 229 );\r
28a00297 230\r
28a00297 231\r
162ed594 232/**\r
233 Called to initialize the memory map and add descriptors to\r
234 the current descriptor list.\r
235 The first descriptor that is added must be general usable\r
236 memory as the addition allocates heap.\r
28a00297 237\r
022c6d45 238 @param Type The type of memory to add\r
239 @param Start The starting address in the memory range Must be\r
240 page aligned\r
241 @param NumberOfPages The number of pages in the range\r
242 @param Attribute Attributes of the memory to add\r
28a00297 243\r
162ed594 244 @return None. The range is added to the memory map\r
28a00297 245\r
162ed594 246**/\r
28a00297 247VOID\r
248CoreAddMemoryDescriptor (\r
249 IN EFI_MEMORY_TYPE Type,\r
250 IN EFI_PHYSICAL_ADDRESS Start,\r
251 IN UINT64 NumberOfPages,\r
252 IN UINT64 Attribute\r
23c98c94 253 );\r
28a00297 254\r
28a00297 255\r
162ed594 256/**\r
257 Release memory lock on mGcdMemorySpaceLock.\r
28a00297 258\r
162ed594 259**/\r
28a00297 260VOID\r
261CoreReleaseGcdMemoryLock (\r
262 VOID\r
23c98c94 263 );\r
28a00297 264\r
28a00297 265\r
162ed594 266/**\r
267 Acquire memory lock on mGcdMemorySpaceLock.\r
28a00297 268\r
162ed594 269**/\r
28a00297 270VOID\r
271CoreAcquireGcdMemoryLock (\r
272 VOID\r
23c98c94 273 );\r
28a00297 274\r
28a00297 275\r
162ed594 276/**\r
277 External function. Initializes the GCD and memory services based on the memory\r
278 descriptor HOBs. This function is responsible for priming the GCD map and the\r
279 memory map, so memory allocations and resource allocations can be made. The first\r
280 part of this function can not depend on any memory services until at least one\r
281 memory descriptor is provided to the memory services. Then the memory services\r
282 can be used to intialize the GCD map.\r
28a00297 283\r
022c6d45 284 @param HobStart The start address of the HOB.\r
285 @param MemoryBaseAddress Start address of memory region found to init DXE\r
286 core.\r
287 @param MemoryLength Length of memory region found to init DXE core.\r
28a00297 288\r
162ed594 289 @retval EFI_SUCCESS Memory services successfully initialized.\r
28a00297 290\r
162ed594 291**/\r
28a00297 292EFI_STATUS\r
293CoreInitializeMemoryServices (\r
23c98c94 294 IN VOID **HobStart,\r
295 OUT EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,\r
296 OUT UINT64 *MemoryLength\r
297 );\r
162ed594 298\r
28a00297 299\r
28a00297 300\r
162ed594 301/**\r
302 External function. Initializes the GCD and memory services based on the memory\r
28a00297 303 descriptor HOBs. This function is responsible for priming the GCD map and the\r
304 memory map, so memory allocations and resource allocations can be made. The first\r
305 part of this function can not depend on any memory services until at least one\r
306 memory descriptor is provided to the memory services. Then the memory services\r
162ed594 307 can be used to intialize the GCD map. The HobStart will be relocated to a pool\r
308 buffer.\r
28a00297 309\r
022c6d45 310 @param HobStart The start address of the HOB\r
311 @param MemoryBaseAddress Start address of memory region found to init DXE\r
312 core.\r
313 @param MemoryLength Length of memory region found to init DXE core.\r
28a00297 314\r
162ed594 315 @retval EFI_SUCCESS GCD services successfully initialized.\r
28a00297 316\r
162ed594 317**/\r
28a00297 318EFI_STATUS\r
319CoreInitializeGcdServices (\r
022c6d45 320 IN OUT VOID **HobStart,\r
28a00297 321 IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,\r
322 IN UINT64 MemoryLength\r
23c98c94 323 );\r
28a00297 324\r
28a00297 325\r
162ed594 326/**\r
327 Initializes "event" support and populates parts of the System and Runtime Table.\r
28a00297 328\r
162ed594 329 @retval EFI_SUCCESS Always return success\r
28a00297 330\r
162ed594 331**/\r
28a00297 332EFI_STATUS\r
333CoreInitializeEventServices (\r
334 VOID\r
23c98c94 335 );\r
28a00297 336\r
28a00297 337\r
162ed594 338/**\r
339 Add the Image Services to EFI Boot Services Table and install the protocol\r
340 interfaces for this image.\r
28a00297 341\r
022c6d45 342 @param HobStart The HOB to initialize\r
28a00297 343\r
162ed594 344 @return Status code.\r
28a00297 345\r
162ed594 346**/\r
28a00297 347EFI_STATUS\r
348CoreInitializeImageServices (\r
349 IN VOID *HobStart\r
23c98c94 350 );\r
28a00297 351\r
28a00297 352\r
162ed594 353/**\r
354 Creates an event that is fired everytime a Protocol of a specific type is installed.\r
28a00297 355\r
162ed594 356**/\r
28a00297 357VOID\r
358CoreNotifyOnArchProtocolInstallation (\r
359 VOID\r
23c98c94 360 );\r
28a00297 361\r
28a00297 362\r
162ed594 363/**\r
364 Return TRUE if all AP services are availible.\r
28a00297 365\r
022c6d45 366 @retval EFI_SUCCESS All AP services are available\r
162ed594 367 @retval EFI_NOT_FOUND At least one AP service is not available\r
28a00297 368\r
162ed594 369**/\r
28a00297 370EFI_STATUS\r
371CoreAllEfiServicesAvailable (\r
372 VOID\r
23c98c94 373 );\r
28a00297 374\r
28a00297 375\r
162ed594 376/**\r
377 Calcualte the 32-bit CRC in a EFI table using the service provided by the\r
378 gRuntime service.\r
28a00297 379\r
162ed594 380 @param Hdr Pointer to an EFI standard header\r
28a00297 381\r
162ed594 382**/\r
28a00297 383VOID\r
384CalculateEfiHdrCrc (\r
385 IN OUT EFI_TABLE_HEADER *Hdr\r
23c98c94 386 );\r
28a00297 387\r
28a00297 388\r
162ed594 389/**\r
390 Called by the platform code to process a tick.\r
28a00297 391\r
022c6d45 392 @param Duration The number of 100ns elasped since the last call\r
162ed594 393 to TimerTick\r
28a00297 394\r
162ed594 395**/\r
28a00297 396VOID\r
397EFIAPI\r
398CoreTimerTick (\r
23c98c94 399 IN UINT64 Duration\r
400 );\r
28a00297 401\r
28a00297 402\r
162ed594 403/**\r
404 Initialize the dispatcher. Initialize the notification function that runs when\r
022c6d45 405 an FV2 protocol is added to the system.\r
28a00297 406\r
162ed594 407**/\r
28a00297 408VOID\r
409CoreInitializeDispatcher (\r
410 VOID\r
23c98c94 411 );\r
28a00297 412\r
28a00297 413\r
162ed594 414/**\r
415 This is the POSTFIX version of the dependency evaluator. This code does\r
416 not need to handle Before or After, as it is not valid to call this\r
417 routine in this case. The SOR is just ignored and is a nop in the grammer.\r
418 POSTFIX means all the math is done on top of the stack.\r
28a00297 419\r
022c6d45 420 @param DriverEntry DriverEntry element to update.\r
28a00297 421\r
022c6d45 422 @retval TRUE If driver is ready to run.\r
423 @retval FALSE If driver is not ready to run or some fatal error\r
162ed594 424 was found.\r
28a00297 425\r
162ed594 426**/\r
28a00297 427BOOLEAN\r
428CoreIsSchedulable (\r
022c6d45 429 IN EFI_CORE_DRIVER_ENTRY *DriverEntry\r
23c98c94 430 );\r
28a00297 431\r
28a00297 432\r
162ed594 433/**\r
434 Preprocess dependency expression and update DriverEntry to reflect the\r
435 state of Before, After, and SOR dependencies. If DriverEntry->Before\r
436 or DriverEntry->After is set it will never be cleared. If SOR is set\r
437 it will be cleared by CoreSchedule(), and then the driver can be\r
438 dispatched.\r
28a00297 439\r
022c6d45 440 @param DriverEntry DriverEntry element to update .\r
28a00297 441\r
162ed594 442 @retval EFI_SUCCESS It always works.\r
28a00297 443\r
162ed594 444**/\r
28a00297 445EFI_STATUS\r
446CorePreProcessDepex (\r
022c6d45 447 IN EFI_CORE_DRIVER_ENTRY *DriverEntry\r
23c98c94 448 );\r
28a00297 449\r
28a00297 450\r
28a00297 451\r
162ed594 452/**\r
453 Terminates all boot services.\r
28a00297 454\r
022c6d45 455 @param ImageHandle Handle that identifies the exiting image.\r
162ed594 456 @param MapKey Key to the latest memory map.\r
28a00297 457\r
022c6d45 458 @retval EFI_SUCCESS Boot Services terminated\r
162ed594 459 @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r
28a00297 460\r
162ed594 461**/\r
28a00297 462EFI_STATUS\r
463EFIAPI\r
464CoreExitBootServices (\r
465 IN EFI_HANDLE ImageHandle,\r
466 IN UINTN MapKey\r
23c98c94 467 );\r
28a00297 468\r
28a00297 469\r
162ed594 470/**\r
471 Make sure the memory map is following all the construction rules,\r
472 it is the last time to check memory map error before exit boot services.\r
28a00297 473\r
022c6d45 474 @param MapKey Memory map key\r
28a00297 475\r
022c6d45 476 @retval EFI_INVALID_PARAMETER Memory map not consistent with construction\r
477 rules.\r
162ed594 478 @retval EFI_SUCCESS Valid memory map.\r
28a00297 479\r
162ed594 480**/\r
28a00297 481EFI_STATUS\r
482CoreTerminateMemoryMap (\r
23c98c94 483 IN UINTN MapKey\r
484 );\r
28a00297 485\r
28a00297 486\r
162ed594 487/**\r
488 Signals all events in the EventGroup.\r
28a00297 489\r
162ed594 490 @param EventGroup The list to signal\r
28a00297 491\r
162ed594 492**/\r
28a00297 493VOID\r
494CoreNotifySignalList (\r
495 IN EFI_GUID *EventGroup\r
23c98c94 496 );\r
28a00297 497\r
28a00297 498\r
28a00297 499\r
162ed594 500/**\r
501 Boot Service called to add, modify, or remove a system configuration table from\r
502 the EFI System Table.\r
28a00297 503\r
022c6d45 504 @param Guid Pointer to the GUID for the entry to add, update, or\r
505 remove\r
506 @param Table Pointer to the configuration table for the entry to add,\r
507 update, or remove, may be NULL.\r
28a00297 508\r
162ed594 509 @return EFI_SUCCESS Guid, Table pair added, updated, or removed.\r
510 @return EFI_INVALID_PARAMETER Input GUID not valid.\r
511 @return EFI_NOT_FOUND Attempted to delete non-existant entry\r
512 @return EFI_OUT_OF_RESOURCES Not enough memory available\r
28a00297 513\r
162ed594 514**/\r
28a00297 515EFI_STATUS\r
516EFIAPI\r
517CoreInstallConfigurationTable (\r
23c98c94 518 IN EFI_GUID *Guid,\r
519 IN VOID *Table\r
520 );\r
28a00297 521\r
28a00297 522\r
28a00297 523\r
162ed594 524/**\r
525 Raise the task priority level to the new level.\r
526 High level is implemented by disabling processor interrupts.\r
28a00297 527\r
022c6d45 528 @param NewTpl New task priority level\r
28a00297 529\r
162ed594 530 @return The previous task priority level\r
28a00297 531\r
162ed594 532**/\r
28a00297 533EFI_TPL\r
534EFIAPI\r
535CoreRaiseTpl (\r
23c98c94 536 IN EFI_TPL NewTpl\r
537 );\r
28a00297 538\r
28a00297 539\r
28a00297 540\r
162ed594 541/**\r
542 Lowers the task priority to the previous value. If the new\r
543 priority unmasks events at a higher priority, they are dispatched.\r
28a00297 544\r
162ed594 545 @param NewTpl New, lower, task priority\r
28a00297 546\r
162ed594 547**/\r
28a00297 548VOID\r
549EFIAPI\r
550CoreRestoreTpl (\r
23c98c94 551 IN EFI_TPL NewTpl\r
552 );\r
28a00297 553\r
28a00297 554\r
28a00297 555\r
162ed594 556/**\r
557 Introduces a fine-grained stall.\r
28a00297 558\r
162ed594 559 @param Microseconds The number of microseconds to stall execution.\r
28a00297 560\r
022c6d45 561 @retval EFI_SUCCESS Execution was stalled for at least the requested\r
562 amount of microseconds.\r
162ed594 563 @retval EFI_NOT_AVAILABLE_YET gMetronome is not available yet\r
28a00297 564\r
162ed594 565**/\r
28a00297 566EFI_STATUS\r
567EFIAPI\r
568CoreStall (\r
569 IN UINTN Microseconds\r
23c98c94 570 );\r
28a00297 571\r
28a00297 572\r
28a00297 573\r
162ed594 574/**\r
575 Sets the system's watchdog timer.\r
28a00297 576\r
162ed594 577 @param Timeout The number of seconds to set the watchdog timer to.\r
578 A value of zero disables the timer.\r
579 @param WatchdogCode The numeric code to log on a watchdog timer timeout\r
580 event. The firmware reserves codes 0x0000 to 0xFFFF.\r
581 Loaders and operating systems may use other timeout\r
582 codes.\r
583 @param DataSize The size, in bytes, of WatchdogData.\r
584 @param WatchdogData A data buffer that includes a Null-terminated Unicode\r
585 string, optionally followed by additional binary data.\r
586 The string is a description that the call may use to\r
587 further indicate the reason to be logged with a\r
588 watchdog event.\r
589\r
590 @return EFI_SUCCESS Timeout has been set\r
591 @return EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet\r
592 @return EFI_UNSUPPORTED System does not have a timer (currently not used)\r
593 @return EFI_DEVICE_ERROR Could not complete due to hardware error\r
28a00297 594\r
162ed594 595**/\r
28a00297 596EFI_STATUS\r
597EFIAPI\r
598CoreSetWatchdogTimer (\r
23c98c94 599 IN UINTN Timeout,\r
600 IN UINT64 WatchdogCode,\r
601 IN UINTN DataSize,\r
602 IN CHAR16 *WatchdogData OPTIONAL\r
603 );\r
28a00297 604\r
28a00297 605\r
28a00297 606\r
162ed594 607/**\r
608 Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r
609 Calls the private one which contains a BOOLEAN parameter for notifications\r
28a00297 610\r
022c6d45 611 @param UserHandle The handle to install the protocol handler on,\r
612 or NULL if a new handle is to be allocated\r
613 @param Protocol The protocol to add to the handle\r
614 @param InterfaceType Indicates whether Interface is supplied in\r
615 native form.\r
616 @param Interface The interface for the protocol being added\r
28a00297 617\r
162ed594 618 @return Status code\r
28a00297 619\r
162ed594 620**/\r
28a00297 621EFI_STATUS\r
622EFIAPI\r
623CoreInstallProtocolInterface (\r
624 IN OUT EFI_HANDLE *UserHandle,\r
625 IN EFI_GUID *Protocol,\r
626 IN EFI_INTERFACE_TYPE InterfaceType,\r
627 IN VOID *Interface\r
23c98c94 628 );\r
28a00297 629\r
28a00297 630\r
162ed594 631/**\r
632 Installs a protocol interface into the boot services environment.\r
28a00297 633\r
022c6d45 634 @param UserHandle The handle to install the protocol handler on,\r
635 or NULL if a new handle is to be allocated\r
636 @param Protocol The protocol to add to the handle\r
637 @param InterfaceType Indicates whether Interface is supplied in\r
638 native form.\r
639 @param Interface The interface for the protocol being added\r
640 @param Notify indicates whether notify the notification list\r
641 for this protocol\r
28a00297 642\r
022c6d45 643 @retval EFI_INVALID_PARAMETER Invalid parameter\r
644 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
162ed594 645 @retval EFI_SUCCESS Protocol interface successfully installed\r
28a00297 646\r
162ed594 647**/\r
28a00297 648EFI_STATUS\r
649CoreInstallProtocolInterfaceNotify (\r
650 IN OUT EFI_HANDLE *UserHandle,\r
651 IN EFI_GUID *Protocol,\r
652 IN EFI_INTERFACE_TYPE InterfaceType,\r
653 IN VOID *Interface,\r
654 IN BOOLEAN Notify\r
23c98c94 655 );\r
28a00297 656\r
28a00297 657\r
28a00297 658\r
162ed594 659/**\r
660 Installs a list of protocol interface into the boot services environment.\r
661 This function calls InstallProtocolInterface() in a loop. If any error\r
662 occures all the protocols added by this function are removed. This is\r
663 basically a lib function to save space.\r
28a00297 664\r
022c6d45 665 @param Handle The handle to install the protocol handlers on,\r
666 or NULL if a new handle is to be allocated\r
667 @param ... EFI_GUID followed by protocol instance. A NULL\r
668 terminates the list. The pairs are the\r
669 arguments to InstallProtocolInterface(). All the\r
670 protocols are added to Handle.\r
28a00297 671\r
022c6d45 672 @retval EFI_INVALID_PARAMETER Handle is NULL.\r
162ed594 673 @retval EFI_SUCCESS Protocol interfaces successfully installed.\r
28a00297 674\r
162ed594 675**/\r
28a00297 676EFI_STATUS\r
677EFIAPI\r
678CoreInstallMultipleProtocolInterfaces (\r
679 IN OUT EFI_HANDLE *Handle,\r
680 ...\r
23c98c94 681 );\r
28a00297 682\r
28a00297 683\r
28a00297 684\r
162ed594 685/**\r
686 Uninstalls a list of protocol interface in the boot services environment.\r
687 This function calls UnisatllProtocolInterface() in a loop. This is\r
688 basically a lib function to save space.\r
28a00297 689\r
022c6d45 690 @param Handle The handle to uninstall the protocol\r
691 @param ... EFI_GUID followed by protocol instance. A NULL\r
692 terminates the list. The pairs are the\r
693 arguments to UninstallProtocolInterface(). All\r
694 the protocols are added to Handle.\r
28a00297 695\r
162ed594 696 @return Status code\r
28a00297 697\r
162ed594 698**/\r
28a00297 699EFI_STATUS\r
700EFIAPI\r
701CoreUninstallMultipleProtocolInterfaces (\r
702 IN EFI_HANDLE Handle,\r
703 ...\r
23c98c94 704 );\r
28a00297 705\r
28a00297 706\r
28a00297 707\r
162ed594 708/**\r
709 Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.\r
28a00297 710\r
022c6d45 711 @param UserHandle Handle on which the interface is to be\r
712 reinstalled\r
713 @param Protocol The numeric ID of the interface\r
714 @param OldInterface A pointer to the old interface\r
715 @param NewInterface A pointer to the new interface\r
28a00297 716\r
162ed594 717 @retval EFI_SUCCESS The protocol interface was installed\r
718 @retval EFI_NOT_FOUND The OldInterface on the handle was not found\r
719 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
28a00297 720\r
162ed594 721**/\r
28a00297 722EFI_STATUS\r
723EFIAPI\r
724CoreReinstallProtocolInterface (\r
725 IN EFI_HANDLE UserHandle,\r
726 IN EFI_GUID *Protocol,\r
727 IN VOID *OldInterface,\r
728 IN VOID *NewInterface\r
23c98c94 729 );\r
28a00297 730\r
731\r
28a00297 732\r
162ed594 733/**\r
734 Uninstalls all instances of a protocol:interfacer from a handle.\r
735 If the last protocol interface is remove from the handle, the\r
736 handle is freed.\r
28a00297 737\r
022c6d45 738 @param UserHandle The handle to remove the protocol handler from\r
739 @param Protocol The protocol, of protocol:interface, to remove\r
740 @param Interface The interface, of protocol:interface, to remove\r
28a00297 741\r
022c6d45 742 @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
162ed594 743 @retval EFI_SUCCESS Protocol interface successfully uninstalled.\r
28a00297 744\r
162ed594 745**/\r
28a00297 746EFI_STATUS\r
747EFIAPI\r
748CoreUninstallProtocolInterface (\r
749 IN EFI_HANDLE UserHandle,\r
750 IN EFI_GUID *Protocol,\r
751 IN VOID *Interface\r
23c98c94 752 );\r
28a00297 753\r
28a00297 754\r
28a00297 755\r
162ed594 756/**\r
757 Queries a handle to determine if it supports a specified protocol.\r
28a00297 758\r
022c6d45 759 @param UserHandle The handle being queried.\r
760 @param Protocol The published unique identifier of the protocol.\r
761 @param Interface Supplies the address where a pointer to the\r
762 corresponding Protocol Interface is returned.\r
28a00297 763\r
162ed594 764 @return The requested protocol interface for the handle\r
28a00297 765\r
162ed594 766**/\r
28a00297 767EFI_STATUS\r
768EFIAPI\r
769CoreHandleProtocol (\r
23c98c94 770 IN EFI_HANDLE UserHandle,\r
771 IN EFI_GUID *Protocol,\r
772 OUT VOID **Interface\r
773 );\r
28a00297 774\r
28a00297 775\r
28a00297 776\r
162ed594 777/**\r
778 Locates the installed protocol handler for the handle, and\r
779 invokes it to obtain the protocol interface. Usage information\r
780 is registered in the protocol data base.\r
28a00297 781\r
022c6d45 782 @param UserHandle The handle to obtain the protocol interface on\r
783 @param Protocol The ID of the protocol\r
784 @param Interface The location to return the protocol interface\r
785 @param ImageHandle The handle of the Image that is opening the\r
786 protocol interface specified by Protocol and\r
787 Interface.\r
788 @param ControllerHandle The controller handle that is requiring this\r
789 interface.\r
790 @param Attributes The open mode of the protocol interface\r
791 specified by Handle and Protocol.\r
792\r
793 @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
162ed594 794 @retval EFI_SUCCESS Get the protocol interface.\r
28a00297 795\r
162ed594 796**/\r
28a00297 797EFI_STATUS\r
798EFIAPI\r
799CoreOpenProtocol (\r
800 IN EFI_HANDLE UserHandle,\r
801 IN EFI_GUID *Protocol,\r
802 OUT VOID **Interface OPTIONAL,\r
803 IN EFI_HANDLE ImageHandle,\r
804 IN EFI_HANDLE ControllerHandle,\r
805 IN UINT32 Attributes\r
23c98c94 806 );\r
28a00297 807\r
28a00297 808\r
28a00297 809\r
162ed594 810/**\r
811 Return information about Opened protocols in the system\r
28a00297 812\r
022c6d45 813 @param UserHandle The handle to close the protocol interface on\r
814 @param Protocol The ID of the protocol\r
815 @param EntryBuffer A pointer to a buffer of open protocol\r
816 information in the form of\r
817 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
162ed594 818 @param EntryCount Number of EntryBuffer entries\r
28a00297 819\r
162ed594 820**/\r
28a00297 821EFI_STATUS\r
822EFIAPI\r
823CoreOpenProtocolInformation (\r
824 IN EFI_HANDLE UserHandle,\r
825 IN EFI_GUID *Protocol,\r
826 OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
827 OUT UINTN *EntryCount\r
23c98c94 828 );\r
28a00297 829\r
28a00297 830\r
28a00297 831\r
162ed594 832/**\r
833 Closes a protocol on a handle that was opened using OpenProtocol().\r
28a00297 834\r
022c6d45 835 @param UserHandle The handle for the protocol interface that was\r
836 previously opened with OpenProtocol(), and is\r
837 now being closed.\r
838 @param Protocol The published unique identifier of the protocol.\r
839 It is the caller's responsibility to pass in a\r
840 valid GUID.\r
841 @param AgentHandle The handle of the agent that is closing the\r
842 protocol interface.\r
843 @param ControllerHandle If the agent that opened a protocol is a driver\r
844 that follows the EFI Driver Model, then this\r
845 parameter is the controller handle that required\r
846 the protocol interface. If the agent does not\r
847 follow the EFI Driver Model, then this parameter\r
848 is optional and may be NULL.\r
849\r
850 @retval EFI_SUCCESS The protocol instance was closed.\r
851 @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a\r
852 valid EFI_HANDLE.\r
853 @retval EFI_NOT_FOUND Can not find the specified protocol or\r
162ed594 854 AgentHandle.\r
28a00297 855\r
162ed594 856**/\r
28a00297 857EFI_STATUS\r
858EFIAPI\r
859CoreCloseProtocol (\r
860 IN EFI_HANDLE UserHandle,\r
861 IN EFI_GUID *Protocol,\r
162ed594 862 IN EFI_HANDLE AgentHandle,\r
022c6d45 863 IN EFI_HANDLE ControllerHandle\r
23c98c94 864 );\r
28a00297 865\r
28a00297 866\r
28a00297 867\r
162ed594 868/**\r
869 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
870 from pool.\r
871\r
022c6d45 872 @param UserHandle The handle from which to retrieve the list of\r
873 protocol interface GUIDs.\r
874 @param ProtocolBuffer A pointer to the list of protocol interface GUID\r
875 pointers that are installed on Handle.\r
876 @param ProtocolBufferCount A pointer to the number of GUID pointers present\r
877 in ProtocolBuffer.\r
878\r
879 @retval EFI_SUCCESS The list of protocol interface GUIDs installed\r
880 on Handle was returned in ProtocolBuffer. The\r
881 number of protocol interface GUIDs was returned\r
882 in ProtocolBufferCount.\r
883 @retval EFI_INVALID_PARAMETER Handle is NULL.\r
884 @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.\r
885 @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.\r
886 @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.\r
887 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
162ed594 888 results.\r
28a00297 889\r
162ed594 890**/\r
28a00297 891EFI_STATUS\r
892EFIAPI\r
893CoreProtocolsPerHandle (\r
23c98c94 894 IN EFI_HANDLE UserHandle,\r
895 OUT EFI_GUID ***ProtocolBuffer,\r
896 OUT UINTN *ProtocolBufferCount\r
897 );\r
28a00297 898\r
28a00297 899\r
28a00297 900\r
162ed594 901/**\r
902 Add a new protocol notification record for the request protocol.\r
28a00297 903\r
022c6d45 904 @param Protocol The requested protocol to add the notify\r
905 registration\r
906 @param Event The event to signal\r
907 @param Registration Returns the registration record\r
28a00297 908\r
022c6d45 909 @retval EFI_INVALID_PARAMETER Invalid parameter\r
910 @retval EFI_SUCCESS Successfully returned the registration record\r
162ed594 911 that has been added\r
28a00297 912\r
162ed594 913**/\r
28a00297 914EFI_STATUS\r
915EFIAPI\r
916CoreRegisterProtocolNotify (\r
23c98c94 917 IN EFI_GUID *Protocol,\r
918 IN EFI_EVENT Event,\r
022c6d45 919 OUT VOID **Registration\r
23c98c94 920 );\r
022c6d45 921\r
28a00297 922\r
923\r
162ed594 924/**\r
925 Locates the requested handle(s) and returns them in Buffer.\r
28a00297 926\r
022c6d45 927 @param SearchType The type of search to perform to locate the\r
928 handles\r
929 @param Protocol The protocol to search for\r
930 @param SearchKey Dependant on SearchType\r
931 @param BufferSize On input the size of Buffer. On output the\r
932 size of data returned.\r
933 @param Buffer The buffer to return the results in\r
28a00297 934\r
022c6d45 935 @retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is\r
936 returned in BufferSize.\r
937 @retval EFI_INVALID_PARAMETER Invalid parameter\r
938 @retval EFI_SUCCESS Successfully found the requested handle(s) and\r
162ed594 939 returns them in Buffer.\r
28a00297 940\r
162ed594 941**/\r
28a00297 942EFI_STATUS\r
943EFIAPI\r
944CoreLocateHandle (\r
23c98c94 945 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
946 IN EFI_GUID *Protocol OPTIONAL,\r
947 IN VOID *SearchKey OPTIONAL,\r
948 IN OUT UINTN *BufferSize,\r
949 OUT EFI_HANDLE *Buffer\r
950 );\r
022c6d45 951\r
28a00297 952\r
28a00297 953\r
162ed594 954/**\r
955 Locates the handle to a device on the device path that best matches the specified protocol.\r
28a00297 956\r
022c6d45 957 @param Protocol The protocol to search for.\r
958 @param DevicePath On input, a pointer to a pointer to the device\r
959 path. On output, the device path pointer is\r
960 modified to point to the remaining part of the\r
961 devicepath.\r
962 @param Device A pointer to the returned device handle.\r
28a00297 963\r
022c6d45 964 @retval EFI_SUCCESS The resulting handle was returned.\r
965 @retval EFI_NOT_FOUND No handles matched the search.\r
162ed594 966 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
28a00297 967\r
162ed594 968**/\r
28a00297 969EFI_STATUS\r
970EFIAPI\r
971CoreLocateDevicePath (\r
23c98c94 972 IN EFI_GUID *Protocol,\r
973 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
974 OUT EFI_HANDLE *Device\r
975 );\r
28a00297 976\r
022c6d45 977\r
28a00297 978\r
162ed594 979/**\r
980 Function returns an array of handles that support the requested protocol\r
981 in a buffer allocated from pool. This is a version of CoreLocateHandle()\r
982 that allocates a buffer for the caller.\r
28a00297 983\r
022c6d45 984 @param SearchType Specifies which handle(s) are to be returned.\r
985 @param Protocol Provides the protocol to search by. This\r
986 parameter is only valid for SearchType\r
987 ByProtocol.\r
988 @param SearchKey Supplies the search key depending on the\r
989 SearchType.\r
990 @param NumberHandles The number of handles returned in Buffer.\r
991 @param Buffer A pointer to the buffer to return the requested\r
992 array of handles that support Protocol.\r
993\r
994 @retval EFI_SUCCESS The result array of handles was returned.\r
995 @retval EFI_NOT_FOUND No handles match the search.\r
996 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
997 matching results.\r
998 @retval EFI_INVALID_PARAMETER One or more paramters are not valid.\r
28a00297 999\r
162ed594 1000**/\r
28a00297 1001EFI_STATUS\r
1002EFIAPI\r
1003CoreLocateHandleBuffer (\r
23c98c94 1004 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
1005 IN EFI_GUID *Protocol OPTIONAL,\r
1006 IN VOID *SearchKey OPTIONAL,\r
1007 IN OUT UINTN *NumberHandles,\r
1008 OUT EFI_HANDLE **Buffer\r
1009 );\r
28a00297 1010\r
022c6d45 1011\r
28a00297 1012\r
162ed594 1013/**\r
1014 Return the first Protocol Interface that matches the Protocol GUID. If\r
1015 Registration is pasased in return a Protocol Instance that was just add\r
1016 to the system. If Retistration is NULL return the first Protocol Interface\r
1017 you find.\r
28a00297 1018\r
44310938 1019 @param Protocol The protocol to search for\r
1020 @param Registration Optional Registration Key returned from\r
1021 RegisterProtocolNotify()\r
1022 @param Interface Return the Protocol interface (instance).\r
28a00297 1023\r
44310938 1024 @retval EFI_SUCCESS If a valid Interface is returned\r
1025 @retval EFI_INVALID_PARAMETER Invalid parameter\r
162ed594 1026 @retval EFI_NOT_FOUND Protocol interface not found\r
28a00297 1027\r
162ed594 1028**/\r
28a00297 1029EFI_STATUS\r
1030EFIAPI\r
1031CoreLocateProtocol (\r
23c98c94 1032 IN EFI_GUID *Protocol,\r
1033 IN VOID *Registration OPTIONAL,\r
1034 OUT VOID **Interface\r
1035 );\r
28a00297 1036\r
28a00297 1037\r
162ed594 1038/**\r
1039 return handle database key.\r
28a00297 1040\r
28a00297 1041\r
162ed594 1042 @return Handle database key.\r
28a00297 1043\r
162ed594 1044**/\r
28a00297 1045UINT64\r
1046CoreGetHandleDatabaseKey (\r
1047 VOID\r
23c98c94 1048 );\r
28a00297 1049\r
28a00297 1050\r
162ed594 1051/**\r
1052 Go connect any handles that were created or modified while a image executed.\r
28a00297 1053\r
022c6d45 1054 @param Key The Key to show that the handle has been\r
162ed594 1055 created/modified\r
28a00297 1056\r
162ed594 1057**/\r
28a00297 1058VOID\r
1059CoreConnectHandlesByKey (\r
1060 UINT64 Key\r
23c98c94 1061 );\r
28a00297 1062\r
28a00297 1063\r
28a00297 1064\r
162ed594 1065/**\r
1066 Connects one or more drivers to a controller.\r
28a00297 1067\r
022c6d45 1068 @param ControllerHandle Handle of the controller to be\r
1069 connected.\r
1070 @param DriverImageHandle DriverImageHandle A pointer to an\r
1071 ordered list of driver image\r
1072 handles.\r
1073 @param RemainingDevicePath RemainingDevicePath A pointer to\r
1074 the device path that specifies a\r
1075 child of the controller specified\r
1076 by ControllerHandle.\r
1077 @param Recursive Whether the function would be\r
1078 called recursively or not.\r
28a00297 1079\r
162ed594 1080 @return Status code.\r
28a00297 1081\r
162ed594 1082**/\r
022c6d45 1083EFI_STATUS\r
28a00297 1084EFIAPI\r
1085CoreConnectController (\r
1086 IN EFI_HANDLE ControllerHandle,\r
1087 IN EFI_HANDLE *DriverImageHandle OPTIONAL,\r
1088 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r
1089 IN BOOLEAN Recursive\r
23c98c94 1090 );\r
28a00297 1091\r
28a00297 1092\r
28a00297 1093\r
162ed594 1094/**\r
1095 Disonnects a controller from a driver\r
28a00297 1096\r
022c6d45 1097 @param ControllerHandle ControllerHandle The handle of\r
1098 the controller from which\r
1099 driver(s) are to be\r
1100 disconnected.\r
1101 @param DriverImageHandle DriverImageHandle The driver to\r
1102 disconnect from ControllerHandle.\r
1103 @param ChildHandle ChildHandle The handle of the\r
1104 child to destroy.\r
1105\r
1106 @retval EFI_SUCCESS One or more drivers were\r
1107 disconnected from the controller.\r
1108 @retval EFI_SUCCESS On entry, no drivers are managing\r
1109 ControllerHandle.\r
1110 @retval EFI_SUCCESS DriverImageHandle is not NULL,\r
1111 and on entry DriverImageHandle is\r
1112 not managing ControllerHandle.\r
1113 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\r
1114 EFI_HANDLE.\r
1115 @retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL,\r
1116 and it is not a valid EFI_HANDLE.\r
1117 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it\r
1118 is not a valid EFI_HANDLE.\r
1119 @retval EFI_OUT_OF_RESOURCES There are not enough resources\r
1120 available to disconnect any\r
1121 drivers from ControllerHandle.\r
1122 @retval EFI_DEVICE_ERROR The controller could not be\r
1123 disconnected because of a device\r
162ed594 1124 error.\r
28a00297 1125\r
162ed594 1126**/\r
022c6d45 1127EFI_STATUS\r
28a00297 1128EFIAPI\r
1129CoreDisconnectController (\r
23c98c94 1130 IN EFI_HANDLE ControllerHandle,\r
1131 IN EFI_HANDLE DriverImageHandle OPTIONAL,\r
1132 IN EFI_HANDLE ChildHandle OPTIONAL\r
1133 );\r
28a00297 1134\r
28a00297 1135\r
28a00297 1136\r
162ed594 1137/**\r
1138 Allocates pages from the memory map.\r
28a00297 1139\r
022c6d45 1140 @param Type The type of allocation to perform\r
1141 @param MemoryType The type of memory to turn the allocated pages\r
1142 into\r
1143 @param NumberOfPages The number of pages to allocate\r
1144 @param Memory A pointer to receive the base allocated memory\r
1145 address\r
28a00297 1146\r
162ed594 1147 @return Status. On success, Memory is filled in with the base address allocated\r
022c6d45 1148 @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in\r
1149 spec.\r
1150 @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r
1151 @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r
162ed594 1152 @retval EFI_SUCCESS Pages successfully allocated.\r
28a00297 1153\r
162ed594 1154**/\r
28a00297 1155EFI_STATUS\r
1156EFIAPI\r
1157CoreAllocatePages (\r
23c98c94 1158 IN EFI_ALLOCATE_TYPE Type,\r
1159 IN EFI_MEMORY_TYPE MemoryType,\r
1160 IN UINTN NumberOfPages,\r
1161 IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
1162 );\r
28a00297 1163\r
28a00297 1164\r
28a00297 1165\r
162ed594 1166/**\r
1167 Frees previous allocated pages.\r
28a00297 1168\r
022c6d45 1169 @param Memory Base address of memory being freed\r
1170 @param NumberOfPages The number of pages to free\r
28a00297 1171\r
022c6d45 1172 @retval EFI_NOT_FOUND Could not find the entry that covers the range\r
1173 @retval EFI_INVALID_PARAMETER Address not aligned\r
162ed594 1174 @return EFI_SUCCESS -Pages successfully freed.\r
28a00297 1175\r
162ed594 1176**/\r
022c6d45 1177EFI_STATUS\r
28a00297 1178EFIAPI\r
1179CoreFreePages (\r
1180 IN EFI_PHYSICAL_ADDRESS Memory,\r
1181 IN UINTN NumberOfPages\r
23c98c94 1182 );\r
28a00297 1183\r
28a00297 1184\r
28a00297 1185\r
162ed594 1186/**\r
1187 This function returns a copy of the current memory map. The map is an array of\r
1188 memory descriptors, each of which describes a contiguous block of memory.\r
28a00297 1189\r
022c6d45 1190 @param MemoryMapSize A pointer to the size, in bytes, of the\r
1191 MemoryMap buffer. On input, this is the size of\r
1192 the buffer allocated by the caller. On output,\r
1193 it is the size of the buffer returned by the\r
1194 firmware if the buffer was large enough, or the\r
1195 size of the buffer needed to contain the map if\r
1196 the buffer was too small.\r
1197 @param MemoryMap A pointer to the buffer in which firmware places\r
1198 the current memory map.\r
1199 @param MapKey A pointer to the location in which firmware\r
1200 returns the key for the current memory map.\r
1201 @param DescriptorSize A pointer to the location in which firmware\r
1202 returns the size, in bytes, of an individual\r
1203 EFI_MEMORY_DESCRIPTOR.\r
1204 @param DescriptorVersion A pointer to the location in which firmware\r
1205 returns the version number associated with the\r
1206 EFI_MEMORY_DESCRIPTOR.\r
1207\r
1208 @retval EFI_SUCCESS The memory map was returned in the MemoryMap\r
1209 buffer.\r
1210 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current\r
1211 buffer size needed to hold the memory map is\r
1212 returned in MemoryMapSize.\r
162ed594 1213 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
28a00297 1214\r
162ed594 1215**/\r
28a00297 1216EFI_STATUS\r
1217EFIAPI\r
1218CoreGetMemoryMap (\r
23c98c94 1219 IN OUT UINTN *MemoryMapSize,\r
1220 IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
1221 OUT UINTN *MapKey,\r
1222 OUT UINTN *DescriptorSize,\r
1223 OUT UINT32 *DescriptorVersion\r
1224 );\r
28a00297 1225\r
28a00297 1226\r
28a00297 1227\r
162ed594 1228/**\r
1229 Allocate pool of a particular type.\r
28a00297 1230\r
022c6d45 1231 @param PoolType Type of pool to allocate\r
1232 @param Size The amount of pool to allocate\r
1233 @param Buffer The address to return a pointer to the allocated\r
1234 pool\r
28a00297 1235\r
022c6d45 1236 @retval EFI_INVALID_PARAMETER PoolType not valid\r
1237 @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
162ed594 1238 @retval EFI_SUCCESS Pool successfully allocated.\r
28a00297 1239\r
162ed594 1240**/\r
28a00297 1241EFI_STATUS\r
1242EFIAPI\r
1243CoreAllocatePool (\r
23c98c94 1244 IN EFI_MEMORY_TYPE PoolType,\r
1245 IN UINTN Size,\r
1246 OUT VOID **Buffer\r
1247 );\r
28a00297 1248\r
28a00297 1249\r
28a00297 1250\r
162ed594 1251/**\r
1252 Frees pool.\r
28a00297 1253\r
022c6d45 1254 @param Buffer The allocated pool entry to free\r
28a00297 1255\r
022c6d45 1256 @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
162ed594 1257 @retval EFI_SUCCESS Pool successfully freed.\r
28a00297 1258\r
162ed594 1259**/\r
28a00297 1260EFI_STATUS\r
1261EFIAPI\r
1262CoreFreePool (\r
23c98c94 1263 IN VOID *Buffer\r
1264 );\r
28a00297 1265\r
28a00297 1266\r
28a00297 1267\r
162ed594 1268/**\r
1269 Loads an EFI image into memory and returns a handle to the image.\r
28a00297 1270\r
022c6d45 1271 @param BootPolicy If TRUE, indicates that the request originates\r
1272 from the boot manager, and that the boot\r
1273 manager is attempting to load FilePath as a\r
1274 boot selection.\r
1275 @param ParentImageHandle The caller's image handle.\r
1276 @param FilePath The specific file path from which the image is\r
1277 loaded.\r
1278 @param SourceBuffer If not NULL, a pointer to the memory location\r
1279 containing a copy of the image to be loaded.\r
1280 @param SourceSize The size in bytes of SourceBuffer.\r
1281 @param ImageHandle Pointer to the returned image handle that is\r
1282 created when the image is successfully loaded.\r
1283\r
1284 @retval EFI_SUCCESS The image was loaded into memory.\r
1285 @retval EFI_NOT_FOUND The FilePath was not found.\r
1286 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1287 @retval EFI_UNSUPPORTED The image type is not supported, or the device\r
1288 path cannot be parsed to locate the proper\r
1289 protocol for loading the file.\r
1290 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient\r
162ed594 1291 resources.\r
28a00297 1292\r
162ed594 1293**/\r
28a00297 1294EFI_STATUS\r
1295EFIAPI\r
1296CoreLoadImage (\r
23c98c94 1297 IN BOOLEAN BootPolicy,\r
1298 IN EFI_HANDLE ParentImageHandle,\r
1299 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
1300 IN VOID *SourceBuffer OPTIONAL,\r
1301 IN UINTN SourceSize,\r
1302 OUT EFI_HANDLE *ImageHandle\r
1303 );\r
28a00297 1304\r
28a00297 1305\r
28a00297 1306\r
162ed594 1307/**\r
1308 Unloads an image.\r
28a00297 1309\r
022c6d45 1310 @param ImageHandle Handle that identifies the image to be\r
1311 unloaded.\r
28a00297 1312\r
022c6d45 1313 @retval EFI_SUCCESS The image has been unloaded.\r
1314 @retval EFI_UNSUPPORTED The image has been sarted, and does not support\r
1315 unload.\r
162ed594 1316 @retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle.\r
28a00297 1317\r
162ed594 1318**/\r
28a00297 1319EFI_STATUS\r
1320EFIAPI\r
1321CoreUnloadImage (\r
1322 IN EFI_HANDLE ImageHandle\r
23c98c94 1323 );\r
28a00297 1324\r
28a00297 1325\r
28a00297 1326\r
162ed594 1327/**\r
1328 Transfer control to a loaded image's entry point.\r
28a00297 1329\r
022c6d45 1330 @param ImageHandle Handle of image to be started.\r
1331 @param ExitDataSize Pointer of the size to ExitData\r
1332 @param ExitData Pointer to a pointer to a data buffer that\r
1333 includes a Null-terminated Unicode string,\r
1334 optionally followed by additional binary data.\r
1335 The string is a description that the caller may\r
1336 use to further indicate the reason for the\r
1337 image's exit.\r
1338\r
1339 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1340 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
1341 @retval EFI_SUCCESS Successfully transfer control to the image's\r
162ed594 1342 entry point.\r
28a00297 1343\r
162ed594 1344**/\r
28a00297 1345EFI_STATUS\r
1346EFIAPI\r
1347CoreStartImage (\r
23c98c94 1348 IN EFI_HANDLE ImageHandle,\r
1349 OUT UINTN *ExitDataSize,\r
1350 OUT CHAR16 **ExitData OPTIONAL\r
1351 );\r
28a00297 1352\r
28a00297 1353\r
28a00297 1354\r
162ed594 1355/**\r
1356 Terminates the currently loaded EFI image and returns control to boot services.\r
28a00297 1357\r
022c6d45 1358 @param ImageHandle Handle that identifies the image. This\r
1359 parameter is passed to the image on entry.\r
1360 @param Status The image's exit code.\r
1361 @param ExitDataSize The size, in bytes, of ExitData. Ignored if\r
1362 ExitStatus is EFI_SUCCESS.\r
1363 @param ExitData Pointer to a data buffer that includes a\r
1364 Null-terminated Unicode string, optionally\r
1365 followed by additional binary data. The string\r
1366 is a description that the caller may use to\r
1367 further indicate the reason for the image's\r
1368 exit.\r
1369\r
1370 @retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current\r
1371 image.\r
1372 @retval EFI_SUCCESS Successfully terminates the currently loaded\r
1373 EFI image.\r
1374 @retval EFI_ACCESS_DENIED Should never reach there.\r
162ed594 1375 @retval EFI_OUT_OF_RESOURCES Could not allocate pool\r
28a00297 1376\r
162ed594 1377**/\r
28a00297 1378EFI_STATUS\r
1379EFIAPI\r
1380CoreExit (\r
1381 IN EFI_HANDLE ImageHandle,\r
1382 IN EFI_STATUS Status,\r
1383 IN UINTN ExitDataSize,\r
1384 IN CHAR16 *ExitData OPTIONAL\r
23c98c94 1385 );\r
28a00297 1386\r
28a00297 1387\r
28a00297 1388\r
162ed594 1389/**\r
1390 Creates a general-purpose event structure.\r
28a00297 1391\r
022c6d45 1392 @param Type The type of event to create and its mode and\r
1393 attributes\r
1394 @param NotifyTpl The task priority level of event notifications\r
1395 @param NotifyFunction Pointer to the events notification function\r
1396 @param NotifyContext Pointer to the notification functions context;\r
1397 corresponds to parameter "Context" in the\r
1398 notification function\r
1399 @param Event Pointer to the newly created event if the call\r
1400 succeeds; undefined otherwise\r
1401\r
1402 @retval EFI_SUCCESS The event structure was created\r
1403 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
162ed594 1404 @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
28a00297 1405\r
162ed594 1406**/\r
28a00297 1407EFI_STATUS\r
1408EFIAPI\r
1409CoreCreateEvent (\r
23c98c94 1410 IN UINT32 Type,\r
1411 IN EFI_TPL NotifyTpl,\r
1412 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
1413 IN VOID *NotifyContext, OPTIONAL\r
1414 OUT EFI_EVENT *Event\r
1415 );\r
28a00297 1416\r
28a00297 1417\r
28a00297 1418\r
162ed594 1419/**\r
1420 Creates a general-purpose event structure\r
28a00297 1421\r
022c6d45 1422 @param Type The type of event to create and its mode and\r
1423 attributes\r
1424 @param NotifyTpl The task priority level of event notifications\r
1425 @param NotifyFunction Pointer to the events notification function\r
1426 @param NotifyContext Pointer to the notification functions context;\r
1427 corresponds to parameter "Context" in the\r
1428 notification function\r
1429 @param EventGroup GUID for EventGroup if NULL act the same as\r
1430 gBS->CreateEvent().\r
1431 @param Event Pointer to the newly created event if the call\r
1432 succeeds; undefined otherwise\r
1433\r
1434 @retval EFI_SUCCESS The event structure was created\r
1435 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
162ed594 1436 @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
28a00297 1437\r
162ed594 1438**/\r
28a00297 1439EFI_STATUS\r
1440EFIAPI\r
1441CoreCreateEventEx (\r
1442 IN UINT32 Type,\r
1443 IN EFI_TPL NotifyTpl,\r
1444 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
1445 IN CONST VOID *NotifyContext, OPTIONAL\r
1446 IN CONST EFI_GUID *EventGroup, OPTIONAL\r
1447 OUT EFI_EVENT *Event\r
23c98c94 1448 );\r
28a00297 1449\r
28a00297 1450\r
28a00297 1451\r
162ed594 1452/**\r
1453 Sets the type of timer and the trigger time for a timer event.\r
28a00297 1454\r
022c6d45 1455 @param UserEvent The timer event that is to be signaled at the\r
1456 specified time\r
1457 @param Type The type of time that is specified in\r
1458 TriggerTime\r
1459 @param TriggerTime The number of 100ns units until the timer\r
1460 expires\r
28a00297 1461\r
022c6d45 1462 @retval EFI_SUCCESS The event has been set to be signaled at the\r
1463 requested time\r
162ed594 1464 @retval EFI_INVALID_PARAMETER Event or Type is not valid\r
28a00297 1465\r
162ed594 1466**/\r
28a00297 1467EFI_STATUS\r
1468EFIAPI\r
1469CoreSetTimer (\r
23c98c94 1470 IN EFI_EVENT UserEvent,\r
28a00297 1471 IN EFI_TIMER_DELAY Type,\r
1472 IN UINT64 TriggerTime\r
23c98c94 1473 );\r
28a00297 1474\r
28a00297 1475\r
28a00297 1476\r
162ed594 1477/**\r
022c6d45 1478 Signals the event. Queues the event to be notified if needed.\r
28a00297 1479\r
022c6d45 1480 @param UserEvent The event to signal .\r
28a00297 1481\r
022c6d45 1482 @retval EFI_INVALID_PARAMETER Parameters are not valid.\r
162ed594 1483 @retval EFI_SUCCESS The event was signaled.\r
28a00297 1484\r
162ed594 1485**/\r
28a00297 1486EFI_STATUS\r
1487EFIAPI\r
1488CoreSignalEvent (\r
23c98c94 1489 IN EFI_EVENT UserEvent\r
1490 );\r
28a00297 1491\r
28a00297 1492\r
28a00297 1493\r
162ed594 1494/**\r
1495 Stops execution until an event is signaled.\r
28a00297 1496\r
022c6d45 1497 @param NumberOfEvents The number of events in the UserEvents array\r
1498 @param UserEvents An array of EFI_EVENT\r
1499 @param UserIndex Pointer to the index of the event which\r
1500 satisfied the wait condition\r
28a00297 1501\r
022c6d45 1502 @retval EFI_SUCCESS The event indicated by Index was signaled.\r
1503 @retval EFI_INVALID_PARAMETER The event indicated by Index has a notification\r
1504 function or Event was not a valid type\r
162ed594 1505 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION\r
28a00297 1506\r
162ed594 1507**/\r
28a00297 1508EFI_STATUS\r
1509EFIAPI\r
1510CoreWaitForEvent (\r
23c98c94 1511 IN UINTN NumberOfEvents,\r
1512 IN EFI_EVENT *UserEvents,\r
1513 OUT UINTN *UserIndex\r
1514 );\r
28a00297 1515\r
28a00297 1516\r
28a00297 1517\r
162ed594 1518/**\r
1519 Closes an event and frees the event structure.\r
28a00297 1520\r
022c6d45 1521 @param UserEvent Event to close\r
28a00297 1522\r
022c6d45 1523 @retval EFI_INVALID_PARAMETER Parameters are not valid.\r
162ed594 1524 @retval EFI_SUCCESS The event has been closed\r
28a00297 1525\r
162ed594 1526**/\r
28a00297 1527EFI_STATUS\r
1528EFIAPI\r
1529CoreCloseEvent (\r
23c98c94 1530 IN EFI_EVENT UserEvent\r
1531 );\r
28a00297 1532\r
28a00297 1533\r
28a00297 1534\r
162ed594 1535/**\r
1536 Check the status of an event.\r
28a00297 1537\r
022c6d45 1538 @param UserEvent The event to check\r
28a00297 1539\r
022c6d45 1540 @retval EFI_SUCCESS The event is in the signaled state\r
1541 @retval EFI_NOT_READY The event is not in the signaled state\r
162ed594 1542 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL\r
28a00297 1543\r
162ed594 1544**/\r
28a00297 1545EFI_STATUS\r
1546EFIAPI\r
1547CoreCheckEvent (\r
23c98c94 1548 IN EFI_EVENT UserEvent\r
1549 );\r
28a00297 1550\r
28a00297 1551\r
162ed594 1552/**\r
1553 Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
1554 global coherency domain of the processor.\r
28a00297 1555\r
022c6d45 1556 @param GcdMemoryType Memory type of the memory space.\r
1557 @param BaseAddress Base address of the memory space.\r
1558 @param Length Length of the memory space.\r
1559 @param Capabilities alterable attributes of the memory space.\r
28a00297 1560\r
162ed594 1561 @retval EFI_SUCCESS Merged this memory space into GCD map.\r
28a00297 1562\r
162ed594 1563**/\r
28a00297 1564EFI_STATUS\r
1565CoreAddMemorySpace (\r
1566 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
1567 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1568 IN UINT64 Length,\r
1569 IN UINT64 Capabilities\r
23c98c94 1570 );\r
28a00297 1571\r
28a00297 1572\r
162ed594 1573/**\r
1574 Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
1575 I/O resources from the global coherency domain of the processor.\r
28a00297 1576\r
022c6d45 1577 @param GcdAllocateType The type of allocate operation\r
1578 @param GcdMemoryType The desired memory type\r
1579 @param Alignment Align with 2^Alignment\r
1580 @param Length Length to allocate\r
1581 @param BaseAddress Base address to allocate\r
1582 @param ImageHandle The image handle consume the allocated space.\r
1583 @param DeviceHandle The device handle consume the allocated space.\r
28a00297 1584\r
022c6d45 1585 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
1586 @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
162ed594 1587 @retval EFI_SUCCESS Memory space successfully allocated.\r
28a00297 1588\r
162ed594 1589**/\r
28a00297 1590EFI_STATUS\r
1591CoreAllocateMemorySpace (\r
1592 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
1593 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
1594 IN UINTN Alignment,\r
1595 IN UINT64 Length,\r
1596 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
1597 IN EFI_HANDLE ImageHandle,\r
1598 IN EFI_HANDLE DeviceHandle OPTIONAL\r
23c98c94 1599 );\r
28a00297 1600\r
28a00297 1601\r
162ed594 1602/**\r
1603 Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
1604 I/O resources from the global coherency domain of the processor.\r
28a00297 1605\r
022c6d45 1606 @param BaseAddress Base address of the memory space.\r
1607 @param Length Length of the memory space.\r
28a00297 1608\r
162ed594 1609 @retval EFI_SUCCESS Space successfully freed.\r
28a00297 1610\r
162ed594 1611**/\r
28a00297 1612EFI_STATUS\r
1613CoreFreeMemorySpace (\r
1614 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1615 IN UINT64 Length\r
23c98c94 1616 );\r
28a00297 1617\r
28a00297 1618\r
162ed594 1619/**\r
1620 Removes reserved memory, system memory, or memory-mapped I/O resources from\r
1621 the global coherency domain of the processor.\r
28a00297 1622\r
022c6d45 1623 @param BaseAddress Base address of the memory space.\r
1624 @param Length Length of the memory space.\r
28a00297 1625\r
162ed594 1626 @retval EFI_SUCCESS Successfully remove a segment of memory space.\r
28a00297 1627\r
162ed594 1628**/\r
28a00297 1629EFI_STATUS\r
1630CoreRemoveMemorySpace (\r
1631 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1632 IN UINT64 Length\r
23c98c94 1633 );\r
28a00297 1634\r
28a00297 1635\r
162ed594 1636/**\r
1637 Retrieves the descriptor for a memory region containing a specified address.\r
28a00297 1638\r
022c6d45 1639 @param BaseAddress Specified start address\r
1640 @param Descriptor Specified length\r
28a00297 1641\r
022c6d45 1642 @retval EFI_INVALID_PARAMETER Invalid parameter\r
162ed594 1643 @retval EFI_SUCCESS Successfully get memory space descriptor.\r
28a00297 1644\r
162ed594 1645**/\r
28a00297 1646EFI_STATUS\r
1647CoreGetMemorySpaceDescriptor (\r
1648 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1649 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r
23c98c94 1650 );\r
28a00297 1651\r
28a00297 1652\r
162ed594 1653/**\r
1654 Modifies the attributes for a memory region in the global coherency domain of the\r
1655 processor.\r
28a00297 1656\r
022c6d45 1657 @param BaseAddress Specified start address\r
1658 @param Length Specified length\r
1659 @param Attributes Specified attributes\r
28a00297 1660\r
022c6d45 1661 @retval EFI_SUCCESS Successfully set attribute of a segment of\r
162ed594 1662 memory space.\r
28a00297 1663\r
162ed594 1664**/\r
28a00297 1665EFI_STATUS\r
1666CoreSetMemorySpaceAttributes (\r
1667 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1668 IN UINT64 Length,\r
1669 IN UINT64 Attributes\r
23c98c94 1670 );\r
28a00297 1671\r
28a00297 1672\r
162ed594 1673/**\r
1674 Returns a map of the memory resources in the global coherency domain of the\r
1675 processor.\r
28a00297 1676\r
022c6d45 1677 @param NumberOfDescriptors Number of descriptors.\r
1678 @param MemorySpaceMap Descriptor array\r
28a00297 1679\r
022c6d45 1680 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1681 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
162ed594 1682 @retval EFI_SUCCESS Successfully get memory space map.\r
28a00297 1683\r
162ed594 1684**/\r
28a00297 1685EFI_STATUS\r
1686CoreGetMemorySpaceMap (\r
1687 OUT UINTN *NumberOfDescriptors,\r
1688 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r
23c98c94 1689 );\r
28a00297 1690\r
28a00297 1691\r
162ed594 1692/**\r
1693 Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
28a00297 1694\r
022c6d45 1695 @param GcdIoType IO type of the segment.\r
1696 @param BaseAddress Base address of the segment.\r
1697 @param Length Length of the segment.\r
28a00297 1698\r
022c6d45 1699 @retval EFI_SUCCESS Merged this segment into GCD map.\r
162ed594 1700 @retval EFI_INVALID_PARAMETER Parameter not valid\r
28a00297 1701\r
162ed594 1702**/\r
28a00297 1703EFI_STATUS\r
1704CoreAddIoSpace (\r
1705 IN EFI_GCD_IO_TYPE GcdIoType,\r
1706 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1707 IN UINT64 Length\r
23c98c94 1708 );\r
28a00297 1709\r
28a00297 1710\r
162ed594 1711/**\r
1712 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
1713 domain of the processor.\r
28a00297 1714\r
022c6d45 1715 @param GcdAllocateType The type of allocate operation\r
1716 @param GcdIoType The desired IO type\r
1717 @param Alignment Align with 2^Alignment\r
1718 @param Length Length to allocate\r
1719 @param BaseAddress Base address to allocate\r
1720 @param ImageHandle The image handle consume the allocated space.\r
1721 @param DeviceHandle The device handle consume the allocated space.\r
28a00297 1722\r
022c6d45 1723 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
1724 @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
162ed594 1725 @retval EFI_SUCCESS IO space successfully allocated.\r
28a00297 1726\r
162ed594 1727**/\r
28a00297 1728EFI_STATUS\r
1729CoreAllocateIoSpace (\r
1730 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
1731 IN EFI_GCD_IO_TYPE GcdIoType,\r
1732 IN UINTN Alignment,\r
1733 IN UINT64 Length,\r
1734 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
1735 IN EFI_HANDLE ImageHandle,\r
1736 IN EFI_HANDLE DeviceHandle OPTIONAL\r
23c98c94 1737 );\r
28a00297 1738\r
28a00297 1739\r
162ed594 1740/**\r
1741 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
1742 domain of the processor.\r
28a00297 1743\r
022c6d45 1744 @param BaseAddress Base address of the segment.\r
1745 @param Length Length of the segment.\r
28a00297 1746\r
162ed594 1747 @retval EFI_SUCCESS Space successfully freed.\r
28a00297 1748\r
162ed594 1749**/\r
28a00297 1750EFI_STATUS\r
1751CoreFreeIoSpace (\r
1752 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1753 IN UINT64 Length\r
23c98c94 1754 );\r
28a00297 1755\r
28a00297 1756\r
162ed594 1757/**\r
1758 Removes reserved I/O or I/O resources from the global coherency domain of the\r
1759 processor.\r
28a00297 1760\r
022c6d45 1761 @param BaseAddress Base address of the segment.\r
1762 @param Length Length of the segment.\r
28a00297 1763\r
162ed594 1764 @retval EFI_SUCCESS Successfully removed a segment of IO space.\r
28a00297 1765\r
162ed594 1766**/\r
28a00297 1767EFI_STATUS\r
1768CoreRemoveIoSpace (\r
1769 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1770 IN UINT64 Length\r
23c98c94 1771 );\r
28a00297 1772\r
28a00297 1773\r
162ed594 1774/**\r
1775 Retrieves the descriptor for an I/O region containing a specified address.\r
28a00297 1776\r
022c6d45 1777 @param BaseAddress Specified start address\r
1778 @param Descriptor Specified length\r
28a00297 1779\r
022c6d45 1780 @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
162ed594 1781 @retval EFI_SUCCESS Successfully get the IO space descriptor.\r
28a00297 1782\r
162ed594 1783**/\r
28a00297 1784EFI_STATUS\r
1785CoreGetIoSpaceDescriptor (\r
1786 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1787 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r
23c98c94 1788 );\r
28a00297 1789\r
28a00297 1790\r
162ed594 1791/**\r
1792 Returns a map of the I/O resources in the global coherency domain of the processor.\r
28a00297 1793\r
022c6d45 1794 @param NumberOfDescriptors Number of descriptors.\r
1795 @param IoSpaceMap Descriptor array\r
28a00297 1796\r
022c6d45 1797 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1798 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
162ed594 1799 @retval EFI_SUCCESS Successfully get IO space map.\r
28a00297 1800\r
162ed594 1801**/\r
28a00297 1802EFI_STATUS\r
1803CoreGetIoSpaceMap (\r
1804 OUT UINTN *NumberOfDescriptors,\r
1805 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r
23c98c94 1806 );\r
28a00297 1807\r
28a00297 1808\r
162ed594 1809/**\r
1810 This is the main Dispatcher for DXE and it exits when there are no more\r
1811 drivers to run. Drain the mScheduledQueue and load and start a PE\r
1812 image for each driver. Search the mDiscoveredList to see if any driver can\r
1813 be placed on the mScheduledQueue. If no drivers are placed on the\r
1814 mScheduledQueue exit the function. On exit it is assumed the Bds()\r
1815 will be called, and when the Bds() exits the Dispatcher will be called\r
1816 again.\r
28a00297 1817\r
022c6d45 1818 @retval EFI_ALREADY_STARTED The DXE Dispatcher is already running\r
1819 @retval EFI_NOT_FOUND No DXE Drivers were dispatched\r
1820 @retval EFI_SUCCESS One or more DXE Drivers were dispatched\r
28a00297 1821\r
23c98c94 1822**/\r
28a00297 1823EFI_STATUS\r
1824EFIAPI\r
1825CoreDispatcher (\r
1826 VOID\r
23c98c94 1827 );\r
28a00297 1828\r
162ed594 1829/**\r
1830 Check every driver and locate a matching one. If the driver is found, the Unrequested\r
1831 state flag is cleared.\r
28a00297 1832\r
022c6d45 1833 @param FirmwareVolumeHandle The handle of the Firmware Volume that contains\r
1834 the firmware file specified by DriverName.\r
1835 @param DriverName The Driver name to put in the Dependent state.\r
28a00297 1836\r
022c6d45 1837 @retval EFI_SUCCESS The DriverName was found and it's SOR bit was\r
1838 cleared\r
1839 @retval EFI_NOT_FOUND The DriverName does not exist or it's SOR bit was\r
1840 not set.\r
28a00297 1841\r
23c98c94 1842**/\r
28a00297 1843EFI_STATUS\r
1844EFIAPI\r
1845CoreSchedule (\r
1846 IN EFI_HANDLE FirmwareVolumeHandle,\r
1847 IN EFI_GUID *DriverName\r
23c98c94 1848 );\r
28a00297 1849\r
28a00297 1850\r
162ed594 1851/**\r
022c6d45 1852 Convert a driver from the Untrused back to the Scheduled state.\r
28a00297 1853\r
022c6d45 1854 @param FirmwareVolumeHandle The handle of the Firmware Volume that contains\r
1855 the firmware file specified by DriverName.\r
1856 @param DriverName The Driver name to put in the Scheduled state\r
28a00297 1857\r
022c6d45 1858 @retval EFI_SUCCESS The file was found in the untrusted state, and it\r
1859 was promoted to the trusted state.\r
1860 @retval EFI_NOT_FOUND The file was not found in the untrusted state.\r
28a00297 1861\r
23c98c94 1862**/\r
28a00297 1863EFI_STATUS\r
1864EFIAPI\r
1865CoreTrust (\r
1866 IN EFI_HANDLE FirmwareVolumeHandle,\r
1867 IN EFI_GUID *DriverName\r
23c98c94 1868 );\r
28a00297 1869\r
28a00297 1870\r
162ed594 1871/**\r
1872 Helper function called as part of the code needed\r
1873 to allocate the proper sized buffer for various\r
1874 EFI interfaces.\r
28a00297 1875\r
022c6d45 1876 @param Status Current status\r
1877 @param Buffer Current allocated buffer, or NULL\r
1878 @param BufferSize Current buffer size needed\r
28a00297 1879\r
022c6d45 1880 @retval TRUE if the buffer was reallocated and the caller\r
1881 should try the API again.\r
1882 @retval FALSE buffer could not be allocated and the caller\r
162ed594 1883 should not try the API again.\r
28a00297 1884\r
162ed594 1885**/\r
28a00297 1886BOOLEAN\r
1887CoreGrowBuffer (\r
23c98c94 1888 IN OUT EFI_STATUS *Status,\r
1889 IN OUT VOID **Buffer,\r
1890 IN UINTN BufferSize\r
1891 );\r
28a00297 1892\r
28a00297 1893\r
162ed594 1894/**\r
1895 This routine is the driver initialization entry point. It initializes the\r
1896 libraries, and registers two notification functions. These notification\r
1897 functions are responsible for building the FV stack dynamically.\r
28a00297 1898\r
022c6d45 1899 @param ImageHandle The image handle.\r
1900 @param SystemTable The system table.\r
28a00297 1901\r
162ed594 1902 @retval EFI_SUCCESS Function successfully returned.\r
28a00297 1903\r
162ed594 1904**/\r
28a00297 1905EFI_STATUS\r
1906EFIAPI\r
1907FwVolDriverInit (\r
1908 IN EFI_HANDLE ImageHandle,\r
1909 IN EFI_SYSTEM_TABLE *SystemTable\r
23c98c94 1910 );\r
28a00297 1911\r
28a00297 1912\r
162ed594 1913/**\r
1914 Entry point of the section extraction code. Initializes an instance of the\r
1915 section extraction interface and installs it on a new handle.\r
1916\r
1917 @param ImageHandle A handle for the image that is initializing this driver\r
1918 @param SystemTable A pointer to the EFI system table\r
28a00297 1919\r
162ed594 1920 @retval EFI_SUCCESS Driver initialized successfully\r
1921 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources\r
1922\r
1923**/\r
28a00297 1924EFI_STATUS\r
1925EFIAPI\r
1926InitializeSectionExtraction (\r
1927 IN EFI_HANDLE ImageHandle,\r
1928 IN EFI_SYSTEM_TABLE *SystemTable\r
23c98c94 1929 );\r
28a00297 1930\r
28a00297 1931\r
162ed594 1932/**\r
1933 This DXE service routine is used to process a firmware volume. In\r
1934 particular, it can be called by BDS to process a single firmware\r
1935 volume found in a capsule.\r
28a00297 1936\r
022c6d45 1937 @param FvHeader pointer to a firmware volume header\r
1938 @param Size the size of the buffer pointed to by FvHeader\r
1939 @param FVProtocolHandle the handle on which a firmware volume protocol\r
1940 was produced for the firmware volume passed in.\r
28a00297 1941\r
022c6d45 1942 @retval EFI_OUT_OF_RESOURCES if an FVB could not be produced due to lack of\r
1943 system resources\r
1944 @retval EFI_VOLUME_CORRUPTED if the volume was corrupted\r
1945 @retval EFI_SUCCESS a firmware volume protocol was produced for the\r
162ed594 1946 firmware volume\r
28a00297 1947\r
162ed594 1948**/\r
28a00297 1949EFI_STATUS\r
1950CoreProcessFirmwareVolume (\r
23c98c94 1951 IN VOID *FvHeader,\r
022c6d45 1952 IN UINTN Size,\r
23c98c94 1953 OUT EFI_HANDLE *FVProtocolHandle\r
1954 );\r
28a00297 1955\r
1956//\r
1957//Functions used during debug buils\r
1958//\r
162ed594 1959\r
1960/**\r
1961 Displays Architectural protocols that were not loaded and are required for DXE\r
23c98c94 1962 core to function. Only used in Debug Builds.\r
162ed594 1963\r
1964**/\r
28a00297 1965VOID\r
1966CoreDisplayMissingArchProtocols (\r
1967 VOID\r
23c98c94 1968 );\r
022c6d45 1969\r
28a00297 1970\r
162ed594 1971/**\r
1972 Traverse the discovered list for any drivers that were discovered but not loaded\r
1973 because the dependency experessions evaluated to false.\r
28a00297 1974\r
162ed594 1975**/\r
28a00297 1976VOID\r
1977CoreDisplayDiscoveredNotDispatched (\r
1978 VOID\r
23c98c94 1979 );\r
28a00297 1980\r
28a00297 1981\r
162ed594 1982/**\r
23c98c94 1983 Place holder function until all the Boot Services and Runtime Services are\r
1984 available.\r
28a00297 1985\r
162ed594 1986 @return EFI_NOT_AVAILABLE_YET\r
28a00297 1987\r
162ed594 1988**/\r
28a00297 1989EFI_STATUS\r
1990EFIAPI\r
1991CoreEfiNotAvailableYetArg0 (\r
1992 VOID\r
23c98c94 1993 );\r
28a00297 1994\r
28a00297 1995\r
162ed594 1996/**\r
23c98c94 1997 Place holder function until all the Boot Services and Runtime Services are\r
1998 available.\r
28a00297 1999\r
022c6d45 2000 @param Arg1 Undefined\r
28a00297 2001\r
162ed594 2002 @return EFI_NOT_AVAILABLE_YET\r
28a00297 2003\r
162ed594 2004**/\r
28a00297 2005EFI_STATUS\r
2006EFIAPI\r
2007CoreEfiNotAvailableYetArg1 (\r
2008 UINTN Arg1\r
23c98c94 2009 );\r
28a00297 2010\r
28a00297 2011\r
162ed594 2012/**\r
2013 Place holder function until all the Boot Services and Runtime Services are available.\r
28a00297 2014\r
022c6d45 2015 @param Arg1 Undefined\r
2016 @param Arg2 Undefined\r
28a00297 2017\r
162ed594 2018 @return EFI_NOT_AVAILABLE_YET\r
28a00297 2019\r
162ed594 2020**/\r
28a00297 2021EFI_STATUS\r
2022EFIAPI\r
2023CoreEfiNotAvailableYetArg2 (\r
2024 UINTN Arg1,\r
2025 UINTN Arg2\r
23c98c94 2026 );\r
28a00297 2027\r
28a00297 2028\r
162ed594 2029/**\r
2030 Place holder function until all the Boot Services and Runtime Services are available.\r
28a00297 2031\r
022c6d45 2032 @param Arg1 Undefined\r
2033 @param Arg2 Undefined\r
2034 @param Arg3 Undefined\r
28a00297 2035\r
162ed594 2036 @return EFI_NOT_AVAILABLE_YET\r
28a00297 2037\r
162ed594 2038**/\r
28a00297 2039EFI_STATUS\r
2040EFIAPI\r
2041CoreEfiNotAvailableYetArg3 (\r
2042 UINTN Arg1,\r
2043 UINTN Arg2,\r
2044 UINTN Arg3\r
23c98c94 2045 );\r
28a00297 2046\r
28a00297 2047\r
162ed594 2048/**\r
2049 Place holder function until all the Boot Services and Runtime Services are available.\r
28a00297 2050\r
022c6d45 2051 @param Arg1 Undefined\r
2052 @param Arg2 Undefined\r
2053 @param Arg3 Undefined\r
2054 @param Arg4 Undefined\r
28a00297 2055\r
162ed594 2056 @return EFI_NOT_AVAILABLE_YET\r
28a00297 2057\r
162ed594 2058**/\r
28a00297 2059EFI_STATUS\r
2060EFIAPI\r
2061CoreEfiNotAvailableYetArg4 (\r
2062 UINTN Arg1,\r
2063 UINTN Arg2,\r
2064 UINTN Arg3,\r
2065 UINTN Arg4\r
23c98c94 2066 );\r
28a00297 2067\r
28a00297 2068\r
162ed594 2069/**\r
2070 Place holder function until all the Boot Services and Runtime Services are available.\r
28a00297 2071\r
022c6d45 2072 @param Arg1 Undefined\r
2073 @param Arg2 Undefined\r
2074 @param Arg3 Undefined\r
2075 @param Arg4 Undefined\r
2076 @param Arg5 Undefined\r
28a00297 2077\r
162ed594 2078 @return EFI_NOT_AVAILABLE_YET\r
28a00297 2079\r
162ed594 2080**/\r
28a00297 2081EFI_STATUS\r
2082EFIAPI\r
2083CoreEfiNotAvailableYetArg5 (\r
2084 UINTN Arg1,\r
2085 UINTN Arg2,\r
2086 UINTN Arg3,\r
2087 UINTN Arg4,\r
2088 UINTN Arg5\r
23c98c94 2089 );\r
28a00297 2090\r
28a00297 2091\r
162ed594 2092/**\r
2093 Given a compressed source buffer, this function retrieves the size of the\r
2094 uncompressed buffer and the size of the scratch buffer required to decompress\r
2095 the compressed source buffer.\r
2096\r
2097 The GetInfo() function retrieves the size of the uncompressed buffer and the\r
2098 temporary scratch buffer required to decompress the buffer specified by Source\r
2099 and SourceSize. If the size of the uncompressed buffer or the size of the\r
2100 scratch buffer cannot be determined from the compressed data specified by\r
2101 Source and SourceData, then EFI_INVALID_PARAMETER is returned. Otherwise, the\r
2102 size of the uncompressed buffer is returned in DestinationSize, the size of\r
2103 the scratch buffer is returned in ScratchSize, and EFI_SUCCESS is returned.\r
2104 The GetInfo() function does not have scratch buffer available to perform a\r
2105 thorough checking of the validity of the source data. It just retrieves the\r
2106 "Original Size" field from the beginning bytes of the source data and output\r
2107 it as DestinationSize. And ScratchSize is specific to the decompression\r
2108 implementation.\r
2109\r
2110 @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
2111 @param Source The source buffer containing the compressed data.\r
2112 @param SourceSize The size, in bytes, of the source buffer.\r
2113 @param DestinationSize A pointer to the size, in bytes, of the\r
2114 uncompressed buffer that will be generated when the\r
2115 compressed buffer specified by Source and\r
2116 SourceSize is decompressed.\r
2117 @param ScratchSize A pointer to the size, in bytes, of the scratch\r
2118 buffer that is required to decompress the\r
2119 compressed buffer specified by Source and\r
2120 SourceSize.\r
022c6d45 2121\r
162ed594 2122 @retval EFI_SUCCESS The size of the uncompressed data was returned in\r
2123 DestinationSize and the size of the scratch buffer\r
2124 was returned in ScratchSize.\r
2125 @retval EFI_INVALID_PARAMETER The size of the uncompressed data or the size of\r
2126 the scratch buffer cannot be determined from the\r
2127 compressed data specified by Source and\r
2128 SourceSize.\r
28a00297 2129\r
162ed594 2130**/\r
28a00297 2131EFI_STATUS\r
23c98c94 2132EFIAPI\r
28a00297 2133DxeMainUefiDecompressGetInfo (\r
2134 IN EFI_DECOMPRESS_PROTOCOL *This,\r
2135 IN VOID *Source,\r
2136 IN UINT32 SourceSize,\r
2137 OUT UINT32 *DestinationSize,\r
2138 OUT UINT32 *ScratchSize\r
2139 );\r
2140\r
162ed594 2141\r
2142/**\r
2143 Decompresses a compressed source buffer.\r
2144\r
2145 The Decompress() function extracts decompressed data to its original form.\r
2146 This protocol is designed so that the decompression algorithm can be\r
2147 implemented without using any memory services. As a result, the Decompress()\r
2148 Function is not allowed to call AllocatePool() or AllocatePages() in its\r
db405d1b 2149 implementation. It is the caller's responsibility to allocate and free the\r
162ed594 2150 Destination and Scratch buffers.\r
2151 If the compressed source data specified by Source and SourceSize is\r
2152 sucessfully decompressed into Destination, then EFI_SUCCESS is returned. If\r
2153 the compressed source data specified by Source and SourceSize is not in a\r
2154 valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
2155\r
2156 @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
2157 @param Source The source buffer containing the compressed data.\r
2158 @param SourceSize SourceSizeThe size of source data.\r
2159 @param Destination On output, the destination buffer that contains\r
2160 the uncompressed data.\r
2161 @param DestinationSize The size of the destination buffer. The size of\r
2162 the destination buffer needed is obtained from\r
2163 EFI_DECOMPRESS_PROTOCOL.GetInfo().\r
2164 @param Scratch A temporary scratch buffer that is used to perform\r
2165 the decompression.\r
2166 @param ScratchSize The size of scratch buffer. The size of the\r
2167 scratch buffer needed is obtained from GetInfo().\r
022c6d45 2168\r
162ed594 2169 @retval EFI_SUCCESS Decompression completed successfully, and the\r
2170 uncompressed buffer is returned in Destination.\r
2171 @retval EFI_INVALID_PARAMETER The source buffer specified by Source and\r
2172 SourceSize is corrupted (not in a valid\r
2173 compressed format).\r
2174\r
2175**/\r
28a00297 2176EFI_STATUS\r
2177EFIAPI\r
2178DxeMainUefiDecompress (\r
022c6d45 2179 IN EFI_DECOMPRESS_PROTOCOL *This,\r
28a00297 2180 IN VOID *Source,\r
2181 IN UINT32 SourceSize,\r
2182 IN OUT VOID *Destination,\r
2183 IN UINT32 DestinationSize,\r
2184 IN OUT VOID *Scratch,\r
2185 IN UINT32 ScratchSize\r
2186 );\r
2187\r
162ed594 2188/**\r
2189 SEP member function. This function creates and returns a new section stream\r
2190 handle to represent the new section stream.\r
28a00297 2191\r
022c6d45 2192 @param SectionStreamLength Size in bytes of the section stream.\r
2193 @param SectionStream Buffer containing the new section stream.\r
2194 @param SectionStreamHandle A pointer to a caller allocated UINTN that on\r
2195 output contains the new section stream handle.\r
28a00297 2196\r
162ed594 2197 @retval EFI_SUCCESS The section stream is created successfully.\r
022c6d45 2198 @retval EFI_OUT_OF_RESOURCES memory allocation failed.\r
2199 @retval EFI_INVALID_PARAMETER Section stream does not end concident with end\r
162ed594 2200 of last section.\r
28a00297 2201\r
162ed594 2202**/\r
797a9d67 2203EFI_STATUS\r
2204EFIAPI\r
2205OpenSectionStream (\r
2206 IN UINTN SectionStreamLength,\r
2207 IN VOID *SectionStream,\r
2208 OUT UINTN *SectionStreamHandle\r
2209 );\r
2210\r
162ed594 2211\r
2212\r
2213/**\r
2214 SEP member function. Retrieves requested section from section stream.\r
2215\r
2216 @param SectionStreamHandle The section stream from which to extract the\r
2217 requested section.\r
2218 @param SectionType A pointer to the type of section to search for.\r
2219 @param SectionDefinitionGuid If the section type is EFI_SECTION_GUID_DEFINED,\r
2220 then SectionDefinitionGuid indicates which of\r
2221 these types of sections to search for.\r
2222 @param SectionInstance Indicates which instance of the requested\r
2223 section to return.\r
2224 @param Buffer Double indirection to buffer. If *Buffer is\r
2225 non-null on input, then the buffer is caller\r
2226 allocated. If Buffer is NULL, then the buffer\r
2227 is callee allocated. In either case, the\r
2228 requried buffer size is returned in *BufferSize.\r
2229 @param BufferSize On input, indicates the size of *Buffer if\r
2230 *Buffer is non-null on input. On output,\r
2231 indicates the required size (allocated size if\r
2232 callee allocated) of *Buffer.\r
2233 @param AuthenticationStatus A pointer to a caller-allocated UINT32 that\r
2234 indicates the authentication status of the\r
db405d1b 2235 output buffer. If the input section's\r
162ed594 2236 GuidedSectionHeader.Attributes field\r
2237 has the EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
2238 bit as clear, AuthenticationStatus must return\r
2239 zero. Both local bits (19:16) and aggregate\r
2240 bits (3:0) in AuthenticationStatus are returned\r
2241 by ExtractSection(). These bits reflect the\r
2242 status of the extraction operation. The bit\r
2243 pattern in both regions must be the same, as\r
2244 the local and aggregate authentication statuses\r
2245 have equivalent meaning at this level. If the\r
2246 function returns anything other than\r
2247 EFI_SUCCESS, the value of *AuthenticationStatus\r
2248 is undefined.\r
2249\r
2250 @retval EFI_SUCCESS Section was retrieved successfully\r
2251 @retval EFI_PROTOCOL_ERROR A GUID defined section was encountered in the\r
2252 section stream with its\r
2253 EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r
2254 but there was no corresponding GUIDed Section\r
2255 Extraction Protocol in the handle database.\r
2256 *Buffer is unmodified.\r
2257 @retval EFI_NOT_FOUND An error was encountered when parsing the\r
2258 SectionStream. This indicates the SectionStream\r
2259 is not correctly formatted.\r
2260 @retval EFI_NOT_FOUND The requested section does not exist.\r
2261 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process\r
2262 the request.\r
2263 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
2264 @retval EFI_WARN_TOO_SMALL The size of the caller allocated input buffer is\r
2265 insufficient to contain the requested section.\r
2266 The input buffer is filled and section contents\r
2267 are truncated.\r
2268\r
2269**/\r
797a9d67 2270EFI_STATUS\r
2271EFIAPI\r
2272GetSection (\r
2273 IN UINTN SectionStreamHandle,\r
2274 IN EFI_SECTION_TYPE *SectionType,\r
2275 IN EFI_GUID *SectionDefinitionGuid,\r
2276 IN UINTN SectionInstance,\r
2277 IN VOID **Buffer,\r
2278 IN OUT UINTN *BufferSize,\r
2279 OUT UINT32 *AuthenticationStatus\r
2280 );\r
2281\r
162ed594 2282\r
2283/**\r
2284 SEP member function. Deletes an existing section stream\r
2285\r
022c6d45 2286 @param StreamHandleToClose Indicates the stream to close\r
162ed594 2287\r
2288 @retval EFI_SUCCESS The section stream is closed sucessfully.\r
022c6d45 2289 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
2290 @retval EFI_INVALID_PARAMETER Section stream does not end concident with end\r
162ed594 2291 of last section.\r
2292\r
2293**/\r
797a9d67 2294EFI_STATUS\r
2295EFIAPI\r
2296CloseSectionStream (\r
23c98c94 2297 IN UINTN StreamHandleToClose\r
797a9d67 2298 );\r
2299\r
28a00297 2300#endif\r