Skip to content

Commit

Permalink
Patches: Adapt ShellPkg patches for edk2-stable202202
Browse files Browse the repository at this point in the history
  • Loading branch information
PMheart authored and vit9696 committed Mar 5, 2022
1 parent 3984b40 commit 56697e1
Showing 1 changed file with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Subject: [PATCH] ShellPkg: Devices shell command support misaligned device
1 file changed, 27 insertions(+)

diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index 4e639fe..c9b2d5a 100644
index 509eb60e40..c95c18e32a 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -573,6 +573,25 @@ EfiShellGetDevicePathFromFilePath(
@@ -598,6 +598,25 @@ EfiShellGetDevicePathFromFilePath (
return (DevicePathForReturn);
}

Expand All @@ -38,23 +38,15 @@ index 4e639fe..c9b2d5a 100644
/**
Gets the name of the device specified by the device handle.

@@ -630,6 +649,7 @@ EfiShellGetDeviceName(
EFI_HANDLE *ParentControllerBuffer;
UINTN ParentDriverCount;
EFI_HANDLE *ParentDriverBuffer;
+ BOOLEAN NeedsRealign;

if (BestDeviceName == NULL ||
DeviceHandle == NULL
@@ -748,7 +768,14 @@ EfiShellGetDeviceName(
@@ -783,7 +802,14 @@ EfiShellGetDeviceName (
//
if (DeviceNameToReturn != NULL){
ASSERT(BestDeviceName != NULL);
if (DeviceNameToReturn != NULL) {
ASSERT (BestDeviceName != NULL);
+ NeedsRealign = ((UINTN) DeviceNameToReturn & BIT0) != 0;
+ if (NeedsRealign) {
+ DeviceNameToReturn = RealignString16 (DeviceNameToReturn);
+ }
StrnCatGrow(BestDeviceName, NULL, DeviceNameToReturn, 0);
StrnCatGrow (BestDeviceName, NULL, DeviceNameToReturn, 0);
+ if (NeedsRealign) {
+ FreePool (DeviceNameToReturn);
+ }
Expand Down

0 comments on commit 56697e1

Please sign in to comment.