Add function DevPathFromTextRelativeOffsetRange ().

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8023 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gikidy 2009-04-03 08:14:36 +00:00
parent 0a9fe76339
commit 192b057b07
1 changed files with 34 additions and 0 deletions

View File

@ -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}