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