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