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