3 Internal functions shared in DxeCore module.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef _DXE_LIBRARY_H_
18 #define _DXE_LIBRARY_H_
23 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid.
25 @param Value Describes the class/subclass/operation of the
26 hardware or software entity that the Status Code
31 CoreReportProgressCode (
32 IN EFI_STATUS_CODE_VALUE Value
38 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid,
39 with a handle as additional information.
41 @param Value Describes the class/subclass/operation of the
42 hardware or software entity that the Status Code
44 @param Handle Additional information.
48 CoreReportProgressCodeSpecific (
49 IN EFI_STATUS_CODE_VALUE Value
,
56 Raising to the task priority level of the mutual exclusion
57 lock, and then acquires ownership of the lock.
59 @param Lock The lock to acquire
72 Initialize a basic mutual exclusion lock. Each lock
73 provides mutual exclusion access at it's task priority
74 level. Since there is no-premption (at any TPL) or
75 multiprocessor support, acquiring the lock only consists
76 of raising to the locks TPL.
78 @param Lock The EFI_LOCK structure to initialize
80 @retval EFI_SUCCESS Lock Owned.
81 @retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned.
85 CoreAcquireLockOrFail (
92 Releases ownership of the mutual exclusion lock, and
93 restores the previous task priority level.
95 @param Lock The lock to release
107 // Device Path functions
112 Calculate the size of a whole device path.
114 @param DevicePath The pointer to the device path data.
116 @return Size of device path data structure..
121 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
127 Return TRUE is this is a multi instance device path.
129 @param DevicePath A pointer to a device path data structure.
131 @retval TRUE If DevicePath is multi instance. FALSE - If
132 DevicePath is not multi instance.
136 CoreIsDevicePathMultiInstance (
137 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
144 Duplicate a new device path data structure from the old one.
146 @param DevicePath A pointer to a device path data structure.
148 @return A pointer to the new allocated device path data.
149 @return Caller must free the memory used by DevicePath if it is no longer needed.
152 EFI_DEVICE_PATH_PROTOCOL
*
153 CoreDuplicateDevicePath (
154 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
160 Function is used to append a Src1 and Src2 together.
162 @param Src1 A pointer to a device path data structure.
163 @param Src2 A pointer to a device path data structure.
165 @return A pointer to the new device path is returned.
166 @return NULL is returned if space for the new device path could not be allocated from pool.
167 @return It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
170 EFI_DEVICE_PATH_PROTOCOL
*
171 CoreAppendDevicePath (
172 IN EFI_DEVICE_PATH_PROTOCOL
*Src1
,
173 IN EFI_DEVICE_PATH_PROTOCOL
*Src2
179 Allocate pool of type EfiBootServicesData, the size is specified with AllocationSize.
181 @param AllocationSize Size to allocate.
183 @return Pointer of the allocated pool.
187 CoreAllocateBootServicesPool (
188 IN UINTN AllocationSize
194 Allocate pool of type EfiBootServicesData and zero it, the size is specified with AllocationSize.
196 @param AllocationSize Size to allocate.
198 @return Pointer of the allocated pool.
202 CoreAllocateZeroBootServicesPool (
203 IN UINTN AllocationSize
209 Find a config table by name in system table's ConfigurationTable.
211 @param Guid The table name to look for
212 @param Table Pointer of the config table
214 @retval EFI_NOT_FOUND Could not find the table in system table's
216 @retval EFI_SUCCESS Table successfully found.
228 Allocate pool of specified size with EfiRuntimeServicesData type, and copy specified buffer to this pool.
230 @param AllocationSize Size to allocate.
231 @param Buffer Specified buffer that will be copy to the allocated
234 @return Pointer of the allocated pool.
238 CoreAllocateRuntimeCopyPool (
239 IN UINTN AllocationSize
,
246 Allocate pool of type EfiRuntimeServicesData, the size is specified with AllocationSize.
248 @param AllocationSize Size to allocate.
250 @return Pointer of the allocated pool.
254 CoreAllocateRuntimePool (
255 IN UINTN AllocationSize
261 Allocate pool of specified size with EfiBootServicesData type, and copy specified buffer to this pool.
263 @param AllocationSize Size to allocate.
264 @param Buffer Specified buffer that will be copy to the allocated
267 @return Pointer of the allocated pool.
271 CoreAllocateCopyPool (
272 IN UINTN AllocationSize
,
279 Create a protocol notification event and return it.
281 @param ProtocolGuid Protocol to register notification event on.
282 @param NotifyTpl Maximum TPL to signal the NotifyFunction.
283 @param NotifyFunction EFI notification routine.
284 @param NotifyContext Context passed into Event when it is created.
285 @param Registration Registration key returned from
286 RegisterProtocolNotify().
287 @param SignalFlag Boolean value to decide whether kick the event after
290 @return The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
291 is added to the system.
295 CoreCreateProtocolNotifyEvent (
296 IN EFI_GUID
*ProtocolGuid
,
297 IN EFI_TPL NotifyTpl
,
298 IN EFI_EVENT_NOTIFY NotifyFunction
,
299 IN VOID
*NotifyContext
,
300 OUT VOID
**Registration
,
301 IN BOOLEAN SignalFlag