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