summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-03 11:18:19 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-03 11:18:19 +0000
commit395ed063d9847022bfec1e3827d7752950f73d6e (patch)
tree096dac01546afadf522673876f9098a529b870ea
parent23042a556b73232ac4b620b0a66a53129c916539 (diff)
downloadedk2-platforms-395ed063d9847022bfec1e3827d7752950f73d6e.tar.xz
Apply WriteUnaligned64() to write DevicePath structure.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8027 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
index 75211e879a..0c1f6a61a7 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
@@ -2586,22 +2586,26 @@ DevPathFromTextRelativeOffsetRange (
IN CHAR16 *TextDeviceNode
)
{
- CHAR16 *StartingOffsetStr;
- CHAR16 *EndingOffsetStr;
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
- *Offset;
+ CHAR16 *StartingOffsetStr;
+ CHAR16 *EndingOffsetStr;
+ MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
+ UINT64 StartingOffset;
+ UINT64 EndingOffset;
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);
+ 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, &StartingOffset);
+ Strtoi64 (EndingOffsetStr, &EndingOffset);
+
+ WriteUnaligned64 ((VOID *) &Offset->StartingOffset, StartingOffset);
+ WriteUnaligned64 ((VOID *) &Offset->EndingOffset, EndingOffset);
+
return (EFI_DEVICE_PATH_PROTOCOL *) Offset;
}