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