From 192b057b078b4af1754a72391cfdd0577a0600f8 Mon Sep 17 00:00:00 2001 From: gikidy Date: Fri, 3 Apr 2009 08:14:36 +0000 Subject: Add function DevPathFromTextRelativeOffsetRange (). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8023 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/DevicePathDxe/DevicePathFromText.c | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'MdeModulePkg/Universal/DevicePathDxe') diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c index 3cc08a4502..75211e879a 100644 --- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c +++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c @@ -2573,6 +2573,39 @@ DevPathFromTextFvFile ( return (EFI_DEVICE_PATH_PROTOCOL *) FvFile; } +/** + Converts a text device path node to text relative offset device path structure. + + @param TextDeviceNode The input Text device path node. + + @return A pointer to the newly-created Text device path structure. + +**/ +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextRelativeOffsetRange ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *StartingOffsetStr; + CHAR16 *EndingOffsetStr; + MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH + *Offset; + + StartingOffsetStr = GetNextParamStr (&TextDeviceNode); + EndingOffsetStr = GetNextParamStr (&TextDeviceNode); + Offset = (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *) + CreateDeviceNode ( + MEDIA_DEVICE_PATH, + MEDIA_RELATIVE_OFFSET_RANGE_DP, + sizeof (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH) + ); + + Strtoi64 (StartingOffsetStr, &Offset->StartingOffset); + Strtoi64 (EndingOffsetStr, &Offset->EndingOffset); + + return (EFI_DEVICE_PATH_PROTOCOL *) Offset; +} + /** Converts a text device path node to BIOS Boot Specification device path structure. @@ -2728,6 +2761,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[] {L"Media", DevPathFromTextMedia}, {L"Fv", DevPathFromTextFv}, {L"FvFile", DevPathFromTextFvFile}, + {L"Offset", DevPathFromTextRelativeOffsetRange}, {L"BBS", DevPathFromTextBBS}, {L"Sata", DevPathFromTextSata}, {NULL, NULL} -- cgit v1.2.3