]> git.proxmox.com Git - mirror_edk2.git/blob - EdkShellBinPkg/GenBin/Shell_HotFix.diff
edk2/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc:
[mirror_edk2.git] / EdkShellBinPkg / GenBin / Shell_HotFix.diff
1 diff -urN Shell1.04\Shell/Library/DPath.c EdkCompatibilityPkg\Shell/Library/DPath.c
2 --- Shell1.04\Shell/Library/DPath.c 2007-11-15 14:38:52.000000000 +0800
3 +++ EdkCompatibilityPkg\Shell/Library/DPath.c 2008-02-25 13:38:07.000000000 +0800
4 @@ -1,6 +1,6 @@
5 /*++
6
7 -Copyright (c) 2005 - 2007, Intel Corporation
8 +Copyright (c) 2005 - 2008, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 @@ -1294,17 +1294,8 @@
13 ASSERT (Str != NULL);
14 ASSERT (DevPath != NULL);
15
16 - if (ST->Hdr.Revision > 0x00020000) {
17 - FvPath = DevPath;
18 - CatPrint (Str, L"Fv(%g)", &FvPath->NameGuid);
19 - } else if (ST->Hdr.Revision < 0x00020000) {
20 - //
21 - // MEDIA_FV_FILEPATH_DP_EFI_1_10 == MEDIA_FV_DP == 0x06
22 - //
23 - _DevPathFvFilePath (Str, DevPath);
24 - } else {
25 - _DevPathNodeUnknown (Str, DevPath);
26 - }
27 + FvPath = DevPath;
28 + CatPrint (Str, L"Fv(%g)", &FvPath->NameGuid);
29 }
30 #endif
31
32 @@ -2006,16 +1997,11 @@
33 #if (EFI_SPECIFICATION_VERSION > 0x00020000)
34 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_EFI_2_00 *FvDevicePathNodeUefi_2_00;
35
36 - if (ST->Hdr.Revision > 0x00020000) {
37 + if (ST->Hdr.Revision != 0x00020000) {
38 if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
39 DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
40 return &FvDevicePathNode->NameGuid;
41 }
42 - } else if (ST->Hdr.Revision < 0x00020000) {
43 - if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
44 - DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP_EFI_1_10) {
45 - return &FvDevicePathNode->NameGuid;
46 - }
47 } else {
48 FvDevicePathNodeUefi_2_00 = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_EFI_2_00 *)FvDevicePathNode;
49 if (DevicePathType (&FvDevicePathNodeUefi_2_00->Piwg.Header) == MEDIA_DEVICE_PATH &&
50 diff -urN Shell1.04\Shell/Library/DPath.h EdkCompatibilityPkg\Shell/Library/DPath.h
51 --- Shell1.04\Shell/Library/DPath.h 2007-11-14 22:48:14.000000000 +0800
52 +++ EdkCompatibilityPkg\Shell/Library/DPath.h 2008-02-25 13:38:07.000000000 +0800
53 @@ -1,6 +1,6 @@
54 /*++
55
56 -Copyright (c) 2005 - 2007, Intel Corporation
57 +Copyright (c) 2005 - 2008, Intel Corporation
58 All rights reserved. This program and the accompanying materials
59 are licensed and made available under the terms and conditions of the BSD License
60 which accompanies this distribution. The full text of the license may be found at
61 @@ -161,11 +161,6 @@
62
63 #if (EFI_SPECIFICATION_VERSION > 0x00020000)
64 //
65 -// For EFI1.10 FV file device path
66 -//
67 -#define MEDIA_FV_FILEPATH_DP_EFI_1_10 0x06
68 -
69 -//
70 // For UEFI2.0 FV file device path
71 //
72 typedef struct {
73 diff -urN Shell1.04\Shell/Library/FileIO.c EdkCompatibilityPkg\Shell/Library/FileIO.c
74 --- Shell1.04\Shell/Library/FileIO.c 2006-03-15 11:54:44.000000000 +0800
75 +++ EdkCompatibilityPkg\Shell/Library/FileIO.c 2008-03-24 13:44:52.000000000 +0800
76 @@ -1,6 +1,6 @@
77 /*++
78
79 -Copyright (c) 2005, Intel Corporation
80 +Copyright (c) 2005 - 2008, Intel Corporation
81 All rights reserved. This program and the accompanying materials
82 are licensed and made available under the terms and conditions of the BSD License
83 which accompanies this distribution. The full text of the license may be found at
84 @@ -253,14 +253,16 @@
85
86 --*/
87 {
88 - EFI_STATUS Status;
89 - EFI_FILE_HANDLE LastHandle;
90 - FILEPATH_DEVICE_PATH *FilePathNode;
91 + EFI_STATUS Status;
92 + EFI_FILE_HANDLE LastHandle;
93 + FILEPATH_DEVICE_PATH *FilePathNode;
94 + EFI_DEVICE_PATH_PROTOCOL *AlignedFilePath;
95
96 ASSERT (FilePath != NULL);
97 ASSERT (DeviceHandle != NULL);
98 ASSERT (FileHandle != NULL);
99 -
100 +
101 + AlignedFilePath = NULL;
102 //
103 // File the file system for this file path
104 //
105 @@ -274,12 +276,26 @@
106 *FileHandle = LibOpenRoot (*DeviceHandle);
107 Status = *FileHandle ? EFI_SUCCESS : EFI_UNSUPPORTED;
108
109 + if (EFI_ERROR (Status)) {
110 + return Status;
111 + }
112 +
113 + //
114 + // Duplicate FilePath to make sure it is aligned so that
115 + // FilePathNode->PathName below is 16-bit aligned.
116 + //
117 + AlignedFilePath = DuplicateDevicePath(*FilePath);
118 + if (AlignedFilePath == NULL) {
119 + (*FileHandle)->Close (*FileHandle);
120 + *FileHandle = NULL;
121 + return EFI_OUT_OF_RESOURCES;
122 + }
123 + FilePathNode = (FILEPATH_DEVICE_PATH *)AlignedFilePath;
124 //
125 // To access as a file system, the file path should only
126 // contain file path components. Follow the file path nodes
127 // and find the target file
128 //
129 - FilePathNode = (FILEPATH_DEVICE_PATH *) *FilePath;
130 while (!IsDevicePathEnd (&FilePathNode->Header)) {
131 //
132 // For file system access each node should be a file path component
133 @@ -332,6 +348,7 @@
134 if (EFI_ERROR (Status)) {
135 *FileHandle = NULL;
136 }
137 + FreePool(AlignedFilePath);
138
139 return Status;
140 }
141 diff -urN Shell1.04\Shell/shellenv/var.c EdkCompatibilityPkg\Shell/shellenv/var.c
142 --- Shell1.04\Shell/shellenv/var.c 2006-03-07 16:20:44.000000000 +0800
143 +++ EdkCompatibilityPkg\Shell/shellenv/var.c 2008-02-25 13:38:08.000000000 +0800
144 @@ -389,8 +389,15 @@
145 {
146 UINTN Size;
147 VARIABLE_ID *Var;
148 + UINTN RoundUpValueSize;
149
150 - Size = sizeof (VARIABLE_ID) + StrSize (Name) + ValueSize;
151 + //
152 + // Variable buffer layout: VARIABLE_ID + Value + Name
153 + // We need to round up the variable size to make sure Name is aligned (for IPF).
154 + //
155 + RoundUpValueSize = (ValueSize % 2) ? (ValueSize + 1) : ValueSize;
156 +
157 + Size = sizeof (VARIABLE_ID) + StrSize (Name) + RoundUpValueSize;
158 Var = AllocateZeroPool (Size);
159 if (Var == NULL) {
160 return NULL;
161 @@ -398,7 +405,7 @@
162
163 Var->Signature = VARIABLE_SIGNATURE;
164 Var->u.Value = ((UINT8 *) Var) + sizeof (VARIABLE_ID);
165 - Var->Name = (CHAR16 *) (Var->u.Value + ValueSize);
166 + Var->Name = (CHAR16 *) (Var->u.Value + RoundUpValueSize);
167 Var->ValueSize = ValueSize;
168 CopyMem (Var->u.Value, Value, ValueSize);
169 StrCpy (Var->Name, Name);
170 diff -urN Shell1.04\Shell/ver/Ver.inf EdkCompatibilityPkg\Shell/ver/Ver.inf
171 --- Shell1.04\Shell/ver/Ver.inf 2007-03-04 23:30:48.000000000 +0800
172 +++ EdkCompatibilityPkg\Shell/ver/Ver.inf 2008-03-03 13:36:05.000000000 +0800
173 @@ -1,6 +1,6 @@
174 #/*++
175 #
176 -# Copyright (c) 2005 - 2007, Intel Corporation
177 +# Copyright (c) 2005 - 2008, Intel Corporation
178 # All rights reserved. This program and the accompanying materials
179 # are licensed and made available under the terms and conditions of the BSD License
180 # which accompanies this distribution. The full text of the license may be found at
181 @@ -45,7 +45,7 @@
182 Ver.c
183 Ver.h
184
185 -[sources.ia32|x64]
186 +[sources.ia32,sources.x64]
187 ia32\ver32.c
188
189 [sources.ipf]