MdePkg: Add BMC device path definition and its node/text conversion

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17985 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hao Wu
2015-07-15 03:16:42 +00:00
committed by hwu1225
parent c8c2815802
commit 624f017e17
3 changed files with 90 additions and 0 deletions

View File

@@ -793,6 +793,40 @@ DevPathFromTextCtrl (
return (EFI_DEVICE_PATH_PROTOCOL *) Controller;
}
/**
Converts a text device path node to BMC device path structure.
@param TextDeviceNode The input Text device path node.
@return A pointer to the newly-created BMC device path structure.
**/
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextBmc (
IN CHAR16 *TextDeviceNode
)
{
CHAR16 *InterfaceTypeStr;
CHAR16 *BaseAddressStr;
BMC_DEVICE_PATH *BmcDp;
InterfaceTypeStr = GetNextParamStr (&TextDeviceNode);
BaseAddressStr = GetNextParamStr (&TextDeviceNode);
BmcDp = (BMC_DEVICE_PATH *) CreateDeviceNode (
HARDWARE_DEVICE_PATH,
HW_BMC_DP,
(UINT16) sizeof (BMC_DEVICE_PATH)
);
BmcDp->InterfaceType = (UINT8) Strtoi (InterfaceTypeStr);
WriteUnaligned64 (
(UINT64 *) (&BmcDp->BaseAddress),
StrHexToUint64 (BaseAddressStr)
);
return (EFI_DEVICE_PATH_PROTOCOL *) BmcDp;
}
/**
Converts a generic ACPI text device path node to ACPI device path structure.
@@ -3423,6 +3457,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"MemoryMapped", DevPathFromTextMemoryMapped },
{L"VenHw", DevPathFromTextVenHw },
{L"Ctrl", DevPathFromTextCtrl },
{L"Bmc", DevPathFromTextBmc },
{L"AcpiPath", DevPathFromTextAcpiPath },
{L"Acpi", DevPathFromTextAcpi },