American Megatrends, Inc.

AmiLib

Copyright

© American Megatrends, Inc.


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the source files.
For a list in alphabetical order, see In Alphabetical Order.

  • AcpiRes.c
  • Debug.c
  • Decompress.c
  • EfiDBE.c
  • EfiLib.c
  • IA32AsmLib.asm
  • IA32CLib.c
  • IO.c
  • Memory.c
  • Misc.c
  • PeiLib.c
  • PELoader.c
  • Print.c
  • StdLibC.c
  • x64AsmLib.asm
  • x64CLib.c
Built on 23:24:30 02/23/10


AcpiRes.c

Description:
Implementation of ASL MACROs for ResourceTemplate.  See ACPI 2.0
specification section 16.2.4.

The following functions are used in the file: AcpiRes.c.

Function | Description
AmiIsaDmaMask | EFI_STATUS AmiIsaDmaMask(IN OUT UINT8 *IsaDmaMask, IN BOOLEAN Get) sets or retrieves the ISA DMA mask from NVRAM depending upon the Get input.
AmiIsaIrqMask | EFI_STATUS AmiIsaIrqMask(IN OUT UINT16 *IsaIrqMask, IN BOOLEAN Get) sets or retrieves the ISA IRQ mask from NVRAM depending upon the Get input.
AppendItemLst | EFI_STATUS AppendItemLst(IN T_ITEM_LIST *Lst, IN VOID *pRes) appends the provided object to Lst.
ASLM_DMA | VOID* ASLM_DMA(IN UINT8 dsc_cnt, IN UINT8 typ, IN UINT8 bm, IN UINT8 siz, IN ...) generates a short DMA descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_FixedIO | VOID* ASLM_FixedIO(IN UINT16 bas, IN UINT8 len) generates a short fixed I/O descriptor and returns its address. User is responible for freeing the returned memory.
ASLM_IO | VOID* ASLM_IO(IN UINT8 dec, IN UINT16 min, IN UINT16 max, IN UINT8 aln, IN UINT8 len) generates a short I/O descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_IRQ | VOID* ASLM_IRQ(IN UINT8 dsc_cnt, IN UINT8 ll, IN UINT8 he, IN UINT8 shr, IN ...) generates a short IRQ descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_IRQNoFlags | VOID* ASLM_IRQNoFlags(IN UINT8 dsc_cnt, IN ...) generates a short IRQ descriptor without an optional IRQ information byte and returns its address. User is responsible for freeing the returned memory.
ASLM_Memory24 | VOID* ASLM_Memory24(IN UINT8 rw, IN UINT8 min, IN UINT8 max, IN UINT8 aln, IN UINT8 len) generates a long 24-bit memory descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_StartDependentFn | VOID* ASLM_StartDependentFn(IN UINT8 dsc_cnt, IN UINT8 pComp, IN UINT8 pPerf, IN ...) generates a Start-Dependent Function descriptor with the optional priority byte and returns its address. User is responsible for freeing the returned memory.
ASLM_StartDependentFnNoPri | VOID* ASLM_StartDependentFnNoPri(IN UINT8 dsc_cnt, IN ...) generates a Start-Dependent Function descriptor without the optional priority byte and returns its address. User is responsible for freeing the returned memory.
ASLM_VendorShort | VOID* ASLM_VendorShort(IN UINT8 byte_cnt, IN ...) generates a short Vendor-Defined descriptor and returns its address. User is responsible for freeing the returned memory.
CheckDsdt | BOOLEAN CheckDsdt(IN ACPI_HDR *Dsdt) checks the signature of the provided ACPI header for the DSDT signature.
CheckOpCode | BOOLEAN CheckOpCode(IN UINT8 *NameStart, IN UINT8 OpCode, IN UINT8 ExtOpCode, OUT ASL_OBJ_INFO *ObjInfo) checks an ASL object for the user provided op code and extended op code and returns the op code location in a user allocated ASL_OBJ_INFO structure.
ChsumTbl | UINT8 ChsumTbl(IN UINT8 *TblStart, IN UINT32 BytesCount) calculates the checksum of a table starting at TblStart of length BytesCount and returns the checksum value.
ClearItemLst | VOID ClearItemLst(IN T_ITEM_LIST *Lst, IN BOOLEAN FreeData) clears all the items of Lst. If FreeData is TRUE, frees all the memory associated with the stored objects.
ConvertAslName | UINT32 ConvertAslName(IN UINT8 *AslName) converts an ASL name into a UINT32 value and returns it.
CopyItemLst | EFI_STATUS CopyItemLst(IN T_ITEM_LIST *Lst, OUT T_ITEM_LIST **NewLstPtr) copies Lst into a new list and provides the address of the copy in NewLstPtr.
DeleteItemLst | EFI_STATUS DeleteItemLst(IN T_ITEM_LIST *Lst, IN UINTN ItemIndex, IN BOOLEAN FreeData) deletes the object stored at the provided ItemIndex in Lst. Frees the memory associated with the object pointer if FreeData is TRUE.
FindAslObjectName | VOID* FindAslObjectName(IN UINT8 *Start, IN UINT8 *ObjName, IN UINTN Len) finds an ASL object by its name string and returns its location.
GetAslObj | EFI_STATUS GetAslObj(IN UINT8 *Start, IN UINTN Length, IN UINT8 *Name, IN ASL_OBJ_TYPE ObjType, OUT ASL_OBJ_INFO *ObjInfo)
GetPackageLen | UINTN GetPackageLen(IN AML_PACKAGE_LBYTE *Pck, OUT UINT8 *BytesCnt) determines the length in bytes of an AML package.
HideAslMethodFromOs | Destroys Method passed as MethodName parameter if it is present in ASL object described by AslObj parameter
InsertItemLst | EFI_STATUS InsertItemLst(IN T_ITEM_LIST *Lst, IN VOID *pRes, IN UINTN ItemIndex) inserts the provided item pointed to by pRes into the provided Lst at index ItemIndex.
LibGetDsdt | EFI_STATUS LibGetDsdt(OUT EFI_PHYSICAL_ADDRESS *DsdtAddr, IN EFI_ACPI_TABLE_VERSION Version) retrieves a pointer to the DSDT ACPI table for the user requested Version of ACPI.
reallocItemLst | EFI_STATUS reallocItemLst(IN T_ITEM_LIST *Lst) is an internal worker function which reallocates space for a T_ITEM_LIST.Items[] array.
UpdateAslNameBuffer | EFI_STATUS UpdateAslNameBuffer(UINT8 *BufferStart, UINTN BufferLen, IN UINT8 *ObjName, IN UINT64 Value) locates an ASL object by its name, ObjName, in Memory Buffer specified by BufferStart, and BufferLen and updates its data start with the user provided Value.
UpdateAslNameObject | EFI_STATUS UpdateAslNameObject(IN ACPI_HDR *PDsdt, IN UINT8 *ObjName, IN UINT64 Value) locates an ASL object by its name, ObjName, in the DSDT and updates its data start with the user provided Value.
UpdateAslNameOfDevice | EFI_STATUS UpdateAslNameOfDevice(IN ACPI_HDR *PDsdt, IN CHAR8 *DeviceName, CHAR8 *ObjName, IN UINT64 Value) locates an ASL Device Object by its name, DeviceName, and then In the scope of this Device Object, trys to locate a Name Object, ObjName, in the DSDT. If found it updates its data place holder with user provided Value.
ValidateDescriptor | BOOLEAN ValidateDescriptor(IN ASLR_QWORD_ASD *Descriptor, IN ASLR_TYPE_ENUM ResType, IN BOOLEAN Fixed) validates a ASLV_LARGE_RES descriptor.
ValidateDescriptorBlock | UINTN ValidateDescriptorBlock(IN ASLR_QWORD_ASD *DscStart, IN ASLR_TYPE_ENUM ResType, IN BOOLEAN Fixed) validates the consistancy of the provided ACPI QWORD resource descriptors block which contains some number of ASLR_QWORD_ASDs in memory terminated by an ASLR_EndTag. Returns the total size of the resource descriptors plus the size of the ASLR_EndTag.


AmiIsaDmaMask in the AcpiRes.c

Function : AmiIsaDmaMask

File: AcpiRes.c
Description:
EFI_STATUS AmiIsaDmaMask(IN OUT UINT8 *IsaDmaMask, IN BOOLEAN Get) sets
or retrieves the ISA DMA mask from NVRAM depending upon the Get input.
Input:
IN OUT UINT8 *IsaDmaMask
If Get is TRUE, returns an address to the ISA DMA mask.  If Get is FALSE,
used to update the ISA DMA mask NVRAM variable.  User is responsible for
allocating and managing this memory.

IN BOOLEAN Get
If TRUE, causes function to return an address to the ISA DMA mask.
If FALSE, causes function to use the user provided ISA DMA mask to update
the NVRAM variable with its value.
Output:
EFI_NOT_FOUND,           if the ISA DMA mask NVRAM variable is not found.
EFI_DEVICE_ERROR,        if the ISA DMA mask NVRAM variable could not be
           accessed due to a hardware error.
EFI_SECURITY_VIOLATION,  if the ISA DMA mask NVRAM variable could be not
           be accessed due to a authentication failure.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


AmiIsaIrqMask in the AcpiRes.c

Function : AmiIsaIrqMask

File: AcpiRes.c
Description:
EFI_STATUS AmiIsaIrqMask(IN OUT UINT16 *IsaIrqMask, IN BOOLEAN Get) sets
or retrieves the ISA IRQ mask from NVRAM depending upon the Get input.
Input:
IN OUT UINT16 *IsaIrqMask
If Get is TRUE, returns an address to the ISA IRQ mask.  If Get is FALSE,
used to update the ISA IRQ mask NVRAM variable.  User is responsible for
allocating and managing this memory.

IN BOOLEAN Get
If TRUE, causes function to return an address to the ISA IRQ mask.
If FALSE, causes function to use the user provided ISA IRQ mask to update
the NVRAM variable with its value.
Output:
EFI_NOT_FOUND,           if the ISA IRQ mask NVRAM variable is not found.
EFI_DEVICE_ERROR,        if the ISA IRQ mask NVRAM variable could not be
           accessed due to a hardware error.
EFI_SECURITY_VIOLATION,  if the ISA IRQ mask NVRAM variable could be not
           be accessed due to a authentication failure.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


AppendItemLst in the AcpiRes.c

Function : AppendItemLst

File: AcpiRes.c
Description:
EFI_STATUS AppendItemLst(IN T_ITEM_LIST *Lst, IN VOID *pRes) appends the
provided object to Lst.
Input:
IN T_ITEM_LIST *Lst
List to be appended to.

IN VOID *pRes
Object to be appended.
Output:
EFI_OUT_OF_RESOURCES,  if memory allocation fails.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
reallocItemLst


ASLM_DMA in the AcpiRes.c

Function : ASLM_DMA

File: AcpiRes.c
Description:
VOID* ASLM_DMA(IN UINT8 dsc_cnt, IN UINT8 typ, IN UINT8 bm, IN UINT8 siz,
IN ...) generates a short DMA descriptor and returns its address.  User is
responsible for freeing the returned memory.
Input:
IN UINT8 dsc_cnt
Number of channel numbers in the list.

IN UINT8 typ
DMA channel speed.  Valid values are:
ASLV_Compatibility, ASLV_TypeA, ASLV_TypeB, ASLV_TypeF

IN UINT8 bm
BusMaster or NotBusMaster.  0 defaults to BusMaster.

IN UINT8 siz
Transfer size.  Valid values are:
Transfer8, Transfer16, Transfer8_16

IN ...
List of channel numbers.  Valid values are 0-7.
Output:
VOID* address of the created DMA descriptor.  User is responsible for
freeing the returned memory.
Modified:
Notes:
Referrals:
Malloc
va_start
va_arg
va_end


ASLM_FixedIO in the AcpiRes.c

Function : ASLM_FixedIO

File: AcpiRes.c
Description:
VOID* ASLM_FixedIO(IN UINT16 bas, IN UINT8 len) generates a short fixed
I/O descriptor and returns its address.  User is responible for freeing
the returned memory.
Input:
IN UINT16 bas
Address base.

IN UINT8 len
Range length.
Output:
VOID* address of the created fixed I/O descriptor.  User is responsible
for freeing the returned memory.
Modified:
Notes:
Referrals:
MallocZ


ASLM_IO in the AcpiRes.c

Function : ASLM_IO

File: AcpiRes.c
Description:
VOID* ASLM_IO(IN UINT8 dec, IN UINT16 min, IN UINT16 max, IN UINT8 aln,
IN UINT8 len) generates a short I/O descriptor and returns its address.
User is responsible for freeing the returned memory.
Input:
IN UINT8 dec
Decode value.  Valid values are: ASLV_Decode16, ASLV_Decode10.

IN UINT16 min
Address minimum.

IN UINT16 max
Address maximum.

IN UINT8 aln
Base alignment.

IN UINT8 len
Range length.
Output:
VOID* address of the created I/O descriptor.  User is responsible for
freeing the returned memory.
Modified:
Notes:
Referrals:
MallocZ


ASLM_IRQ in the AcpiRes.c

Function : ASLM_IRQ

File: AcpiRes.c
Description:
VOID* ASLM_IRQ(IN UINT8 dsc_cnt, IN UINT8 ll, IN UINT8 he,
IN UINT8 shr, IN ...) generates a short IRQ descriptor and returns its
address.  User is responsible for freeing the returned memory.
Input:
IN UINT8 dsc_cnt
Number of IRQ numbers in the list.

IN UINT8 ll
IRQ flag.  0 = active-high, 1 = active-low.

IN UINT8 he
IRQ flag.  0 = level-triggered, 1 = edge-triggered.

IN UINT8 shr
IRQ flag.  0 = not interrupt shareable, 1 = interrupt shareable.

IN ...
List of IRQ numbers.  Valid values: 0-15.
Output:
VOID* address of the created IRQ descriptor.  User is responsible for
freeing the returned memory.
Modified:
Notes:
Referrals:
Malloc
va_start
va_arg
va_end


ASLM_IRQNoFlags in the AcpiRes.c

Function : ASLM_IRQNoFlags

File: AcpiRes.c
Description:
VOID* ASLM_IRQNoFlags(IN UINT8 dsc_cnt, IN ...) generates a short IRQ
descriptor without an optional IRQ information byte and returns its
address.  User is responsible for freeing the returned memory.
Input:
IN UINT8 dsc_cnt
Number of IRQ numbers in the list.

IN ...
List of IRQ numbers.  Valid values: 0-15.
Output:
VOID* address of the created IRQ descriptor.  User is responsible for
freeing the returned memory.
Modified:
Notes:
Referrals:
Malloc
va_start
va_arg
va_end


ASLM_Memory24 in the AcpiRes.c

Function : ASLM_Memory24

File: AcpiRes.c
Description:
VOID* ASLM_Memory24(IN UINT8 rw, IN UINT8 min, IN UINT8 max,
IN UINT8 aln, IN UINT8 len) generates a long 24-bit memory descriptor and
returns its address.  User is responsible for freeing the returned memory.
Input:
IN UINT8 rw
Write protection flag.  Valid values: ASLV_ReadOnly, ASLV_ReadWrite.

IN UINT8 min
Minimum base memory address [23:8].

IN UINT8 max
Maximum base memory address [23:8].

IN UINT8 aln
Base alignment.

IN UINT8 len
Range length.
Output:
VOID* address of the created long 24-bit memory descriptor.  User is
responsible for freeing the returned memory.
Modified:
Notes:
Referrals:
MallocZ


ASLM_StartDependentFn in the AcpiRes.c

Function : ASLM_StartDependentFn

File: AcpiRes.c
Description:
VOID* ASLM_StartDependentFn(IN UINT8 dsc_cnt, IN UINT8 pComp,
IN UINT8 pPerf, IN ...) generates a Start-Dependent Function descriptor
with the optional priority byte and returns its address.  User is
responsible for freeing the returned memory.
Input:
IN UINT8 dsc_cnt
Number of items in the descriptor list.

IN UINT8 pComp
Compatibility priority.  Valid values are 0-2.

IN UINT8 pPerf
Performance/robustness priority.  Valid values are 0-2.

IN ...
List of descriptors for this dependent function.
Output:
VOID* address of the created Start-Dependent Function descriptor.  User
is responsible for freeing the returned memory.
Modified:
Notes:
Referrals:
MallocZ
Malloc
va_start
va_arg


ASLM_StartDependentFnNoPri in the AcpiRes.c

Function : ASLM_StartDependentFnNoPri

File: AcpiRes.c
Description:
VOID* ASLM_StartDependentFnNoPri(IN UINT8 dsc_cnt, IN ...) generates a
Start-Dependent Function descriptor without the optional priority byte and
returns its address.  User is responsible for freeing the returned memory.
Input:
IN UINT8 dsc_cnt
Number of items in the descriptor list.

IN ...
List of descriptors for this dependent function.
Output:
VOID* address of the created Start-Dependent Function descriptor.  User
is responsible for freeing the returned memory.
Modified:
Notes:
Referrals:
MallocZ
Malloc
va_start
va_arg


ASLM_VendorShort in the AcpiRes.c

Function : ASLM_VendorShort

File: AcpiRes.c
Description:
VOID* ASLM_VendorShort(IN UINT8 byte_cnt, IN ...) generates a short
Vendor-Defined descriptor and returns its address.  User is responsible
for freeing the returned memory.
Input:
IN UINT8 byte_cnt
Number of bytes in the list.  Must be less than 8.

IN ...
List of byte expressions for the descriptor.  Must be less than 8
elements.
Output:
VOID* address of the created Vendor-Defined descriptor.  User is
responsible for freeing the returned memory.
Modified:
Notes:
Referrals:
MallocZ
va_start
va_arg
va_end


CheckDsdt in the AcpiRes.c

Function : CheckDsdt

File: AcpiRes.c
Description:
BOOLEAN CheckDsdt(IN ACPI_HDR *Dsdt) checks the signature of the provided
ACPI header for the DSDT signature.
Input:
IN ACPI_HDR *Dsdt
Pointer to the ACPI header to be checked for the DSDT signature.
Output:
TRUE if the header signature is that of the DSDT.  Otherwise, FALSE.
Modified:
Notes:
Referrals:


CheckOpCode in the AcpiRes.c

Function : CheckOpCode

File: AcpiRes.c
Description:
BOOLEAN CheckOpCode(IN UINT8 *NameStart, IN UINT8 OpCode,
IN UINT8 ExtOpCode, OUT ASL_OBJ_INFO *ObjInfo) checks an ASL object for
the user provided op code and extended op code and returns the op code
location in a user allocated ASL_OBJ_INFO structure.
Input:
IN UINT8 *NameStart
Pointer to the start of the ASL object's name.

IN UINT8 OpCode
Op code to be checked.

IN UINT8 ExtOpCode
Extended op code to be checked.  If set as 0, only checks for OpCode.

OUT ASL_OBJ_INFO *ObjInfo
Pointer to a user allocated ASL_OBJ_INFO structure which will be updated
with the associated information if the op codes are located.  If an
extended op code is specified, ObjInfo->Object is filled with the location
of the extended op code; otherwise ObjInfo->Object refers to the location
of the op code.
Output:
TRUE if the op code and extended op code (if specified) are located;
otherwise, FALSE.
Modified:
Notes:
Helper function for GetAslObj.
Referrals:
GetPackageLen


ChsumTbl in the AcpiRes.c

Function : ChsumTbl

File: AcpiRes.c
Description:
UINT8 ChsumTbl(IN UINT8 *TblStart, IN UINT32 BytesCount) calculates the
checksum of a table starting at TblStart of length BytesCount and returns
the checksum value.
Input:
IN UINT8 *TblStart
Starting address of the memory area to checksum.

IN UINT32 BytesCount
Length in bytes of the memory area to checksum.
Output:
UINT8 checksum value starting from TblStart and ending at
TblStart + BytesCount.
Modified:
Notes:
Referrals:


ClearItemLst in the AcpiRes.c

Function : ClearItemLst

File: AcpiRes.c
Description:
VOID ClearItemLst(IN T_ITEM_LIST *Lst, IN BOOLEAN FreeData) clears all
the items of Lst.  If FreeData is TRUE, frees all the memory associated
with the stored objects.
Input:
IN T_ITEM_LIST *Lst
List to be cleared.

IN BOOLEAN FreeData
If TRUE, all objects are freed.
Output:
VOID.
Modified:
Notes:
Referrals:


ConvertAslName in the AcpiRes.c

Function : ConvertAslName

File: AcpiRes.c
Description:
UINT32 ConvertAslName(IN UINT8 *AslName) converts an ASL name into a
UINT32 value and returns it.
Input:
IN UINT8 *AslName
Pointer to the ASL name string.
Output:
UINT32 translation of the ASL name.
Modified:
Notes:
Helper function for FindAslObjectName.
Referrals:
Strlen

 MemCpy


CopyItemLst in the AcpiRes.c

Function : CopyItemLst

File: AcpiRes.c
Description:
EFI_STATUS CopyItemLst(IN T_ITEM_LIST *Lst, OUT T_ITEM_LIST **NewLstPtr)
copies Lst into a new list and provides the address of the copy in
NewLstPtr.
Input:
IN T_ITEM_LIST *Lst
List to be copied.

OUT T_ITEM_LIST **NewLstPtr
Location to store the address of the new copy.
Output:
EFI_OUT_OF_RESOURCES,  if memory allocation fails.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
MallocZ


DeleteItemLst in the AcpiRes.c

Function : DeleteItemLst

File: AcpiRes.c
Description:
EFI_STATUS DeleteItemLst(IN T_ITEM_LIST *Lst, IN UINTN ItemIndex,
IN BOOLEAN FreeData) deletes the object stored at the provided ItemIndex
in Lst.  Frees the memory associated with the object pointer if FreeData
is TRUE.
Input:
IN T_ITEM_LIST *Lst
List to be deleted from.

IN UINTN ItemIndex
Index inside Lst->Items to be deleted.

IN BOOLEAN FreeData
TRUE will free the memory associated with the deleted object.
Output:
EFI_INVALID_PARAMETER,  if the provided ItemIndex is invalid.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


FindAslObjectName in the AcpiRes.c

Function : FindAslObjectName

File: AcpiRes.c
Description:
VOID* FindAslObjectName(IN UINT8 *Start, IN UINT8 *ObjName, IN UINTN Len)
finds an ASL object by its name string and returns its location.
Input:
IN UINT8 *Start
Location to begin scanning for the ASL object.

IN UINT8 *ObjName
Name of the ASL object to be located.

IN UINTN Len
Maximum length of bytes to scan for the ASL object.
Output:
VOID* pointer to the start of the ASL name string in memory.
Modified:
Notes:
Helper function for GetAslObj.
Referrals:
ConvertAslName


GetAslObj in the AcpiRes.c

Function : GetAslObj

File: AcpiRes.c
Description:
EFI_STATUS GetAslObj(IN UINT8 *Start, IN UINTN Length, IN UINT8 *Name,
IN ASL_OBJ_TYPE ObjType, OUT ASL_OBJ_INFO *ObjInfo)
Input:
IN UINT8 *Start
Starting location in memory to begin scanning for the desired ASL object.

IN UINTN Length
Maximum number of bytes in memory to be scanned starting from Start for
the ASL object.

IN UINT8 *Name
Pointer to the name of the ASL object to be located.

IN ASL_OBJ_TYPE ObjType
Type of the ASL object to be located.  Supports: otScope, otName, otProc,
otTermal, otDevice, otMethod, otPwrRes, otOpReg

OUT ASL_OBJ_INFO *ObjInfo
Returns completed ASL_OBJ_INFO structure, if the ASL object is found.
Output:
EFI_NOT_FOUND,  if object not found or invalid type.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
FindAslObjectName
CheckOpCode


GetPackageLen in the AcpiRes.c

Function : GetPackageLen

File: AcpiRes.c
Description:
UINTN GetPackageLen(IN AML_PACKAGE_LBYTE *Pck, OUT UINT8 *BytesCnt)
determines the length in bytes of an AML package.
Input:
IN AML_PACKAGE_LBYTE *Pck
AML package to be measured.

OUT UINT8 *BytesCnt
The ByteCount value of the package.
Output:
UINTN size of the AML package in bytes.
Modified:
Notes:
Referrals:


HideAslMethodFromOs in the AcpiRes.c

Function : HideAslMethodFromOs

File: AcpiRes.c
Description:
Destroys Method passed as MethodName parameter if it is present in ASL object
described by AslObj parameter
Input:
IN ASL_OBJ_INFO *AslObj
Pointer to ASL_OBJ_INFO structure, which discribes ASL object to modify

UINT8 *MethodName
Name of the ASL Method to be destroyed.
Referrals:
ConvertAslName


InsertItemLst in the AcpiRes.c

Function : InsertItemLst

File: AcpiRes.c
Description:
EFI_STATUS InsertItemLst(IN T_ITEM_LIST *Lst, IN VOID *pRes,
IN UINTN ItemIndex) inserts the provided item pointed to by pRes into the
provided Lst at index ItemIndex.
Input:
IN T_ITEM_LIST *Lst
List to be inserted into.

IN VOID *pRes
Pointer to object to place in list.

IN UINTN ItemIndex
Index in list to place the object pointed to by pRes.
Output:
EFI_INVALID_PARAMETER,  if the ItemIndex value is invalid.
EFI_OUT_OF_RESOURCES,   if there is not enough memory for the new object.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
reallocItemLst


LibGetDsdt in the AcpiRes.c

Function : LibGetDsdt

File: AcpiRes.c
Description:
EFI_STATUS LibGetDsdt(OUT EFI_PHYSICAL_ADDRESS *DsdtAddr,
IN EFI_ACPI_TABLE_VERSION Version) retrieves a pointer to the DSDT ACPI
table for the user requested Version of ACPI.
Input:
OUT EFI_PHYSICAL_ADDRESS *DsdtAddr
Address of the DSDT associated with the user provided Version.

IN EFI_ACPI_TABLE_VERSION Version
Which version of ACPI's DSDT to return.  Valid values include:
EFI_ACPI_TABLE_VERSION_1_0B, EFI_ACPI_TABLE_VERSION_X,
EFI_ACPI_TABLE_VERSION_NONE
Output:
EFI_NOT_AVAILABLE_YET,  if ACPI support protocol not installed yet.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


reallocItemLst in the AcpiRes.c

Function : reallocItemLst

File: AcpiRes.c
Description:
EFI_STATUS reallocItemLst(IN T_ITEM_LIST *Lst) is an internal worker
function which reallocates space for a T_ITEM_LIST.Items[] array.
Input:
IN T_ITEM_LIST *Lst
List which needs its Items array reallocated.
Output:
EFI_OUT_OF_RESOURCES,  if allocation failed.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
MallocZ


UpdateAslNameBuffer in the AcpiRes.c

Function : UpdateAslNameBuffer

File: AcpiRes.c
Description:
EFI_STATUS UpdateAslNameBuffer(UINT8 *BufferStart, UINTN BufferLen,
IN UINT8 *ObjName, IN UINT64 Value) locates an ASL object by its name,
ObjName, in Memory Buffer specified by BufferStart, and BufferLen
and updates its data start with the user provided Value.
Input:
IN UINT8 *BufferStart
Pointer to the DSDT.

UINTN BufferLen
Length of the Buffer

IN UINT8 *ObjName
Name of the ASL object to be updated.

IN UINT64 Value
New value for the ASL object's data entry.
Output:
EFI_INVALID_PARAMETER,  if the DSDT pointer, ObjName or Value are invalid.
EFI_NOT_FOUND,          if object specified by ObjName not present.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
GetAslObj


UpdateAslNameObject in the AcpiRes.c

Function : UpdateAslNameObject

File: AcpiRes.c
Description:
EFI_STATUS UpdateAslNameObject(IN ACPI_HDR *PDsdt, IN UINT8 *ObjName,
IN UINT64 Value) locates an ASL object by its name, ObjName, in the DSDT
and updates its data start with the user provided Value.
Input:
IN ACPI_HDR *PDsdt
Pointer to the DSDT.

IN UINT8 *ObjName
Name of the ASL object to be updated.

IN UINT64 Value
New value for the ASL object's data entry.
Output:
EFI_INVALID_PARAMETER,  if the DSDT pointer, ObjName or Value are invalid.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
CheckDsdt
GetAslObj


UpdateAslNameOfDevice in the AcpiRes.c

Function : UpdateAslNameOfDevice

File: AcpiRes.c
Description:
EFI_STATUS UpdateAslNameOfDevice(IN ACPI_HDR *PDsdt, IN CHAR8 *DeviceName,
CHAR8 *ObjName, IN UINT64 Value) locates an ASL Device Object by its name,
DeviceName, and then In the scope of this Device Object, trys to locate a
Name Object, ObjName, in the DSDT. If found it updates its data place holder
with user provided Value.
Input:
IN ACPI_HDR *PDsdt
Pointer to the DSDT.

IN CHAR8 *DeviceName
Name of the ASL Device object having in it's scope Name Object to be updated.

IN CHAR8 *ObjName
Name of the ASL Name Object to be updated.

IN UINT64 Value
New value for the ASL object's data entry.
Output:
EFI_INVALID_PARAMETER,  if the DSDT pointer, ObjName or Value are invalid.
EFI_NOT_FOUND,          if object specified by Device Name Or ObjName not present.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
CheckDsdt
GetAslObj


ValidateDescriptor in the AcpiRes.c

Function : ValidateDescriptor

File: AcpiRes.c
Description:
BOOLEAN ValidateDescriptor(IN ASLR_QWORD_ASD *Descriptor,
IN ASLR_TYPE_ENUM ResType, IN BOOLEAN Fixed) validates a ASLV_LARGE_RES
descriptor.
Input:
IN ASLR_QWORD_ASD *Descriptor
Descriptor to be validated.

IN ASLR_TYPE_ENUM ResType
The resource type of the descriptor.  Valid values are:
tResAll, tResIoMem, tResBus

IN BOOLEAN Fixed
If TRUE, checks the general flags for consistancy.
Output:
TRUE if a valid ASLR_QWORD_ASD descriptor.  Otherwise, FALSE.
Modified:
Notes:
Helper function for ValidateDescriptorBlock.
Referrals:


ValidateDescriptorBlock in the AcpiRes.c

Function : ValidateDescriptorBlock

File: AcpiRes.c
Description:
UINTN ValidateDescriptorBlock(IN ASLR_QWORD_ASD *DscStart,
IN ASLR_TYPE_ENUM ResType, IN BOOLEAN Fixed) validates the consistancy of
the provided ACPI QWORD resource descriptors block which contains some
number of ASLR_QWORD_ASDs in memory terminated by an ASLR_EndTag.  Returns
the total size of the resource descriptors plus the size of the
ASLR_EndTag.
Input:
IN ASLR_QWORD_ASD *DscStart
Pointer to the first descriptor in the block to be validated.

IN ASLR_TYPE_ENUM ResType
The resource type of the descriptors.  Valid values are:
tResAll, tResIoMem, tResBus

IN BOOLEAN Fixed
If TRUE, checks the general flags for consistancy.
Output:
UINTN size of the resource descriptor block plus the size of the
ASLR_EndTag.
Modified:
Notes:
Referrals:
ValidateDescriptor


Debug.c

Description:
Contains generic debug library functions.

The following functions are used in the file: Debug.c.

Function | Description
PEI_PROGRESS_CODE | PEI_PROGRESS_CODE(PeiServices, Code) is a macro which reports progress code using (*PeiServices)->ReportStatusCode
PEI_TRACE | PEI_TRACE(Arguments) is a macro which creates a serial debug message in PEI if the DEBUG_MODE SDL token is enabled by invoking the PeiTrace function with the provided arguments. If DEBUG_MODE is off, nothing is generated. See notes for an example usage.
PROGRESS_CODE | PROGRESS_CODE(Code) is a macro which reports progress code using UEFI ReportStatusCode API.
TRACE | Trace (Arguments) is a macro which creates a serial debug message in DXE if the DEBUG_MODE SDL token is enabled by invoking the Trace function with the provided arguments. If DEBUG_MODE is off, nothing is generated. See notes for an example usage.

The following descriptions are used in the file: Debug.c.

Header | Description
Debug_Functions | Debug related functions defined in the AMI library.


Debug_Functions in the Debug.c

General : Debug_Functions

File: Debug.c
Fields:

Header | Function | Description
AmiPeiLib | PEI_TRACE | Macro which creates a serial debug message in PEI.
AmiDxeLib | Trace | Macro which creates a serial debug message in DXE.
AmiDxeLib | PROGRESS_CODE | Macro to report boot progress information in DXE.
AmiPeiLib | PEI_PROGRESS_CODE | Macro report boot progress information in PEI.
AmiDxeLib | ERROR_CODE | Macro to report error condition in DXE.
AmiPeiLib | PEI_ERROR_CODE | Macro to report error condition in PEI.
AmiLib | checkpoint | Send a checkpoint to port 0x80. Use PROGRESS_CODE or PEI_PROGRESS_CODE if possible.

Description:
Debug related functions defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


PEI_PROGRESS_CODE in the Debug.c

Function : PEI_PROGRESS_CODE

File: Debug.c
Description:
PEI_PROGRESS_CODE(PeiServices, Code) is a macro which reports progress code
using (*PeiServices)->ReportStatusCode
Input:
PeiServices - Double pointer to PEI Services Table.
Code - progress code value.
Standard values are defined in AmiStatusCodes.h
Output:
VOID.


PEI_TRACE in the Debug.c

Function : PEI_TRACE

File: Debug.c
Description:
PEI_TRACE(Arguments) is a macro which creates a serial debug message in
PEI if the DEBUG_MODE SDL token is enabled by invoking the PeiTrace
function with the provided arguments.  If DEBUG_MODE is off, nothing is
generated.  See notes for an example usage.
Input:
Arguments
A bracket enclosed list including the following input parameters for
PeiTrace (in order from left to right).

IN UINTN Level
The error level of the debug message.

IN EFI_PEI_SERVICES **ppPS
Double pointer to PEI Services Table.

IN CHAR8 *sFormat
Format string for the debug message to print.

IN ...
Additional parameters utilized by the format string.
Output:
VOID.
Modified:
Notes:
See Sprintf for a detailed description of the format string parameters.
Example usage:

PEI_TRACE((TRACE_ALWAYS, PeiServices, "This is a test message.  Status
is %r.", Status));
Referrals:
PeiTrace
Sprintf


PROGRESS_CODE in the Debug.c

Function : PROGRESS_CODE

File: Debug.c
Description:
PROGRESS_CODE(Code) is a macro which reports progress code
using UEFI ReportStatusCode API.
Input:
Code - progress code value.
Standard values are defined in AmiStatusCodes.h
Output:
VOID.


TRACE in the Debug.c

Function : TRACE

File: Debug.c
Description:

 Trace
(Arguments) is a macro which creates a serial debug message in DXE
if the DEBUG_MODE SDL token is enabled by invoking the

 Trace
 function with
the provided arguments.  If DEBUG_MODE is off, nothing is generated.  See
notes for an example usage.
Input:
Arguments
A bracket enclosed list including the following input parameters for

 Trace
 (in order from left to right).

IN UINTN Level
The error level of the debug message.

IN CHAR8 *sFormat
Format string for the debug message to print.

IN ...
Argument list for the format string.
Output:
VOID.
Modified:
Notes:
See Sprintf for a detailed description of the format string parameters.
Example usage:

 Trace
((TRACE_ALWAYS, "This is a test message.  Status is %r.", Status));
Referrals:

 Trace

Sprintf


Decompress.c

Description:
Standard EFI decompressor library functions.
The functions are used by Core to implement standard Decompression API.
Consumers outside Core should not use functions from this file.
The public API should be used instead.

The following functions are used in the file: Decompress.c.

Function | Description
Decompress | EFI_STATUS Decompress(IN VOID *Source, IN UINT32 SrcSize, IN OUT VOID *Destination, IN UINT32 DstSize, IN OUT VOID *Scratch, IN UINT32 ScratchSize) is the internal implementation of DECOMPRESS_PROTOCOL.Decompress(). External consumers should use Decompress Protocol (not this function).
GetInfo | EFI_STATUS GetInfo(IN VOID *Source, IN UINT32 SrcSize, OUT UINT32 *DstSize, OUT UINT32 *ScratchSize) is the internal implementation of DECOMPRESS_PROTOCOL.GetInfo(). External consumers should use Decompress Protocol (not this function).


Decompress in the Decompress.c

Function : Decompress

File: Decompress.c
Description:
EFI_STATUS Decompress(IN VOID *Source, IN UINT32 SrcSize,
IN OUT VOID *Destination, IN UINT32 DstSize, IN OUT VOID *Scratch,
IN UINT32 ScratchSize) is the internal implementation of
DECOMPRESS_PROTOCOL.Decompress().
External consumers should use Decompress Protocol (not this function).
Input:
IN VOID *Source
The source buffer containing the compressed data.

IN UINT32 SrcSize
The size of source buffer.

IN OUT VOID *Destination
The destination buffer to store the decompressed data.

IN UINT32 DstSize
The size of destination buffer.

IN OUT VOID *Scratch
The buffer used internally by the Decompress routine. This  buffer is
needed to store intermediate data.

IN UINT32 ScratchSize
The size of scratch buffer.
Output:
EFI_SUCCESS,           if the decompression is successfull.
EFI_INVALID_PARAMETER, if the source data is corrupted.
Modified:
Notes:
Referrals:
FillBuf
Decode


GetInfo in the Decompress.c

Function : GetInfo

File: Decompress.c
Description:
EFI_STATUS GetInfo(IN VOID *Source, IN UINT32 SrcSize,
OUT UINT32 *DstSize, OUT UINT32 *ScratchSize) is the internal
implementation of DECOMPRESS_PROTOCOL.GetInfo().
External consumers should use Decompress Protocol (not this function).
Input:
IN VOID *Source
The source buffer containing the compressed data.

IN UINT32 SrcSize
The size of source buffer.

OUT UINT32 *DstSize
The size of destination buffer.

OUT UINT32 *ScratchSize
The size of scratch buffer.
Output:
EFI_SUCCESS,           if the size of destination buffer and the size of
         scratch buffer are successull retrieved.
EFI_INVALID_PARAMETER, if the source data is corrupted.
Modified:
Notes:
Referrals:


EfiDBE.c

Description:
EFI Generic Database Engine serves all data storage, search and
maintanance needs for Database Engine (DBE) objects.

The following functions are used in the file: EfiDBE.c.

Function | Description
DbeBinSearch | VOID DbeBinSearch(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN DBE_CMP Cmp, IN VOID *NewKey, OUT VOID **DataLocation, OUT INT8 *Vicinity, OUT INTN *RecordInd OPTIONAL) executes a binary search of the nearest location closest to the *NewKey value. If the DBE_KEY_FIELD structure of the database is NULL, the NewKey field is the address of the *Data; otherwise the NewKey field will be calculated as "(UINT8*)Data+KeyField.Offset" of "KeyField.Size" size.
DbeDelete | EFI_STATUS DbeDelete(IN DBE_DATABASE *Database, IN VOID *Data, IN BOOLEAN FreeData) removes all records associated with the user provided Data pointer. Function assumes every keyIf FreeData is TRUE, it will also FreePool the Data when it is done.
DbeGoToIndex | EFI_STATUS DbeGoToIndex(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN INTN Index, OUT VOID **Record) returns the record pointer at the user provided index inside Database's IndexArray.
DbeInsert | EFI_STATUS DbeInsert(IN DBE_DATABASE *Database, IN VOID *Record) inserts a user provided record into a database.
DbeLocateKey | EFI_STATUS DbeLocateKey(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN VOID *KeyValue, OUT VOID **Record, OUT INT8 *Vicinity, OUT UINTN *RecordIndex OPTIONAL) locates a record by its key in a database.


DbeBinSearch in the EfiDBE.c

Function : DbeBinSearch

File: EfiDBE.c
Description:
VOID DbeBinSearch(IN DBE_DATABASE *Database, IN UINTN KeyNo,
IN DBE_CMP Cmp, IN VOID *NewKey, OUT VOID **DataLocation,
OUT INT8 *Vicinity, OUT INTN *RecordInd OPTIONAL) executes a binary
search of the nearest location closest to the *NewKey value. If the
DBE_KEY_FIELD structure of the database is NULL, the NewKey field is the
address of the *Data; otherwise the NewKey field will be calculated as
"(UINT8*)Data+KeyField.Offset" of "KeyField.Size" size.
Input:
IN DBE_DATABASE *Database
Address of the database to be searched.

IN UINTN KeyNo
Starting key entry number.

IN DBE_CMP Cmp
Address of function which will be used to compare entries.

IN VOID *NewKey
Pointer to the Key Value we are comparing against.
Output:
OUT VOID **DataLocation
Pointer to location within Index Array of desired data.

OUT INT8 *Vicinity
-1 if new entry should go before provided location, 0 if located, or 1
if new entry should follow the provided location.

OUT INTN *RecordInd OPTIONAL
If not NULL, provides the index position within Index Array of the
desired data.
Modified:
Notes:
Referrals:


DbeDelete in the EfiDBE.c

Function : DbeDelete

File: EfiDBE.c
Description:
EFI_STATUS DbeDelete(IN DBE_DATABASE *Database, IN VOID *Data,
IN BOOLEAN FreeData) removes all records associated with the user
provided Data pointer.  Function assumes every keyIf FreeData is TRUE, it will also FreePool the
Data when it is done.
Input:
IN DBE_DATABASE *Database
Database to remove the associated records from.

IN VOID *Data
Data to check
IN BOOLEAN FreeData
Output:
EFI_INVALID_PARAMETER,  if the provided Database is empty.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
DbeDelIndexKeyEntry
Validate


DbeGoToIndex in the EfiDBE.c

Function : DbeGoToIndex

File: EfiDBE.c
Description:
EFI_STATUS DbeGoToIndex(IN DBE_DATABASE *Database, IN UINTN KeyNo,
IN INTN Index, OUT VOID **Record) returns the record pointer at the user
provided index inside Database's IndexArray.
Input:
IN DBE_DATABASE *Database
Database to fetch the record pointer from.

IN UINTN KeyNo
The key number of the desired IndexArray.

IN INTN Index
The index within the IndexArray to retrieve the record pointer from.

OUT VOID **Record
Filled with the address of the record pointer associated with the provided
Index.
Output:
EFI_DBE_EOF,  if Index is negative or exceeds the number of valid
records.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


DbeInsert in the EfiDBE.c

Function : DbeInsert

File: EfiDBE.c
Description:
EFI_STATUS DbeInsert(IN DBE_DATABASE *Database, IN VOID *Record) inserts
a user provided record into a database.
Input:
IN DBE_DATABASE *Database
The database to be inserted into.

IN VOID *Record
The record to insert into Database.
Output:
EFI_INVALID_PARAMETER,  if Database, Record, or Database->KeyField are
          NULL.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
DbeReallocIndexArray
DbeBinSearch

 MemCpy


DbeLocateKey in the EfiDBE.c

Function : DbeLocateKey

File: EfiDBE.c
Description:
EFI_STATUS DbeLocateKey(IN DBE_DATABASE *Database, IN UINTN KeyNo,
IN VOID *KeyValue, OUT VOID **Record, OUT INT8 *Vicinity,
OUT UINTN *RecordIndex OPTIONAL) locates a record by its key in a
database.
Input:
IN DBE_DATABASE *Database
Database to locate the key within.

IN UINTN KeyNo
Key entry number to start searching from.  For example, 0 starts from the
the first key entry; 1 starts from the second.

IN VOID *KeyValue
Pointer to the key to search for.

OUT VOID **Record
Output location for the pointer to the record which maps to the provided key.

OUT INT8 *Vicinity
Relative location of the KeyValue in respect to the returned Record.  For
instance, 0 means that the Record uses KeyValue, 1 means Record is the
next highest entry above the desired KeyValue, and -1 means Record is the
previous entry.  This should be 0 if the key was located.

OUT UINTN *RecordIndex OPTIONAL
Index position within Index Array of desired record pointer.
Output:
EFI_INVALID_PARAMETER,  if Database, Record, or Database->KeyField are
          NULL; also if KeyNo > Database->KeyCount - 1.
EFI_NOT_FOUND,          if key not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
DbeBinSearch


EfiLib.c

Description:
Contains generic EFI library functions.

The following functions are used in the file: EfiLib.c.

Function | Description
AllocCspResource | EFI_STATUS AllocCspResource(IN DXE_SERVICES *Dxe, IN CSP_RES_ITEM *ResTable, IN UINTN ResCount, IN EFI_HANDLE ImgHandle, IN EFI_HANDLE CntrHandle, IN BOOLEAN AddSpace) provides compatibility with core 4.5.3; acts as a wrapper for LibAllocCspResource.
CreateLegacyBootEvent | EFI_STATUS CreateLegacyBootEvent(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent) creates an EFI event in the Legacy Boot Event Group and allows the caller to specify a notification function. Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library abstracts the implementation mechanism of this event from the caller.
CreateReadyToBootEvent | EFI_STATUS CreateReadyToBootEvent(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent) creates an EFI event in the Ready To Boot Event Group and allows the caller to specify a notification function. Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library abstracts the implementation mechanism of this event from the caller.
DListAdd | VOID DListAdd(IN DLIST *pList, IN DLINK *pElement) adds the node pElement to the end of the doubly linked list denoted by pList.
DListDelete | VOID DListDelete(IN DLIST *pList, IN DLINK *pElement) removes the node pElement from a doubly linked list. It is up to the caller of this function to release the memory used by this node if that is required.
DListEmpty | DListEmpty(IN DLIST *pList) is a macro which returns NULL if the provided DLIST is empty.
DListInit | VOID DListInit(IN DLIST *pList) initializes the head, tail links and number of elements of a new linked list structure. After initializing a linked list with this function, the other linked list functions may be used to add and remove nodes from the linked list. It is up to the caller of this function to allocate the memory for pList.
DListInsert | VOID DListInsert(IN DLIST* pList, IN DLINK* pElement, IN DLINK* pAfter) inserts the node pElement in the doubly linked list denoted by pList immediately after the node pAfter.
DPAdd | VOID* DPAdd(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) appends all the elements of pDp2 just before the device path terminator of pDp1, and returns the result in a newly allocated buffer.
DPAddInstance | VOID* DPAddInstance(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) makes a new device path with pDp1 as its first instance and pDp2 as its second instance, then returns the result in a newly allocated buffer.
DPAddNode | VOID* DPAddNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) adds the very first element of pDp2 to pDp1 just before its device path terminator, and returns the result in a newly allocated buffer.
DPCmp | INTN DPCmp(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) compares two device paths, pDp1 and pDp2, and returns zero if both are equivalent; otherwise, it returns a non-zero value.
DPCopy | VOID* DPCopy(IN EFI_DEVICE_PATH_PROTOCOL *pDp) copies the user provided device path into a new buffer and returns its address.
DPCreateNode | VOID* DPCreateNode(IN UINT8 Type, IN UINT8 SubType, IN UINT16 Length) creates a new device node in a newly allocated buffer of size NodeLength and initializes the device path node header with NodeType and NodeSubType. The new device path node is returned. If NodeLength is smaller than a device path header, then NULL is returned. If there is not enough memory to allocate space for the new device path, then NULL is returned. The memory is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.
DPCut | VOID* DPCut(IN EFI_DEVICE_PATH_PROTOCOL *pDp) creates a new device path containing all but the last node of pDp, then returns the address to the new device path.
DPGetEndNode | EFI_DEVICE_PATH_PROTOCOL* DPGetEndNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns the end of the device path node for the specified device path.
DPGetLastNode | VOID* DPGetLastNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns a pointer to the very last device path node before END_OF_DEVICE_PATH node.
DPIsMultiInstance | BOOLEAN DPIsMultiInstance(IN EFI_DEVICE_PATH_PROTOCOL* pDp) determines if a device path is single or multi-instance. This function returns TRUE if the device path specified by pDp is multi-instance. Otherwise, FALSE is returned. If pDp is NULL, then FALSE is returned.
DPIsOneOf | BOOLEAN DPIsOneOf(IN EFI_DEVICE_PATH_PROTOCOL *pAll, IN EFI_DEVICE_PATH_PROTOCOL *pOne, IN BOOLEAN ExactMatch) determines whether a device path, pAll, contains another device path, pOne. If the ExactMatch parameter is TRUE, it checks for an exact match instead.
DPLength | UINTN DPLength(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns the length of the provided device path, pDp (including the size of EndOfDevicePath).
DPNextInstance | VOID* DPNextInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **ppDp, OUT UINTN *pSize) creates a copy of the current device path instance. It also updates DevicePath to point to the next device path instance in the device path (or NULL if no more) and updates Size to hold the size of the device path instance copy. If DevicePath is NULL, then NULL is returned. If there is not enough memory to allocate space for the new device path, then NULL is returned. The memory is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.
DummyFunction | VOID DummyFunction(IN EFI_EVENT Event, IN VOID *Context) is an empty VOID function which does nothing.
EfiAtRuntime | BOOLEAN EFIAPI EfiAtRuntime ( VOID ) returns TRUE if system has already transitioned to runtime(ExitBootServices has been called), otherwise returns FALSE. This function can only be used is driver has been initialized using InitAmiRuntimeLib function.
EfiGoneVirtual | BOOLEAN EFIAPI EfiGoneVirtual ( VOID ) returns TRUE if system has already transitioned to the virtual addressing mode (SetVirtualAddressMap has been called), otherwise returns FALSE. This function can only be used is driver has been initialized using InitAmiRuntimeLib function.
EndMeasure | EFI_STATUS EndMeasure(IN EFI_HANDLE Handle, IN CHAR16 *Token, IN CHAR16 *Host, IN UINT64 Ticker) ends timing on a specified handle, token and host, with Ticker as the end tick. See notes for proper usage.
FindDeviceName | BOOLEAN FindDeviceName( IN EFI_HANDLE Controller, IN EFI_HANDLE Child, OUT CHAR16 **wsName) checks all the protocols associated with a device handle and its child controller for its name; if a child is not defined, checks all associated protocols.
FSReadFile | EFI_STATUS FSReadFile(IN EFI_HANDLE hDevice, IN EFI_DEVICE_PATH_PROTOCOL* pPath, OUT VOID** ppSource, OUT UINTN *pSize)
FVReadFile | EFI_STATUS FVReadFile(IN EFI_HANDLE hDevice, IN EFI_GUID* pFileName, OUT VOID** ppSource, OUT UINTN *pSize)
FvReadPe32Image | EFI_STATUS FvReadPe32Image(IN EFI_GUID *NameGuid, IN OUT VOID **Buffer, IN OUT UINTN *BufferSize, OUT UINT32 *AuthenticationStatus)
GetBootMode | EFI_BOOT_MODE GetBootMode() returns current boot mode. If no boot mode information is available, BOOT_WITH_FULL_CONFIGURATION is returned.
GetControllerName | BOOLEAN GetControllerName(IN EFI_HANDLE Controller, OUT CHAR16 **wsName) retrieves the name of the controller specified by Controller and copies it into the caller allocated Unicode string at address wsName.
GetEfiConfigurationTable | VOID *GetEfiConfigurationTable(IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_GUID *Guid) retrieves a pointer to the system configuration table from the EFI System Table based on a specified GUID. If a match is found, then a pointer to the configuration table is returned. If a matching GUID is not found, then NULL is returned.
GetEfiVariable | EFI_STATUS GetEfiVariable(IN CHAR16 *sName, IN EFI_GUID *pGuid, OUT UINT32 *pAttributes OPTIONAL, IN OUT UINTN *pDataSize, OUT VOID **ppData) reads an EFI variable with the name Name and GUID Guid. If variable is found, variable attributes, size, and data are returned using Attributes, DataSize, and Data parameters and EFI_SUCCESS is returned. If variable is not found, EFI_NOT_FOUND is returned. The output buffer is specified by a double indirection of the Data parameter. The input value of *Data is used to determine if the output buffer is caller allocated or is dynamically allocated by this functions. If the input value of *Data is not NULL, it indicates that the output buffer is caller allocated. In this case, the input value of *DataSize indicates the size of the caller-allocated output buffer. If the output buffer is not large enough to contain the variable data, it is freed and new buffer of sufficient size is allocated from boot services pool memory, which will be returned in *Data. If the input value of *Data not NULL, it indicates that the output buffer is allocated by GetEfiVariable routine. In this case, GetEfiVariable will allocate an appropriately sized buffer from boot services pool memory, which will be returned in *Data.
GetImageName | BOOLEAN GetImageName(IN EFI_HANDLE ImageHandle, OUT CHAR8 *sName) retrieves the name of the image specified by ImageHandle and returns it in sName.
GetSmstConfigurationTable | VOID *GetEfiConfigurationTable( IN EFI_GUID *TableGuid) retrieves a pointer to the system configuration table from the SMM System Table based on a specified GUID. If a match is found, then a pointer to the configuration table is returned. If a matching GUID is not found, then NULL is returned.
HiiLibGetBrowserData | Retrieves uncommitted state data from the HII browser. Only works in UEFI 2.1 mode.
HiiLibGetString | Reads string from the HII database in current language.
HiiLibPublishPackages | Publishes submitted array of HII packages into HII database.
HiiLibSetBrowserData | Updates uncommitted state data of the HII browser. Only works in UEFI 2.1 mode.
HiiLibSetString | Updates string in the HII database in all languages supported by the package list.
InitAmiLib | VOID InitAmiLib(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) initializes the global variables used by library routines. It must be called before any other library routine is used. See notes for variables initialized.
InitAmiRuntimeLib | VOID InitAmiRuntimeLib(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_EVENT_NOTIFY ExitBsCallback OPTIONAL, IN EFI_EVENT_NOTIFY GoVirtualCallback OPTIONAL) initializes the global variables using call to InitAmiLib. Runtime drivers should use this function instead of InitAmiLib.
InitSmmHandler | EFI_STATUS InitSmmHandler(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable), IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) OPTIONAL) first calls the provided NotInSmmFunction (if provided), then runs the InSmmFunction in SMM.
InitSmmHandlerEx | The function is similar to InitSmmHandler function. The difference between the two is handling of missing SmmBase protocol. If SmmBase protocol is not available, InitSmmHandler function returns error. This function registers callback and loads module to SMM once SmmBase is available.
LanguageCodesEqual | BOOLEAN LanguageCodesEqual(CONST CHAR8* LangCode1, CONST CHAR8* LangCode2) compares two language codes and returns TRUE if they are equal.
LFReadFile | EFI_STATUS LFReadFile(IN EFI_HANDLE hDevice, IN EFI_DEVICE_PATH_PROTOCOL* pPath, IN BOOLEAN BootPolicy, OUT VOID** ppSource, OUT UINTN *pSize)
LibAllocCspResource | EFI_STATUS LibAllocCspResource(IN CSP_RES_ITEM *ResTable, IN UINTN ResCount, IN EFI_HANDLE ImgHandle, IN EFI_HANDLE CntrHandle) uses GCD services to allocate list of resources specified by ResTable.
LibGetDxeSvcTbl | EFI_STATUS LibGetDxeSvcTbl(OUT DXE_SERVICES **ppDxe OPTIONAL) locates the DXE Service Table in the EFI System Table and returns it in ppDxe. If pointer is found, EFI_SUCCESS is returned.
LibReportStatusCode | EFI_STATUS LibReportStatusCode(IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN EFI_GUID *CallerId OPTIONAL, IN EFI_STATUS_CODE_DATA *Data OPTIONAL) abstracts status code reporting. The Framework moved from a proprietary to a UEFI 2.0-based mechanism. This function abstracts the caller from how the status code is reported to prevent the code from having to change with this version of the specification supported.
LoadResources | EFI_STATUS LoadResources(EFI_HANDLE ImageHandle, UINTN NumberOfCallbacks, CALLBACK_INFO *pCallBack, INIT_HII_PACK InitFunction) - loads HII packages associated with the specified image and publishes them to the HII database
LoadStrings | EFI_STATUS LoadStrings(EFI_HANDLE ImageHandle, EFI_HII_HANDLE *pHiiHandle) - loads HII string packages associated with the specified image and publishes them to the HII database
Malloc | VOID *Malloc(IN UINTN Size) allocates Size bytes of memory from EfiBootServicesData and returns a pointer to the allocated space.
MallocZ | VOID* MallocZ(IN UINTN Size) allocates Size bytes of memory from EfiBootServicesData, initializes it to zero, then returns a pointer to the allocated space.
PERF_CODE | PERF_CODE(Code) is a macro which places the provided code block into the requested location if the DXE_PERFORMANCE SDL token is turned on. If the DXE_PERFORMANCE SDL token is turned off, the macro inserts nothing.
PERF_END | PERF_END(Handle, Token, Host, Ticker) is a macro which invokes the EndMeasure function to stop timing for a performance entry in order to determine performance if the DXE_PERFORMANCE SDL token is turned on. If the DXE_PERFORMANCE SDL token is turned off, the macro does nothing.
PERF_START | PERF_START(Handle, Token, Host, Ticker) is a macro which invokes the StartMeasure function to log a timer entry for measuring performance if the DXE_PERFORMANCE SDL token is turned on. If the DXE_PERFORMANCE SDL token is turned off, the macro does nothing.
ReadImage | EFI_STATUS ReadImage(IN BOOLEAN BootPolicy, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN OUT VOID **ppSource, IN OUT UINTN *pSourceSize OPTIONAL, OUT UINTN *pImageSize OPTIONAL, OUT EFI_HANDLE *phDevice OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **ppPath OPTIONAL)
ReadImageResource | EFI_STATUS ReadImageResource(IN EFI_HANDLE ImageHandle, IN EFI_GUID *pGuid, OUT VOID **ppData, OUT UINTN *pDataSize)
RegisterProtocolCallback | EFI_STATUS RegisterProtocolCallback(IN EFI_GUID *pProtocol, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent, OUT VOID **ppRegistration) creates a notification event and registers that event with protocol instances specified by ProtocolGuid. Every time a protocol of type ProtocolGuid instance is installed or reinstalled, the notification function is executed. This function returns EFI_SUCCESS if notification event has been created.
StartMeasure | EFI_STATUS StartMeasure (IN EFI_HANDLE Handle, IN CHAR16 *Token, IN CHAR16 *Host, IN UINT64 Ticker) starts timing on a specified handle, token and host, with Ticker as the start tick. See notes for proper usage.
TimerIsSet | VOID TimerIsSet(IN EFI_EVENT Event, IN OUT VOID *Context)
TimerStart | EFI_EVENT TimerStart(OUT BOOLEAN *pTimerFlag, IN UINT64 Delay)
TimerStop | VOID TimerStop(IN BOOLEAN TimerFlag, IN EFI_EVENT Event)
Trace | VOID Trace (IN UINTN Level, IN CHAR8 *sFormat, IN ...) prints a debug message using status code protocol if the specified error level is enabled.
WriteBootToOsPerformanceData | VOID WriteBootToOsPerformanceData() allocates a block of memory and writes performance data into it.

The following data structures are used in the file: EfiLib.c.

Variable | Description
DLINK | DLINK is a type defined structure used in an AMILIB provided doubly-linked list API which is used as a node for an entry into the list.
DLIST | DLIST is a type defined structure used in an AMILIB provided doubly-linked list API to maintain pointers for a list's head, tail, and size.

The following descriptions are used in the file: EfiLib.c.

Header | Description
Device_Path_Functions | Device path related functions defined in the AMI library.
Doubly_Linked_List_Functions | The following functions are provided by the AMI library as a basic API for a doubly-linked list. Note that the DLINK node structure does not include an entry for the actual data. There are several methods for getting around this limitation. The easiest method is to create a new structure type which contains a DLINK structure as its first member and the data afterwards. This new structure can then be typecasted to the old DLINK type when using the API. See notes for an example. There are presently no search functions provided for this API.
Performance_Measurement_Functions | Functions which are used to measure boot performance that are defined in the AMI library.


AllocCspResource in the EfiLib.c

Function : AllocCspResource

File: EfiLib.c
Description:
EFI_STATUS AllocCspResource(IN DXE_SERVICES *Dxe,
IN CSP_RES_ITEM *ResTable, IN UINTN ResCount, IN EFI_HANDLE ImgHandle,
IN EFI_HANDLE CntrHandle, IN BOOLEAN AddSpace) provides compatibility with
core 4.5.3; acts as a wrapper for LibAllocCspResource.
Input:
IN DXE_SERVICES *Dxe
Unused.

IN CSP_RES_ITEM *ResTable
Table of requested GCD resources.

IN UINTN ResCount
Number of elements in the ResTable.

IN EFI_HANDLE ImgHandle
Handle of the image to allocate resources to.

IN EFI_HANDLE CntrHandle
Handle of the controller to allocate resources to.

IN BOOLEAN AddSpace
Unused.
Output:
EFI_ERROR_CODE, if function fails.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Use LibAllocCspResource unless you are using core 4.5.3 or older.
Referrals:
LibAllocCspResource


CreateLegacyBootEvent in the EfiLib.c

Function : CreateLegacyBootEvent

File: EfiLib.c
Description:
EFI_STATUS CreateLegacyBootEvent(IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext,
OUT EFI_EVENT *pEvent) creates an EFI event in the Legacy Boot Event Group
and allows the caller to specify a notification function.  Prior to
UEFI 2.0 this was done via a non-standard UEFI extension, and this library
abstracts the implementation mechanism of this event from the caller.
Input:
IN EFI_TPL NotifyTpl
The task priority level of the event.

IN EFI_EVENT_NOTIFY NotifyFunction
The notification function to call when the event is signaled.

IN VOID *pNotifyContext
The content to pass to NotifyFunction when the event is signaled.

OUT EFI_EVENT *pEvent
Return the event that was created
Output:
EFI_INVALID_PARAMETER,  if the input parameters are incorrect.
EFI_OUT_OF_RESOURCES,   if the event could not be allocated.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


CreateReadyToBootEvent in the EfiLib.c

Function : CreateReadyToBootEvent

File: EfiLib.c
Description:
EFI_STATUS CreateReadyToBootEvent(IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext,
OUT EFI_EVENT *pEvent) creates an EFI event in the Ready To Boot Event
Group and allows the caller to specify a notification function.  Prior to
UEFI 2.0 this was done via a non-standard UEFI extension, and this library
abstracts the implementation mechanism of this event from the caller.
Input:
IN EFI_TPL NotifyTpl
The task priority level of the event.

IN EFI_EVENT_NOTIFY NotifyFunction
The notification function to call when the event is signaled.

IN VOID *pNotifyContext
The content to pass to NotifyFunction when the event is signaled.

OUT EFI_EVENT *pEvent
Return the event that was created.
Output:
EFI_INVALID_PARAMETER,  if the input parameters are incorrect.
EFI_OUT_OF_RESOURCES,   if the event could not be allocated.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


Device_Path_Functions in the EfiLib.c

General : Device_Path_Functions

File: EfiLib.c
Fields:

Header | Function | Description
AmiDxeLib | DPLength | Find the size of a device path in bytes.
AmiDxeLib | DPAddNode | Create new device path with the contents of one device path + the first element from another.
AmiDxeLib | DPAdd | Create new device path by appending a device path's elements to another device path.
AmiDxeLib | DPAddInstance | Create new device path utilizing two provided device paths as instances.
AmiDxeLib | DPCopy | Create new device path containing the exact contents of another device path.
AmiDxeLib | DPIsOneOf | Determine whether a device path contains a user provided device path.
AmiDxeLib | DPGetLastNode | Return the last node of a device path prior to END_OF_DEVICE_PATH.
AmiDxeLib | DPCmp | Determine whether two device paths are equivalent.
AmiDxeLib | DPCut | Create new device path with all but the last node of another device path.
AmiDxeLib | DPGetEndNode | Return the last node of a device path.
AmiDxeLib | DPNextInstance | Create a copy of the current device path instance and updates the device path to point to the next instance.
AmiDxeLib | DPCreateNode | Create a device path node.
AmiDxeLib | DPIsMultiInstance | Determine whether device path is single or multi-instance.

Description:
Device path related functions defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


DLINK in the EfiLib.c

Variable : DLINK

File: EfiLib.c
Fields:

Name | Type | Description
pNext | DLINK* | Pointer to the next node in the list.
pPrev | DLINK* | Pointer to the previous node in the list.

Description:
DLINK is a type defined structure used in an AMILIB provided
doubly-linked list API which is used as a node for an entry into the list.
Notes:
Prototype provided in AmiDxeLib.h.  See Doubly_Linked_List_Functions for
example usage.
Referrals:
Doubly_Linked_List_Functions
DLIST


DLIST in the EfiLib.c

Variable : DLIST

File: EfiLib.c
Fields:

Name | Type | Description
Size | UINTN | Number of DLINK nodes contained by the DLIST.
pHead | DLINK* | Pointer to the head node (start) of the list.
pTail | DLINK* | Pointer to the tail node (end) of the list.

Description:
DLIST is a type defined structure used in an AMILIB provided
doubly-linked list API to maintain pointers for a list's head, tail, and
size.
Notes:
Prototype provided in AmiDxeLib.h.  See Doubly_Linked_List_Functions for
example usage.
Referrals:
Doubly_Linked_List_Functions
DLINK
DListInit
DListEmpty
DListAdd
DListDelete
DListInsert
DListEmpty


DListAdd in the EfiLib.c

Function : DListAdd

File: EfiLib.c
Description:
VOID DListAdd(IN DLIST *pList, IN DLINK *pElement) adds the node pElement
to the end of the doubly linked list denoted by pList.
Input:
IN DLIST *pList
A pointer to the doubly linked list structure.

IN DLINK *pElement
A pointer to a node that is to be added at the end of the doubly linked
list.
Output:
VOID.
Modified:
Notes:
Referrals:


DListDelete in the EfiLib.c

Function : DListDelete

File: EfiLib.c
Description:
VOID DListDelete(IN DLIST *pList, IN DLINK *pElement) removes the node
pElement from a doubly linked list.  It is up to the caller of this
function to release the memory used by this node if that is required.
Input:
IN DLIST *pList
A pointer to the doubly linked list structure.

IN DLINK *pElement
A pointer to a node that is to be deleted from the end of the doubly
linked list.
Output:
VOID.
Modified:
Notes:
It is up to the caller of this function to release the memory used by
this node if that is required.
Referrals:


DListEmpty in the EfiLib.c

Function : DListEmpty

File: EfiLib.c
Description:
DListEmpty(IN DLIST *pList) is a macro which returns NULL if the provided
DLIST is empty.
Input:
IN DLIST *pList
A pointer to the doubly linked list structure.
Output:
DLINK* address of the list's head; NULL if the list is empty.
Modified:
Notes:
Macro defined in AmiDxeLib.h.  No validation performed on pList.
Referrals:


DListInit in the EfiLib.c

Function : DListInit

File: EfiLib.c
Description:
VOID DListInit(IN DLIST *pList) initializes the head, tail links and
number of elements of a new linked list structure.  After initializing a
linked list with this function, the other linked list functions may be
used to add and remove nodes from the linked list.  It is up to the caller
of this function to allocate the memory for pList.
Input:
IN DLIST *pList
A pointer to the doubly linked list structure.
Output:
VOID.
Modified:
Notes:
It is up to the caller of this function to allocate the memory for pList.
Referrals:


DListInsert in the EfiLib.c

Function : DListInsert

File: EfiLib.c
Description:
VOID DListInsert(IN DLIST* pList, IN DLINK* pElement, IN DLINK* pAfter)
inserts the node pElement in the doubly linked list denoted by pList
immediately after the node pAfter.
Input:
IN DLIST *pList
A pointer to the doubly linked list structure.

IN DLINK *pElement
A pointer to a node that is to be added to the doubly linked list.

IN DLINK *pAfter
A pointer to a node after which pElement  is to be added.
Output:
VOID.
Modified:
Notes:
Referrals:


Doubly_Linked_List_Functions in the EfiLib.c

General : Doubly_Linked_List_Functions

File: EfiLib.c
Fields:

Header | Name | Description
AmiDxeLib | DLIST | Doubly-linked list structure.
AmiDxeLib | DLINK | Doubly-linked list node.
AmiDxeLib | DListInit | Initialize a DLIST list structure.
AmiDxeLib | DListAdd | Add a DLINK node to the end of a DLIST.
AmiDxeLib | DListDelete | Remove a DLINK node from a DLIST.
AmiDxeLib | DListInsert | Insert a DLINK node after a specific DLINK node inside a DLIST.
AmiDxeLib | DListEmpty | Determine whether a DLIST is empty.

Description:
The following functions are provided by the AMI library as a basic API for
a doubly-linked list.  Note that the DLINK node structure does not include
an entry for the actual data.  There are several methods for getting
around this limitation.

The easiest method is to create a new structure type which contains
a DLINK structure as its first member and the data afterwards.  This new
structure can then be typecasted to the old DLINK type when using the
API.  See notes for an example.

There are presently no search functions provided for this API.
Notes:
Header details which header file contains the function prototype for
the above functions; append .h to the given name.  None indicates that
no header file contains a function prototype.

The following code demonstrates creating a node which
contains a UINT32 data member, inserting it into a list, then changing
its value.

typedef struct {
DLINK  Link;
UINT32 Data;
} UINT32_NODE;

DLIST       ExampleList;
UINT32_NODE ExampleNode;

ExampleNode.Data = 0xDEADBEEF;

DListInit(&ExampleList);
DListAdd(&ExampleList, (DLINK*) &ExampleNode);
((UINT32_NODE*)ExampleList.pHead)->Data = 0x12345678;


DPAdd in the EfiLib.c

Function : DPAdd

File: EfiLib.c
Description:
VOID* DPAdd(IN EFI_DEVICE_PATH_PROTOCOL *pDp1,
IN EFI_DEVICE_PATH_PROTOCOL *pDp2) appends all the elements of pDp2 just
before the device path terminator of pDp1, and returns the result in a
newly allocated buffer.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp1
The device path to be appended to.  Element(s) will be inserted prior to
pDp1's device path terminator.  Device path will not be altered.

IN EFI_DEVICE_PATH_PROTOCOL *pDp2
The device path to be read from.  All elements will be appended to pDp1.
If NULL, returns copy of pDp1.
Output:
VOID* address of the modified device path.  User is responsible for
managing this piece of memory.
Modified:
Notes:
Referrals:
DPCopy
DPLength
Malloc

 MemCpy


DPAddInstance in the EfiLib.c

Function : DPAddInstance

File: EfiLib.c
Description:
VOID* DPAddInstance(IN EFI_DEVICE_PATH_PROTOCOL *pDp1,
IN EFI_DEVICE_PATH_PROTOCOL *pDp2) makes a new device path with pDp1 as
its first instance and pDp2 as its second instance, then returns the
result in a newly allocated buffer.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp1
The first device path instance.

IN EFI_DEVICE_PATH_PROTOCOL *pDp2
The second device path instance.
Output:
VOID* address of the modified device path.  User is responsible for
managing this piece of memory.
Modified:
Notes:
Referrals:
DPCopy
DPLength
Malloc

 MemCpy


DPAddNode in the EfiLib.c

Function : DPAddNode

File: EfiLib.c
Description:
VOID* DPAddNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp1,
IN EFI_DEVICE_PATH_PROTOCOL *pDp2) adds the very first element of pDp2 to
pDp1 just before its device path terminator, and returns the result in a
newly allocated buffer.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp1
The device path to be appended to.  Element will be inserted prior to
pDp1's device path terminator.  Device path will not be altered.

IN EFI_DEVICE_PATH_PROTOCOL *pDp2
The device path to be read from.  The very first element will be appended
to pDp1; note that pDp2 does not require a device path terminator.
Output:
VOID* address of the modified device path.  User is responsible for
managing this piece of memory.
Modified:
Notes:
Referrals:
DPCopy
DPLength
Malloc

 MemCpy

NODE_LENGTH


DPCmp in the EfiLib.c

Function : DPCmp

File: EfiLib.c
Description:
INTN DPCmp(IN EFI_DEVICE_PATH_PROTOCOL *pDp1,
IN EFI_DEVICE_PATH_PROTOCOL *pDp2) compares two device paths, pDp1 and
pDp2, and returns zero if both are equivalent; otherwise, it returns
a non-zero value.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp1
Address of the first device path to compare.

IN EFI_DEVICE_PATH_PROTOCOL *pDp2
Address of the second device path to compare.
Output:
INTN non-zero value if both input device paths are not equivalent;
otherwise, zero.
Modified:
Notes:
Referrals:
DPLength
MemCmp


DPCopy in the EfiLib.c

Function : DPCopy

File: EfiLib.c
Description:
VOID* DPCopy(IN EFI_DEVICE_PATH_PROTOCOL *pDp) copies the user provided
device path into a new buffer and returns its address.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp
The device path to be copied.
Output:
VOID* address of the new copy of pDp.  User is responsible for managing
this piece of memory.
Modified:
Notes:
Referrals:
DPLength
Malloc

 MemCpy


DPCreateNode in the EfiLib.c

Function : DPCreateNode

File: EfiLib.c
Description:
VOID* DPCreateNode(IN UINT8 Type, IN UINT8 SubType, IN UINT16 Length)
creates a new device node in a newly allocated buffer of size NodeLength
and initializes the device path node header with NodeType and NodeSubType.
The new device path node is returned.  If NodeLength is smaller than a
device path header, then NULL is returned.  If there is not enough memory
to allocate space for the new device path, then NULL is returned.  The
memory is allocated from EFI boot services memory. It is the
responsibility of the caller to free the memory allocated.
Input:
IN UINT8 Type
The device node type for the new device node.

IN UINT8 SubType
The device node sub-type for the new device node.

IN UINT16 Length
The length of the new device node.
Output:
VOID* address of the new device path node.  NULL if NodeLength is
smaller than a device path header, or there is not enough memory.
Modified:
Notes:
Referrals:
Malloc
SET_NODE_LENGTH


DPCut in the EfiLib.c

Function : DPCut

File: EfiLib.c
Description:
VOID* DPCut(IN EFI_DEVICE_PATH_PROTOCOL *pDp) creates a new device path
containing all but the last node of pDp, then returns the address to the
new device path.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp
The device path to be copied.
Output:
VOID* address of the new copy of pDp containing all but the last node.
Returns NULL if there is not enough memory or pDp is NULL.
Modified:
Notes:
Referrals:
DPGetLastNode
Malloc

 MemCpy

SET_NODE_LENGTH


DPGetEndNode in the EfiLib.c

Function : DPGetEndNode

File: EfiLib.c
Description:
EFI_DEVICE_PATH_PROTOCOL* DPGetEndNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp)
returns the end of the device path node for the specified device path.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp
Address of the device path.
Output:
EFI_DEVICE_PATH_PROTOCOL* address of the end of device path node.  NULL
if pDp is NULL.
Modified:
Notes:
Referrals:
isEndNode
NEXT_NODE


DPGetLastNode in the EfiLib.c

Function : DPGetLastNode

File: EfiLib.c
Description:
VOID* DPGetLastNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns a pointer
to the very last device path node before END_OF_DEVICE_PATH node.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp
The device path whose last node is needed.
Output:
VOID* address of the last device path node before END_OF_DEVICE_PATH in
the provided device path, pDp.
Modified:
Notes:
Referrals:
isEndNode
NEXT_NODE


DPIsMultiInstance in the EfiLib.c

Function : DPIsMultiInstance

File: EfiLib.c
Description:
BOOLEAN DPIsMultiInstance(IN EFI_DEVICE_PATH_PROTOCOL* pDp) determines
if a device path is single or multi-instance.  This function returns TRUE
if the device path specified by pDp is multi-instance.  Otherwise, FALSE
is returned.  If pDp is NULL, then FALSE is returned.
Input:
IN EFI_DEVICE_PATH_PROTOCOL* pDp
A pointer to a device path data structure.
Output:
TRUE if the device path specified by DevicePath is multi-instance.
FALSE if pDp is NULL or not multi-instance.
Modified:
Notes:
Referrals:
DPGetEndNode


DPIsOneOf in the EfiLib.c

Function : DPIsOneOf

File: EfiLib.c
Description:
BOOLEAN DPIsOneOf(IN EFI_DEVICE_PATH_PROTOCOL *pAll,
IN EFI_DEVICE_PATH_PROTOCOL *pOne, IN BOOLEAN ExactMatch) determines
whether a device path, pAll, contains another device path, pOne.  If the
ExactMatch parameter is TRUE, it checks for an exact match instead.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pAll
The device path to be scanned.

IN EFI_DEVICE_PATH_PROTOCOL *pOne
The device path to locate within pAll.

IN BOOLEAN ExactMatch
If TRUE, checks whether pAll is exactly pOne.
Output:
TRUE if pAll contains pOne and ExactMatch is FALSE, or if pAll equals
pOne and ExactMatch is TRUE.  Otherwise, FALSE.
Modified:
Notes:
Referrals:
NODE_LENGTH
isEndNode
MemCmp
NEXT_NODE


DPLength in the EfiLib.c

Function : DPLength

File: EfiLib.c
Description:
UINTN DPLength(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns the length of
the provided device path, pDp (including the size of EndOfDevicePath).
Input:
IN EFI_DEVICE_PATH_PROTOCOL *pDp
The device path whose length is desired.
Output:
UINTN size of the device path, pDp, including EndOfDevicePath.
Modified:
Notes:
Referrals:
isEndNode
NEXT_NODE
NODE_LENGTH


DPNextInstance in the EfiLib.c

Function : DPNextInstance

File: EfiLib.c
Description:
VOID* DPNextInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **ppDp,
OUT UINTN *pSize) creates a copy of the current device path instance. It
also updates DevicePath to point to the next device path instance in the
device path (or NULL if no more) and updates Size to hold the size of the
device path instance copy. If DevicePath is NULL, then NULL is returned.
If there is not enough memory to allocate space for the new device path,
then NULL is returned.  The memory is allocated from EFI boot services
memory. It is the responsibility of the caller to free the memory
allocated.
Input:
IN OUT EFI_DEVICE_PATH_PROTOCOL **ppDp
On input, this holds the pointer to the current device path instance. On
output, this holds the pointer to the next device path instance or NULL
if there are no more device path instances in the device path pointer to
a device path data structure.

OUT UINTN *pSize
On output, this holds the size of the device path instance, in bytes, or
zero if DevicePath is NULL.
Output:
VOID* address of a copy of the next device path instance.  NULL if there
are no more device path instances, or not enough memory, or the provided
device path was NULL.  It is the responsibility of the caller to free the
memory allocated.
Modified:
Notes:
Referrals:
DPGetEndNode
Malloc

 MemCpy


DummyFunction in the EfiLib.c

Function : DummyFunction

File: EfiLib.c
Description:
VOID DummyFunction(IN EFI_EVENT Event, IN VOID *Context) is an empty
VOID function which does nothing.
Input:
IN EFI_EVENT Event
Unused.

IN VOID *Context
Unused.
Output:
VOID.
Modified:
Notes:
Referrals:


EfiAtRuntime in the EfiLib.c

Function : EfiAtRuntime

File: EfiLib.c
Description:
BOOLEAN EFIAPI EfiAtRuntime ( VOID ) returns TRUE if system has already
transitioned to runtime(ExitBootServices has been called), otherwise returns FALSE.
This function can only be used is driver has been initialized using InitAmiRuntimeLib function.
Input:
None
Output:
BOOLEAN TRUE - system is in UEFI Runtime.
FALSE - system is in the boot time.
Notes:
This function can only be used if driver has been initialized using InitAmiRuntimeLib function.
This function does not detect legacy boot.
It will keep returning FALSE if called after the boot to legacy OS.
Referrals:
InitAmiRuntimeLib


EfiGoneVirtual in the EfiLib.c

Function : EfiGoneVirtual

File: EfiLib.c
Description:
BOOLEAN EFIAPI EfiGoneVirtual ( VOID ) returns TRUE if system has already
transitioned to the virtual addressing mode (SetVirtualAddressMap has been called), otherwise returns FALSE.
This function can only be used is driver has been initialized using InitAmiRuntimeLib function.
Input:
None
Output:
BOOLEAN TRUE - system is in virtual addressing mode.
FALSE - system is not in virtual addressing mode.
Notes:
This function can only be used if driver has been initialized using InitAmiRuntimeLib function.
Referrals:
InitAmiRuntimeLib


EndMeasure in the EfiLib.c

Function : EndMeasure

File: EfiLib.c
Description:
EFI_STATUS EndMeasure(IN EFI_HANDLE Handle, IN CHAR16 *Token,
IN CHAR16 *Host, IN UINT64 Ticker) ends timing on a specified handle,
token and host, with Ticker as the end tick.  See notes for proper usage.
Input:
IN EFI_HANDLE Handle
Handle to stop.

IN CHAR16 *Token
Token to stop.

IN CHAR16 *Host
Host to stop.

IN UINT64 Ticker
End tick for timing; if 0, then EndMeasure gets current timer.
Output:
EFI_NOT_FOUND,   if node or Performance Protocol not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
To properly use this function, use the PERF_END macro defined in
AmiDxeLib.h; this allows the DXE_PERFORMANCE SDL token to control
enabling and disabling performance measurement in DXE.
Referrals:
PERF_END


FindDeviceName in the EfiLib.c

Function : FindDeviceName

File: EfiLib.c
Description:
BOOLEAN FindDeviceName( IN EFI_HANDLE Controller, IN EFI_HANDLE Child,
OUT CHAR16 **wsName) checks all the protocols associated with a device
handle and its child controller for its name; if a child is not defined,
checks all associated protocols.
Input:
IN EFI_HANDLE Controller
The image handle whose name is desired.

IN EFI_HANDLE Child
The child handle to be checked.  If set to NULL, checks all protocols
associated with the Controller instead.

OUT CHAR16 **wsName
Address of the null-terminated Unicode string to put device name into.
User is reponsible for allocating the necessary memory resources.
Output:
TRUE if device name found; otherwise, FALSE.
Modified:
Notes:
Referrals:


FSReadFile in the EfiLib.c

Function : FSReadFile

File: EfiLib.c
Description:
EFI_STATUS FSReadFile(IN EFI_HANDLE hDevice, IN EFI_DEVICE_PATH_PROTOCOL* pPath, OUT VOID** ppSource, OUT UINTN *pSize)
Input:
Output:
Modified:
Notes:
Referrals:
isEndNode
NODE_LENGTH

 MemCpy

Malloc
NEXT_NODE


FVReadFile in the EfiLib.c

Function : FVReadFile

File: EfiLib.c
Description:
EFI_STATUS FVReadFile(IN EFI_HANDLE hDevice, IN EFI_GUID* pFileName, OUT VOID** ppSource, OUT UINTN *pSize)
Input:
Output:
Modified:
Notes:
Referrals:


FvReadPe32Image in the EfiLib.c

Function : FvReadPe32Image

File: EfiLib.c
Description:
EFI_STATUS FvReadPe32Image(IN EFI_GUID *NameGuid, IN OUT VOID **Buffer,
IN OUT UINTN *BufferSize, OUT UINT32 *AuthenticationStatus)
Input:
IN EFI_GUID *NameGuid
GUID associated with the image in the firmware volume.

IN OUT VOID **Buffer
Pointer to buffer for the image to be returned in.  Caller may specify
*Buffer = NULL, in which case FvReadPe32Image will dynamically allocate
the necessary amount of memory and return the pointer to the buffer
here.

IN OUT UINTN *BufferSize
If Buffer is caller allocated, caller must put size of the Buffer here.
Returns with the size of the image, even in the case the caller allocated
Buffer is too small.

OUT UINT32 *AuthenticationStatus)
Pointer to a caller-allocated UINT32 in which the authentication status
is returned.  See Possible AuthenticationStatus Bit Values in the EFI
Firmware Volume Specification for more information.
Output:
EFI_WARN_BUFFER_TOO_SMALL,  if Buffer is too small to contain image.
              BufferSize is updated with the necessary size,
              and Buffer is filled with the truncated image.
EFI_OUT_OF_RESOURCES,       if an allocation failure occurred.
EFI_NOT_FOUND,              if the requested file or EFI_SECTION_PE32 was
              not found.
EFI_DEVICE_ERROR,           if a hardware error occurred when attempting
              to access the firmware volume.
EFI_ACCESS_DENIED,          if the firmware volume is configured to
              disallow reads.
EFI_PROTOCOL_ERROR,         if the GUIDED_SECTION_EXTRACTION_PROTOCOL for
              the EFI_SECTION_PE32 was not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
guidFV


GetBootMode in the EfiLib.c

Function : GetBootMode

File: EfiLib.c
Description:
EFI_BOOT_MODE GetBootMode() returns current boot mode. If no boot mode
information is available, BOOT_WITH_FULL_CONFIGURATION is returned.
Input:
VOID.
Output:
BOOT_WITH_FULL_CONFIGURATION,  if no boot mode information is available.
Otherwise, the current EFI_BOOT_MODE.
Modified:
Notes:
Referrals:
GetEfiConfigurationTable


GetControllerName in the EfiLib.c

Function : GetControllerName

File: EfiLib.c
Description:
BOOLEAN GetControllerName(IN EFI_HANDLE Controller, OUT CHAR16 **wsName)
retrieves the name of the controller specified by Controller and copies
it into the caller allocated Unicode string at address wsName.
Input:
IN EFI_HANDLE Controller
Handle of the controller whose name is desired.

OUT CHAR16 **wsName
Address of the null-terminated Unicode string to put controller name into.
Output:
TRUE if name found; otherwise, FALSE.
Modified:
Notes:
Referrals:
FindDeviceName
DPCopy
DPGetLastNode


GetEfiConfigurationTable in the EfiLib.c

Function : GetEfiConfigurationTable

File: EfiLib.c
Description:
VOID *GetEfiConfigurationTable(IN EFI_SYSTEM_TABLE *SystemTable,
IN EFI_GUID *Guid) retrieves a pointer to the system configuration table
from the EFI System Table based on a specified GUID.  If a match is found,
then a pointer to the configuration table is returned.  If a matching GUID
is not found, then NULL is returned.
Input:
IN EFI_SYSTEM_TABLE *SystemTable
Pointer to the EFI System Table.

IN EFI_GUID *Guid
Pointer to table's GUID type.
Output:
VOID* pointer to configuration table if a match is found; otherwise NULL.
Modified:
Notes:
Referrals:
guidcmp


GetEfiVariable in the EfiLib.c

Function : GetEfiVariable

File: EfiLib.c
Description:
EFI_STATUS GetEfiVariable(IN CHAR16 *sName, IN EFI_GUID *pGuid,
OUT UINT32 *pAttributes OPTIONAL, IN OUT UINTN *pDataSize,
OUT VOID **ppData) reads an EFI variable with the name Name and GUID Guid.
If variable is found, variable attributes, size, and data are returned
using Attributes, DataSize, and Data parameters and EFI_SUCCESS is
returned. If variable is not found, EFI_NOT_FOUND is returned. The output
buffer is specified by a double indirection of the Data parameter. The
input value of *Data is used to determine if the output buffer is caller
allocated or is dynamically allocated by this functions. If the input
value of  *Data is not NULL, it indicates that the output buffer is caller
allocated. In this case, the input value of *DataSize indicates the size
of the caller-allocated output buffer. If the output buffer is not large
enough to contain the variable data, it is freed and new   buffer of
sufficient size is allocated from boot services pool memory, which will be
returned in *Data.  If the input value of *Data not NULL, it indicates
that the output buffer is allocated by GetEfiVariable routine. In this
case, GetEfiVariable will allocate an appropriately sized buffer from boot
services pool memory, which will be returned in *Data.
Input:
IN CHAR16 *sName
Pointer to the null-terminated Unicode string with name of the EFI
Variable to read.

IN EFI_GUID *pGuid
Pointer to GUID of the EFI Variable to read.

OUT UINT32 *pAttributes OPTIONAL
Pointer to the Attributes of the EFI Variable.

IN OUT UINTN *pDataSize
Pointer to the variable data size.

OUT VOID **ppData
Pointer to the variable data.
Output:
EFI_NOT_FOUND, if variable is not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
Malloc


GetImageName in the EfiLib.c

Function : GetImageName

File: EfiLib.c
Description:
BOOLEAN GetImageName(IN EFI_HANDLE ImageHandle, OUT CHAR8 *sName)
retrieves the name of the image specified by ImageHandle and returns it
in sName.
Input:
IN EFI_HANDLE ImageHandle
The image handle whose name is desired.

OUT CHAR8 *sName
Address of the null-terminated ASCII string to put image name into.  User
is reponsible for allocating the necessary memory resources.
Output:
TRUE if the image name has been found; otherwise, FALSE.
Modified:
Notes:
Referrals:
GetName
Sprintf


GetSmstConfigurationTable in the EfiLib.c

Function : GetSmstConfigurationTable

File: EfiLib.c
Description:
VOID *GetEfiConfigurationTable( IN EFI_GUID *TableGuid)
retrieves a pointer to the system configuration table
from the SMM System Table based on a specified GUID.  If a match is found,
then a pointer to the configuration table is returned.  If a matching GUID
is not found, then NULL is returned.
Input:
IN EFI_GUID *TableGuid
Pointer to table's GUID type.
Output:
VOID* pointer to configuration table if a match is found; otherwise NULL.
Notes:
This function only works in SMM. It relies on global initialization performed
by InitSmmHandler(or InitSmmHandlerEx) function.
Referrals:
guidcmp


HiiLibGetBrowserData in the EfiLib.c

Function : HiiLibGetBrowserData

File: EfiLib.c
Description:
Retrieves uncommitted state data from the HII browser.
Only works in UEFI 2.1 mode.
Input:
IN OUT UINTN *BufferSize - A pointer to the size of the buffer associated with Buffer.
On input, the size in bytes of Buffer. On output, the size of data returned in Buffer.
OUT VOID *Buffer - A data returned from an IFR browser.
IN CONST EFI_GUID *VarStoreGuid OPTIONAL - An optional field to indicate the target variable GUID name to use.
IN CONST CHAR16 *VarStoreName  OPTIONAL  - An optional field to indicate the target variable name.
Output:
EFI_STATUS


HiiLibGetString in the EfiLib.c

Function : HiiLibGetString

File: EfiLib.c
Description:
Reads string from the HII database in current language.
Input:
IN EFI_HII_HANDLE HiiHandle - Package list handle
IN EFI_STRING_ID StringId - ID of the string to read
IN OUT UINTN *StringSize - On entry, points to the size of the buffer pointed to by String,
in bytes. On return, points to the length of the string, in bytes.
OUT EFI_STRING String - Points to the output null-terminated string.
Output:
EFI_STATUS


HiiLibPublishPackages in the EfiLib.c

Function : HiiLibPublishPackages

File: EfiLib.c
Description:
Publishes submitted array of HII packages into HII database.
Input:
IN VOID *PackagePointers - array of pointers to the HII packages
IN UINTN NumberOfPackages - number of pointers in the PackagePointers array
IN EFI_GUID *PackageGuid - package list GUID
IN EFI_HANDLE DriverHandle OPTIONAL - Handle to associate with the package list
OUT EFI_HII_HANDLE *HiiHandle - HII handle of the package list
Output:
EFI_STATUS


HiiLibSetBrowserData in the EfiLib.c

Function : HiiLibSetBrowserData

File: EfiLib.c
Description:
Updates uncommitted state data of the HII browser.
Only works in UEFI 2.1 mode.
Input:
IN UINTN BufferSize - Size of the buffer associated with Buffer.
IN VOID *Buffer - A data to send to an IFR browser.
IN CONST EFI_GUID *VarStoreGuid OPTIONAL - An optional field to indicate the target variable GUID name to use.
IN CONST CHAR16 *VarStoreName  OPTIONAL  - An optional field to indicate the target variable name.
Output:
EFI_STATUS


HiiLibSetString in the EfiLib.c

Function : HiiLibSetString

File: EfiLib.c
Description:
Updates string in the HII database in all languages supported by the package list.
Input:
IN EFI_HII_HANDLE HiiHandle - Package list handle
IN EFI_STRING_ID StringId - ID of the string to udpate
IN EFI_STRING String - Points to the new null-terminated string.
Output:
EFI_STATUS


InitAmiLib in the EfiLib.c

Function : InitAmiLib

File: EfiLib.c
Description:
VOID InitAmiLib(IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable) initializes the global variables used by
library routines. It must be called before any other library routine is
used. See notes for variables initialized.
Input:
IN EFI_HANDLE ImageHandle
The image handle.

IN EFI_SYSTEM_TABLE *SystemTable
Pointer to the EFI System Table.
Output:
VOID.
Modified:
pST
pBS
pRS
TheImageHandle
Notes:
The global variables initialized by this function are:
pST             Pointer to the EFI System Table.
pBS             Pointer to the Boot Services Table.
pRS             Pointer to the Runtime Services Table.
TheImageHandle  Image handle.
Referrals:


InitAmiRuntimeLib in the EfiLib.c

Function : InitAmiRuntimeLib

File: EfiLib.c
Description:
VOID InitAmiRuntimeLib(IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_EVENT_NOTIFY ExitBsCallback OPTIONAL,
IN EFI_EVENT_NOTIFY GoVirtualCallback OPTIONAL) initializes the global variables using call to InitAmiLib.
Runtime drivers should use this function instead of InitAmiLib.
Input:
IN EFI_HANDLE ImageHandle
The image handle.

IN EFI_SYSTEM_TABLE *SystemTable
Pointer to the EFI System Table.

IN EFI_EVENT_NOTIFY ExitBsCallback OPTIONAL
Optional Exit Boot Services callback function pointer

IN EFI_EVENT_NOTIFY GoVirtualCallback OPTIONAL
Optional Virtual Address Change callback function pointer
Output:
VOID.
Modified:
pST
pBS
pRS
TheImageHandle
Notes:
The global variables initialized by this function are:
pST             Pointer to the EFI System Table.
pBS             Pointer to the Boot Services Table.
pRS             Pointer to the Runtime Services Table.
TheImageHandle  Image handle.
Referrals:


InitSmmHandler in the EfiLib.c

Function : InitSmmHandler

File: EfiLib.c
Description:
EFI_STATUS InitSmmHandler(IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable,
IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE ImageHandle,
EFI_SYSTEM_TABLE *SystemTable),
IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE ImageHandle,
EFI_SYSTEM_TABLE *SystemTable) OPTIONAL) first calls the provided
NotInSmmFunction (if provided), then runs the InSmmFunction in SMM.
Input:
IN EFI_HANDLE ImageHandle
This driver's image handle.

IN EFI_SYSTEM_TABLE *SystemTable
Pointer to the system table.

IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE ImageHandle EFI_SYSTEM_TABLE *SystemTable)
Pointer to the function to be run inside SMM.

IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) OPTIONAL
Pointer to the function to be run outside SMM.
Output:
EFI_NOT_FOUND, if the SMM Base Protocol is not installed.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


InitSmmHandlerEx in the EfiLib.c

Function : InitSmmHandlerEx

File: EfiLib.c
Description:
The function is similar to InitSmmHandler function.
The difference between the two is handling of missing SmmBase protocol.
If SmmBase protocol is not available, InitSmmHandler function returns error.
This function registers callback and loads module to SMM once SmmBase is available.
Input:
IN EFI_HANDLE ImageHandle
This driver's image handle.

IN EFI_SYSTEM_TABLE *SystemTable
Pointer to the system table.

IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE ImageHandle EFI_SYSTEM_TABLE *SystemTable)
Pointer to the function to be run inside SMM.

IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) OPTIONAL
Pointer to the function to be run outside SMM.
Output:
EFI_NOT_FOUND, if the SMM Base Protocol is not installed.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


LanguageCodesEqual in the EfiLib.c

Function : LanguageCodesEqual

File: EfiLib.c
Description:
BOOLEAN LanguageCodesEqual(CONST CHAR8* LangCode1, CONST CHAR8* LangCode2)
compares two language codes and returns TRUE if they are equal.
Input:
CONST CHAR8* LangCode1 - first language code
CONST CHAR8* LangCode2 - second language code
Output:
BOOLEAN TRUE - the language codes are equal
FALSE - the language codes are not equal
Notes:
if EFI_SPECIFICATION_VERSION is greater than 0x00020000, the function
expects language codes in RFC 4646 format.
if EFI_SPECIFICATION_VERSION is less or equal than 0x00020000, the function
expects language codes in ISO 639-2 format.


LFReadFile in the EfiLib.c

Function : LFReadFile

File: EfiLib.c
Description:
EFI_STATUS LFReadFile(IN EFI_HANDLE hDevice, IN EFI_DEVICE_PATH_PROTOCOL* pPath, IN BOOLEAN BootPolicy, OUT VOID** ppSource, OUT UINTN *pSize)
Input:
Output:
Modified:
Notes:
Referrals:


LibAllocCspResource in the EfiLib.c

Function : LibAllocCspResource

File: EfiLib.c
Description:
EFI_STATUS LibAllocCspResource(IN CSP_RES_ITEM *ResTable,
IN UINTN ResCount, IN EFI_HANDLE ImgHandle, IN EFI_HANDLE CntrHandle) uses
GCD services to allocate list of resources specified by ResTable.
Input:
IN CSP_RES_ITEM *ResTable
Table of requested GCD resources.

IN UINTN ResCount
Number of elements in the ResTable.

IN EFI_HANDLE ImgHandle
Handle of the image to allocate resources to.

IN EFI_HANDLE CntrHandle
Handle of the controller to allocate resources to.
Output:
EFI_ERROR_CODE, if function fails.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
LibGetDxeSvcTbl


LibGetDxeSvcTbl in the EfiLib.c

Function : LibGetDxeSvcTbl

File: EfiLib.c
Description:
EFI_STATUS LibGetDxeSvcTbl(OUT DXE_SERVICES **ppDxe OPTIONAL) locates the
DXE Service Table in the EFI System Table and returns it in ppDxe. If
pointer is found, EFI_SUCCESS is returned.
Input:
OUT DXE_SERVICES **ppDxe OPTIONAL
Places the address of the DXE Services Table at *ppDxe, if **ppDxe not
equal to NULL.
Output:
EFI_INVALID_PARAMETER,  if InitAmiLib() was not called prior to invoking
          this function.
EFI_NOT_AVAILABLE_YET,  if EFI Configuration Table does not have the DXE
          Services Table pointer initialized yet.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
GetEfiConfigurationTable


LibReportStatusCode in the EfiLib.c

Function : LibReportStatusCode

File: EfiLib.c
Description:
EFI_STATUS LibReportStatusCode(IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance,
IN EFI_GUID *CallerId OPTIONAL, IN EFI_STATUS_CODE_DATA *Data OPTIONAL)
abstracts status code reporting.  The Framework moved from a proprietary
to a UEFI 2.0-based mechanism.  This function abstracts the caller from
how the status code is reported to prevent the code from having to change
with this version of the specification supported.
Input:
IN EFI_STATUS_CODE_TYPE Type
Indicates the type of status code being reported.

IN EFI_STATUS_CODE_VALUE Value
Describes the current status of a hardware or software entity. This
includes information about the class and subclass that is used to classify
the entity as well as an operation. For progress codes, the operation is
the current activity. For error codes, it is the exception. For debug
codes, it is not defined at this time.

IN UINT32 Instance
The enumeration of a hardware or software entity within the system. A
system may contain multiple entities that match a class/subclass pairing.
The instance differentiates between them. An instance of 0 indicates that
instance information is unavailable, not meaningful, or not relevant.
Valid instance numbers start with 1.

IN EFI_GUID *CallerId OPTIONAL
This optional parameter may be used to identify the caller. This parameter
allows the status code driver to apply different rules to different
callers.

IN EFI_STATUS_CODE_DATA *Data OPTIONAL
This optional parameter may be used to pass additional data. The contents
of this data type may have additional GUID-specific data.
Output:
EFI_UNSUPPORTED, if Status Code protocol unavailable.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


LoadResources in the EfiLib.c

Function : LoadResources

File: EfiLib.c
Description:
EFI_STATUS LoadResources(EFI_HANDLE ImageHandle,
UINTN NumberOfCallbacks, CALLBACK_INFO *pCallBack,
INIT_HII_PACK InitFunction) - loads HII packages associated with
the specified image and publishes them to the HII database
Input:
IN EFI_HANDLE ImageHandle - Image Handle
IN UINTN NumberOfCallbacks - Number of the structures in the pCallBack array
IN OUT CALLBACK_INFO *pCallBack - Array of IFR package descriptors.
IN INIT_HII_PACK InitFunction - initialization function to be launched once resources are published.
Output:
EFI_STATUS


LoadStrings in the EfiLib.c

Function : LoadStrings

File: EfiLib.c
Description:
EFI_STATUS LoadStrings(EFI_HANDLE ImageHandle,
EFI_HII_HANDLE *pHiiHandle) - loads HII string packages associated with
the specified image and publishes them to the HII database
Input:
EFI_HANDLE ImageHandle - Image Handle
EFI_HII_HANDLE *pHiiHandle - HII package list handle
Output:
EFI_STATUS


Malloc in the EfiLib.c

Function : Malloc

File: EfiLib.c
Description:
VOID *Malloc(IN UINTN Size) allocates Size bytes of memory from
EfiBootServicesData and returns a pointer to the allocated space.
Input:
IN UINTN Size
The number of bytes to be allocated.
Output:
VOID* address of the allocated memory.
Modified:
Notes:
This function is available only in the DXE phase.  Use
pBS->FreePool(VOID*) to return memory to the pool once it's no longer
needed.
Referrals:


MallocZ in the EfiLib.c

Function : MallocZ

File: EfiLib.c
Description:
VOID* MallocZ(IN UINTN Size) allocates Size bytes of memory from
EfiBootServicesData, initializes it to zero, then returns a pointer to
the allocated space.
Input:
IN UINTN Size
The number of bytes to be allocated.
Output:
VOID* address of the allocated and zeroed memory.
Modified:
Notes:
Referrals:
Malloc


PERF_CODE in the EfiLib.c

Function : PERF_CODE

File: EfiLib.c
Description:
PERF_CODE(Code) is a macro which places the provided code block into the
requested location if the DXE_PERFORMANCE SDL token is turned on.  If the
DXE_PERFORMANCE SDL token is turned off, the macro inserts nothing.
Input:
Code
Block or line of code to be inserted if the DXE_PERFORMANCE SDL token is
enabled.
Output:
VOID.
Modified:
Notes:
This macro is defined in AmiDxeLib.h.
Referrals:
EndMeasure


PERF_END in the EfiLib.c

Function : PERF_END

File: EfiLib.c
Description:
PERF_END(Handle, Token, Host, Ticker) is a macro which invokes the
EndMeasure function to stop timing for a performance entry in order to
determine performance if the DXE_PERFORMANCE SDL token is turned on.  If
the DXE_PERFORMANCE SDL token is turned off, the macro does nothing.
Input:
IN EFI_HANDLE Handle
Handle to stop.

IN CHAR16 *Token
Token to stop.

IN CHAR16 *Host
Host to stop.

IN UINT64 Ticker
End tick for timing; if 0, then EndMeasure gets current timer.
Output:
EFI_NOT_FOUND,   if node or Performance Protocol not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
This macro is defined in AmiDxeLib.h.
Referrals:
EndMeasure


PERF_START in the EfiLib.c

Function : PERF_START

File: EfiLib.c
Description:
PERF_START(Handle, Token, Host, Ticker) is a macro which invokes the
StartMeasure function to log a timer entry for measuring performance if
the DXE_PERFORMANCE SDL token is turned on.  If the DXE_PERFORMANCE SDL
token is turned off, the macro does nothing.
Input:
IN EFI_HANDLE Handle
Handle to measure.

IN CHAR16 *Token
Token to measure.

IN CHAR16 *Host
Host to measure.

IN UINT64 Ticker
Set gauge data's StartTick. If 0, StartTick is current timer value.
Output:
EFI_OUT_OF_RESOURCES,  if not enough memory available for new item.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
This macro is defined in AmiDxeLib.h.
Referrals:
StartMeasure


Performance_Measurement_Functions in the EfiLib.c

General : Performance_Measurement_Functions

File: EfiLib.c
Fields:

Header | Function | Description
AmiPeiLib | PEI_PERF_START | Macro that starts timing for performance measurement.
AmiPeiLib | PEI_PERF_END | Macro that stops timing for performance measurement.
AmiPeiLib | PeiPerfMeasure | Start or stop timing performance measurement.
AmiDxeLib | PERF_START | Macro that starts timing for performance measurement.
AmiDxeLib | StartMeasure | Start timing for performance measurement.
AmiDxeLib | PERF_END | Macro that stops timing for performance measurement.
AmiDxeLib | EndMeasure | Stop timing for performance measurement.
AmiDxeLib | PERF_CODE | Macro that inserts performance measurement related code.
AmiPeiLib | PEI_PERF_SAVE_S3_DATA | Macro that saves performance information to a HOB for S3 measurement.
AmiPeiLib | SaveS3PerformanceData | Save performance information to a HOB for S3 measurement.
AmiDxeLib | WriteBootToOsPerformanceData | Write performance information.

Description:
Functions which are used to measure boot performance that are defined in
the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


ReadImage in the EfiLib.c

Function : ReadImage

File: EfiLib.c
Description:
EFI_STATUS ReadImage(IN BOOLEAN BootPolicy,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN OUT VOID **ppSource,
IN OUT UINTN *pSourceSize OPTIONAL, OUT UINTN *pImageSize OPTIONAL,
OUT EFI_HANDLE *phDevice OPTIONAL,
OUT EFI_DEVICE_PATH_PROTOCOL **ppPath OPTIONAL)
Input:

Output:

Modified:

Notes:

Referrals:


ReadImageResource in the EfiLib.c

Function : ReadImageResource

File: EfiLib.c
Description:
EFI_STATUS ReadImageResource(IN EFI_HANDLE ImageHandle,
IN EFI_GUID *pGuid, OUT VOID **ppData, OUT UINTN *pDataSize)
Input:
Output:
Modified:
Notes:
Referrals:


RegisterProtocolCallback in the EfiLib.c

Function : RegisterProtocolCallback

File: EfiLib.c
Description:
EFI_STATUS RegisterProtocolCallback(IN EFI_GUID *pProtocol,
IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext,
OUT EFI_EVENT *pEvent, OUT VOID **ppRegistration) creates a notification
event and registers that event with protocol instances specified by
ProtocolGuid.  Every time a protocol of type ProtocolGuid instance is
installed or reinstalled, the notification function is executed.  This
function returns EFI_SUCCESS if notification event has been created.
Input:
IN EFI_GUID *pProtocol
Supplies GUID of the protocol upon whose installation the event is fired.

IN EFI_EVENT_NOTIFY NotifyFunction
Supplies the function to notify when the event is signaled.

IN VOID *pNotifyContext
The context parameter to pass to NotifyFunction.  This is an optional
parameter and may be NULL.

OUT EFI_EVENT *pEvent
Event created event.

OUT VOID **ppRegistration
A pointer to a memory location to receive the registration value.  This
value is passed to LocateHandle() to obtain new handles that have been
added that support the ProtocolGuid-specified protocol.
Output:
EFI_OUT_OF_RESOURCES,   if space for the notification event could not be
          allocated.
EFI_INVALID_PARAMETER,  if Protocol, Event, or Registration are NULL.
Otherwise, EFI_SUCCESS
Modified:
Notes:
Referrals:


StartMeasure in the EfiLib.c

Function : StartMeasure

File: EfiLib.c
Description:
EFI_STATUS StartMeasure (IN EFI_HANDLE Handle, IN CHAR16 *Token,
IN CHAR16 *Host, IN UINT64 Ticker) starts timing on a specified handle,
token and host, with Ticker as the start tick.  See notes for proper
usage.
Input:
IN EFI_HANDLE Handle
Handle to measure.

IN CHAR16 *Token
Token to measure.

IN CHAR16 *Host
Host to measure.

IN UINT64 Ticker
Set gauge data's StartTick. If 0, StartTick is current timer.
Output:
EFI_OUT_OF_RESOURCES,  if not enough memory available for new item.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
To properly use this function, use the PERF_START macro defined in
AmiDxeLib.h; this allows the DXE_PERFORMANCE SDL token to control
enabling and disabling performance measurement in DXE.
Referrals:
PERF_START


TimerIsSet in the EfiLib.c

Function : TimerIsSet

File: EfiLib.c
Description:
VOID TimerIsSet(IN EFI_EVENT Event, IN OUT VOID *Context)
Input:
Output:
Modified:
Notes:
Referrals:


TimerStart in the EfiLib.c

Function : TimerStart

File: EfiLib.c
Description:
EFI_EVENT TimerStart(OUT BOOLEAN *pTimerFlag, IN UINT64 Delay)
Input:
Output:
Modified:
Notes:
Referrals:
TimerIsSet


TimerStop in the EfiLib.c

Function : TimerStop

File: EfiLib.c
Description:
VOID TimerStop(IN BOOLEAN TimerFlag, IN EFI_EVENT Event)
Input:
Output:
Modified:
Notes:
Referrals:


Trace in the EfiLib.c

Function : Trace

File: EfiLib.c
Description:
VOID

 Trace
(IN UINTN Level, IN CHAR8 *sFormat, IN ...) prints a debug
message using status code protocol if the specified error level is
enabled.
Input:
IN UINTN Level
The error level of the debug message.

IN CHAR8 *sFormat
Format string for the debug message to print.

IN ...
Argument list for the format string.
Output:
VOID.
Modified:
Notes:
Use the

 Trace
(Arguments) macro for generating debug messages in DXE.
This allows the DEBUG_MODE token to control whether the debug message is
included or removed in the build process.  See Sprintf for format string
parameters.
Referrals:
va_start
PrintDebugMessageVaList
va_end

 Trace
(Arguments)
Sprintf


WriteBootToOsPerformanceData in the EfiLib.c

Function : WriteBootToOsPerformanceData

File: EfiLib.c
Description:
VOID WriteBootToOsPerformanceData() allocates a block of memory and
writes performance data into it.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
This function must only be called once; by default, it is called by BDS.
Referrals:
GetCpuTimer
Div64
Strcpy


IA32AsmLib.asm

Description:
Generic CPU library functions for the IA32 architecture.  See function
definitions in the x64 library;  most IA32 functions have been removed
from help builder output to fix a name collision issue.

The following functions are used in the file: IA32AsmLib.asm.

Function | Description
EnableLongMode | VOID EnableLongMode(IN VOID *PageTable, IN VOID *Function, IN VOID *Parameter1, IN VOID *Parameter2) enables long mode then calls the provided function with the provided parameters.


EnableLongMode in the IA32AsmLib.asm

Function : EnableLongMode

File: IA32AsmLib.asm
Description:
VOID EnableLongMode(IN VOID *PageTable, IN VOID *Function,
IN VOID *Parameter1, IN VOID *Parameter2) enables long mode then calls the
provided function with the provided parameters.
Input:
IN VOID *PageTable
Pointer to level 4 page map.

IN VOID *Function
Pointer to function to call.

IN VOID *Parameter1
Parameter 1 for above function call.

IN VOID *Parameter2
Parameter 2 for above function call.
Output:
VOID.
Modified:
Notes:
Referrals:


IA32CLib.c

Description:
Generic CPU library functions for the IA32 architecture.   See function
definitions in the x64 library;  most IA32 functions have been removed
from help builder output to fix a name collision issue.

The following functions are used in the file: IA32CLib.c.

Function | Description
InitLongMode | VOID InitLongMode(IN EFI_PEI_SERVICES **PeiServices, IN VOID *Function, IN VOID *Parameter1, IN VOID *Parameter2) initializes memory page mapping, enables long mode and jumps to a provided function.
InitLongModeExt | VOID InitLongMode(IN EFI_PEI_SERVICES **PeiServices, IN VOID *Function, IN VOID *Parameter1, IN VOID *Parameter2) initializes memory page mapping, enables long mode and jumps to a provided function.
memcpy | VOID MemCpy (OUT VOID *pDestination, IN VOID *pSource, IN UINTN Count) is a wrapper for MemCpy , which copies Count bytes of memory from Source to Destination.


InitLongMode in the IA32CLib.c

Function : InitLongMode

File: IA32CLib.c
Description:
VOID InitLongMode(IN EFI_PEI_SERVICES **PeiServices, IN VOID *Function,
IN VOID *Parameter1, IN VOID *Parameter2) initializes memory page mapping,
enables long mode and jumps to a provided function.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services table.

IN VOID *Function
Pointer to a function for EnableLongMode to call.

IN VOID *Parameter1
First parameter to provide the Function to be called.

IN VOID *Parameter2
Second parameter to provide the Function to be called.
Output:
VOID.
Modified:
Notes:
Referrals:
FindNextHobByType
EFI_ERROR
GetPageTableNumPages
FillPageTable
EnableLongMode


InitLongModeExt in the IA32CLib.c

Function : InitLongModeExt

File: IA32CLib.c
Description:
VOID InitLongMode(IN EFI_PEI_SERVICES **PeiServices, IN VOID *Function,
IN VOID *Parameter1, IN VOID *Parameter2) initializes memory page mapping,
enables long mode and jumps to a provided function.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services table.

IN VOID *Function
Pointer to a function for EnableLongMode to call.

IN VOID *Parameter1
First parameter to provide the Function to be called.

IN VOID *Parameter2
Second parameter to provide the Function to be called.
Output:
VOID.
Modified:
Notes:
Referrals:
FindNextHobByType
EFI_ERROR
GetPageTableNumPages
FillPageTable
EnableLongMode


memcpy in the IA32CLib.c

Function : memcpy

File: IA32CLib.c
Description:
VOID

 MemCpy
(OUT VOID *pDestination, IN VOID *pSource, IN UINTN Count) is
a wrapper for

 MemCpy
, which copies Count bytes of memory from Source to
Destination.
Input:
OUT VOID *pDestination
Memory address where data shall be copied.  User is responsible for
allocating the necessary memory resources.

IN VOID *pSource
Memory address from where data shall be copied.

IN UINTN Count
Number of bytes to copy from pSource.
Output:
VOID.
Modified:
Notes:

 MemCpy
 checks for overlapping of source and destination and selects copy
direction that prevents memory corruption.
Referrals:

 MemCpy


IO.c

Description:
Contains generic I/O read/write functions.

The following functions are used in the file: IO.c.

Function | Description
IoRead | EFI_STATUS IoRead(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer) performs Count I/O reads of the defined Width at the Address and stores the result in Buffer. After every I/O operation, Address and Buffer are updated according to the Width. See notes for details.
IoReadWrite | EFI_STATUS IoReadWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN VOID *DataValue, IN VOID *DataMask) reads the specified I/O Address, ANDs the result with DataMask, then ORs the modified result with DataValue and writes the value back to Address.
IoWrite | EFI_STATUS IoWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer) performs Count I/O writes of the defined Width at the Address from the Buffer. After every I/O operation, Address and Buffer are updated according to the Width. See notes for details.
MemRead | EFI_STATUS MemRead(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer) performs Count MMIO reads of the size Width at the Address and stores the result in Buffer. After every MMIO operation, Address and Buffer are updated according to Width.
MemReadWrite | EFI_STATUS MemReadWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN VOID *DataValue, IN VOID *DataMask) reads the specified physical Address, ANDs the result with DataMask, then ORs the modified result with DataValue and writes the value back to Address.
MemWrite | EFI_STATUS MemWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer) performs Count MMIO writes of the size Width at the Address using the contents of Buffer. After every MMIO operation, Address and Buffer are updated according to Width.

The following descriptions are used in the file: IO.c.

Header | Description
IO_Read_Write_Functions | Generic I/O read/write functions.


IO_Read_Write_Functions in the IO.c

General : IO_Read_Write_Functions

File: IO.c
Fields:

Header | Function | Description
AmiLib | IoRead | Read value(s) from an I/O address or an entire region.
AmiLib | IoRead8 | Read 8-bit value from an I/O address.
AmiLib | IoRead16 | Read 16-bit value from an I/O address.
AmiLib | IoRead32 | Read 32-bit value from an I/O address.
AmiLib | IoReadWrite | Read value from an I/O address then write back a value.
AmiLib | IoWrite | Write buffer to an I/O address or region.
AmiLib | IoWrite8 | Write 8-bit value to an I/O address.
AmiLib | IoWrite16 | Write 16-bit value to an I/O address.
AmiLib | IoWrite32 | Write 32-bit value to an I/O address.
AmiLib | MemRead | Read value(s) from a memory mapped I/O address or an entire region.
AmiLib | MemReadWrite | Read value from a memory mapped I/O address then write back a value.
AmiLib | MemWrite | Write buffer to an I/O address or region.

Description:
Generic I/O read/write functions.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


IoRead in the IO.c

Function : IoRead

File: IO.c
Description:
EFI_STATUS IoRead(IN CPU_IO_WIDTH Width, IN UINT64 Address,
IN UINTN Count, OUT VOID *Buffer) performs Count I/O reads of the defined
Width at the Address and stores the result in Buffer.  After every I/O
operation, Address and Buffer are updated according to the Width. See
notes for details.
Input:
IN CPU_IO_WIDTH Width
Number of bits to read from I/O.  Supports at most 32-bits.

IN UINT64 Address
I/O address to read from.

IN UINTN Count
Number of reads to perform.

OUT VOID *Buffer
Buffer where the read results will be stored.  User is responsible for
properly allocating the necessary memory resources.
Output:
EFI_INVALID_PARAMETER, if Count = 0, Width > 32-bits, or the range of
          Address > 0xffff.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Address and Buffer are updated according to the Width as follows:
CpuIoWidthUint8 - Both Address and Buffer are incremented by 1.
CpuIoWidthUint16 - Both Address and Buffer are incremented by 2.
CpuIoWidthUint32 - Both Address and Buffer are incremented by 4.
CpuIoWidthFifoUint8 - Only Buffer is incremented by 1.
CpuIoWidthFifoUint16 - Only Buffer is incremented by 2.
CpuIoWidthFifoUint32 - Only Buffer is incremented by 4.
CpuIoWidthFillUint8 - Only Address is incremented by 1.
CpuIoWidthFillUint16 - Only Address is incremented by 2.
CpuIoWidthFillUint32 - Only Address is incremented by 4.
Referrals:
IoRead8
IoRead16
IoRead32


IoReadWrite in the IO.c

Function : IoReadWrite

File: IO.c
Description:
EFI_STATUS IoReadWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address,
IN VOID *DataValue, IN VOID *DataMask) reads the specified I/O Address,
ANDs the result with DataMask, then ORs the modified result with DataValue
and writes the value back to Address.
Input:
IN CPU_IO_WIDTH Width
Number of bits to read/write from I/O.  Only supports: CpuIoWidthUint8,
CpuIoWidthUint16, and CpuIoWidthUint32.

IN UINT64 Address
I/O address to read and write to.

IN VOID *DataValue
UINT32 OR mask value.

IN VOID *DataMask
UINT32 AND mask value.
Output:
EFI_INVALID_PARAMETER, if Width not supported, or the range of
          Address > 0xffff.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
IoWrite
IoRead


IoWrite in the IO.c

Function : IoWrite

File: IO.c
Description:
EFI_STATUS IoWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address,
IN UINTN Count, IN VOID *Buffer) performs Count I/O writes of the defined
Width at the Address from the Buffer.  After every I/O operation, Address
and Buffer are updated according to the Width.  See notes for details.
Input:
IN CPU_IO_WIDTH Width
Number of bits to read from I/O.  Supports at most 32-bits.

IN UINT64 Address
I/O address to write to.

IN UINTN Count
Number of writes to perform.

IN VOID *Buffer
Buffer where the data to be written is located.
Output:
EFI_INVALID_PARAMETER, if Count = 0, Width > 32-bits, or the range of
          Address > 0xffff.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Address and Buffer are updated according to the Width as follows:
CpuIoWidthUint8 - Both Address and Buffer are incremented by 1.
CpuIoWidthUint16 - Both Address and Buffer are incremented by 2.
CpuIoWidthUint32 - Both Address and Buffer are incremented by 4.
CpuIoWidthFifoUint8 - Only Buffer is incremented by 1.
CpuIoWidthFifoUint16 - Only Buffer is incremented by 2.
CpuIoWidthFifoUint32 - Only Buffer is incremented by 4.
CpuIoWidthFillUint8 - Only Address is incremented by 1.
CpuIoWidthFillUint16 - Only Address is incremented by 2.
CpuIoWidthFillUint32 - Only Address is incremented by 4.
Referrals:
IoWrite8
IoWrite16
IoWrite32


MemRead in the IO.c

Function : MemRead

File: IO.c
Description:
EFI_STATUS MemRead(IN CPU_IO_WIDTH Width, IN UINT64 Address,
IN UINTN Count, IN VOID *Buffer) performs Count MMIO reads of the size
Width at the Address and stores the result in Buffer. After every MMIO
operation, Address and Buffer are updated according to Width.
Input:
IN CPU_IO_WIDTH Width
The width of the access.

IN UINT64 Address
The physical address of the access.

IN UINTN Count
The number of accesses to perform.

IN VOID *Buffer
A pointer to the buffer of data.  User is responsible for allocating the
necessary memory resources.
Output:
EFI_INVALID_PARAMETER, if Count = 0, Width not supported, or the range of
          Address overflows the bounds of memory.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Address and Buffer are updated according to Width as follows:
CpuIoWidthUint8 - Both Address and Buffer are incremented by 1.
CpuIoWidthUint16 - Both Address and Buffer are incremented by 2.
CpuIoWidthUint32 - Both Address and Buffer are incremented by 4.
CpuIoWidthUint64 - Both Address and Buffer are incremented by 8.
CpuIoWidthFifoUint8 - Only Buffer is incremented by 1.
CpuIoWidthFifoUint16 - Only Buffer is incremented by 2.
CpuIoWidthFifoUint32 - Only Buffer is incremented by 4.
CpuIoWidthFifoUint64 - Only Buffer is incremented by 8.
CpuIoWidthFillUint8 - Only Address is incremented by 1.
CpuIoWidthFillUint16 - Only Address is incremented by 2.
CpuIoWidthFillUint32 - Only Address is incremented by 4.
CpuIoWidthFillUint64 - Only Address is incremented by 8.
Referrals:


MemReadWrite in the IO.c

Function : MemReadWrite

File: IO.c
Description:
EFI_STATUS MemReadWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address,
IN VOID *DataValue, IN VOID *DataMask) reads the specified physical
Address, ANDs the result with DataMask, then ORs the modified result with
DataValue and writes the value back to Address.
Input:
IN CPU_IO_WIDTH Width
The width of the access.  Only supports CpuIoWidthUintxx.

IN UINT64 Address
The physical address of the access.

IN VOID *DataValue
UINT64 OR mask value.

IN VOID *DataMask
UINT64 AND mask value.
Output:
EFI_INVALID_PARAMETER, if Width not supported, or the range of
          Address overflows the bounds of memory.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


MemWrite in the IO.c

Function : MemWrite

File: IO.c
Description:
EFI_STATUS MemWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address,
IN UINTN Count, OUT VOID *Buffer) performs Count MMIO writes of the size
Width at the Address using the contents of Buffer. After every MMIO
operation, Address and Buffer are updated according to Width.
Input:
IN CPU_IO_WIDTH Width
The width of the access.

IN UINT64 Address
The physical address of the access.

IN UINTN Count
The number of accesses to perform.

OUT VOID *Buffer
A pointer to the buffer of data.
Output:
EFI_INVALID_PARAMETER, if Count = 0, Width not supported, or the range of
          Address overflows the bounds of memory.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Address and Buffer are updated according to Width as follows:
CpuIoWidthUint8 - Both Address and Buffer are incremented by 1.
CpuIoWidthUint16 - Both Address and Buffer are incremented by 2.
CpuIoWidthUint32 - Both Address and Buffer are incremented by 4.
CpuIoWidthUint64 - Both Address and Buffer are incremented by 8.
CpuIoWidthFifoUint8 - Only Buffer is incremented by 1.
CpuIoWidthFifoUint16 - Only Buffer is incremented by 2.
CpuIoWidthFifoUint32 - Only Buffer is incremented by 4.
CpuIoWidthFifoUint64 - Only Buffer is incremented by 8.
CpuIoWidthFillUint8 - Only Address is incremented by 1.
CpuIoWidthFillUint16 - Only Address is incremented by 2.
CpuIoWidthFillUint32 - Only Address is incremented by 4.
CpuIoWidthFillUint64 - Only Address is incremented by 8.
Referrals:


Memory.c

Description:
Contains memory related library functions.

The following functions are used in the file: Memory.c.

Function | Description
FillPageTable | VOID FillPageTable(IN UINT8 NumberMemoryBits, IN VOID *PageTable) fills a provided page table with an identity map.
GetPageTableNumPages | UINT32 GetPageTableNumPages(IN UINT8 NumberMemoryBits) gets the number of pages to allocate for paging. Limit 512GB.
MemCmp | INTN MemCmp(IN VOID* pDestination, IN VOID* pSource, IN UINTN Count) compares Length bytes of pDestination to Length bytes of pSource. If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the value returned is the first mismatched byte in pSource subtracted from the first mismatched byte in pDestination.

The following descriptions are used in the file: Memory.c.

Header | Description
Memory_Functions | Memory functions defined in the AMI library. Note some may only be available in DXE.


FillPageTable in the Memory.c

Function : FillPageTable

File: Memory.c
Description:
VOID FillPageTable(IN UINT8 NumberMemoryBits, IN VOID *PageTable) fills a
provided page table with an identity map.
Input:
IN UINT8 NumberMemoryBits
Number of memory bits to map.

IN VOID *PageTable
Page table to fill.
Output:
VOID.
Modified:
Notes:
Referrals:
Shl64

 MemSet

Shr64


GetPageTableNumPages in the Memory.c

Function : GetPageTableNumPages

File: Memory.c
Description:
UINT32 GetPageTableNumPages(IN UINT8 NumberMemoryBits) gets the number
of pages to allocate for paging.  Limit 512GB.
Input:
IN UINT8 NumberMemoryBits
Number of memory bits to map.
Output:
UINT32 number of pages.
Modified:
Notes:
Referrals:
Shl64
Shr64


MemCmp in the Memory.c

Function : MemCmp

File: Memory.c
Description:
INTN MemCmp(IN VOID* pDestination, IN VOID* pSource, IN UINTN Count)
compares Length bytes of pDestination to Length bytes of pSource.  If all
Length bytes of the two buffers are identical, then 0 is returned.
Otherwise, the value returned is the first mismatched byte in pSource
subtracted from the first mismatched byte in pDestination.
Input:
IN VOID* pDestination
Pointer to the first buffer to compare.

IN VOID* pSource
Pointer to the second buffer to compare.

IN UINTN Count
Number of bytes to compare.
Output:
INTN value of first mismatched byte in pSource subtracted from the first
mismatched byte in pDestination (pDestination - pSource). Returns 0 if
both buffers are the same.
Modified:
Notes:
Referrals:


Memory_Functions in the Memory.c

General : Memory_Functions

File: Memory.c
Fields:

Header | Function | Description
AmiLib | MemSet | Fills a buffer with a user provided value.
AmiLib | MemCmp | Compare two buffers for equality.
AmiLIb | MemCpy | Copy a buffer into another buffer.
AmiDxeLib | Malloc | Allocate memory from EfiBootServicesData.
AmiDxeLib | MallocZ | Allocate memory from EfiBootServicesData that has been cleared with zeros.

Description:
Memory functions defined in the AMI library.  Note some may only be
available in DXE.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


Misc.c

Description:
Miscellaneous generic library functions.

The following functions are used in the file: Misc.c.

Function | Description
ExecScript | EFI_STATUS ExecScript(IN IO_DATA *ScriptData, IN UINTN EntryCount) executes a sequence of CPU I/O operations.
FindNextHobByGuid | EFI_STATUS FindNextHobByGuid(IN EFI_GUID *Guid, IN OUT VOID **Hob) finds HOB of type Guid Extention with a specified GUID starting from the HOB that comes after the HOB pointed by *Hob. *Hob pointer is updated with the address of the found HOB.
FindNextHobByType | EFI_STATUS FindNextHobByType(IN UINT16 Type, IN OUT VOID **Hob) finds a HOB with a specified Type starting from the HOB that comes after the HOB pointed by *Hob. *Hob pointer is updated with the address of the found HOB.


ExecScript in the Misc.c

Function : ExecScript

File: Misc.c
Description:
EFI_STATUS ExecScript(IN IO_DATA *ScriptData, IN UINTN EntryCount)
executes a sequence of CPU I/O operations.
Input:
IN IO_DATA *ScriptData
Pointer to the first element of  an IO_DATA table.

IN UINTN EntryCount
Number of entries in the IO_DATA table.
Output:
EFI_INVALID_PARAMETER, if a width or address within the table is invalid.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
IoWrite


FindNextHobByGuid in the Misc.c

Function : FindNextHobByGuid

File: Misc.c
Description:
EFI_STATUS FindNextHobByGuid(IN EFI_GUID *Guid, IN OUT VOID **Hob) finds
HOB of type Guid Extention with a specified GUID starting from the HOB
that comes after the HOB pointed by *Hob.  *Hob pointer is updated with
the address of the found HOB.
Input:
IN EFI_GUID *Guid
GUID for specific Guid Extention HOB.

IN OUT VOID **Hob
Address of the HOB if found.  Otherwise unchanged.
Output:
EFI_INVALID_PARAMETER, if Hob = NULL.
EFI_NOT_FOUND,         if HOB of specified type not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
FindNextHobByType
guidcmp


FindNextHobByType in the Misc.c

Function : FindNextHobByType

File: Misc.c
Description:
EFI_STATUS FindNextHobByType(IN UINT16 Type, IN OUT VOID **Hob) finds a
HOB with a specified Type starting from the HOB that comes after the HOB
pointed by *Hob.  *Hob pointer is updated with the address of the found
HOB.
Input:
IN UINT16 Type
Type of HOB to return.

IN OUT VOID **Hob
Address of the HOB if found.  Otherwise unchanged.
Output:
EFI_INVALID_PARAMETER, if Hob = NULL.
EFI_NOT_FOUND,         if HOB of specified type not found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:
NextHob


PeiLib.c

Description:
Contains an assortment of localized PEI library functions.

The following functions are used in the file: PeiLib.c.

Function | Description
CreateHobMemoryAllocationModule | EFI_STATUS CreateHobMemoryAllocationModule( IN EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress, IN UINT64 MemoryLength, IN EFI_MEMORY_TYPE MemoryType, IN EFI_GUID *ModuleName, IN EFI_PHYSICAL_ADDRESS EntryPoint) adds a memory allocation HOB with a memory allocation module GUID using CreateHob from PEI Services.
CreateHobResourceDescriptor | EFI_STATUS CreateHobResourceDescriptor(IN EFI_PEI_SERVICES **PeiServices, IN EFI_GUID *Owner, IN EFI_RESOURCE_TYPE ResourceType, IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 ResourceLength) builds a resource descriptor HOB that describes a chunk of system memory using CreateHob from PEI Services.
CreateLoadHob | EFI_STATUS CreateLoadHob(IN EFI_PEI_SERVICES **ppPS, IN EFI_FFS_FILE_HEADER *pFfsHeader, EFI_PEIM_ENTRY_POINT EntryPoint, EFI_PEIM_ENTRY_POINT InMemEntryPoint) builds a EFI_HOB_TYPE_GUID_EXTENSION HOB with a PEIM load HOB.
FindFfsFileByName | VOID* FindFfsFileByName(IN EFI_PEI_SERVICES **PeiServices, IN EFI_FV_FILETYPE FileType, IN EFI_GUID *FileName) scans all available firmware volumes for a FFS file of type FileType with GUID equal to FileName and returns the address of the first byte of the FFS file data. If more than one file matches the criteria, the function returns the address of the first file found.
PEI_PERF_END | PEI_PERF_END(Ps, Token, FileHeader, Value) is a macro which invokes the PeiPerfMeasure function to stop timing for an entry to determine performance if the PEI_PERFORMANCE SDL token is turned on. If the PEI_PERFORMANCE SDL token is turned off, the macro does nothing.
PEI_PERF_SAVE_S3_DATA | PEI_PERF_SAVE_S3_DATA(Ps) is a macro which invokes the SaveS3PerformanceData function in order to save the S3 performance data in an EFI PEI performance HOB. This should only be called once, just before the end of PEI.
PEI_PERF_START | PEI_PERF_START(Ps, Token, FileHeader, Value) is a macro which invokes the PeiPerfMeasure function to log a timer entry for measuring performance if the PEI_PERFORMANCE SDL token is turned on. If the PEI_PERFORMANCE SDL token is turned off, the macro does nothing.
PeiGetNextVariableName | EFI_STATUS PeiGetNextVariableName(IN EFI_PEI_SERVICES **PeiServices, IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VariableGuid) performs enumeration of the EFI variables. This function serves as a wrapper for the Read Only Variable PPI GetNextVariableName routine. It locates the Read Only Variable PPI instance, then makes a call to the GetNextVariableName routine and returns its EFI_STATUS.
PeiGetVariable | EFI_STATUS PeiGetNextVariableName(IN EFI_PEI_SERVICES **PeiServices, IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VariableGuid, OUT UINT32 *Attributes, IN OUT UINTN *DataSize, OUT VOID *Data) reads an EFI variable; it serves as a wrapper for the Read Only Variable PPI GetVariable routine. The functions first locates the Read Only Variable PPI instance, then makes a call to the GetVariable routine and returns the EFI_STATUS of the GetVariable call.
PeiPerfMeasure | VOID PeiPerfMeasure(IN EFI_PEI_SERVICES **PeiServices, IN CHAR16 *Token, IN EFI_FFS_FILE_HEADER *FileHeader, IN BOOLEAN EntryExit, IN UINT64 Value) logs a timestamp count for measuring performance. See the notes for proper usage.
PeiTrace | VOID PeiTrace(IN UINTN Level, IN EFI_PEI_SERVICES **ppPS, IN CHAR8 *sFormat, IN ...) prints a debug message using the ReportStatusCode from PEI Services if the specified error level is enabled.
SaveS3PerformanceData | VOID SaveS3PerformanceData(IN EFI_PEI_SERVICES **PeiServices) saves the S3 performance data in an EFI PEI performance HOB. This should only be called once, just before the end of PEI. See notes for proper usage.


CreateHobMemoryAllocationModule in the PeiLib.c

Function : CreateHobMemoryAllocationModule

File: PeiLib.c
Description:
EFI_STATUS CreateHobMemoryAllocationModule(
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress, IN UINT64 MemoryLength,
IN EFI_MEMORY_TYPE MemoryType, IN EFI_GUID *ModuleName,
IN EFI_PHYSICAL_ADDRESS EntryPoint) adds a memory allocation HOB with a
memory allocation module GUID using CreateHob from PEI Services.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to PEI Services Table.

IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress
The physical address of the module.

IN UINT64 MemoryLength
The length of the module in bytes.

IN EFI_MEMORY_TYPE MemoryType
Module memory type.

IN EFI_GUID *ModuleName
The GUID File Name of the module.

IN EFI_PHYSICAL_ADDRESS EntryPoint
The 64-bit physical address of the module's entry point.
Output:
EFI_INVALID_PARAMETER, if Hob = NULL.
EFI_OUT_OF_RESOURCES,  if there is not enough space to create HOB.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


CreateHobResourceDescriptor in the PeiLib.c

Function : CreateHobResourceDescriptor

File: PeiLib.c
Description:
EFI_STATUS CreateHobResourceDescriptor(IN EFI_PEI_SERVICES **PeiServices,
IN EFI_GUID *Owner, IN EFI_RESOURCE_TYPE ResourceType,
IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 ResourceLength) builds a
resource descriptor HOB that describes a chunk of system memory using
CreateHob from PEI Services.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services Table.

IN EFI_GUID *Owner
GUID of the owner of this resource.  Make this NULL if there is none.

IN EFI_RESOURCE_TYPE ResourceType
The type of resource described by this HOB.

IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
The resource attributes of the memory described by this HOB.

IN EFI_PHYSICAL_ADDRESS PhysicalStart
The 64-bit physical address of memory described by this HOB.

IN UINT64 ResourceLength
The length of the memory described by this HOB in bytes.
Output:
EFI_INVALID_PARAMETER, if HOB = NULL.
EFI_OUT_OF_RESOURCES,  if there is not enough space to create HOB.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


CreateLoadHob in the PeiLib.c

Function : CreateLoadHob

File: PeiLib.c
Description:
EFI_STATUS CreateLoadHob(IN EFI_PEI_SERVICES **ppPS,
IN EFI_FFS_FILE_HEADER *pFfsHeader, EFI_PEIM_ENTRY_POINT EntryPoint,
EFI_PEIM_ENTRY_POINT InMemEntryPoint) builds a EFI_HOB_TYPE_GUID_EXTENSION
HOB with a PEIM load HOB.
Input:
IN EFI_PEI_SERVICES **ppPS
Double pointer to the PEI Services Table.

IN EFI_FFS_FILE_HEADER *pFfsHeader
Pointer to the desired FFS header.

EFI_PEIM_ENTRY_POINT EntryPoint
Pointer to the FFS entry point.

EFI_PEIM_ENTRY_POINT InMemEntryPoint
Pointer to the FFS entry point in memory.
Output:
EFI_INVALID_PARAMETER, if HOB = NULL.
EFI_OUT_OF_RESOURCES,  if not enough space to create HOB.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
Referrals:


FindFfsFileByName in the PeiLib.c

Function : FindFfsFileByName

File: PeiLib.c
Description:
VOID* FindFfsFileByName(IN EFI_PEI_SERVICES **PeiServices,
IN EFI_FV_FILETYPE FileType, IN EFI_GUID *FileName) scans all available
firmware volumes for a FFS file of type FileType with GUID equal to
FileName and returns the address of the first byte of the FFS file data.
If more than one file matches the criteria, the function returns the
address of the first file found.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services Table.

IN EFI_FV_FILETYPE FileType
Type of FFS file to find.

IN EFI_GUID *FileName
GUID of FFS file to find.
Output:
VOID* pointer to the first byte of the FFS file data. Returns NULL if no
FFS file found.
Modified:
Notes:
Referrals:


PEI_PERF_END in the PeiLib.c

Function : PEI_PERF_END

File: PeiLib.c
Description:
PEI_PERF_END(Ps, Token, FileHeader, Value) is a macro which invokes
the PeiPerfMeasure function to stop timing for an entry to determine
performance if the PEI_PERFORMANCE SDL token is turned on.  If the
PEI_PERFORMANCE SDL token is turned off, the macro does nothing.
Input:
IN EFI_PEI_SERVICES **Ps
Double pointer to the PEI Services Table.

IN CHAR16 *Token
Pointer to token name.

IN EFI_FFS_FILE_HEADER *FileHeader
Pointer to the file header.

IN UINT64 Value
A non-zero value indicates the stop time.  Otherwise, GetCpuTimer is used
to get the current CPU timer value.
Output:
VOID.
Modified:
Notes:
This macro is defined in AmiPeiLib.h.
Referrals:
PeiPerfMeasure
GetCpuTimer


PEI_PERF_SAVE_S3_DATA in the PeiLib.c

Function : PEI_PERF_SAVE_S3_DATA

File: PeiLib.c
Description:
PEI_PERF_SAVE_S3_DATA(Ps) is a macro which invokes the
SaveS3PerformanceData function in order to save the S3 performance data in
an EFI PEI performance HOB.  This should only be called once, just before
the end of PEI.
Input:
IN EFI_PEI_SERVICES **Ps
Double pointer to the PEI Services Table.
Output:
VOID.
Modified:
Notes:
This macro is defined in AmiPeiLib.h.
Referrals:
SaveS3PerformanceData


PEI_PERF_START in the PeiLib.c

Function : PEI_PERF_START

File: PeiLib.c
Description:
PEI_PERF_START(Ps, Token, FileHeader, Value) is a macro which invokes
the PeiPerfMeasure function to log a timer entry for measuring performance
if the PEI_PERFORMANCE SDL token is turned on.  If the PEI_PERFORMANCE SDL
token is turned off, the macro does nothing.
Input:
IN EFI_PEI_SERVICES **Ps
Double pointer to the PEI Services Table.

IN CHAR16 *Token
Pointer to token name.

IN EFI_FFS_FILE_HEADER *FileHeader
Pointer to the file header.

IN UINT64 Value
A non-zero value indicates the start time.  Otherwise, GetCpuTimer is used
to get the current CPU timer value.
Output:
VOID.
Modified:
Notes:
This macro is defined in AmiPeiLib.h.
Referrals:
PeiPerfMeasure
GetCpuTimer


PeiGetNextVariableName in the PeiLib.c

Function : PeiGetNextVariableName

File: PeiLib.c
Description:
EFI_STATUS PeiGetNextVariableName(IN EFI_PEI_SERVICES **PeiServices,
IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName,
IN OUT EFI_GUID *VariableGuid) performs enumeration of the EFI variables.
This function serves as a wrapper for the Read Only Variable PPI
GetNextVariableName routine. It locates the Read Only Variable PPI
instance, then makes a call to the GetNextVariableName routine and returns
its EFI_STATUS.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services Table.

IN OUT UINTN *VariableNameSize
On entry, points to the size of the buffer pointed to by VariableName.
If function returns EFI_BUFFER_TOO_SMALL, VariableNameSize is updated to
reflect the buffer size required for the next variable's name.

IN OUT CHAR16 *VariableName
On entry, a pointer to a null-terminated string that is the variable's
name. On return, points to the next variable's null-terminated name
string.

IN OUT EFI_GUID *VariableGuid
On entry, a pointer to an UEFI _GUID that is the variable's GUID. On
return, a pointer to the next variable's GUID.
Output:
EFI_NOT_FOUND,         if the variable or Read Only Variable PPI could
          not be found.
EFI_BUFFER_TOO_SMALL,  if VariableNameSize is too small for the resulting
          data.  VariableNameSize is updated with the size
          required for the specified variable.
EFI_INVALID_PARAMETER, if VariableName, VariableNameSize, or VariableGuid
          are NULL.
EFI_DEVICE_ERROR,      if the variable could not be retrieved because of
          a device error.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
See the Platform Initialization Specification for details regarding
the Read Only Variable PPI and NextVariableName.
Referrals:


PeiGetVariable in the PeiLib.c

Function : PeiGetVariable

File: PeiLib.c
Description:
EFI_STATUS PeiGetNextVariableName(IN EFI_PEI_SERVICES **PeiServices,
IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VariableGuid,
OUT UINT32 *Attributes, IN OUT UINTN *DataSize, OUT VOID *Data) reads an
EFI variable; it serves as a wrapper for the Read Only Variable PPI
GetVariable routine. The functions first locates the Read Only Variable
PPI instance, then makes a call to the GetVariable routine and returns
the EFI_STATUS of the GetVariable call.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services Table.

IN CONST CHAR16 *VariableName
A pointer to a null-terminated string that is the variable's name.

IN CONST EFI_GUID *VariableGuid
A pointer to an EFI_GUID that is the variable's GUID. The combination of
VariableGuid and VariableName must be unique.

OUT UINT32 *Attributes
If non-NULL, on return, points to the variable's attributes.

IN OUT UINTN *DataSize
On entry, points to the size in bytes of the Data buffer. On return,
points to the size of the data returned in Data.

OUT VOID *Data
Points to the buffer which will hold the returned variable value.  The
user is responsible for allocating this memory!
Output:
EFI_BUFFER_TOO_SMALL,  if DataSize is too small to hold the contents of
          the variable.  DataSize will be set to show the
          minimum required size.
EFI_INVALID_PARAMETER, if VariableName, VariableGuid, DataSize, or Data
          are equal to NULL.
EFI_DEVICE_ERROR,      if variable could not be retrieved because of a
          device error.
EFI_NOT_FOUND,         if the variable or Read Only Variable PPI could
          not be found.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
See Platform Initialization Specification for details regarding the
Read Only Variable PPI and GetVariable.
Referrals:


PeiPerfMeasure in the PeiLib.c

Function : PeiPerfMeasure

File: PeiLib.c
Description:
VOID PeiPerfMeasure(IN EFI_PEI_SERVICES **PeiServices, IN CHAR16 *Token,
IN EFI_FFS_FILE_HEADER *FileHeader, IN BOOLEAN EntryExit, IN UINT64 Value)
logs a timestamp count for measuring performance.  See the notes for
proper usage.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to the PEI Services Table.

IN CHAR16 *Token
Pointer to token name.

IN EFI_FFS_FILE_HEADER *FileHeader
Pointer to the file header.

IN BOOLEAN EntryExit
FALSE indicates start, TRUE indicates stop.

IN UINT64 Value
If EntryExit is TRUE, a non-zero value indicates stop time.  Otherwise if
EntryExit is FALSE, a non-zero value indicates start time.
Output:
VOID.
Modified:
Notes:
Use the PEI_PERF_START and PEI_PERF_END macros; this allows performance
monitoring to be enabled or disabled with the PEI_PERFORMANCE SDL token.
Referrals:
GetCpuTimer


PeiTrace in the PeiLib.c

Function : PeiTrace

File: PeiLib.c
Description:
VOID PeiTrace(IN UINTN Level, IN EFI_PEI_SERVICES **ppPS,
IN CHAR8 *sFormat, IN ...) prints a debug message using the
ReportStatusCode from PEI Services if the specified error level is
enabled.
Input:
IN UINTN Level
The error level of the debug message.

IN EFI_PEI_SERVICES **ppPS
Double pointer to PEI Services Table.

IN CHAR8 *sFormat
Format string for the debug message to print.

IN ...
Additional parameters utilized by the format string.
Output:
VOID.
Modified:
Notes:
Use the PEI_TRACE macro for debug messages in PEI!  This allows the
DEBUG_MODE token to control the inclusion of debug messages.  See
Sprintf function for format string syntax.
Referrals:
PrepareStatusCodeString
va_start
va_end
PEI_TRACE
Sprintf


SaveS3PerformanceData in the PeiLib.c

Function : SaveS3PerformanceData

File: PeiLib.c
Description:
VOID SaveS3PerformanceData(IN EFI_PEI_SERVICES **PeiServices) saves the
S3 performance data in an EFI PEI performance HOB.  This should only be
called once, just before the end of PEI.  See notes for proper usage.
Input:
IN EFI_PEI_SERVICES **PeiServices
Double pointer to PEI Services Table.
Output:
VOID.
Modified:
Notes:
To use this function properly, use the PEI_PERF_SAVE_S3_DATA macro.  This
allows the PEI_PERFORMANCE SDL token to control enabling and disabling
performance measurements.
The PEI_PERF_SAVE_S3_DATA macro is used by S3Resume module to log performance data.
Referrals:
GetCpuTimer


PELoader.c

Description:
Loader functions for PE32/PE32+ files.
The functions are used by Core to implement standard image loading API.
Consumers outside Core should not use functions from this file.
The public API should be used instead.

The following functions are used in the file: PELoader.c.

Function | Description
FindPeSection | VOID* FindPeSection(IN UINT8 *pstart, IN UINT64 name, OUT UINTN *pSize) locates a section with the user provided name inside a portable executable (PE) image.
GetDebugDirectory | DEBUG_DIRECTORY* GetDebugDirectory(IN VOID *ptr, OUT UINTN *TeAdjustment) locates and returns the location of DEBUG_DIRECTORY in a terse executable (TE) or portable executable (PE) image.
GetImageSize | UINT32 GetImageSize(IN VOID *p) retrieves the size of a terse executable (TE) image or portable executable (PE) image.
GetName | BOOLEAN GetName(IN UINT8 *p, OUT CHAR8 *sName) retrieves the name of portable executable (PE) or terse executable (TE) image, if it is available.
GetPeOptionalHeader | OPTIONAL_HEADER* GetPeOptionalHeader(IN VOID *p) returns the address of a portable executable (PE) image's optional header.
IsPeImageValid | BOOLEAN IsPeImageValid(IN UINT8 *pstart) reads the header signature of a portable executable (PE) image and returns TRUE if it is valid.
isTeImageValid | BOOLEAN isTeImageValid(IN UINT8 *pstart) reads the header signature of a terse executable (TE) image and returns true if it is valid.
LoadPeImage | VOID* LoadPeImage(IN UINT8 *pold, IN UINT8 *pnew) is a wrapper function for LoadPeImageEx which passes NULL for prealloc.
LoadPeImageEx | VOID* LoadPeImageEx(IN UINT8 *pold, IN UINT8 *pnew, IN UINT8 *prealloc) loads a portal executable into memory from a file.
PEEntryPoint | VOID* PEEntryPoint(IN VOID *p) returns the address of the entry point to a portable executable (PE) image.
ReallocatePeImage | BOOLEAN ReallocatePeImage(IN UINT8 *pcurrent, IN UINT8 *pnew, IN UINT8 *prealloc) loads an already loaded portable executable (PE) image at a new memory location with the proper fixup.
TEEntryPoint | VOID* TEEntryPoint(IN VOID *p) returns the address of the entry point to a terse executable (TE) image.


FindPeSection in the PELoader.c

Function : FindPeSection

File: PELoader.c
Description:
VOID* FindPeSection(IN UINT8 *pstart, IN UINT64 name, OUT UINTN *pSize)
locates a section with the user provided name inside a portable executable
(PE) image.
Input:
IN UINT8 *pstart
Pointer to the start of the image to be searched.

IN UINT64 name
UINT64 name associated with the section to be located.

OUT UINTN *pSize
Contains the size of the located section.
Output:
If located, VOID* pointer to the virtual address of the located section;
otherwise, NULL.
Modified:
Notes:
Referrals:


GetDebugDirectory in the PELoader.c

Function : GetDebugDirectory

File: PELoader.c
Description:
DEBUG_DIRECTORY* GetDebugDirectory(IN VOID *ptr, OUT UINTN *TeAdjustment)
locates and returns the location of DEBUG_DIRECTORY in a terse executable
(TE) or portable executable (PE) image.
Input:
IN VOID *ptr
Pointer to the start of the TE or PE image.

OUT UINTN *TeAdjustment
If ptr is a valid TE image and not NULL, returns the number of bytes
stripped from the header.  If ptr is a PE image, returns 0.
Output:
DEBUG_DIRECTORY* address to the image's DEBUG_DIRECTORY structure.
Modified:
Notes:
Referrals:
isTeImageValid


GetImageSize in the PELoader.c

Function : GetImageSize

File: PELoader.c
Description:
UINT32 GetImageSize(IN VOID *p) retrieves the size of a terse executable
(TE) image or portable executable (PE) image.
Input:
IN VOID *p
Pointer to the start of the TE or PE image.
Output:
UINT32 size of the image.
Modified:
Notes:
Referrals:
GetDebugDirectory


GetName in the PELoader.c

Function : GetName

File: PELoader.c
Description:
BOOLEAN GetName(IN UINT8 *p, OUT CHAR8 *sName) retrieves the name of
portable executable (PE) or terse executable (TE) image, if it is
available.
Input:
IN UINT8 *p
Pointer to the start of the PE or TE image whose name is desired.

OUT CHAR8 *sName
Returns string containing image's name, if it is available.  User is
responsible for allocating the necessary memory resources.
Output:
TRUE, if name is located; otherwise FALSE.
Modified:
Notes:
Referrals:
GetDebugDirectory
Strlen
Strcmp

 MemCpy


GetPeOptionalHeader in the PELoader.c

Function : GetPeOptionalHeader

File: PELoader.c
Description:
OPTIONAL_HEADER* GetPeOptionalHeader(IN VOID *p) returns the address of a
portable executable (PE) image's optional header.
Input:
IN VOID *p
Pointer to the start of the PE image whose optional header is desired.
Output:
OPTIONAL_HEADER* address to the PE image's optional header.
Modified:
Notes:
Referrals:


IsPeImageValid in the PELoader.c

Function : IsPeImageValid

File: PELoader.c
Description:
BOOLEAN IsPeImageValid(IN UINT8 *pstart) reads the header signature of a
portable executable (PE) image and returns TRUE if it is valid.
Input:
IN UINT8 *pstart
Pointer to the start of the PE image.
Output:
FALSE if image is invalid, otherwise TRUE.
Modified:
Notes:
If x64_BUILD enabled, supports both PE32 and PE32+.  Otherwise only
supports PE32.
Referrals:


isTeImageValid in the PELoader.c

Function : isTeImageValid

File: PELoader.c
Description:
BOOLEAN isTeImageValid(IN UINT8 *pstart) reads the header signature of a
terse executable (TE) image and returns true if it is valid.
Input:
IN UINT8 *pstart
Pointer to the start of the TE image.
Output:
FALSE if image is invalid, otherwise TRUE.
Modified:
Notes:
If x64_BUILD enabled, supports both PE32 and PE32+.  Otherwise only
supports PE32.
Referrals:


LoadPeImage in the PELoader.c

Function : LoadPeImage

File: PELoader.c
Description:
VOID* LoadPeImage(IN UINT8 *pold, IN UINT8 *pnew) is a wrapper function
for LoadPeImageEx which passes NULL for prealloc.
Input:
IN UINT8 *pold
Pointer to the start of the file in memory.

IN UINT8 *pnew
Pointer to starting location in memory for the loaded image.
Output:
If successful, VOID* address of the entry point for the newly loaded
image; otherwise, NULL if pold and or pnew are not 16-byte aligned, or
pold does not point to valid PE image.
Modified:
Notes:
Referrals:
LoadPeImageEx


LoadPeImageEx in the PELoader.c

Function : LoadPeImageEx

File: PELoader.c
Description:
VOID* LoadPeImageEx(IN UINT8 *pold, IN UINT8 *pnew, IN UINT8 *prealloc)
loads a portal executable into memory from a file.
Input:
IN UINT8 *pold
Pointer to the start of the file in memory.

IN UINT8 *pnew
Pointer to starting location in memory for the loaded image.

IN UINT8 *prealloc
Pointer to an array of UINTN fixup reallocations.  May be set to NULL.
Output:
If successful, VOID* address of the entry point for the newly loaded
image; otherwise, NULL if pold and or pnew are not 16-byte aligned, or
pold does not point to valid PE image.
Modified:
Notes:
Referrals:
IsPeImageValid

 MemCpy

 MemSet

ReallocatePeImage
GetDebugDirectory


PEEntryPoint in the PELoader.c

Function : PEEntryPoint

File: PELoader.c
Description:
VOID* PEEntryPoint(IN VOID *p) returns the address of the entry point to
a portable executable (PE) image.
Input:
IN VOID *p
Pointer to the start of the PE image whose entry point is desired.
Output:
VOID* address to the entry point of the PE image, p.
Modified:
Notes:
Referrals:


ReallocatePeImage in the PELoader.c

Function : ReallocatePeImage

File: PELoader.c
Description:
BOOLEAN ReallocatePeImage(IN UINT8 *pcurrent, IN UINT8 *pnew,
IN UINT8 *prealloc) loads an already loaded portable executable (PE) image
at a new memory location with the proper fixup.
Input:
IN UINT8 *pcurrent
Pointer to the current location of the PE image in memory.

IN UINT8 *pnew
Pointer to the new location of the PE image in memory.  May be set to the
same value as pcurrent to adjust fixup only.

IN UINT8 *prealloc
Pointer to an array of UINTN fixup reallocations.  May be set to NULL.
Output:
FALSE if image contains an unknown fixup type; otherwise TRUE.
Modified:
Notes:
Can only handle the IA32 or IA64 fix up types.
Referrals:
GetPeOptionalHeader


TEEntryPoint in the PELoader.c

Function : TEEntryPoint

File: PELoader.c
Description:
VOID* TEEntryPoint(IN VOID *p) returns the address of the entry point to
a terse executable (TE) image.
Input:
IN VOID *p
Pointer to the start of the TE image whose entry point is desired.
Output:
VOID* address to the entry point of the TE image, p.
Modified:
Notes:
Referrals:


Print.c

The following functions are used in the file: Print.c.

Function | Description
DevicePathToStr | EFI_STATUS DevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *Path, OUT CHAR8 **Str) convert the provided device path into string. Str is allocated by this routine. It must be freed by the caller.


DevicePathToStr in the Print.c

Function : DevicePathToStr

File: Print.c
Description:
EFI_STATUS DevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *Path,
OUT CHAR8 **Str) convert the provided device path into string.  Str is
allocated by this routine.  It must be freed by the caller.
Input:
IN EFI_DEVICE_PATH_PROTOCOL *Path
The device path which is desired as a string.

OUT CHAR8 **Str
Address to store the pointer for the device path's string.  User is
responsible for freeing this memory.
Output:
EFI_UNSUPPORTED, if string conversion fails.
Otherwise, EFI_SUCCESS.
Modified:
Notes:
This function is intended for debug purpose only.
It does not provide support for all variety of device path types.
Referrals:
NEXT_NODE
MallocZ

 MemCpy


StdLibC.c

Description:
StdLibC.c contains a number of standard C library functions, including
but not limited to string and cctype library functions.

The following functions are used in the file: StdLibC.c.

Function | Description
Atoi | INT32 Atoi(IN CHAR8 *string) converts an ASCII string that represents an integer into an actual INT32 integer value and returns the result.
ItoaEx | CHAR8* ItoaEx(IN INT64 value, IN OUT CHAR8 *string, IN INT32 radix, IN BOOLEAN is_int64) converts an INT64 value into a CHAR8 ASCII representation and returns a pointer to the ASCII string.
ItowEx | CHAR16* ItowEx(IN INT64 value, IN OUT CHAR16 *string, IN INT32 radix, IN BOOLEAN is_int64) converts an INT64 value into a 16-bit Unicode representation and returns a CHAR16 pointer to the string.
Sprintf | UINTN Sprintf(OUT CHAR8 *Buffer, IN CHAR8 *Format, IN ...) produces a null-terminated ASCII string in the output Buffer. The ASCII string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of ASCII characters in the produced output buffer is returned, not including the null-terminator. See notes for format string information.
Sprintf_s | UINTN Sprintf_s(OUT CHAR8 *Buffer, IN UINTN BufferSize, IN CHAR8 *Format, IN ...) produces a null-terminated ASCII string in the output Buffer of size BufferSize. The ASCII string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of ASCII characters in the produced output buffer is returned, not including the null-terminator.
Strcmp | INT32 Strcmp(IN CHAR8 *string1, IN CHAR8 *string2) compares two CHAR8 strings, string1 and string2, and returns 0 if they are identical, non-zero if they are not identical.
Strcpy | CHAR8* Strcpy(IN OUT CHAR8 *string1, IN CHAR8 *string2) copies the contents of a CHAR8 string, string2, into another CHAR8 string, string1.
Strlen | UINTN Strlen(IN CHAR8 *string) takes a null-terminated CHAR8 string and returns its UINTN length (not including the null-terminator).
Strstr | CHAR8* Strstr(IN CONST CHAR8 *string, IN CONST CHAR8 *strSearch) locates strSearch within string, and returns a pointer to the start of the located string.
StrtolEx | INT64 StrtolEx(IN CHAR8 *nptr, OUT CHAR8 **endptr, IN INT32 base, IN INT32 increment) converts a CHAR8 string representation of a number into an INT64 representation.
Strupr | CHAR8* Strupr(IN CHAR8 *str) converts a CHAR8 string to all uppercase characters.
Swprintf | UINTN Swprintf(OUT CHAR16 *Buffer, IN CHAR16 *Format, IN ...) produces a null-terminated Unicode string in the output Buffer. The Unicode string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of Unicode characters in the produced output buffer is returned, not including the null-terminator.
Swprintf_s | UINTN Swprintf_s(OUT CHAR16 *Buffer, IN UINTN BufferSize, IN CHAR16 *Format, IN ...) produces a null-terminated Unicode string in the output Buffer of size BufferSize. The Unicode string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of Unicode characters in the produced output buffer is returned, not including the null-terminator.
Toupper | INT32 Toupper(IN INT32 c) converts a lowercase ASCII character, c, to an uppercase ASCII character and returns its uppercase ASCII value. If c is not a valid lowercase ASCII character, returns c.
Wcscmp | INT32 Wcscmp(IN CHAR16 *string1, IN CHAR16 *string2) compares two CHAR16 strings, string1 and string2, and returns 0 if they are identical, non-zero if they are not identical.
Wcscpy | CHAR16* Wcscpy(IN OUT CHAR16 *string1, IN CHAR16 *string2) copies the contents of a CHAR16 string, string2, into another CHAR16 string, string1.
Wcslen | UINTN Wcslen(IN CHAR16 *string) takes a null-terminated CHAR16 string and returns its UINTN length (not including the null-terminator).
Wcsupr | CHAR16* Wcsupr(IN CHAR16 *str) converts a CHAR16 string to all uppercase characters.

The following descriptions are used in the file: StdLibC.c.

Header | Description
Cstring_Functions | C string handling functions, typically found in string.h, that are defined in the AMI library.
Ctype_Functions | C character handling functions, typically found in ctype.h, that are defined in the AMI library.
Stdio_Functions | C standard I/O functions, typically found in stdio.h, that are defined in the AMI library.
Stdlib_Functions | C standard general utilities library functions, typically found in stdlib.h, that are defined in the AMI library.
String_Functions | String related functions that are defined in the AMI library.


Atoi in the StdLibC.c

Function : Atoi

File: StdLibC.c
Description:
INT32 Atoi(IN CHAR8 *string) converts an ASCII string that represents an
integer into an actual INT32 integer value and returns the result.
Input:
IN CHAR8 *string
Pointer to a CHAR8 string that represents an integer number.
Output:
INT32 value that the string represented.
Modified:
Notes:
Referrals:


Cstring_Functions in the StdLibC.c

General : Cstring_Functions

File: StdLibC.c
Fields:

Header | Function | Description
AmiLib | Strlen | Find length of null-terminated 8-bit ASCII string.
AmiLib | Wcslen | Find length of null-terminated 16-bit Unicode string.
AmiLib | Strcpy | Copy an 8-bit ASCII string into another string.
AmiLib | Wcscpy | Copy a 16-bit Unicode string into another string.
AmiLIb | MemCpy | Copy a buffer into another buffer.
AmiLib | Strcmp | Compare two 8-bit ASCII strings to each other.
AmiLib | Wcscmp | Compare two 16-bit Unicode strings to each other.
AmiLib | MemCmp | Compare two buffers for equality.
AmiLib | Strupr | Convert an 8-bit ASCII string into all uppercase characters.
AmiLib | Wcsupr | Convert a 16-bit Unicode string to all uppercase characters.
AmiLib | Strstr | Find an occurrence of an 8-bit ASCII string inside another string.
AmiLib | MemSet | Fills a buffer with a user provided value.

Description:
C string handling functions, typically found in string.h, that are
defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions; append .h to the given name.  None indicates that
no header file contains a function prototype.


Ctype_Functions in the StdLibC.c

General : Ctype_Functions

File: StdLibC.c
Fields:

Header | Function | Description
None | Toupper | Convert lowercase 8-bit ASCII character to uppercase.

Description:
C character handling functions, typically found in ctype.h, that are
defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions; append .h to the given name.  None indicates that
no header file contains a function prototype.


ItoaEx in the StdLibC.c

Function : ItoaEx

File: StdLibC.c
Description:
CHAR8* ItoaEx(IN INT64 value, IN OUT CHAR8 *string, IN INT32 radix,
IN BOOLEAN is_int64) converts an INT64 value into a CHAR8 ASCII
representation and returns a pointer to the ASCII string.
Input:
IN INT64 value
Value that needs to be converted into an ASCII representation.

IN OUT CHAR8 *string
Pointer to a CHAR8 string buffer which will contain the result of the
conversion.  User is responsible for allocating the necessary memory
resources.

IN INT32 radix
Radix of the conversion.  For example, 10 for decimal, 16 for hexadecimal,
etc.

IN BOOLEAN is_int64
TRUE if value is a 64-bit integer; FALSE if it's 32-bit.
Output:
CHAR8* string pointer, string, that contains the ASCII representation of
value in the user requested radix.
Modified:
Notes:
Referrals:
ItoaHelper


ItowEx in the StdLibC.c

Function : ItowEx

File: StdLibC.c
Description:
CHAR16* ItowEx(IN INT64 value, IN OUT CHAR16 *string, IN INT32 radix,
IN BOOLEAN is_int64) converts an INT64 value into a 16-bit Unicode
representation and returns a CHAR16 pointer to the string.
Input:
IN INT64 value
Value that needs to be converted into an ASCII representation.

IN OUT CHAR16 *string
Pointer to a CHAR8 string buffer which will contain the result of the
conversion.

IN INT32 radix
Radix of the conversion.  For example, 10 for decimal, 16 for hexadecimal,
etc.

IN BOOLEAN is_int64
TRUE if value is a 64-bit integer; FALSE if it's 32-bit.
Output:
CHAR16* string pointer, string, that contains the 16-bit Unicode
representation of value in the user requested radix.
Modified:
Notes:
Referrals:
ItoaHelper


Sprintf in the StdLibC.c

Function : Sprintf

File: StdLibC.c
Description:
UINTN Sprintf(OUT CHAR8 *Buffer, IN CHAR8 *Format, IN ...) produces a
null-terminated ASCII string in the output Buffer.  The ASCII string is
produced by parsing the format string specified by Format.  Arguments are
pulled from the variable argument list based on the contents of the format
string.  The number of ASCII characters in the produced output buffer is
returned, not including the null-terminator. See notes for format string
information.
Input:
OUT CHAR8 *Buffer
Pointer to a null-terminated output ASCII string buffer.  User is
responsible for allocating the necessary memory resources!

IN CHAR8 *Format
Pointer to a null-terminated format ASCII string.

IN ...
Variable argument list which provides the data/variables used within the
format string.
Output:
UINTN number of ASCII characters in the produced output buffer, not
including the null-terminator.
Modified:
Notes:
Objects inside the format string have the following syntax.
%[flags][width]type

*** [flags] ***
. Flag  .  Description
. -     .  The field is left justified.  If flag is not specified, then
.       . the field is right justified.
. space .  Prefix a space character to a number.  Only valid for types X,
.       . x, and d.
. +     .  Prefix a plus character to a number.  Only valid for types X,
.       . x, and d.  If both space and `+' are specified, then space is
.       . ignored.
. 0     .  Pad with `0' characters to the left of a number.  Only valid
.       . for types X, x, and d.
. L, l  .  The number being printed is a UINT64.  Only valid for types X,
.       . x, and d.  If this flag is not specified, then the number being
.       . printed is an int.
NOTE
All invalid [flags] are ignored.

*** [width] ***
. Width  .  Description
. *      .  The width of the field is specified by a UINTN argument in the
.        . argument list.
. Number .  The number specified as a decimal value represents the width of
.        . the field.
NOTE
If [width] is not specified, then a field width of 0 is assumed.

*** type ***
. Type  .  Description
. %     .  Print a `%'.
. c     .  The argument is an ASCII character.
. x     .  The argument is a hexadecimal number.  The characters used are
.       . 0..9 and a..f.  If the flag `l' is not specified, then the
.       . argument is assumed to be an int.
. X     .  The argument is a hexadecimal number.  The characters used are
.       . 0..9 and A..F.  If the flag `l' is not specified, then the
.       . argument is assumed to be an int.
. d     .  The argument is a decimal number.  If the flag `l' is not
.       . specified, then the argument is assumed to be an int.
. i     .  The same as `d'.
. s     .  The argument is a pointer to null-terminated ASCII string.
. a     .  The same as `s'.
. S     .  The argument is a pointer to a null-terminated Unicode string.
. g     .  The argument is a pointer to a GUID structure.  The GUID is
.       . printed in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
. G     .  The argument is a pointer to a GUID structure.  The GUID is
.       . printed in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
. r     .  The argument is an EFI_STATUS value.  This value is converted
.       . to a string.
NOTE
All invalid type characters are copied into the result string.
Referrals:
va_start
Sprintf_va_list
va_end


Sprintf_s in the StdLibC.c

Function : Sprintf_s

File: StdLibC.c
Description:
UINTN Sprintf_s(OUT CHAR8 *Buffer, IN UINTN BufferSize, IN CHAR8 *Format,
IN ...) produces a null-terminated ASCII string in the output Buffer of
size BufferSize.  The ASCII string is produced by parsing the format
string specified by Format.  Arguments are pulled from the variable
argument list based on the contents of the format string.  The number of
ASCII characters in the produced output buffer is returned, not including
the null-terminator.
Input:
OUT CHAR8 *Buffer
Pointer to a null-terminated output ASCII string buffer.  User is
responsible for allocating the necessary memory resources!

IN UINTN BufferSize
The size, in bytes, of the output Buffer.

IN CHAR8 *Format
Pointer to a null-terminated format ASCII string.

IN ...
Variable argument list of data/variables used within the format string.
Output:
UINTN number of ASCII characters in the produced output buffer, not
including the null-terminator.
Modified:
Notes:
Refer to Sprintf function for format string syntax.
Referrals:
va_start
Sprintf_s_va_list
va_end


Stdio_Functions in the StdLibC.c

General : Stdio_Functions

File: StdLibC.c
Fields:

Header | Function | Description
AmiLib | Sprintf | Print a formatted 8-bit ASCII string to a buffer.
AmiLib | Swprintf | Print a formatted 16-bit Unicode string to a buffer.
AmiLib | Sprintf_s | Print a formatted 8-bit ASCII string to a buffer of predetermined size.
AmiLib | Swprintf_s | Print a formatted 16-bit Unicode string to a buffer of predetermined size.

Description:
C standard I/O functions, typically found in stdio.h, that are
defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions; append .h to the given name.  None indicates that
no header file contains a function prototype.


Stdlib_Functions in the StdLibC.c

General : Stdlib_Functions

File: StdLibC.c
Fields:

Header | Function | Description
AmiLib | Atoi | Convert 8-bit ASCII string to INT32.
AmiLib | StrtolEx | Convert 8-bit ASCII string to INT64.
AmiLib | ItoaEx | Convert INT64 to 8-bit ASCII string.
AmiLib | ItowEx | Convert INT64 to 16-bit Unicode string.
AmiDxeLib | Malloc | Allocate memory from EfiBootServicesData.
AmiDxeLib | MallocZ | Allocate memory from EfiBootServicesData that has been cleared with zeros.

Description:
C standard general utilities library functions, typically found in
stdlib.h, that are defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions; append .h to the given name.  None indicates that
no header file contains a function prototype.


Strcmp in the StdLibC.c

Function : Strcmp

File: StdLibC.c
Description:
INT32 Strcmp(IN CHAR8 *string1, IN CHAR8 *string2) compares two CHAR8
strings, string1 and string2, and returns 0 if they are identical,
non-zero if they are not identical.
Input:
IN CHAR8 *string1
Pointer to a CHAR8 null-terminated string.

IN CHAR8 *string2
Pointer to a CHAR8 null-terminated string.
Output:
INT32 non-zero value if both string1 and string2 are not identical.
Otherwise, returns 0 if both string1 and string 2 are identical.
Modified:
Notes:
Referrals:


Strcpy in the StdLibC.c

Function : Strcpy

File: StdLibC.c
Description:
CHAR8* Strcpy(IN OUT CHAR8 *string1, IN CHAR8 *string2) copies the
contents of a CHAR8 string, string2, into another CHAR8 string, string1.
Input:
IN OUT CHAR8 *string1
Pointer to a CHAR8 string buffer to receive the contents of string2.
String size must be greater than or equal to string2.  User is
responsible for allocating the necessary memory resources.

IN CHAR8 *string2
Pointer to a null-terminated CHAR8 string to be copied.
Output:
CHAR8* string pointer to the last character added to string1.
Modified:
Notes:
Referrals:


String_Functions in the StdLibC.c

General : String_Functions

File: StdLibC.c
Fields:

Header | Function | Description
AmiLib | Strlen | Find length of null-terminated 8-bit ASCII string.
AmiLib | Wcslen | Find length of null-terminated 16-bit Unicode string.
AmiLib | Strcpy | Copy an 8-bit ASCII string into another string.
AmiLib | Wcscpy | Copy a 16-bit Unicode string into another string.
AmiLib | Strcmp | Compare two 8-bit ASCII strings to each other.
AmiLib | Wcscmp | Compare two 16-bit Unicode strings to each other.
AmiLib | Strupr | Convert an 8-bit ASCII string into all uppercase characters.
AmiLib | Wcsupr | Convert a 16-bit Unicode string to all uppercase characters.
AmiLib | Strstr | Find an occurrence of an 8-bit ASCII string inside another string.
AmiLib | Sprintf | Print a formatted 8-bit ASCII string to a buffer.
AmiLib | Swprintf | Print a formatted 16-bit Unicode string to a buffer.
AmiLib | Sprintf_s | Print a formatted 8-bit ASCII string to a buffer of predetermined size.
AmiLib | Swprintf_s | Print a formatted 16-bit Unicode string to a buffer of predetermined size.
AmiLib | ItoaEx | Convert INT64 to 8-bit ASCII string.
AmiLib | ItowEx | Convert INT64 to 16-bit Unicode string.

Description:
String related functions that are defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions; append .h to the given name.  None indicates that
no header file contains a function prototype.


Strlen in the StdLibC.c

Function : Strlen

File: StdLibC.c
Description:
UINTN Strlen(IN CHAR8 *string) takes a null-terminated CHAR8 string and
returns its UINTN length (not including the null-terminator).
Input:
IN CHAR8 *string
Pointer to a null-terminated CHAR8 string.
Output:
UINTN length of the string (not including the null-terminator).
Modified:
Notes:
Referrals:


Strstr in the StdLibC.c

Function : Strstr

File: StdLibC.c
Description:
CHAR8* Strstr(IN CONST CHAR8 *string, IN CONST CHAR8 *strSearch) locates
strSearch within string, and returns a pointer to the start of the located
string.
Input:
IN CONST CHAR8 *string
The string to be searched through.

IN CONST CHAR8 *strSearch
The string to locate/find.
Output:
CHAR8* string pointer to the start of the located string if strSearch is
located.  If not found, returns a pointer to the end of the input string.
If strSearch is an empty null-terminated string, returns the start of
string.
Modified:
Notes:
Referrals:


StrtolEx in the StdLibC.c

Function : StrtolEx

File: StdLibC.c
Description:
INT64 StrtolEx(IN CHAR8 *nptr, OUT CHAR8 **endptr, IN INT32 base,
IN INT32 increment) converts a CHAR8 string representation of a number
into an INT64 representation.
Input:
IN CHAR8 *nptr
CHAR8 string to be converted into an INT64.

OUT CHAR8 **endptr
CHAR8 string pointer to the final character read from nptr.

IN INT32 base
The base of the string being passed in.  If 0, string will be parsed by
defaults; preceding "0x" treated as hexadecimal, preceding "0" treated as
octal, everything else treated as decimal.

IN INT32 increment
The number of characters in between each number digit.  For example,
"14131" would be 1; "1 4 1 3 1" would be 2.
Output:
INT64 representation of the number in the ASCII nptr string using the
provided base and increment amount.
Modified:
Notes:
Referrals:


Strupr in the StdLibC.c

Function : Strupr

File: StdLibC.c
Description:
CHAR8* Strupr(IN CHAR8 *str) converts a CHAR8 string to all uppercase
characters.
Input:
IN CHAR8 *str
CHAR8 string to be converted to all uppercase.
Output:
CHAR8* string pointer to the start of the modified string.
Modified:
Notes:
Original string will be modified!
Referrals:


Swprintf in the StdLibC.c

Function : Swprintf

File: StdLibC.c
Description:
UINTN Swprintf(OUT CHAR16 *Buffer, IN CHAR16 *Format, IN ...) produces a
null-terminated Unicode string in the output Buffer. The Unicode string is
produced by parsing the format string specified by Format.  Arguments are
pulled from the variable argument list based on the contents of the format
string.  The number of Unicode characters in the produced output buffer is
returned, not including the null-terminator.
Input:
OUT CHAR16 *Buffer
Pointer to a null-terminated output Unicode string buffer.  User is
responsible for allocating the necssary memory resources!

IN CHAR16 *Format
Pointer to a null-terminated format Unicode string.

IN ...
Variable arguement list of data/variables used within the format string.
Output:
UINTN number of Unicode characters in the produced output buffer, not
including the null-terminator.
Modified:
Notes:
See Sprintf function for format string details.
Referrals:
va_start
Swprintf_va_list
va_end


Swprintf_s in the StdLibC.c

Function : Swprintf_s

File: StdLibC.c
Description:
UINTN Swprintf_s(OUT CHAR16 *Buffer, IN UINTN BufferSize,
IN CHAR16 *Format, IN ...) produces a null-terminated Unicode string in
the output Buffer of size BufferSize.  The Unicode string is produced by
parsing the format string specified by Format.  Arguments are pulled from
the variable argument list based on the contents of the format string.
The number of Unicode characters in the produced output buffer is
returned, not including the null-terminator.
Input:
OUT CHAR16 *Buffer
Pointer to a null-terminated output Unicode string buffer.  User is
responsible for allocating the necessary memory resources!

IN UINTN BufferSize
The size, in bytes, of the output Buffer.

IN CHAR16 *Format
Pointer to a null-terminated format Unicode string.

IN ...
Variable argument list of data/variables used within the format string.
Output:
UINTN number of Unicode characters in the produced output buffer, not
including the null-terminator.
Modified:
Notes:
Refer to Sprintf function for format string syntax.
Referrals:
va_start
Swprintf_s_va_list
va_end


Toupper in the StdLibC.c

Function : Toupper

File: StdLibC.c
Description:
INT32 Toupper(IN INT32 c) converts a lowercase ASCII character, c, to an
uppercase ASCII character and returns its uppercase ASCII value.  If c is
not a valid lowercase ASCII character, returns c.
Input:
IN INT32 c
ASCII value to be converted from lowercase to uppercase.
Output:
INT32 value of c, if c is not a valid lowercase ASCII character.
Otherwise, INT32 ASCII value of c as an uppercase letter.
Modified:
Notes:
Referrals:


Wcscmp in the StdLibC.c

Function : Wcscmp

File: StdLibC.c
Description:
INT32 Wcscmp(IN CHAR16 *string1, IN CHAR16 *string2) compares two CHAR16
strings, string1 and string2, and returns 0 if they are identical,
non-zero if they are not identical.
Input:
IN CHAR16 *string1
Pointer to a CHAR16 null-terminated string.

IN CHAR16 *string2
Pointer to a CHAR16 null-terminated string.
Output:
INT32 non-zero value if both string1 and string2 are not identical.
Otherwise, returns 0 if both string1 and string 2 are identical.
Modified:
Notes:
Referrals:


Wcscpy in the StdLibC.c

Function : Wcscpy

File: StdLibC.c
Description:
CHAR16* Wcscpy(IN OUT CHAR16 *string1, IN CHAR16 *string2) copies the
contents of a CHAR16 string, string2, into another CHAR16 string, string1.
Input:
IN OUT CHAR16 *string1
Pointer to a CHAR16 string buffer to receive the contents of string2.
String size must be greater than or equal to string2.  User is
responsible for allocating the necessary memory resources.

IN CHAR16 *string2
Pointer to a null-terminated CHAR16 string to be copied.
Output:
CHAR16* string pointer to the last character added to string1.
Modified:
Notes:
Referrals:


Wcslen in the StdLibC.c

Function : Wcslen

File: StdLibC.c
Description:
UINTN Wcslen(IN CHAR16 *string) takes a null-terminated CHAR16 string and
returns its UINTN length (not including the null-terminator).
Input:
IN CHAR16 *string
Pointer to a null-terminated CHAR16 string.
Output:
UINTN length of the string (not including the null-terminator).
Modified:
Notes:
Referrals:


Wcsupr in the StdLibC.c

Function : Wcsupr

File: StdLibC.c
Description:
CHAR16* Wcsupr(IN CHAR16 *str) converts a CHAR16 string to all uppercase
characters.
Input:
IN CHAR16 *str
CHAR16 string to be converted to all uppercase.
Output:
CHAR16* string pointer to the start of the modified string.
Modified:
Notes:
Original string will be modified!
Referrals:


x64AsmLib.asm

Description:
Generic CPU library functions for the x64 architecture.

The following functions are used in the file: x64AsmLib.asm.

Function | Description
checkpoint | VOID checkpoint(IN UINT8 c) writes the value c to port 0x80.
CPULib_CpuID | VOID CPULib_CpuID(IN UINT32 CpuIDIndex, IN UINT32 *pRegEAX, IN UINT32 *pRegEBX, IN UINT32 *pRegECX, IN UINT32 *pRegEDX) issues the CPUID instruction with the index provided and returns the register values.
CPULib_DisableInterrupt | VOID CPULib_DisableInterrupt() disables interrupts on the CPU.
CPULib_EnableInterrupt | VOID CPULib_EnableInterrupt() enables interrupts on the CPU.
CPULib_GetInterruptState | BOOLEAN CPULib_GetInterruptState()returns the current CPU interrupt state.
CPULIB_GetPageTable | VOID* CPULIB_GetPageTable() retrieves the address of the page table.
CPULib_LoadGdt | VOID CPULib_LoadGdt(IN VOID *ptr) loads the GDT at the location pointed to by ptr.
CPULib_LoadIdt | VOID CPULib_LoadIdt(IN VOID *ptr) loads the IDT at the location provided by ptr.
CPULib_LockByteDec | VOID CPULib_LockByteDec(IN UINT8 *ptr) locks the preceeding byte before the address pointed to by ptr.
CPULib_LockByteInc | VOID CPULib_LockByteInc(IN UINT8 *ptr) locks the next byte after the address pointed to by ptr.
CPULib_Pause | VOID CPULib_Pause() performs the pause assembly instruction.
CPULib_SaveGdt | VOID CPULib_SaveGdt(IN VOID *ptr) stores the loaded GDT at the location provided by ptr.
CPULib_SaveIdt | VOID CPULib_SaveIdt(IN VOID *ptr) stores the loaded IDT at the location provided by ptr.
DisableCacheInCR0 | VOID DisableCacheInCR0() disables the CPU cache using the CR0 register.
EnableCacheInCR0 | VOID EnableCacheInCR0() enables the CPU cache using the CR0 register.
EnableMachineCheck | VOID EnableMachineCheck() sets the Machine Check Exception bit in CR4, which enables machine check interrupts to occur.
GetCpuTimer | UINT64 GetCpuTimer() returns the value of the CPU timer.
GetCsSegment | UINT16 GetCsSegment() retreives the value of the CS register.
GetPowerOfTwo64 | UINT64 GetPowerOfTwo64(IN UINT64 Input) returns the highest bit set in the provided UINT64 Input. Equivalent to 1 << log2(x).
HltCpu | VOID HltCpu() halts the CPU.
IoRead16 | UINT16 IoRead16(IN UINT16 Port) reads the 16-bit value stored at the I/O port defined by Port.
IoRead32 | UINT32 IoRead32(IN UINT16 Port) reads the 32-bit value stored at the I/O port defined by Port.
IoRead64 | UINT32 IoRead64(IN UINT16 Port) reads the 64-bit value stored at the I/O port defined by Port.
IoRead8 | UINT8 IoRead8(IN UINT16 Port) reads the 8-bit value stored at the I/O port defined by Port.
IoWrite16 | VOID IoWrite16(IN UINT16 Port, IN UINT16 Value) writes the 16-bit Value to the I/O port defined by Port.
IoWrite32 | VOID IoWrite32(IN UINT16 Port, IN UINT32 Value) writes the 32-bit Value to the I/O port defined by Port.
IoWrite64 | VOID IoWrite64(IN UINT16 Port, IN UINT64 Value) writes the 64-bit Value to the I/O port defined by Port.
IoWrite8 | VOID IoWrite8(IN UINT16 Port, IN UINT8 Value) writes the 8-bit Value to the I/O port defined by Port.
MemCpy | VOID MemCpy (OUT VOID *pDestination, IN VOID *pSource, IN UINTN Count) copies Count bytes of memory from Source to Destination.
MemRead32 | UINT32 MemRead32(IN UINT32 *Address) reads and returns the 32-bit value stored at the user provided address.
MemReadWrite32 | VOID MemReadWrite32(IN UINT32 *Address, IN UINT32 Value, IN UINT32 Mask) reads the 32-bit value stored at Address, ANDs it with Mask, ORs the result with Value, then writes the result back to Address.
MemSet | VOID MemSet (IN VOID *pBuffer, IN UINTN Count, IN UINT8 Value) fills Count bytes of memory in pBuffer with Value.
ReadCr3 | UINTN ReadCr3() reads the register CR3 and returns its value.
ReadMsr | UINT64 ReadMsr(UINT32 Msr) reads the CPU MSR index defined by Msr and returns the value.
ReadRtdsc | UINT64 ReadRtdsc() retrieves the time stamp counter.
WaitForever | VOID WaitForever() performs an infinite loop which does nothing.
WaitForSemaphore | VOID WaitForSemaphore(IN volatile UINT8 *Semaphore) waits for the semaphore to become available; once available, it claims the semaphore and returns.
WaitUntilZero32 | VOID WaitUntilZero32(IN volatile UINT32 *Value) waits until the UINT32 value stored at the Value address becomes 0, then continues.
WaitUntilZero8 | VOID WaitUntilZero8(IN volatile UINT8 *Value) waits until the byte stored at Value becomes 0, then continues.
WriteCr3 | VOID WriteCr3(IN UINTN CR3) writes the provided value to the CR3 register.
WriteMsr | VOID WriteMsr(IN UINT32 Msr, IN UINT64 Value) writes the Value to the supplied MSR index, Msr.


checkpoint in the x64AsmLib.asm

Function : checkpoint

File: x64AsmLib.asm
Description:
VOID checkpoint(IN UINT8 c) writes the value c to port 0x80.
Input:
IN UINT8 c
The value/checkpoint to write to 0x80.
Output:
VOID.
Modified:
Notes:
This routine should only be used if the PROGRESS_CODE or
PEI_PROGRESS_CODE macros are unavailable.
Referrals:


CPULib_CpuID in the x64AsmLib.asm

Function : CPULib_CpuID

File: x64AsmLib.asm
Description:
VOID CPULib_CpuID(IN UINT32 CpuIDIndex, IN UINT32 *pRegEAX,
IN UINT32 *pRegEBX, IN UINT32 *pRegECX, IN UINT32 *pRegEDX) issues the
CPUID instruction with the index provided and returns the register values.
Input:
IN UINT32 CpuIDIndex
32-bit CPUID index.

IN UINT32 *pRegEAX
Value of EAX after CPUID instruction.

IN UINT32 *pRegEBX
Value of EBX after CPUID instruction.

IN UINT32 *pRegECX
Value of ECX after CPUID instruction.

IN UINT32 *pRegEDX
Value of EDX after CPUID instruction.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_DisableInterrupt in the x64AsmLib.asm

Function : CPULib_DisableInterrupt

File: x64AsmLib.asm
Description:
VOID CPULib_DisableInterrupt() disables interrupts on the CPU.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_EnableInterrupt in the x64AsmLib.asm

Function : CPULib_EnableInterrupt

File: x64AsmLib.asm
Description:
VOID CPULib_EnableInterrupt() enables interrupts on the CPU.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_GetInterruptState in the x64AsmLib.asm

Function : CPULib_GetInterruptState

File: x64AsmLib.asm
Description:
BOOLEAN CPULib_GetInterruptState()returns the current CPU interrupt state.
Input:
VOID.
Output:
FALSE if interrupts are disabled; otherwise TRUE.
Modified:
Notes:
Referrals:


CPULIB_GetPageTable in the x64AsmLib.asm

Function : CPULIB_GetPageTable

File: x64AsmLib.asm
Description:
VOID* CPULIB_GetPageTable() retrieves the address of the page table.
Input:
VOID.
Output:
VOID* address of the page table.
Modified:
Notes:
Referrals:


CPULib_LoadGdt in the x64AsmLib.asm

Function : CPULib_LoadGdt

File: x64AsmLib.asm
Description:
VOID CPULib_LoadGdt(IN VOID *ptr) loads the GDT at the location pointed to
by ptr.
Input:
IN VOID *ptr
Address of the GDT to be loaded.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_LoadIdt in the x64AsmLib.asm

Function : CPULib_LoadIdt

File: x64AsmLib.asm
Description:
VOID CPULib_LoadIdt(IN VOID *ptr) loads the IDT at the location provided
by ptr.
Input:
IN VOID *ptr
Address of the IDT to be loaded.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_LockByteDec in the x64AsmLib.asm

Function : CPULib_LockByteDec

File: x64AsmLib.asm
Description:
VOID CPULib_LockByteDec(IN UINT8 *ptr) locks the preceeding byte before
the address pointed to by ptr.
Input:
IN UINT8 *ptr
Address to the byte which follows the desired byte to be locked.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_LockByteInc in the x64AsmLib.asm

Function : CPULib_LockByteInc

File: x64AsmLib.asm
Description:
VOID CPULib_LockByteInc(IN UINT8 *ptr) locks the next byte after the
address pointed to by ptr.
Input:
IN UINT8 *ptr
Address to the byte which preceeds the desired byte to be locked.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_Pause in the x64AsmLib.asm

Function : CPULib_Pause

File: x64AsmLib.asm
Description:
VOID CPULib_Pause() performs the pause assembly instruction.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_SaveGdt in the x64AsmLib.asm

Function : CPULib_SaveGdt

File: x64AsmLib.asm
Description:
VOID CPULib_SaveGdt(IN VOID *ptr) stores the loaded GDT at the location
provided by ptr.
Input:
IN VOID *ptr
Address to save the GDT.  User is responsible for allocating the necessary
memory resources.
Output:
VOID.
Modified:
Notes:
Referrals:


CPULib_SaveIdt in the x64AsmLib.asm

Function : CPULib_SaveIdt

File: x64AsmLib.asm
Description:
VOID CPULib_SaveIdt(IN VOID *ptr) stores the loaded IDT at the location
provided by ptr.
Input:
IN VOID *ptr
Address to save the IDT.  User is responsible for allocating the necessary
memory resources.
Output:
VOID.
Modified:
Notes:
Referrals:


DisableCacheInCR0 in the x64AsmLib.asm

Function : DisableCacheInCR0

File: x64AsmLib.asm
Description:
VOID DisableCacheInCR0() disables the CPU cache using the CR0 register.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


EnableCacheInCR0 in the x64AsmLib.asm

Function : EnableCacheInCR0

File: x64AsmLib.asm
Description:
VOID EnableCacheInCR0() enables the CPU cache using the CR0 register.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


EnableMachineCheck in the x64AsmLib.asm

Function : EnableMachineCheck

File: x64AsmLib.asm
Description:
VOID EnableMachineCheck() sets the Machine Check Exception bit in CR4,
which enables machine check interrupts to occur.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


GetCpuTimer in the x64AsmLib.asm

Function : GetCpuTimer

File: x64AsmLib.asm
Description:
UINT64 GetCpuTimer() returns the value of the CPU timer.
Input:
None.
Output:
UINT64 value of the CPU timer.
Modified:
Notes:
Referrals:


GetCsSegment in the x64AsmLib.asm

Function : GetCsSegment

File: x64AsmLib.asm
Description:
UINT16 GetCsSegment() retreives the value of the CS register.
Input:
VOID.
Output:
UINT16 value of CS.
Modified:
Notes:
Referrals:


GetPowerOfTwo64 in the x64AsmLib.asm

Function : GetPowerOfTwo64

File: x64AsmLib.asm
Description:
UINT64 GetPowerOfTwo64(IN UINT64 Input) returns the highest bit set in
the provided UINT64 Input.  Equivalent to 1 << log2(x).
Input:
IN UINT64 Input
The 64-bit value to check for its highest bit.
Output:
UINT64 value of the highest bit; if Input is 0, returns 0.
Modified:
Notes:
Referrals:


HltCpu in the x64AsmLib.asm

Function : HltCpu

File: x64AsmLib.asm
Description:
VOID HltCpu() halts the CPU.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


IoRead16 in the x64AsmLib.asm

Function : IoRead16

File: x64AsmLib.asm
Description:
UINT16 IoRead16(IN UINT16 Port) reads the 16-bit value stored at the I/O
port defined by Port.
Input:
IN UINT16 Port
I/O port to read 16-bits from.
Output:
UINT16 value stored at I/O Port.
Modified:
Notes:
Referrals:


IoRead32 in the x64AsmLib.asm

Function : IoRead32

File: x64AsmLib.asm
Description:
UINT32 IoRead32(IN UINT16 Port) reads the 32-bit value stored at the I/O
port defined by Port.
Input:
IN UINT16 Port
I/O port to read 32-bits from.
Output:
UINT32 value stored at I/O Port.
Modified:
Notes:
Referrals:


IoRead64 in the x64AsmLib.asm

Function : IoRead64

File: x64AsmLib.asm
Description:
UINT32 IoRead64(IN UINT16 Port) reads the 64-bit value stored at the I/O
port defined by Port.
Input:
IN UINT16 Port
I/O port to read 64-bits from.
Output:
UINT64 value stored at I/O Port.
Modified:
Notes:
Referrals:


IoRead8 in the x64AsmLib.asm

Function : IoRead8

File: x64AsmLib.asm
Description:
UINT8 IoRead8(IN UINT16 Port) reads the 8-bit value stored at the I/O
port defined by Port.
Input:
IN UINT16 Port
I/O port to read 8-bits from.
Output:
UINT8 value stored at I/O Port.
Modified:
Notes:
Referrals:


IoWrite16 in the x64AsmLib.asm

Function : IoWrite16

File: x64AsmLib.asm
Description:
VOID IoWrite16(IN UINT16 Port, IN UINT16 Value) writes the 16-bit Value
to the I/O port defined by Port.
Input:
IN UINT16 Port
I/O port to write 16-bits to.

IN UINT16 Value
16-bits to write to the I/O Port.
Output:
VOID.
Modified:
Notes:
Referrals:


IoWrite32 in the x64AsmLib.asm

Function : IoWrite32

File: x64AsmLib.asm
Description:
VOID IoWrite32(IN UINT16 Port, IN UINT32 Value) writes the 32-bit Value
to the I/O port defined by Port.
Input:
IN UINT16 Port
I/O port to write 32-bits to.

IN UINT32 Value
32-bits to write to the I/O Port.
Output:
VOID.
Modified:
Notes:
Referrals:


IoWrite64 in the x64AsmLib.asm

Function : IoWrite64

File: x64AsmLib.asm
Description:
VOID IoWrite64(IN UINT16 Port, IN UINT64 Value) writes the 64-bit Value
to the I/O port defined by Port.
Input:
IN UINT16 Port
I/O port to write 64-bits to.

IN UINT64 Value
64-bits to write to the I/O Port.
Output:
VOID.
Modified:
Notes:
Referrals:


IoWrite8 in the x64AsmLib.asm

Function : IoWrite8

File: x64AsmLib.asm
Description:
VOID IoWrite8(IN UINT16 Port, IN UINT8 Value) writes the 8-bit Value to
the I/O port defined by Port.
Input:
IN UINT16 Port
I/O port to write 8-bits to.

IN UINT8 Value
8-bits to write to the I/O Port.
Output:
VOID.
Modified:
Notes:
Referrals:


MemCpy in the x64AsmLib.asm

Function : MemCpy

File: x64AsmLib.asm
Description:
VOID

 MemCpy
(OUT VOID *pDestination, IN VOID *pSource, IN UINTN Count)
copies Count bytes of memory from Source to Destination.
Input:
OUT VOID *pDestination
Memory address where data shall be copied.  User is responsible for
allocating the necessary memory resources.

IN VOID *pSource
Memory address from where data shall be copied.

IN UINTN Count
Number of bytes to copy from pSource.
Output:
VOID.
Modified:
Notes:
This function checks for overlapping of source and destination and
selects copy direction that prevents memory corruption.
Referrals:


MemRead32 in the x64AsmLib.asm

Function : MemRead32

File: x64AsmLib.asm
Description:
UINT32 MemRead32(IN UINT32 *Address) reads and returns the 32-bit value
stored at the user provided address.
Input:
IN UINT32 *Address
Address to read 32-bits from.
Output:
UINT32 value stored at Address.
Modified:
Notes:
Referrals:


MemReadWrite32 in the x64AsmLib.asm

Function : MemReadWrite32

File: x64AsmLib.asm
Description:
VOID MemReadWrite32(IN UINT32 *Address, IN UINT32 Value, IN UINT32 Mask)
reads the 32-bit value stored at Address, ANDs it with Mask, ORs the result
with Value, then writes the result back to Address.
Input:
IN UINT32 *Address
Address which shall be read from and subsequently written to.

IN UINT32 Value
Value to be ORed with the value stored at Address after it has been ANDed
with the provided Mask.

IN UINT32 Mask
Mask to be ANDed with the original value stored at Address.
Output:
VOID.
Modified:
Notes:
Referrals:


MemSet in the x64AsmLib.asm

Function : MemSet

File: x64AsmLib.asm
Description:
VOID

 MemSet
(IN VOID *pBuffer, IN UINTN Count, IN UINT8 Value) fills Count
bytes of memory in pBuffer with Value.
Input:
IN VOID *pBuffer
The starting location in memory where to begin filling.

IN UINTN Count
The number of bytes to fill with Value.

IN UINT8 Value
The value to fill memory with starting at pBuffer.
Output:
VOID.
Modified:
Notes:
Referrals:


ReadCr3 in the x64AsmLib.asm

Function : ReadCr3

File: x64AsmLib.asm
Description:
UINTN ReadCr3() reads the register CR3 and returns its value.
Input:
Output:
UINTN value stored in the CR3 register.
Modified:
Notes:
Referrals:


ReadMsr in the x64AsmLib.asm

Function : ReadMsr

File: x64AsmLib.asm
Description:
UINT64 ReadMsr(UINT32 Msr) reads the CPU MSR index defined by Msr and
returns the value.
Input:
IN UINT32 Msr
32-bit MSR index to be read.
Output:
UINT64 MSR value at MSR index, Msr.
Modified:
Notes:
Referrals:


ReadRtdsc in the x64AsmLib.asm

Function : ReadRtdsc

File: x64AsmLib.asm
Description:
UINT64 ReadRtdsc() retrieves the time stamp counter.
Input:
VOID.
Output:
UINT64 value of the time stamp counter.
Modified:
Notes:
Referrals:


WaitForever in the x64AsmLib.asm

Function : WaitForever

File: x64AsmLib.asm
Description:
VOID WaitForever() performs an infinite loop which does nothing.
Input:
VOID.
Output:
VOID.
Modified:
Notes:
Referrals:


WaitForSemaphore in the x64AsmLib.asm

Function : WaitForSemaphore

File: x64AsmLib.asm
Description:
VOID WaitForSemaphore(IN volatile UINT8 *Semaphore) waits for the
semaphore to become available; once available, it claims the semaphore and
returns.
Input:
IN volatile UINT8 *Semaphore
Pointer to the desired semaphore.
Output:
VOID.
Modified:
Notes:
Referrals:


WaitUntilZero32 in the x64AsmLib.asm

Function : WaitUntilZero32

File: x64AsmLib.asm
Description:
VOID WaitUntilZero32(IN volatile UINT32 *Value) waits until the UINT32
value stored at the Value address becomes 0, then continues.
Input:
IN volatile UINT32 *Value
Address of the UINT32 value to be monitored.
Output:
VOID.
Modified:
Notes:
Referrals:


WaitUntilZero8 in the x64AsmLib.asm

Function : WaitUntilZero8

File: x64AsmLib.asm
Description:
VOID WaitUntilZero8(IN volatile UINT8 *Value) waits until the byte stored
at Value becomes 0, then continues.
Input:
IN volatile UINT8 *Value
Address of the byte value to be monitored.
Output:
VOID.
Modified:
Notes:
Referrals:


WriteCr3 in the x64AsmLib.asm

Function : WriteCr3

File: x64AsmLib.asm
Description:
VOID WriteCr3(IN UINTN CR3) writes the provided value to the CR3 register.
Input:
IN UINTN CR3
Value to be written to the CR3 register.
Output:
VOID.
Modified:
Notes:
Referrals:


WriteMsr in the x64AsmLib.asm

Function : WriteMsr

File: x64AsmLib.asm
Description:
VOID WriteMsr(IN UINT32 Msr, IN UINT64 Value) writes the Value to the
supplied MSR index, Msr.
Input:
IN UINT32 Msr
32-bit MSR index to be written to.

IN UINT64 Value
Value to be written to MSR index.
Output:
VOID.
Modified:
Notes:
Referrals:


x64CLib.c

Description:
Generic CPU library functions for the x64 architecture.

The following functions are used in the file: x64CLib.c.

Function | Description
Div64 | UINT64 Div64(IN UINT64 Dividend, IN UINTN Divisor, OUT UINTN *Remainder OPTIONAL) divides a 64-bit number, Dividend, by the Divisor, which can be up to 31-bits.
memset | VOID MemSet (IN VOID *pBuffer, IN UINT8 Value, IN UINTN Count) is a wrapper for MemSet which fills Count bytes of memory in pBuffer with Value.
Mul64 | UINT64 Mul64(IN UINT64 Value64, IN UINTN Value32) multiplies a 64-bit number by a 32-bit number and returns the 64-bit result.
Shl64 | UINT64 Shl64(IN UINT64 Value, IN UINT8 Shift) shifts the 64-bit Value left the provided number of bits, Shift.
Shr64 | UINT64 Shr64(IN UINT64 Value, IN UINT8 Shift) shifts the 64-bit Value right the provided number of bits, Shift.

The following descriptions are used in the file: x64CLib.c.

Header | Description
CPU_Functions | CPU related functions defined in the AMI library.
Math_64_Bit_Functions | Math functions involving 64-bit input parameters designed to be usable on both 32-bit and 64-bit platforms.


CPU_Functions in the x64CLib.c

General : CPU_Functions

File: x64CLib.c
Fields:

Header | Function | Description
None | CPULib_CpuID | Perform the cpuid assembly instruction.
None | CPULib_DisableInterrupt | Disable interrupts.
None | CPULib_EnableInterrupt | Enable interrupts.
None | CPULib_GetInterruptState | Get current interrupt state (enabled or disabled).
None | CPULIB_GetPageTable | Retrieve address of the page table.
None | CPULib_LoadGdt | Load GDT.
None | CPULib_LoadIdt | Load IDT.
None | CPULib_LockByteDec | Lock preceeding byte.
None | CPULib_LockByteInc | Lock following byte.
None | CPULib_Pause | Pause CPU.
None | CPULib_SaveGdt | Save GDT at provided location.
None | CPULib_SaveIdt | Save IDT at provided location.
None | DisableCacheInCR0 | Disable CPU cache using CR0.
None | EnableCacheInCR0 | Enable CPU cache using CR0.
None | EnableMachineCheck | Enable machine check exception bit in CR4.
AmiLib | GetCpuTimer | Retrieve the CPU timer's value.
None | GetCsSegment | Retrieve the code segment.
None | HltCpu | Halt the CPU.
None | WaitForever | Perform infinite loop.
None | WaitForSemaphore | Wait for semaphore to become available. then take control.
None | WaitUntilZero32 | Wait until a 32-bit memory region becomes zero.
None | WaitUntilZero8 | Wait until an 8-bit meomry region becomes zero.
None | WriteMsr | Write a value to a MSR.
None | ReadMsr | Read value from a MSR.
AmiLib | WriteCr3 | Write a value to CR3.
AmiLib | ReadCr3 | Read value from CR3.
None | ReadRtdsc | Retrieve the time stamp counter.

Description:
CPU related functions defined in the AMI library.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


Div64 in the x64CLib.c

Function : Div64

File: x64CLib.c
Description:
UINT64 Div64(IN UINT64 Dividend, IN UINTN Divisor,
OUT UINTN *Remainder OPTIONAL) divides a 64-bit number, Dividend, by the
Divisor, which can be up to 31-bits.
Input:
IN UINT64 Dividend
The 64-bit number to be divided.

IN UINT Divisor
The number to divide Dividend by; may not exceed 31-bits in size.

OUT UINTN *Remainder OPTIONAL
The remainder of the division.  Provide NULL if undesired; otherwise user
is responsible for handling the necessary memory resources.
Output:
UINT64 result of dividing Dividend by Divisor.
Modified:
Notes:
Referrals:


Math_64_Bit_Functions in the x64CLib.c

General : Math_64_Bit_Functions

File: x64CLib.c
Fields:

Header | Function | Description
AmiLib | Shr64 | Shift 64-bit value right.
AmiLib | Shl64 | Shift 64-bit value left.
AmiLib | Div64 | Divide 64-bit value by a 31-bit value.
AmiLib | Mul64 | Multiply 64-bit value by a 32-bit value.
AmiLib | GetPowerOfTwo64 | Determine the highest set bit in a 64-bit value.

Description:
Math functions involving 64-bit input parameters designed to be usable on
both 32-bit and 64-bit platforms.
Notes:
Header details which header file contains the function prototype for
the above functions.  Append .h to the given name.


memset in the x64CLib.c

Function : memset

File: x64CLib.c
Description:
VOID

 MemSet
(IN VOID *pBuffer, IN UINT8 Value, IN UINTN Count) is a
wrapper for

 MemSet
 which fills Count bytes of memory in pBuffer with
Value.
Input:
IN VOID *pBuffer
The starting location in memory where to begin filling.

IN UINT8 Value
The value to fill memory with starting at pBuffer.

IN UINTN Count
The number of bytes to fill with Value.
Output:
VOID.
Modified:
Notes:
Referrals:

 MemSet


Mul64 in the x64CLib.c

Function : Mul64

File: x64CLib.c
Description:
UINT64 Mul64(IN UINT64 Value64, IN UINTN Value32) multiplies a 64-bit
number by a 32-bit number and returns the 64-bit result.
Input:
IN UINTN64 Value64
The 64-bit number to multiply by.

IN UINTN Value32
The 32-bit number to multiply by.
Output:
UINT64 result of multiplying Value64 by Value32.
Modified:
Notes:
Referrals:


Shl64 in the x64CLib.c

Function : Shl64

File: x64CLib.c
Description:
UINT64 Shl64(IN UINT64 Value, IN UINT8 Shift) shifts the 64-bit Value
left the provided number of bits, Shift.
Input:
IN UINT64 Value
The value to be shifted left.

IN UINT8 Shift
The number of bits to shift.
Output:
UINT64 Value shifted left Shift number of bits.
Modified:
Notes:
Referrals:


Shr64 in the x64CLib.c

Function : Shr64

File: x64CLib.c
Description:
UINT64 Shr64(IN UINT64 Value, IN UINT8 Shift) shifts the 64-bit Value
right the provided number of bits, Shift.
Input:
IN UINT64 Value
The value to be shifted.

IN UINT8 Shift
The number of bits to shift right.
Output:
UINT64 Value shifted right Shift number of bits.
Modified:
Notes:
Referrals:


Functions in Alphabetical Order

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.

  • A
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • L
  • M
  • P
  • R
  • S
  • T
  • U
  • V
  • W


Functions in Alphabetical Order

A

Function | Description
AllocCspResource | EFI_STATUS AllocCspResource(IN DXE_SERVICES *Dxe, IN CSP_RES_ITEM *ResTable, IN UINTN ResCount, IN EFI_HANDLE ImgHandle, IN EFI_HANDLE CntrHandle, IN BOOLEAN AddSpace) provides compatibility with core 4.5.3; acts as a wrapper for LibAllocCspResource.
AmiIsaDmaMask | EFI_STATUS AmiIsaDmaMask(IN OUT UINT8 *IsaDmaMask, IN BOOLEAN Get) sets or retrieves the ISA DMA mask from NVRAM depending upon the Get input.
AmiIsaIrqMask | EFI_STATUS AmiIsaIrqMask(IN OUT UINT16 *IsaIrqMask, IN BOOLEAN Get) sets or retrieves the ISA IRQ mask from NVRAM depending upon the Get input.
AppendItemLst | EFI_STATUS AppendItemLst(IN T_ITEM_LIST *Lst, IN VOID *pRes) appends the provided object to Lst.
ASLM_DMA | VOID* ASLM_DMA(IN UINT8 dsc_cnt, IN UINT8 typ, IN UINT8 bm, IN UINT8 siz, IN ...) generates a short DMA descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_FixedIO | VOID* ASLM_FixedIO(IN UINT16 bas, IN UINT8 len) generates a short fixed I/O descriptor and returns its address. User is responible for freeing the returned memory.
ASLM_IO | VOID* ASLM_IO(IN UINT8 dec, IN UINT16 min, IN UINT16 max, IN UINT8 aln, IN UINT8 len) generates a short I/O descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_IRQ | VOID* ASLM_IRQ(IN UINT8 dsc_cnt, IN UINT8 ll, IN UINT8 he, IN UINT8 shr, IN ...) generates a short IRQ descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_IRQNoFlags | VOID* ASLM_IRQNoFlags(IN UINT8 dsc_cnt, IN ...) generates a short IRQ descriptor without an optional IRQ information byte and returns its address. User is responsible for freeing the returned memory.
ASLM_Memory24 | VOID* ASLM_Memory24(IN UINT8 rw, IN UINT8 min, IN UINT8 max, IN UINT8 aln, IN UINT8 len) generates a long 24-bit memory descriptor and returns its address. User is responsible for freeing the returned memory.
ASLM_StartDependentFn | VOID* ASLM_StartDependentFn(IN UINT8 dsc_cnt, IN UINT8 pComp, IN UINT8 pPerf, IN ...) generates a Start-Dependent Function descriptor with the optional priority byte and returns its address. User is responsible for freeing the returned memory.
ASLM_StartDependentFnNoPri | VOID* ASLM_StartDependentFnNoPri(IN UINT8 dsc_cnt, IN ...) generates a Start-Dependent Function descriptor without the optional priority byte and returns its address. User is responsible for freeing the returned memory.
ASLM_VendorShort | VOID* ASLM_VendorShort(IN UINT8 byte_cnt, IN ...) generates a short Vendor-Defined descriptor and returns its address. User is responsible for freeing the returned memory.
Atoi | INT32 Atoi(IN CHAR8 *string) converts an ASCII string that represents an integer into an actual INT32 integer value and returns the result.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

C

Function | Description
CheckDsdt | BOOLEAN CheckDsdt(IN ACPI_HDR *Dsdt) checks the signature of the provided ACPI header for the DSDT signature.
CheckOpCode | BOOLEAN CheckOpCode(IN UINT8 *NameStart, IN UINT8 OpCode, IN UINT8 ExtOpCode, OUT ASL_OBJ_INFO *ObjInfo) checks an ASL object for the user provided op code and extended op code and returns the op code location in a user allocated ASL_OBJ_INFO structure.
checkpoint | VOID checkpoint(IN UINT8 c) writes the value c to port 0x80.
ChsumTbl | UINT8 ChsumTbl(IN UINT8 *TblStart, IN UINT32 BytesCount) calculates the checksum of a table starting at TblStart of length BytesCount and returns the checksum value.
ClearItemLst | VOID ClearItemLst(IN T_ITEM_LIST *Lst, IN BOOLEAN FreeData) clears all the items of Lst. If FreeData is TRUE, frees all the memory associated with the stored objects.
ConvertAslName | UINT32 ConvertAslName(IN UINT8 *AslName) converts an ASL name into a UINT32 value and returns it.
CopyItemLst | EFI_STATUS CopyItemLst(IN T_ITEM_LIST *Lst, OUT T_ITEM_LIST **NewLstPtr) copies Lst into a new list and provides the address of the copy in NewLstPtr.
CPULib_CpuID | VOID CPULib_CpuID(IN UINT32 CpuIDIndex, IN UINT32 *pRegEAX, IN UINT32 *pRegEBX, IN UINT32 *pRegECX, IN UINT32 *pRegEDX) issues the CPUID instruction with the index provided and returns the register values.
CPULib_DisableInterrupt | VOID CPULib_DisableInterrupt() disables interrupts on the CPU.
CPULib_EnableInterrupt | VOID CPULib_EnableInterrupt() enables interrupts on the CPU.
CPULib_GetInterruptState | BOOLEAN CPULib_GetInterruptState()returns the current CPU interrupt state.
CPULIB_GetPageTable | VOID* CPULIB_GetPageTable() retrieves the address of the page table.
CPULib_LoadGdt | VOID CPULib_LoadGdt(IN VOID *ptr) loads the GDT at the location pointed to by ptr.
CPULib_LoadIdt | VOID CPULib_LoadIdt(IN VOID *ptr) loads the IDT at the location provided by ptr.
CPULib_LockByteDec | VOID CPULib_LockByteDec(IN UINT8 *ptr) locks the preceeding byte before the address pointed to by ptr.
CPULib_LockByteInc | VOID CPULib_LockByteInc(IN UINT8 *ptr) locks the next byte after the address pointed to by ptr.
CPULib_Pause | VOID CPULib_Pause() performs the pause assembly instruction.
CPULib_SaveGdt | VOID CPULib_SaveGdt(IN VOID *ptr) stores the loaded GDT at the location provided by ptr.
CPULib_SaveIdt | VOID CPULib_SaveIdt(IN VOID *ptr) stores the loaded IDT at the location provided by ptr.
CreateHobMemoryAllocationModule | EFI_STATUS CreateHobMemoryAllocationModule( IN EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress, IN UINT64 MemoryLength, IN EFI_MEMORY_TYPE MemoryType, IN EFI_GUID *ModuleName, IN EFI_PHYSICAL_ADDRESS EntryPoint) adds a memory allocation HOB with a memory allocation module GUID using CreateHob from PEI Services.
CreateHobResourceDescriptor | EFI_STATUS CreateHobResourceDescriptor(IN EFI_PEI_SERVICES **PeiServices, IN EFI_GUID *Owner, IN EFI_RESOURCE_TYPE ResourceType, IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 ResourceLength) builds a resource descriptor HOB that describes a chunk of system memory using CreateHob from PEI Services.
CreateLegacyBootEvent | EFI_STATUS CreateLegacyBootEvent(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent) creates an EFI event in the Legacy Boot Event Group and allows the caller to specify a notification function. Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library abstracts the implementation mechanism of this event from the caller.
CreateLoadHob | EFI_STATUS CreateLoadHob(IN EFI_PEI_SERVICES **ppPS, IN EFI_FFS_FILE_HEADER *pFfsHeader, EFI_PEIM_ENTRY_POINT EntryPoint, EFI_PEIM_ENTRY_POINT InMemEntryPoint) builds a EFI_HOB_TYPE_GUID_EXTENSION HOB with a PEIM load HOB.
CreateReadyToBootEvent | EFI_STATUS CreateReadyToBootEvent(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent) creates an EFI event in the Ready To Boot Event Group and allows the caller to specify a notification function. Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library abstracts the implementation mechanism of this event from the caller.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

D

Function | Description
DbeBinSearch | VOID DbeBinSearch(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN DBE_CMP Cmp, IN VOID *NewKey, OUT VOID **DataLocation, OUT INT8 *Vicinity, OUT INTN *RecordInd OPTIONAL) executes a binary search of the nearest location closest to the *NewKey value. If the DBE_KEY_FIELD structure of the database is NULL, the NewKey field is the address of the *Data; otherwise the NewKey field will be calculated as "(UINT8*)Data+KeyField.Offset" of "KeyField.Size" size.
DbeDelete | EFI_STATUS DbeDelete(IN DBE_DATABASE *Database, IN VOID *Data, IN BOOLEAN FreeData) removes all records associated with the user provided Data pointer. Function assumes every keyIf FreeData is TRUE, it will also FreePool the Data when it is done.
DbeGoToIndex | EFI_STATUS DbeGoToIndex(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN INTN Index, OUT VOID **Record) returns the record pointer at the user provided index inside Database's IndexArray.
DbeInsert | EFI_STATUS DbeInsert(IN DBE_DATABASE *Database, IN VOID *Record) inserts a user provided record into a database.
DbeLocateKey | EFI_STATUS DbeLocateKey(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN VOID *KeyValue, OUT VOID **Record, OUT INT8 *Vicinity, OUT UINTN *RecordIndex OPTIONAL) locates a record by its key in a database.
Decompress | EFI_STATUS Decompress(IN VOID *Source, IN UINT32 SrcSize, IN OUT VOID *Destination, IN UINT32 DstSize, IN OUT VOID *Scratch, IN UINT32 ScratchSize) is the internal implementation of DECOMPRESS_PROTOCOL.Decompress(). External consumers should use Decompress Protocol (not this function).
DeleteItemLst | EFI_STATUS DeleteItemLst(IN T_ITEM_LIST *Lst, IN UINTN ItemIndex, IN BOOLEAN FreeData) deletes the object stored at the provided ItemIndex in Lst. Frees the memory associated with the object pointer if FreeData is TRUE.
DevicePathToStr | EFI_STATUS DevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *Path, OUT CHAR8 **Str) convert the provided device path into string. Str is allocated by this routine. It must be freed by the caller.
DisableCacheInCR0 | VOID DisableCacheInCR0() disables the CPU cache using the CR0 register.
Div64 | UINT64 Div64(IN UINT64 Dividend, IN UINTN Divisor, OUT UINTN *Remainder OPTIONAL) divides a 64-bit number, Dividend, by the Divisor, which can be up to 31-bits.
DListAdd | VOID DListAdd(IN DLIST *pList, IN DLINK *pElement) adds the node pElement to the end of the doubly linked list denoted by pList.
DListDelete | VOID DListDelete(IN DLIST *pList, IN DLINK *pElement) removes the node pElement from a doubly linked list. It is up to the caller of this function to release the memory used by this node if that is required.
DListEmpty | DListEmpty(IN DLIST *pList) is a macro which returns NULL if the provided DLIST is empty.
DListInit | VOID DListInit(IN DLIST *pList) initializes the head, tail links and number of elements of a new linked list structure. After initializing a linked list with this function, the other linked list functions may be used to add and remove nodes from the linked list. It is up to the caller of this function to allocate the memory for pList.
DListInsert | VOID DListInsert(IN DLIST* pList, IN DLINK* pElement, IN DLINK* pAfter) inserts the node pElement in the doubly linked list denoted by pList immediately after the node pAfter.
DPAdd | VOID* DPAdd(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) appends all the elements of pDp2 just before the device path terminator of pDp1, and returns the result in a newly allocated buffer.
DPAddInstance | VOID* DPAddInstance(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) makes a new device path with pDp1 as its first instance and pDp2 as its second instance, then returns the result in a newly allocated buffer.
DPAddNode | VOID* DPAddNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) adds the very first element of pDp2 to pDp1 just before its device path terminator, and returns the result in a newly allocated buffer.
DPCmp | INTN DPCmp(IN EFI_DEVICE_PATH_PROTOCOL *pDp1, IN EFI_DEVICE_PATH_PROTOCOL *pDp2) compares two device paths, pDp1 and pDp2, and returns zero if both are equivalent; otherwise, it returns a non-zero value.
DPCopy | VOID* DPCopy(IN EFI_DEVICE_PATH_PROTOCOL *pDp) copies the user provided device path into a new buffer and returns its address.
DPCreateNode | VOID* DPCreateNode(IN UINT8 Type, IN UINT8 SubType, IN UINT16 Length) creates a new device node in a newly allocated buffer of size NodeLength and initializes the device path node header with NodeType and NodeSubType. The new device path node is returned. If NodeLength is smaller than a device path header, then NULL is returned. If there is not enough memory to allocate space for the new device path, then NULL is returned. The memory is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.
DPCut | VOID* DPCut(IN EFI_DEVICE_PATH_PROTOCOL *pDp) creates a new device path containing all but the last node of pDp, then returns the address to the new device path.
DPGetEndNode | EFI_DEVICE_PATH_PROTOCOL* DPGetEndNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns the end of the device path node for the specified device path.
DPGetLastNode | VOID* DPGetLastNode(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns a pointer to the very last device path node before END_OF_DEVICE_PATH node.
DPIsMultiInstance | BOOLEAN DPIsMultiInstance(IN EFI_DEVICE_PATH_PROTOCOL* pDp) determines if a device path is single or multi-instance. This function returns TRUE if the device path specified by pDp is multi-instance. Otherwise, FALSE is returned. If pDp is NULL, then FALSE is returned.
DPIsOneOf | BOOLEAN DPIsOneOf(IN EFI_DEVICE_PATH_PROTOCOL *pAll, IN EFI_DEVICE_PATH_PROTOCOL *pOne, IN BOOLEAN ExactMatch) determines whether a device path, pAll, contains another device path, pOne. If the ExactMatch parameter is TRUE, it checks for an exact match instead.
DPLength | UINTN DPLength(IN EFI_DEVICE_PATH_PROTOCOL *pDp) returns the length of the provided device path, pDp (including the size of EndOfDevicePath).
DPNextInstance | VOID* DPNextInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **ppDp, OUT UINTN *pSize) creates a copy of the current device path instance. It also updates DevicePath to point to the next device path instance in the device path (or NULL if no more) and updates Size to hold the size of the device path instance copy. If DevicePath is NULL, then NULL is returned. If there is not enough memory to allocate space for the new device path, then NULL is returned. The memory is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated.
DummyFunction | VOID DummyFunction(IN EFI_EVENT Event, IN VOID *Context) is an empty VOID function which does nothing.

Data Structure | Description
DLINK | DLINK is a type defined structure used in an AMILIB provided doubly-linked list API which is used as a node for an entry into the list.
DLIST | DLIST is a type defined structure used in an AMILIB provided doubly-linked list API to maintain pointers for a list's head, tail, and size.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

E

Function | Description
EfiAtRuntime | BOOLEAN EFIAPI EfiAtRuntime ( VOID ) returns TRUE if system has already transitioned to runtime(ExitBootServices has been called), otherwise returns FALSE. This function can only be used is driver has been initialized using InitAmiRuntimeLib function.
EfiGoneVirtual | BOOLEAN EFIAPI EfiGoneVirtual ( VOID ) returns TRUE if system has already transitioned to the virtual addressing mode (SetVirtualAddressMap has been called), otherwise returns FALSE. This function can only be used is driver has been initialized using InitAmiRuntimeLib function.
EnableCacheInCR0 | VOID EnableCacheInCR0() enables the CPU cache using the CR0 register.
EnableLongMode | VOID EnableLongMode(IN VOID *PageTable, IN VOID *Function, IN VOID *Parameter1, IN VOID *Parameter2) enables long mode then calls the provided function with the provided parameters.
EnableMachineCheck | VOID EnableMachineCheck() sets the Machine Check Exception bit in CR4, which enables machine check interrupts to occur.
EndMeasure | EFI_STATUS EndMeasure(IN EFI_HANDLE Handle, IN CHAR16 *Token, IN CHAR16 *Host, IN UINT64 Ticker) ends timing on a specified handle, token and host, with Ticker as the end tick. See notes for proper usage.
ExecScript | EFI_STATUS ExecScript(IN IO_DATA *ScriptData, IN UINTN EntryCount) executes a sequence of CPU I/O operations.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

F

Function | Description
FillPageTable | VOID FillPageTable(IN UINT8 NumberMemoryBits, IN VOID *PageTable) fills a provided page table with an identity map.
FindAslObjectName | VOID* FindAslObjectName(IN UINT8 *Start, IN UINT8 *ObjName, IN UINTN Len) finds an ASL object by its name string and returns its location.
FindDeviceName | BOOLEAN FindDeviceName( IN EFI_HANDLE Controller, IN EFI_HANDLE Child, OUT CHAR16 **wsName) checks all the protocols associated with a device handle and its child controller for its name; if a child is not defined, checks all associated protocols.
FindFfsFileByName | VOID* FindFfsFileByName(IN EFI_PEI_SERVICES **PeiServices, IN EFI_FV_FILETYPE FileType, IN EFI_GUID *FileName) scans all available firmware volumes for a FFS file of type FileType with GUID equal to FileName and returns the address of the first byte of the FFS file data. If more than one file matches the criteria, the function returns the address of the first file found.
FindNextHobByGuid | EFI_STATUS FindNextHobByGuid(IN EFI_GUID *Guid, IN OUT VOID **Hob) finds HOB of type Guid Extention with a specified GUID starting from the HOB that comes after the HOB pointed by *Hob. *Hob pointer is updated with the address of the found HOB.
FindNextHobByType | EFI_STATUS FindNextHobByType(IN UINT16 Type, IN OUT VOID **Hob) finds a HOB with a specified Type starting from the HOB that comes after the HOB pointed by *Hob. *Hob pointer is updated with the address of the found HOB.
FindPeSection | VOID* FindPeSection(IN UINT8 *pstart, IN UINT64 name, OUT UINTN *pSize) locates a section with the user provided name inside a portable executable (PE) image.
FSReadFile | EFI_STATUS FSReadFile(IN EFI_HANDLE hDevice, IN EFI_DEVICE_PATH_PROTOCOL* pPath, OUT VOID** ppSource, OUT UINTN *pSize)
FVReadFile | EFI_STATUS FVReadFile(IN EFI_HANDLE hDevice, IN EFI_GUID* pFileName, OUT VOID** ppSource, OUT UINTN *pSize)
FvReadPe32Image | EFI_STATUS FvReadPe32Image(IN EFI_GUID *NameGuid, IN OUT VOID **Buffer, IN OUT UINTN *BufferSize, OUT UINT32 *AuthenticationStatus)

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

G

Function | Description
GetAslObj | EFI_STATUS GetAslObj(IN UINT8 *Start, IN UINTN Length, IN UINT8 *Name, IN ASL_OBJ_TYPE ObjType, OUT ASL_OBJ_INFO *ObjInfo)
GetBootMode | EFI_BOOT_MODE GetBootMode() returns current boot mode. If no boot mode information is available, BOOT_WITH_FULL_CONFIGURATION is returned.
GetControllerName | BOOLEAN GetControllerName(IN EFI_HANDLE Controller, OUT CHAR16 **wsName) retrieves the name of the controller specified by Controller and copies it into the caller allocated Unicode string at address wsName.
GetCpuTimer | UINT64 GetCpuTimer() returns the value of the CPU timer.
GetCsSegment | UINT16 GetCsSegment() retreives the value of the CS register.
GetDebugDirectory | DEBUG_DIRECTORY* GetDebugDirectory(IN VOID *ptr, OUT UINTN *TeAdjustment) locates and returns the location of DEBUG_DIRECTORY in a terse executable (TE) or portable executable (PE) image.
GetEfiConfigurationTable | VOID *GetEfiConfigurationTable(IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_GUID *Guid) retrieves a pointer to the system configuration table from the EFI System Table based on a specified GUID. If a match is found, then a pointer to the configuration table is returned. If a matching GUID is not found, then NULL is returned.
GetEfiVariable | EFI_STATUS GetEfiVariable(IN CHAR16 *sName, IN EFI_GUID *pGuid, OUT UINT32 *pAttributes OPTIONAL, IN OUT UINTN *pDataSize, OUT VOID **ppData) reads an EFI variable with the name Name and GUID Guid. If variable is found, variable attributes, size, and data are returned using Attributes, DataSize, and Data parameters and EFI_SUCCESS is returned. If variable is not found, EFI_NOT_FOUND is returned. The output buffer is specified by a double indirection of the Data parameter. The input value of *Data is used to determine if the output buffer is caller allocated or is dynamically allocated by this functions. If the input value of *Data is not NULL, it indicates that the output buffer is caller allocated. In this case, the input value of *DataSize indicates the size of the caller-allocated output buffer. If the output buffer is not large enough to contain the variable data, it is freed and new buffer of sufficient size is allocated from boot services pool memory, which will be returned in *Data. If the input value of *Data not NULL, it indicates that the output buffer is allocated by GetEfiVariable routine. In this case, GetEfiVariable will allocate an appropriately sized buffer from boot services pool memory, which will be returned in *Data.
GetImageName | BOOLEAN GetImageName(IN EFI_HANDLE ImageHandle, OUT CHAR8 *sName) retrieves the name of the image specified by ImageHandle and returns it in sName.
GetImageSize | UINT32 GetImageSize(IN VOID *p) retrieves the size of a terse executable (TE) image or portable executable (PE) image.
GetInfo | EFI_STATUS GetInfo(IN VOID *Source, IN UINT32 SrcSize, OUT UINT32 *DstSize, OUT UINT32 *ScratchSize) is the internal implementation of DECOMPRESS_PROTOCOL.GetInfo(). External consumers should use Decompress Protocol (not this function).
GetName | BOOLEAN GetName(IN UINT8 *p, OUT CHAR8 *sName) retrieves the name of portable executable (PE) or terse executable (TE) image, if it is available.
GetPackageLen | UINTN GetPackageLen(IN AML_PACKAGE_LBYTE *Pck, OUT UINT8 *BytesCnt) determines the length in bytes of an AML package.
GetPageTableNumPages | UINT32 GetPageTableNumPages(IN UINT8 NumberMemoryBits) gets the number of pages to allocate for paging. Limit 512GB.
GetPeOptionalHeader | OPTIONAL_HEADER* GetPeOptionalHeader(IN VOID *p) returns the address of a portable executable (PE) image's optional header.
GetPowerOfTwo64 | UINT64 GetPowerOfTwo64(IN UINT64 Input) returns the highest bit set in the provided UINT64 Input. Equivalent to 1 << log2(x).
GetSmstConfigurationTable | VOID *GetEfiConfigurationTable( IN EFI_GUID *TableGuid) retrieves a pointer to the system configuration table from the SMM System Table based on a specified GUID. If a match is found, then a pointer to the configuration table is returned. If a matching GUID is not found, then NULL is returned.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

H

Function | Description
HideAslMethodFromOs | Destroys Method passed as MethodName parameter if it is present in ASL object described by AslObj parameter
HiiLibGetBrowserData | Retrieves uncommitted state data from the HII browser. Only works in UEFI 2.1 mode.
HiiLibGetString | Reads string from the HII database in current language.
HiiLibPublishPackages | Publishes submitted array of HII packages into HII database.
HiiLibSetBrowserData | Updates uncommitted state data of the HII browser. Only works in UEFI 2.1 mode.
HiiLibSetString | Updates string in the HII database in all languages supported by the package list.
HltCpu | VOID HltCpu() halts the CPU.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

I

Function | Description
InitAmiLib | VOID InitAmiLib(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) initializes the global variables used by library routines. It must be called before any other library routine is used. See notes for variables initialized.
InitAmiRuntimeLib | VOID InitAmiRuntimeLib(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_EVENT_NOTIFY ExitBsCallback OPTIONAL, IN EFI_EVENT_NOTIFY GoVirtualCallback OPTIONAL) initializes the global variables using call to InitAmiLib. Runtime drivers should use this function instead of InitAmiLib.
InitLongMode | VOID InitLongMode(IN EFI_PEI_SERVICES **PeiServices, IN VOID *Function, IN VOID *Parameter1, IN VOID *Parameter2) initializes memory page mapping, enables long mode and jumps to a provided function.
InitLongModeExt | VOID InitLongMode(IN EFI_PEI_SERVICES **PeiServices, IN VOID *Function, IN VOID *Parameter1, IN VOID *Parameter2) initializes memory page mapping, enables long mode and jumps to a provided function.
InitSmmHandler | EFI_STATUS InitSmmHandler(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable), IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) OPTIONAL) first calls the provided NotInSmmFunction (if provided), then runs the InSmmFunction in SMM.
InitSmmHandlerEx | The function is similar to InitSmmHandler function. The difference between the two is handling of missing SmmBase protocol. If SmmBase protocol is not available, InitSmmHandler function returns error. This function registers callback and loads module to SMM once SmmBase is available.
InsertItemLst | EFI_STATUS InsertItemLst(IN T_ITEM_LIST *Lst, IN VOID *pRes, IN UINTN ItemIndex) inserts the provided item pointed to by pRes into the provided Lst at index ItemIndex.
IoRead | EFI_STATUS IoRead(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer) performs Count I/O reads of the defined Width at the Address and stores the result in Buffer. After every I/O operation, Address and Buffer are updated according to the Width. See notes for details.
IoRead16 | UINT16 IoRead16(IN UINT16 Port) reads the 16-bit value stored at the I/O port defined by Port.
IoRead32 | UINT32 IoRead32(IN UINT16 Port) reads the 32-bit value stored at the I/O port defined by Port.
IoRead64 | UINT32 IoRead64(IN UINT16 Port) reads the 64-bit value stored at the I/O port defined by Port.
IoRead8 | UINT8 IoRead8(IN UINT16 Port) reads the 8-bit value stored at the I/O port defined by Port.
IoReadWrite | EFI_STATUS IoReadWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN VOID *DataValue, IN VOID *DataMask) reads the specified I/O Address, ANDs the result with DataMask, then ORs the modified result with DataValue and writes the value back to Address.
IoWrite | EFI_STATUS IoWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer) performs Count I/O writes of the defined Width at the Address from the Buffer. After every I/O operation, Address and Buffer are updated according to the Width. See notes for details.
IoWrite16 | VOID IoWrite16(IN UINT16 Port, IN UINT16 Value) writes the 16-bit Value to the I/O port defined by Port.
IoWrite32 | VOID IoWrite32(IN UINT16 Port, IN UINT32 Value) writes the 32-bit Value to the I/O port defined by Port.
IoWrite64 | VOID IoWrite64(IN UINT16 Port, IN UINT64 Value) writes the 64-bit Value to the I/O port defined by Port.
IoWrite8 | VOID IoWrite8(IN UINT16 Port, IN UINT8 Value) writes the 8-bit Value to the I/O port defined by Port.
IsPeImageValid | BOOLEAN IsPeImageValid(IN UINT8 *pstart) reads the header signature of a portable executable (PE) image and returns TRUE if it is valid.
isTeImageValid | BOOLEAN isTeImageValid(IN UINT8 *pstart) reads the header signature of a terse executable (TE) image and returns true if it is valid.
ItoaEx | CHAR8* ItoaEx(IN INT64 value, IN OUT CHAR8 *string, IN INT32 radix, IN BOOLEAN is_int64) converts an INT64 value into a CHAR8 ASCII representation and returns a pointer to the ASCII string.
ItowEx | CHAR16* ItowEx(IN INT64 value, IN OUT CHAR16 *string, IN INT32 radix, IN BOOLEAN is_int64) converts an INT64 value into a 16-bit Unicode representation and returns a CHAR16 pointer to the string.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

L

Function | Description
LanguageCodesEqual | BOOLEAN LanguageCodesEqual(CONST CHAR8* LangCode1, CONST CHAR8* LangCode2) compares two language codes and returns TRUE if they are equal.
LFReadFile | EFI_STATUS LFReadFile(IN EFI_HANDLE hDevice, IN EFI_DEVICE_PATH_PROTOCOL* pPath, IN BOOLEAN BootPolicy, OUT VOID** ppSource, OUT UINTN *pSize)
LibAllocCspResource | EFI_STATUS LibAllocCspResource(IN CSP_RES_ITEM *ResTable, IN UINTN ResCount, IN EFI_HANDLE ImgHandle, IN EFI_HANDLE CntrHandle) uses GCD services to allocate list of resources specified by ResTable.
LibGetDsdt | EFI_STATUS LibGetDsdt(OUT EFI_PHYSICAL_ADDRESS *DsdtAddr, IN EFI_ACPI_TABLE_VERSION Version) retrieves a pointer to the DSDT ACPI table for the user requested Version of ACPI.
LibGetDxeSvcTbl | EFI_STATUS LibGetDxeSvcTbl(OUT DXE_SERVICES **ppDxe OPTIONAL) locates the DXE Service Table in the EFI System Table and returns it in ppDxe. If pointer is found, EFI_SUCCESS is returned.
LibReportStatusCode | EFI_STATUS LibReportStatusCode(IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN EFI_GUID *CallerId OPTIONAL, IN EFI_STATUS_CODE_DATA *Data OPTIONAL) abstracts status code reporting. The Framework moved from a proprietary to a UEFI 2.0-based mechanism. This function abstracts the caller from how the status code is reported to prevent the code from having to change with this version of the specification supported.
LoadPeImage | VOID* LoadPeImage(IN UINT8 *pold, IN UINT8 *pnew) is a wrapper function for LoadPeImageEx which passes NULL for prealloc.
LoadPeImageEx | VOID* LoadPeImageEx(IN UINT8 *pold, IN UINT8 *pnew, IN UINT8 *prealloc) loads a portal executable into memory from a file.
LoadResources | EFI_STATUS LoadResources(EFI_HANDLE ImageHandle, UINTN NumberOfCallbacks, CALLBACK_INFO *pCallBack, INIT_HII_PACK InitFunction) - loads HII packages associated with the specified image and publishes them to the HII database
LoadStrings | EFI_STATUS LoadStrings(EFI_HANDLE ImageHandle, EFI_HII_HANDLE *pHiiHandle) - loads HII string packages associated with the specified image and publishes them to the HII database

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

M

Function | Description
Malloc | VOID *Malloc(IN UINTN Size) allocates Size bytes of memory from EfiBootServicesData and returns a pointer to the allocated space.
MallocZ | VOID* MallocZ(IN UINTN Size) allocates Size bytes of memory from EfiBootServicesData, initializes it to zero, then returns a pointer to the allocated space.
MemCmp | INTN MemCmp(IN VOID* pDestination, IN VOID* pSource, IN UINTN Count) compares Length bytes of pDestination to Length bytes of pSource. If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the value returned is the first mismatched byte in pSource subtracted from the first mismatched byte in pDestination.
memcpy | VOID MemCpy (OUT VOID *pDestination, IN VOID *pSource, IN UINTN Count) is a wrapper for MemCpy , which copies Count bytes of memory from Source to Destination.
MemCpy | VOID MemCpy (OUT VOID *pDestination, IN VOID *pSource, IN UINTN Count) copies Count bytes of memory from Source to Destination.
MemRead | EFI_STATUS MemRead(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer) performs Count MMIO reads of the size Width at the Address and stores the result in Buffer. After every MMIO operation, Address and Buffer are updated according to Width.
MemRead32 | UINT32 MemRead32(IN UINT32 *Address) reads and returns the 32-bit value stored at the user provided address.
MemReadWrite | EFI_STATUS MemReadWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN VOID *DataValue, IN VOID *DataMask) reads the specified physical Address, ANDs the result with DataMask, then ORs the modified result with DataValue and writes the value back to Address.
MemReadWrite32 | VOID MemReadWrite32(IN UINT32 *Address, IN UINT32 Value, IN UINT32 Mask) reads the 32-bit value stored at Address, ANDs it with Mask, ORs the result with Value, then writes the result back to Address.
memset | VOID MemSet (IN VOID *pBuffer, IN UINT8 Value, IN UINTN Count) is a wrapper for MemSet which fills Count bytes of memory in pBuffer with Value.
MemSet | VOID MemSet (IN VOID *pBuffer, IN UINTN Count, IN UINT8 Value) fills Count bytes of memory in pBuffer with Value.
MemWrite | EFI_STATUS MemWrite(IN CPU_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer) performs Count MMIO writes of the size Width at the Address using the contents of Buffer. After every MMIO operation, Address and Buffer are updated according to Width.
Mul64 | UINT64 Mul64(IN UINT64 Value64, IN UINTN Value32) multiplies a 64-bit number by a 32-bit number and returns the 64-bit result.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

P

Function | Description
PEEntryPoint | VOID* PEEntryPoint(IN VOID *p) returns the address of the entry point to a portable executable (PE) image.
PEI_PERF_END | PEI_PERF_END(Ps, Token, FileHeader, Value) is a macro which invokes the PeiPerfMeasure function to stop timing for an entry to determine performance if the PEI_PERFORMANCE SDL token is turned on. If the PEI_PERFORMANCE SDL token is turned off, the macro does nothing.
PEI_PERF_SAVE_S3_DATA | PEI_PERF_SAVE_S3_DATA(Ps) is a macro which invokes the SaveS3PerformanceData function in order to save the S3 performance data in an EFI PEI performance HOB. This should only be called once, just before the end of PEI.
PEI_PERF_START | PEI_PERF_START(Ps, Token, FileHeader, Value) is a macro which invokes the PeiPerfMeasure function to log a timer entry for measuring performance if the PEI_PERFORMANCE SDL token is turned on. If the PEI_PERFORMANCE SDL token is turned off, the macro does nothing.
PEI_PROGRESS_CODE | PEI_PROGRESS_CODE(PeiServices, Code) is a macro which reports progress code using (*PeiServices)->ReportStatusCode
PEI_TRACE | PEI_TRACE(Arguments) is a macro which creates a serial debug message in PEI if the DEBUG_MODE SDL token is enabled by invoking the PeiTrace function with the provided arguments. If DEBUG_MODE is off, nothing is generated. See notes for an example usage.
PeiGetNextVariableName | EFI_STATUS PeiGetNextVariableName(IN EFI_PEI_SERVICES **PeiServices, IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VariableGuid) performs enumeration of the EFI variables. This function serves as a wrapper for the Read Only Variable PPI GetNextVariableName routine. It locates the Read Only Variable PPI instance, then makes a call to the GetNextVariableName routine and returns its EFI_STATUS.
PeiGetVariable | EFI_STATUS PeiGetNextVariableName(IN EFI_PEI_SERVICES **PeiServices, IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VariableGuid, OUT UINT32 *Attributes, IN OUT UINTN *DataSize, OUT VOID *Data) reads an EFI variable; it serves as a wrapper for the Read Only Variable PPI GetVariable routine. The functions first locates the Read Only Variable PPI instance, then makes a call to the GetVariable routine and returns the EFI_STATUS of the GetVariable call.
PeiPerfMeasure | VOID PeiPerfMeasure(IN EFI_PEI_SERVICES **PeiServices, IN CHAR16 *Token, IN EFI_FFS_FILE_HEADER *FileHeader, IN BOOLEAN EntryExit, IN UINT64 Value) logs a timestamp count for measuring performance. See the notes for proper usage.
PeiTrace | VOID PeiTrace(IN UINTN Level, IN EFI_PEI_SERVICES **ppPS, IN CHAR8 *sFormat, IN ...) prints a debug message using the ReportStatusCode from PEI Services if the specified error level is enabled.
PERF_CODE | PERF_CODE(Code) is a macro which places the provided code block into the requested location if the DXE_PERFORMANCE SDL token is turned on. If the DXE_PERFORMANCE SDL token is turned off, the macro inserts nothing.
PERF_END | PERF_END(Handle, Token, Host, Ticker) is a macro which invokes the EndMeasure function to stop timing for a performance entry in order to determine performance if the DXE_PERFORMANCE SDL token is turned on. If the DXE_PERFORMANCE SDL token is turned off, the macro does nothing.
PERF_START | PERF_START(Handle, Token, Host, Ticker) is a macro which invokes the StartMeasure function to log a timer entry for measuring performance if the DXE_PERFORMANCE SDL token is turned on. If the DXE_PERFORMANCE SDL token is turned off, the macro does nothing.
PROGRESS_CODE | PROGRESS_CODE(Code) is a macro which reports progress code using UEFI ReportStatusCode API.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

R

Function | Description
ReadCr3 | UINTN ReadCr3() reads the register CR3 and returns its value.
ReadImage | EFI_STATUS ReadImage(IN BOOLEAN BootPolicy, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN OUT VOID **ppSource, IN OUT UINTN *pSourceSize OPTIONAL, OUT UINTN *pImageSize OPTIONAL, OUT EFI_HANDLE *phDevice OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **ppPath OPTIONAL)
ReadImageResource | EFI_STATUS ReadImageResource(IN EFI_HANDLE ImageHandle, IN EFI_GUID *pGuid, OUT VOID **ppData, OUT UINTN *pDataSize)
ReadMsr | UINT64 ReadMsr(UINT32 Msr) reads the CPU MSR index defined by Msr and returns the value.
ReadRtdsc | UINT64 ReadRtdsc() retrieves the time stamp counter.
ReallocatePeImage | BOOLEAN ReallocatePeImage(IN UINT8 *pcurrent, IN UINT8 *pnew, IN UINT8 *prealloc) loads an already loaded portable executable (PE) image at a new memory location with the proper fixup.
reallocItemLst | EFI_STATUS reallocItemLst(IN T_ITEM_LIST *Lst) is an internal worker function which reallocates space for a T_ITEM_LIST.Items[] array.
RegisterProtocolCallback | EFI_STATUS RegisterProtocolCallback(IN EFI_GUID *pProtocol, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent, OUT VOID **ppRegistration) creates a notification event and registers that event with protocol instances specified by ProtocolGuid. Every time a protocol of type ProtocolGuid instance is installed or reinstalled, the notification function is executed. This function returns EFI_SUCCESS if notification event has been created.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

S

Function | Description
SaveS3PerformanceData | VOID SaveS3PerformanceData(IN EFI_PEI_SERVICES **PeiServices) saves the S3 performance data in an EFI PEI performance HOB. This should only be called once, just before the end of PEI. See notes for proper usage.
Shl64 | UINT64 Shl64(IN UINT64 Value, IN UINT8 Shift) shifts the 64-bit Value left the provided number of bits, Shift.
Shr64 | UINT64 Shr64(IN UINT64 Value, IN UINT8 Shift) shifts the 64-bit Value right the provided number of bits, Shift.
Sprintf | UINTN Sprintf(OUT CHAR8 *Buffer, IN CHAR8 *Format, IN ...) produces a null-terminated ASCII string in the output Buffer. The ASCII string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of ASCII characters in the produced output buffer is returned, not including the null-terminator. See notes for format string information.
Sprintf_s | UINTN Sprintf_s(OUT CHAR8 *Buffer, IN UINTN BufferSize, IN CHAR8 *Format, IN ...) produces a null-terminated ASCII string in the output Buffer of size BufferSize. The ASCII string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of ASCII characters in the produced output buffer is returned, not including the null-terminator.
StartMeasure | EFI_STATUS StartMeasure (IN EFI_HANDLE Handle, IN CHAR16 *Token, IN CHAR16 *Host, IN UINT64 Ticker) starts timing on a specified handle, token and host, with Ticker as the start tick. See notes for proper usage.
Strcmp | INT32 Strcmp(IN CHAR8 *string1, IN CHAR8 *string2) compares two CHAR8 strings, string1 and string2, and returns 0 if they are identical, non-zero if they are not identical.
Strcpy | CHAR8* Strcpy(IN OUT CHAR8 *string1, IN CHAR8 *string2) copies the contents of a CHAR8 string, string2, into another CHAR8 string, string1.
Strlen | UINTN Strlen(IN CHAR8 *string) takes a null-terminated CHAR8 string and returns its UINTN length (not including the null-terminator).
Strstr | CHAR8* Strstr(IN CONST CHAR8 *string, IN CONST CHAR8 *strSearch) locates strSearch within string, and returns a pointer to the start of the located string.
StrtolEx | INT64 StrtolEx(IN CHAR8 *nptr, OUT CHAR8 **endptr, IN INT32 base, IN INT32 increment) converts a CHAR8 string representation of a number into an INT64 representation.
Strupr | CHAR8* Strupr(IN CHAR8 *str) converts a CHAR8 string to all uppercase characters.
Swprintf | UINTN Swprintf(OUT CHAR16 *Buffer, IN CHAR16 *Format, IN ...) produces a null-terminated Unicode string in the output Buffer. The Unicode string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of Unicode characters in the produced output buffer is returned, not including the null-terminator.
Swprintf_s | UINTN Swprintf_s(OUT CHAR16 *Buffer, IN UINTN BufferSize, IN CHAR16 *Format, IN ...) produces a null-terminated Unicode string in the output Buffer of size BufferSize. The Unicode string is produced by parsing the format string specified by Format. Arguments are pulled from the variable argument list based on the contents of the format string. The number of Unicode characters in the produced output buffer is returned, not including the null-terminator.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

T

Function | Description
TEEntryPoint | VOID* TEEntryPoint(IN VOID *p) returns the address of the entry point to a terse executable (TE) image.
TimerIsSet | VOID TimerIsSet(IN EFI_EVENT Event, IN OUT VOID *Context)
TimerStart | EFI_EVENT TimerStart(OUT BOOLEAN *pTimerFlag, IN UINT64 Delay)
TimerStop | VOID TimerStop(IN BOOLEAN TimerFlag, IN EFI_EVENT Event)
Toupper | INT32 Toupper(IN INT32 c) converts a lowercase ASCII character, c, to an uppercase ASCII character and returns its uppercase ASCII value. If c is not a valid lowercase ASCII character, returns c.
TRACE | Trace (Arguments) is a macro which creates a serial debug message in DXE if the DEBUG_MODE SDL token is enabled by invoking the Trace function with the provided arguments. If DEBUG_MODE is off, nothing is generated. See notes for an example usage.
Trace | VOID Trace (IN UINTN Level, IN CHAR8 *sFormat, IN ...) prints a debug message using status code protocol if the specified error level is enabled.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

U

Function | Description
UpdateAslNameBuffer | EFI_STATUS UpdateAslNameBuffer(UINT8 *BufferStart, UINTN BufferLen, IN UINT8 *ObjName, IN UINT64 Value) locates an ASL object by its name, ObjName, in Memory Buffer specified by BufferStart, and BufferLen and updates its data start with the user provided Value.
UpdateAslNameObject | EFI_STATUS UpdateAslNameObject(IN ACPI_HDR *PDsdt, IN UINT8 *ObjName, IN UINT64 Value) locates an ASL object by its name, ObjName, in the DSDT and updates its data start with the user provided Value.
UpdateAslNameOfDevice | EFI_STATUS UpdateAslNameOfDevice(IN ACPI_HDR *PDsdt, IN CHAR8 *DeviceName, CHAR8 *ObjName, IN UINT64 Value) locates an ASL Device Object by its name, DeviceName, and then In the scope of this Device Object, trys to locate a Name Object, ObjName, in the DSDT. If found it updates its data place holder with user provided Value.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

V

Function | Description
ValidateDescriptor | BOOLEAN ValidateDescriptor(IN ASLR_QWORD_ASD *Descriptor, IN ASLR_TYPE_ENUM ResType, IN BOOLEAN Fixed) validates a ASLV_LARGE_RES descriptor.
ValidateDescriptorBlock | UINTN ValidateDescriptorBlock(IN ASLR_QWORD_ASD *DscStart, IN ASLR_TYPE_ENUM ResType, IN BOOLEAN Fixed) validates the consistancy of the provided ACPI QWORD resource descriptors block which contains some number of ASLR_QWORD_ASDs in memory terminated by an ASLR_EndTag. Returns the total size of the resource descriptors plus the size of the ASLR_EndTag.

Built on 23:24:29 02/23/10


Functions in Alphabetical Order

W

Function | Description
WaitForever | VOID WaitForever() performs an infinite loop which does nothing.
WaitForSemaphore | VOID WaitForSemaphore(IN volatile UINT8 *Semaphore) waits for the semaphore to become available; once available, it claims the semaphore and returns.
WaitUntilZero32 | VOID WaitUntilZero32(IN volatile UINT32 *Value) waits until the UINT32 value stored at the Value address becomes 0, then continues.
WaitUntilZero8 | VOID WaitUntilZero8(IN volatile UINT8 *Value) waits until the byte stored at Value becomes 0, then continues.
Wcscmp | INT32 Wcscmp(IN CHAR16 *string1, IN CHAR16 *string2) compares two CHAR16 strings, string1 and string2, and returns 0 if they are identical, non-zero if they are not identical.
Wcscpy | CHAR16* Wcscpy(IN OUT CHAR16 *string1, IN CHAR16 *string2) copies the contents of a CHAR16 string, string2, into another CHAR16 string, string1.
Wcslen | UINTN Wcslen(IN CHAR16 *string) takes a null-terminated CHAR16 string and returns its UINTN length (not including the null-terminator).
Wcsupr | CHAR16* Wcsupr(IN CHAR16 *str) converts a CHAR16 string to all uppercase characters.
WriteBootToOsPerformanceData | VOID WriteBootToOsPerformanceData() allocates a block of memory and writes performance data into it.
WriteCr3 | VOID WriteCr3(IN UINTN CR3) writes the provided value to the CR3 register.
WriteMsr | VOID WriteMsr(IN UINT32 Msr, IN UINT64 Value) writes the Value to the supplied MSR index, Msr.

Built on 23:24:29 02/23/10


General Information

Header | Description
CPU_Functions | CPU related functions defined in the AMI library.
Cstring_Functions | C string handling functions, typically found in string.h, that are defined in the AMI library.
Ctype_Functions | C character handling functions, typically found in ctype.h, that are defined in the AMI library.
Debug_Functions | Debug related functions defined in the AMI library.
Device_Path_Functions | Device path related functions defined in the AMI library.
Doubly_Linked_List_Functions | The following functions are provided by the AMI library as a basic API for a doubly-linked list. Note that the DLINK node structure does not include an entry for the actual data. There are several methods for getting around this limitation. The easiest method is to create a new structure type which contains a DLINK structure as its first member and the data afterwards. This new structure can then be typecasted to the old DLINK type when using the API. See notes for an example. There are presently no search functions provided for this API.
IO_Read_Write_Functions | Generic I/O read/write functions.
Math_64_Bit_Functions | Math functions involving 64-bit input parameters designed to be usable on both 32-bit and 64-bit platforms.
Memory_Functions | Memory functions defined in the AMI library. Note some may only be available in DXE.
Performance_Measurement_Functions | Functions which are used to measure boot performance that are defined in the AMI library.
Stdio_Functions | C standard I/O functions, typically found in stdio.h, that are defined in the AMI library.
Stdlib_Functions | C standard general utilities library functions, typically found in stdlib.h, that are defined in the AMI library.
String_Functions | String related functions that are defined in the AMI library.


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2010 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.