diff options
author | gikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-03 08:14:36 +0000 |
---|---|---|
committer | gikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-03 08:14:36 +0000 |
commit | 192b057b078b4af1754a72391cfdd0577a0600f8 (patch) | |
tree | d8bead99fa616484caf995ab5b077cf8f580b639 /MdeModulePkg/Universal/DevicePathDxe | |
parent | 0a9fe763390d9ba730e8bd0b017b0d51742543fb (diff) | |
download | edk2-192b057b078b4af1754a72391cfdd0577a0600f8.tar.gz edk2-192b057b078b4af1754a72391cfdd0577a0600f8.tar.bz2 edk2-192b057b078b4af1754a72391cfdd0577a0600f8.zip |
Add function DevPathFromTextRelativeOffsetRange ().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8023 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DevicePathDxe')
-rw-r--r-- | MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c | 34 |
1 files changed, 34 insertions, 0 deletions
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 @@ -2574,6 +2574,39 @@ DevPathFromTextFvFile ( }
/**
+ 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.
@param TextDeviceNode The input Text device path node.
@@ -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}
|