diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-15 19:56:50 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-15 19:56:50 +0000 |
commit | 6bab33c7b677dea7a67df512ef1a058daeebef57 (patch) | |
tree | e9016ca1b3d736c5a831e72bc43cb466383d1da9 /ArmPlatformPkg/Bds/BootOptionSupport.c | |
parent | e862cd50c6a12183204ba0fa93403d88fd2e0376 (diff) | |
download | edk2-platforms-6bab33c7b677dea7a67df512ef1a058daeebef57.tar.xz |
ArmPlatformPkg/Bds: Fix various bugs in the new BDS
The errors were:
- uncaught returned error
- used of uninitialized variables
ArmPlatformPkg/Bds: Implement the update of MemMap Boot Device
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11830 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Bds/BootOptionSupport.c')
-rw-r--r-- | ArmPlatformPkg/Bds/BootOptionSupport.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c b/ArmPlatformPkg/Bds/BootOptionSupport.c index 7de2df4825..a4396b5109 100644 --- a/ArmPlatformPkg/Bds/BootOptionSupport.c +++ b/ArmPlatformPkg/Bds/BootOptionSupport.c @@ -386,7 +386,7 @@ BdsLoadOptionFileSystemUpdateDevicePath ( Print(L"File path of the EFI Application or the kernel: ");
UnicodeStrToAsciiStr (EndingDevicePath->PathName,AsciiBootFilePath);
- Status = EditHIInputAscii(AsciiBootFilePath,BOOT_DEVICE_FILEPATH_MAX);
+ Status = EditHIInputAscii (AsciiBootFilePath,BOOT_DEVICE_FILEPATH_MAX);
if (EFI_ERROR(Status)) {
return Status;
}
@@ -567,9 +567,40 @@ BdsLoadOptionMemMapUpdateDevicePath ( OUT UINT32 *Attributes
)
{
- ASSERT(0);
- //TODO: Implement me
- return EFI_SUCCESS;
+ EFI_STATUS Status;
+ CHAR8 AsciiStartingAddress[BOOT_DEVICE_ADDRESS_MAX];
+ CHAR8 AsciiEndingAddress[BOOT_DEVICE_ADDRESS_MAX];
+ MEMMAP_DEVICE_PATH* EndingDevicePath;
+ EFI_DEVICE_PATH* DevicePath;
+
+ DevicePath = DuplicateDevicePath (BootOption->FilePathList);
+ EndingDevicePath = (MEMMAP_DEVICE_PATH*)GetLastDevicePathNode (DevicePath);
+
+ Print(L"Starting Address of the binary: ");
+ AsciiSPrint (AsciiStartingAddress,BOOT_DEVICE_ADDRESS_MAX,"0x%X",(UINTN)EndingDevicePath->StartingAddress);
+ Status = EditHIInputAscii (AsciiStartingAddress,BOOT_DEVICE_ADDRESS_MAX);
+ if (EFI_ERROR(Status)) {
+ return EFI_ABORTED;
+ }
+
+ Print(L"Ending Address of the binary: ");
+ AsciiSPrint (AsciiEndingAddress,BOOT_DEVICE_ADDRESS_MAX,"0x%X",(UINTN)EndingDevicePath->EndingAddress);
+ Status = EditHIInputAscii (AsciiEndingAddress,BOOT_DEVICE_ADDRESS_MAX);
+ if (EFI_ERROR(Status)) {
+ return EFI_ABORTED;
+ }
+
+ EndingDevicePath->StartingAddress = AsciiStrHexToUint64 (AsciiStartingAddress);
+ EndingDevicePath->EndingAddress = AsciiStrHexToUint64 (AsciiEndingAddress);
+
+ Status = BootDeviceGetType (NULL, BootType, Attributes);
+ if (EFI_ERROR(Status)) {
+ FreePool(DevicePath);
+ } else {
+ *NewDevicePath = DevicePath;
+ }
+
+ return Status;
}
BOOLEAN
|