3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #ifndef _DXE_LIBRARY_H_
23 #define _DXE_LIBRARY_H_
27 CoreReportProgressCode (
28 IN EFI_STATUS_CODE_VALUE Value
34 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiDxeServicesTableGuid.
38 Value - Describes the class/subclass/operation of the hardware or software entity
39 that the Status Code relates to.
49 CoreReportProgressCodeSpecific (
50 IN EFI_STATUS_CODE_VALUE Value
,
57 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiDxeServicesTableGuid,
58 with a handle as additional information.
62 Value - Describes the class/subclass/operation of the hardware or software entity
63 that the Status Code relates to.
65 Handle - Additional information.
82 Raising to the task priority level of the mutual exclusion
83 lock, and then acquires ownership of the lock.
87 Lock - The lock to acquire
97 CoreAcquireLockOrFail (
104 Initialize a basic mutual exclusion lock. Each lock
105 provides mutual exclusion access at it's task priority
106 level. Since there is no-premption (at any TPL) or
107 multiprocessor support, acquiring the lock only consists
108 of raising to the locks TPL.
112 Lock - The EFI_LOCK structure to initialize
116 EFI_SUCCESS - Lock Owned.
117 EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
130 Releases ownership of the mutual exclusion lock, and
131 restores the previous task priority level.
135 Lock - The lock to release
145 // Device Path functions
150 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
156 Calculate the size of a whole device path.
160 DevicePath - The pointer to the device path data.
164 Size of device path data structure..
170 CoreIsDevicePathMultiInstance (
171 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
176 Return TRUE is this is a multi instance device path.
179 DevicePath - A pointer to a device path data structure.
183 TRUE - If DevicePath is multi instance. FALSE - If DevicePath is not multi
190 EFI_DEVICE_PATH_PROTOCOL
*
191 CoreDuplicateDevicePath (
192 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
197 Duplicate a new device path data structure from the old one.
200 DevicePath - A pointer to a device path data structure.
203 A pointer to the new allocated device path data.
204 Caller must free the memory used by DevicePath if it is no longer needed.
209 EFI_DEVICE_PATH_PROTOCOL
*
210 CoreAppendDevicePath (
211 IN EFI_DEVICE_PATH_PROTOCOL
*Src1
,
212 IN EFI_DEVICE_PATH_PROTOCOL
*Node
217 Function is used to append a Src1 and Src2 together.
220 Src1 - A pointer to a device path data structure.
222 Node - A pointer to a device path data structure.
226 A pointer to the new device path is returned.
227 NULL is returned if space for the new device path could not be allocated from pool.
228 It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
234 CoreAllocateBootServicesPool (
235 IN UINTN AllocationSize
241 Allocate pool of type EfiBootServicesData, the size is specified with AllocationSize.
245 AllocationSize - Size to allocate.
249 Pointer of the allocated pool.
255 CoreAllocateZeroBootServicesPool (
256 IN UINTN AllocationSize
262 Allocate pool of type EfiBootServicesData and zero it, the size is specified with AllocationSize.
266 AllocationSize - Size to allocate.
270 Pointer of the allocated pool.
284 Find a config table by name in system table's ConfigurationTable.
288 Guid - The table name to look for
290 Table - Pointer of the config table
294 EFI_NOT_FOUND - Could not find the table in system table's ConfigurationTable.
296 EFI_SUCCESS - Table successfully found.
302 CoreAllocateRuntimeCopyPool (
303 IN UINTN AllocationSize
,
310 Allocate pool of specified size with EfiRuntimeServicesData type, and copy specified buffer to this pool.
314 AllocationSize - Size to allocate.
316 Buffer - Specified buffer that will be copy to the allocated pool
320 Pointer of the allocated pool.
326 CoreAllocateRuntimePool (
327 IN UINTN AllocationSize
333 Allocate pool of type EfiRuntimeServicesData, the size is specified with AllocationSize.
337 AllocationSize - Size to allocate.
341 Pointer of the allocated pool.
347 CoreAllocateCopyPool (
348 IN UINTN AllocationSize
,
355 Allocate pool of specified size with EfiBootServicesData type, and copy specified buffer to this pool.
359 AllocationSize - Size to allocate.
361 Buffer - Specified buffer that will be copy to the allocated pool
365 Pointer of the allocated pool.
371 CoreCreateProtocolNotifyEvent (
372 IN EFI_GUID
*ProtocolGuid
,
373 IN EFI_TPL NotifyTpl
,
374 IN EFI_EVENT_NOTIFY NotifyFunction
,
375 IN VOID
*NotifyContext
,
376 OUT VOID
**Registration
,
377 IN BOOLEAN SignalFlag
383 Create a protocol notification event and return it.
387 ProtocolGuid - Protocol to register notification event on.
389 NotifyTpl - Maximum TPL to signal the NotifyFunction.
391 NotifyFuncition - EFI notification routine.
393 NotifyContext - Context passed into Event when it is created.
395 Registration - Registration key returned from RegisterProtocolNotify().
397 SignalFlag - Boolean value to decide whether kick the event after register or not.
401 The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
402 is added to the system.