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.
16 #ifndef _DXE_LIBRARY_H_
17 #define _DXE_LIBRARY_H_
21 CoreReportProgressCode (
22 IN EFI_STATUS_CODE_VALUE Value
28 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid.
32 Value - Describes the class/subclass/operation of the hardware or software entity
33 that the Status Code relates to.
43 CoreReportProgressCodeSpecific (
44 IN EFI_STATUS_CODE_VALUE Value
,
51 Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid,
52 with a handle as additional information.
56 Value - Describes the class/subclass/operation of the hardware or software entity
57 that the Status Code relates to.
59 Handle - Additional information.
76 Raising to the task priority level of the mutual exclusion
77 lock, and then acquires ownership of the lock.
81 Lock - The lock to acquire
91 CoreAcquireLockOrFail (
98 Initialize a basic mutual exclusion lock. Each lock
99 provides mutual exclusion access at it's task priority
100 level. Since there is no-premption (at any TPL) or
101 multiprocessor support, acquiring the lock only consists
102 of raising to the locks TPL.
106 Lock - The EFI_LOCK structure to initialize
110 EFI_SUCCESS - Lock Owned.
111 EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
124 Releases ownership of the mutual exclusion lock, and
125 restores the previous task priority level.
129 Lock - The lock to release
139 // Device Path functions
144 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
150 Calculate the size of a whole device path.
154 DevicePath - The pointer to the device path data.
158 Size of device path data structure..
164 CoreIsDevicePathMultiInstance (
165 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
170 Return TRUE is this is a multi instance device path.
173 DevicePath - A pointer to a device path data structure.
177 TRUE - If DevicePath is multi instance. FALSE - If DevicePath is not multi
184 EFI_DEVICE_PATH_PROTOCOL
*
185 CoreDuplicateDevicePath (
186 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
191 Duplicate a new device path data structure from the old one.
194 DevicePath - A pointer to a device path data structure.
197 A pointer to the new allocated device path data.
198 Caller must free the memory used by DevicePath if it is no longer needed.
203 EFI_DEVICE_PATH_PROTOCOL
*
204 CoreAppendDevicePath (
205 IN EFI_DEVICE_PATH_PROTOCOL
*Src1
,
206 IN EFI_DEVICE_PATH_PROTOCOL
*Node
211 Function is used to append a Src1 and Src2 together.
214 Src1 - A pointer to a device path data structure.
216 Node - A pointer to a device path data structure.
220 A pointer to the new device path is returned.
221 NULL is returned if space for the new device path could not be allocated from pool.
222 It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
228 CoreAllocateBootServicesPool (
229 IN UINTN AllocationSize
235 Allocate pool of type EfiBootServicesData, the size is specified with AllocationSize.
239 AllocationSize - Size to allocate.
243 Pointer of the allocated pool.
249 CoreAllocateZeroBootServicesPool (
250 IN UINTN AllocationSize
256 Allocate pool of type EfiBootServicesData and zero it, the size is specified with AllocationSize.
260 AllocationSize - Size to allocate.
264 Pointer of the allocated pool.
278 Find a config table by name in system table's ConfigurationTable.
282 Guid - The table name to look for
284 Table - Pointer of the config table
288 EFI_NOT_FOUND - Could not find the table in system table's ConfigurationTable.
290 EFI_SUCCESS - Table successfully found.
296 CoreAllocateRuntimeCopyPool (
297 IN UINTN AllocationSize
,
304 Allocate pool of specified size with EfiRuntimeServicesData type, and copy specified buffer to this pool.
308 AllocationSize - Size to allocate.
310 Buffer - Specified buffer that will be copy to the allocated pool
314 Pointer of the allocated pool.
320 CoreAllocateRuntimePool (
321 IN UINTN AllocationSize
327 Allocate pool of type EfiRuntimeServicesData, the size is specified with AllocationSize.
331 AllocationSize - Size to allocate.
335 Pointer of the allocated pool.
341 CoreAllocateCopyPool (
342 IN UINTN AllocationSize
,
349 Allocate pool of specified size with EfiBootServicesData type, and copy specified buffer to this pool.
353 AllocationSize - Size to allocate.
355 Buffer - Specified buffer that will be copy to the allocated pool
359 Pointer of the allocated pool.
365 CoreCreateProtocolNotifyEvent (
366 IN EFI_GUID
*ProtocolGuid
,
367 IN EFI_TPL NotifyTpl
,
368 IN EFI_EVENT_NOTIFY NotifyFunction
,
369 IN VOID
*NotifyContext
,
370 OUT VOID
**Registration
,
371 IN BOOLEAN SignalFlag
377 Create a protocol notification event and return it.
381 ProtocolGuid - Protocol to register notification event on.
383 NotifyTpl - Maximum TPL to signal the NotifyFunction.
385 NotifyFuncition - EFI notification routine.
387 NotifyContext - Context passed into Event when it is created.
389 Registration - Registration key returned from RegisterProtocolNotify().
391 SignalFlag - Boolean value to decide whether kick the event after register or not.
395 The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
396 is added to the system.