2 Internal functions shared in DxeCore module.
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _DXE_LIBRARY_H_
16 #define _DXE_LIBRARY_H_
21 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid.
23 @param Value Describes the class/subclass/operation of the
24 hardware or software entity that the Status Code
29 CoreReportProgressCode (
30 IN EFI_STATUS_CODE_VALUE Value
35 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid,
36 with a handle as additional information.
38 @param Value Describes the class/subclass/operation of the
39 hardware or software entity that the Status Code
41 @param Handle Additional information.
45 CoreReportProgressCodeSpecific (
46 IN EFI_STATUS_CODE_VALUE Value
,
52 Raising to the task priority level of the mutual exclusion
53 lock, and then acquires ownership of the lock.
55 @param Lock The lock to acquire
67 Initialize a basic mutual exclusion lock. Each lock
68 provides mutual exclusion access at it's task priority
69 level. Since there is no-premption (at any TPL) or
70 multiprocessor support, acquiring the lock only consists
71 of raising to the locks TPL.
73 @param Lock The EFI_LOCK structure to initialize
75 @retval EFI_SUCCESS Lock Owned.
76 @retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned.
80 CoreAcquireLockOrFail (
86 Releases ownership of the mutual exclusion lock, and
87 restores the previous task priority level.
89 @param Lock The lock to release
100 // Device Path functions
105 Calculate the size of a whole device path.
107 @param DevicePath The pointer to the device path data.
109 @return Size of device path data structure..
114 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
119 Return TRUE is this is a multi instance device path.
121 @param DevicePath A pointer to a device path data structure.
123 @retval TRUE If DevicePath is multi instance. FALSE - If
124 DevicePath is not multi instance.
128 CoreIsDevicePathMultiInstance (
129 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
135 Duplicate a new device path data structure from the old one.
137 @param DevicePath A pointer to a device path data structure.
139 @return A pointer to the new allocated device path data.
140 @return Caller must free the memory used by DevicePath if it is no longer needed.
143 EFI_DEVICE_PATH_PROTOCOL
*
144 CoreDuplicateDevicePath (
145 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
150 Function is used to append a Src1 and Src2 together.
152 @param Src1 A pointer to a device path data structure.
153 @param Src2 A pointer to a device path data structure.
155 @return A pointer to the new device path is returned.
156 @return NULL is returned if space for the new device path could not be allocated from pool.
157 @return It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
160 EFI_DEVICE_PATH_PROTOCOL
*
161 CoreAppendDevicePath (
162 IN EFI_DEVICE_PATH_PROTOCOL
*Src1
,
163 IN EFI_DEVICE_PATH_PROTOCOL
*Src2
168 Allocate pool of type EfiBootServicesData, the size is specified with AllocationSize.
170 @param AllocationSize Size to allocate.
172 @return Pointer of the allocated pool.
176 CoreAllocateBootServicesPool (
177 IN UINTN AllocationSize
182 Allocate pool of type EfiBootServicesData and zero it, the size is specified with AllocationSize.
184 @param AllocationSize Size to allocate.
186 @return Pointer of the allocated pool.
190 CoreAllocateZeroBootServicesPool (
191 IN UINTN AllocationSize
196 Find a config table by name in system table's ConfigurationTable.
198 @param Guid The table name to look for
199 @param Table Pointer of the config table
201 @retval EFI_NOT_FOUND Could not find the table in system table's
203 @retval EFI_SUCCESS Table successfully found.
214 Allocate pool of specified size with EfiRuntimeServicesData type, and copy specified buffer to this pool.
216 @param AllocationSize Size to allocate.
217 @param Buffer Specified buffer that will be copy to the allocated
220 @return Pointer of the allocated pool.
224 CoreAllocateRuntimeCopyPool (
225 IN UINTN AllocationSize
,
231 Allocate pool of type EfiRuntimeServicesData, the size is specified with AllocationSize.
233 @param AllocationSize Size to allocate.
235 @return Pointer of the allocated pool.
239 CoreAllocateRuntimePool (
240 IN UINTN AllocationSize
245 Allocate pool of specified size with EfiBootServicesData type, and copy specified buffer to this pool.
247 @param AllocationSize Size to allocate.
248 @param Buffer Specified buffer that will be copy to the allocated
251 @return Pointer of the allocated pool.
255 CoreAllocateCopyPool (
256 IN UINTN AllocationSize
,
262 Create a protocol notification event and return it.
264 @param ProtocolGuid Protocol to register notification event on.
265 @param NotifyTpl Maximum TPL to signal the NotifyFunction.
266 @param NotifyFunction EFI notification routine.
267 @param NotifyContext Context passed into Event when it is created.
268 @param Registration Registration key returned from
269 RegisterProtocolNotify().
270 @param SignalFlag Boolean value to decide whether kick the event after
273 @return The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
274 is added to the system.
278 CoreCreateProtocolNotifyEvent (
279 IN EFI_GUID
*ProtocolGuid
,
280 IN EFI_TPL NotifyTpl
,
281 IN EFI_EVENT_NOTIFY NotifyFunction
,
282 IN VOID
*NotifyContext
,
283 OUT VOID
**Registration
,
284 IN BOOLEAN SignalFlag