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