diff --git a/DeviceTree/DevicetreeStrings.uni b/DeviceTree/DevicetreeStrings.uni index 6bb31c3..80f7fca 100644 Binary files a/DeviceTree/DevicetreeStrings.uni and b/DeviceTree/DevicetreeStrings.uni differ diff --git a/DeviceTree/devicetree.inf b/DeviceTree/devicetree.inf index f346f0b..a86a1a0 100644 --- a/DeviceTree/devicetree.inf +++ b/DeviceTree/devicetree.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=DevicetreeMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/EDK_Snapshot.txt b/EDK_Snapshot.txt index 9c47365..4907998 100644 --- a/EDK_Snapshot.txt +++ b/EDK_Snapshot.txt @@ -1,5 +1,5 @@ Notes: - This EFI Shell release package has been tested on the 2006-09-04's EDK which snapshot -is Edk-Dev-Snapshot-20060904, User can get this version EDK from the following URL: - http://edk.tianocore.org/files/documents/16/273/Edk-Dev-Snapshot-20060904.zip + This EFI Shell release package has been tested on the 2007-03-15's EDK which snapshot +is Edk-Dev-Snapshot-20070315, User can get this version EDK from the following URL: + https://edk.tianocore.org/files/documents/16/338/Edk-Dev-Snapshot-20070315.zip We don't guarantee this package can work correctly on the other EDK snapshot. \ No newline at end of file diff --git a/EfiCompress/CompressMain.c b/EfiCompress/CompressMain.c index 7251be5..3edb17e 100644 --- a/EfiCompress/CompressMain.c +++ b/EfiCompress/CompressMain.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -365,6 +365,23 @@ Routine Description: Status = Compress (File1Buffer, (UINT32) SourceSize, File2Buffer, (UINT32 *) &DestinationSize); + if (Status == EFI_BUFFER_TOO_SMALL) { + FreePool (File2Buffer); + File2Buffer = AllocatePool (DestinationSize); + if (File2Buffer == NULL) { + PrintToken (STRING_TOKEN (STR_COMPRESS_OUT_OF_MEM), HiiCompressHandle, L"eficompress"); + Status = EFI_OUT_OF_RESOURCES; + goto Done; + } + + Status = Compress (File1Buffer, (UINT32) SourceSize, File2Buffer, (UINT32 *) &DestinationSize); + } + + if (EFI_ERROR (Status)) { + PrintToken (STRING_TOKEN (STR_COMPRESS_COMPRESS_ERROR), HiiCompressHandle, L"eficompress", Status); + goto Done; + } + if (SourceSize) { Ratio = ((INT32) SourceSize * 100 - (INT32) DestinationSize * 100) / (INT32) SourceSize; if (Ratio >= 0) { @@ -396,23 +413,6 @@ Routine Description: ); } - if (Status == EFI_BUFFER_TOO_SMALL) { - FreePool (File2Buffer); - File2Buffer = AllocatePool (DestinationSize); - if (File2Buffer == NULL) { - PrintToken (STRING_TOKEN (STR_COMPRESS_OUT_OF_MEM), HiiCompressHandle, L"eficompress"); - Status = EFI_OUT_OF_RESOURCES; - goto Done; - } - - Status = Compress (File1Buffer, (UINT32) SourceSize, File2Buffer, (UINT32 *) &DestinationSize); - } - - if (EFI_ERROR (Status)) { - PrintToken (STRING_TOKEN (STR_COMPRESS_COMPRESS_ERROR), HiiCompressHandle, L"eficompress", Status); - goto Done; - } - Status = File2Handle->Write (File2Handle, &DestinationSize, File2Buffer); if (EFI_ERROR (Status)) { PrintToken (STRING_TOKEN (STR_COMPRESS_WRITE_ERROR), HiiCompressHandle, L"eficompress", File2Arg->FullName, Status); diff --git a/EfiCompress/CompressStrings.uni b/EfiCompress/CompressStrings.uni index 08f8ab7..1012df9 100644 Binary files a/EfiCompress/CompressStrings.uni and b/EfiCompress/CompressStrings.uni differ diff --git a/EfiCompress/compress.c b/EfiCompress/compress.c index 98c2486..e21c1f6 100644 --- a/EfiCompress/compress.c +++ b/EfiCompress/compress.c @@ -1,9 +1,9 @@ -/*++ +/* -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at +which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, @@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: - Compress.c + compress.c Abstract: @@ -25,39 +25,40 @@ Module Name: #include "EfiShellLib.h" + // // Macro Definitions // -typedef INT32 NODE; -#define UINT8_MAX 0xff -#define UINT8_BIT 8 -#define THRESHOLD 3 -#define INIT_CRC 0 -#define WNDBIT 19 -#define WNDSIZ (1U << WNDBIT) -#define MAXMATCH 256 -#define BLKSIZ (1U << 14) // 16 * 1024U -#define PERC_FLAG 0x80000000U -#define CODE_BIT 16 -#define NIL 0 -#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX) -#define HASH(p, c) ((p) + ((c) << (WNDBIT - 9)) + WNDSIZ * 2) -#define CRCPOLY 0xA001 -#define UPDATE_CRC(c) mCrc = mCrcTable[(mCrc ^ (c)) & 0xFF] ^ (mCrc >> UINT8_BIT) +typedef INT16 NODE; +#define UINT8_MAX 0xff +#define UINT8_BIT 8 +#define THRESHOLD 3 +#define INIT_CRC 0 +#define WNDBIT 13 +#define WNDSIZ (1U << WNDBIT) +#define MAXMATCH 256 +#define BLKSIZ (1U << 14) // 16 * 1024U +#define PERC_FLAG 0x8000U +#define CODE_BIT 16 +#define NIL 0 +#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX) +#define HASH(p, c) ((p) + ((c) << (WNDBIT - 9)) + WNDSIZ * 2) +#define CRCPOLY 0xA001 +#define UPDATE_CRC(c) mCrc = mCrcTable[(mCrc ^ (c)) & 0xFF] ^ (mCrc >> UINT8_BIT) // // C: the Char&Len Set; P: the Position Set; T: the exTra Set // -#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD) -#define CBIT 9 -#define NP (WNDBIT + 1) -#define PBIT 5 -#define NT (CODE_BIT + 3) -#define TBIT 5 +#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD) +#define CBIT 9 +#define NP (WNDBIT + 1) +#define PBIT 4 +#define NT (CODE_BIT + 3) +#define TBIT 5 #if NT > NP -#define NPT NT + #define NPT NT #else -#define NPT NP + #define NPT NP #endif // // Function Prototypes @@ -260,8 +261,9 @@ STATIC INT32 mRemainder, mMatchLen, mBitCount, mHeapSize, mN; STATIC UINT32 mBufSiz = 0, mOutputPos, mOutputMask, mSubBitBuf, mCrc; STATIC UINT32 mCompSize, mOrigSize; -STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1], mCrcTable[UINT8_MAX + 1], - mCFreq[2 * NC - 1], mCTable[4096], mCCode[NC], mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1]; +STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1], + mCrcTable[UINT8_MAX + 1], mCFreq[2 * NC - 1], mCTable[4096], mCCode[NC], + mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1]; STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NULL; @@ -691,7 +693,7 @@ Returns: (VOID) } if (t < WNDSIZ) { - mPosition[t] = (NODE) (mPos | (UINT32) PERC_FLAG); + mPosition[t] = (NODE) (mPos | PERC_FLAG); } } else { // @@ -719,7 +721,7 @@ Returns: (VOID) mMatchPos = r; } else { j = mLevel[r]; - mMatchPos = (NODE) (mPosition[r] & (UINT32)~PERC_FLAG); + mMatchPos = (NODE) (mPosition[r] & ~PERC_FLAG); } if (mMatchPos >= mPos) { @@ -817,7 +819,7 @@ Returns: (VOID) return ; } - t = (NODE) (mPosition[r] & (UINT32)~PERC_FLAG); + t = (NODE) (mPosition[r] & ~PERC_FLAG); if (t >= mPos) { t -= WNDSIZ; } @@ -825,8 +827,8 @@ Returns: (VOID) s = t; q = mParent[r]; u = mPosition[q]; - while (u & (UINT32) PERC_FLAG) { - u &= (UINT32)~PERC_FLAG; + while (u & PERC_FLAG) { + u &= ~PERC_FLAG; if (u >= mPos) { u -= WNDSIZ; } @@ -849,7 +851,7 @@ Returns: (VOID) s = u; } - mPosition[q] = (NODE) (s | WNDSIZ | (UINT32) PERC_FLAG); + mPosition[q] = (NODE) (s | WNDSIZ | PERC_FLAG); } s = Child (r, mText[t + mLevel[r]]); @@ -962,15 +964,14 @@ Arguments: (VOID) // Not enough benefits are gained by outputting a pointer, // so just output the original character // - CompressOutput (mText[mPos - 1], 0); + CompressOutput(mText[mPos - 1], 0); } else { // // Outputting a pointer is beneficial enough, do it. // - CompressOutput ( - LastMatchLen + (UINT8_MAX + 1 - THRESHOLD), - (mPos - LastMatchPos - 2) & (WNDSIZ - 1) - ); + + CompressOutput(LastMatchLen + (UINT8_MAX + 1 - THRESHOLD), + (mPos - LastMatchPos - 2) & (WNDSIZ - 1)); LastMatchLen--; while (LastMatchLen > 0) { GetNextMatch (); @@ -1189,7 +1190,7 @@ EncodeP ( PutBits (mPTLen[c], mPTCode[c]); if (c > 1) { - PutBits (c - 1, p & (0xFFFFFFFFU >> (32 - c + 1))); + PutBits(c - 1, p & (0xFFFFU >> (17 - c))); } } @@ -1216,8 +1217,6 @@ Routine Description: { UINT32 i; - UINT32 j; - UINT32 k; UINT32 Flags; @@ -1265,14 +1264,10 @@ Routine Description: } else { Flags <<= 1; } - if (Flags & (1U << (UINT8_BIT - 1))) { - EncodeC (mBuf[Pos++] + (1U << UINT8_BIT)); - k = mBuf[Pos++]; - for (j = 0; j < 3; j++) { - k <<= UINT8_BIT; - k += mBuf[Pos++]; - } + EncodeC(mBuf[Pos++] + (1U << UINT8_BIT)); + k = mBuf[Pos++] << UINT8_BIT; + k += mBuf[Pos++]; EncodeP (k); } else { @@ -1309,12 +1304,7 @@ Returns: (VOID) if ((mOutputMask >>= 1) == 0) { mOutputMask = 1U << (UINT8_BIT - 1); - // - // Check the buffer overflow per outputing UINT8_BIT symbols - // which is an Original Character or a Pointer. The biggest - // symbol is a Pointer which occupies 5 bytes. - // - if (mOutputPos >= mBufSiz - 5 * UINT8_BIT) { + if (mOutputPos >= mBufSiz - 3 * UINT8_BIT) { SendBlock (); mOutputPos = 0; } @@ -1322,21 +1312,17 @@ Returns: (VOID) CPos = mOutputPos++; mBuf[CPos] = 0; } - mBuf[mOutputPos++] = (UINT8) c; mCFreq[c]++; if (c >= (1U << UINT8_BIT)) { mBuf[CPos] |= mOutputMask; - mBuf[mOutputPos++] = (UINT8) (p >> 24); - mBuf[mOutputPos++] = (UINT8) (p >> 16); - mBuf[mOutputPos++] = (UINT8) (p >> (UINT8_BIT)); - mBuf[mOutputPos++] = (UINT8) p; - c = 0; + mBuf[mOutputPos++] = (UINT8)(p >> UINT8_BIT); + mBuf[mOutputPos++] = (UINT8) p; + c = 0; while (p) { p >>= 1; c++; } - mPFreq[c]++; } } @@ -1421,22 +1407,30 @@ Routine Description: --*/ { UINT8 Temp; - - while (n >= mBitCount) { - Temp = (UINT8) (mSubBitBuf | (x >> (n -= mBitCount))); - // - // n -= mBitCount should never equal to 32 - // + + if (n < mBitCount) { + mSubBitBuf |= x << (mBitCount -= n); + } else { + + Temp = (UINT8)(mSubBitBuf | (x >> (n -= mBitCount))); if (mDst < mDstUpperLimit) { *mDst++ = Temp; } - mCompSize++; - mSubBitBuf = 0; - mBitCount = UINT8_BIT; - } - mSubBitBuf |= x << (mBitCount -= n); + if (n < UINT8_BIT) { + mSubBitBuf = x << (mBitCount = UINT8_BIT - n); + } else { + + Temp = (UINT8)(x >> (n - UINT8_BIT)); + if (mDst < mDstUpperLimit) { + *mDst++ = Temp; + } + mCompSize++; + + mSubBitBuf = x << (mBitCount = 2 * UINT8_BIT - n); + } + } } STATIC diff --git a/EfiDecompress/Decompress.c b/EfiDecompress/Decompress.c index cfec1b9..918f673 100644 --- a/EfiDecompress/Decompress.c +++ b/EfiDecompress/Decompress.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -31,7 +31,6 @@ extern UINT8 STRING_ARRAY_NAME[]; // #include STRING_DEFINES_FILE -#include EFI_PROTOCOL_DEFINITION (TianoDecompress) #include EFI_PROTOCOL_DEFINITION (decompress) EFI_HII_HANDLE HiiDecompressHandle; @@ -193,7 +192,7 @@ Routine Description: // // // - Status = LibLocateProtocol (&gEfiTianoDecompressProtocolGuid, &Decompress); + Status = LibLocateProtocol (&gEfiDecompressProtocolGuid, &Decompress); if (EFI_ERROR (Status)) { PrintToken (STRING_TOKEN (STR_DECOMPRESS_PROTOCOL_NOT_FOUND), HiiDecompressHandle, L"efidecompress"); Status = EFI_UNSUPPORTED; diff --git a/EfiDecompress/DecompressStrings.uni b/EfiDecompress/DecompressStrings.uni index 856211c..53e4cf6 100644 Binary files a/EfiDecompress/DecompressStrings.uni and b/EfiDecompress/DecompressStrings.uni differ diff --git a/IpConfig/IpConfigStrings.uni b/IpConfig/IpConfigStrings.uni index 1d779c2..624340e 100644 Binary files a/IpConfig/IpConfigStrings.uni and b/IpConfig/IpConfigStrings.uni differ diff --git a/Library/ConsistMapping.c b/Library/ConsistMapping.c index e3a0834..c6fe366 100644 --- a/Library/ConsistMapping.c +++ b/Library/ConsistMapping.c @@ -170,17 +170,17 @@ AppendCSDGuid ( Buffer, 0, L"%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x", - Guid->Data1, - Guid->Data2, - Guid->Data3, - Guid->Data4[0], - Guid->Data4[1], - Guid->Data4[2], - Guid->Data4[3], - Guid->Data4[4], - Guid->Data4[5], - Guid->Data4[6], - Guid->Data4[7] + (UINTN) Guid->Data1, + (UINTN) Guid->Data2, + (UINTN) Guid->Data3, + (UINTN) Guid->Data4[0], + (UINTN) Guid->Data4[1], + (UINTN) Guid->Data4[2], + (UINTN) Guid->Data4[3], + (UINTN) Guid->Data4[4], + (UINTN) Guid->Data4[5], + (UINTN) Guid->Data4[6], + (UINTN) Guid->Data4[7] ); StrLwr (Buffer); AppendCSDStr (MappingItem, Buffer); @@ -412,7 +412,7 @@ _DevPathSerialMacAddr ( } for (Index = 0, PBuffer = Buffer; Index < HwAddressSize; Index++, PBuffer += 2) { - SPrint (PBuffer, 0, L"%02x", MAC->MacAddress.Addr[Index]); + SPrint (PBuffer, 0, L"%02x", (UINTN) MAC->MacAddress.Addr[Index]); } AppendCSDStr (MappingItem, Buffer); @@ -434,7 +434,7 @@ _DevPathSerialInfiniBand ( InfiniBand = (INFINIBAND_DEVICE_PATH *) DevicePathNode; for (Index = 0, PBuffer = Buffer; Index < 16; Index++, PBuffer += 2) { - SPrint (PBuffer, 0, L"%02x", InfiniBand->PortGid[Index]); + SPrint (PBuffer, 0, L"%02x", (UINTN) InfiniBand->PortGid[Index]); } AppendCSDStr (MappingItem, Buffer); @@ -460,10 +460,10 @@ _DevPathSerialIPv4 ( Buffer, 0, L"%02x%02x%02x%02x", - IP->LocalIpAddress.Addr[0], - IP->LocalIpAddress.Addr[1], - IP->LocalIpAddress.Addr[2], - IP->LocalIpAddress.Addr[3] + (UINTN) IP->LocalIpAddress.Addr[0], + (UINTN) IP->LocalIpAddress.Addr[1], + (UINTN) IP->LocalIpAddress.Addr[2], + (UINTN) IP->LocalIpAddress.Addr[3] ); AppendCSDStr (MappingItem, Buffer); AppendCSDNum (MappingItem, IP->LocalPort); @@ -471,10 +471,10 @@ _DevPathSerialIPv4 ( Buffer, 0, L"%02x%02x%02x%02x", - IP->RemoteIpAddress.Addr[0], - IP->RemoteIpAddress.Addr[1], - IP->RemoteIpAddress.Addr[2], - IP->RemoteIpAddress.Addr[3] + (UINTN) IP->RemoteIpAddress.Addr[0], + (UINTN) IP->RemoteIpAddress.Addr[1], + (UINTN) IP->RemoteIpAddress.Addr[2], + (UINTN) IP->RemoteIpAddress.Addr[3] ); AppendCSDStr (MappingItem, Buffer); AppendCSDNum (MappingItem, IP->RemotePort); @@ -496,13 +496,13 @@ _DevPathSerialIPv6 ( IP = (IPv6_DEVICE_PATH *) DevicePathNode; for (Index = 0, PBuffer = Buffer; Index < 16; Index++, PBuffer += 2) { - SPrint (PBuffer, 0, L"%02x", IP->LocalIpAddress.Addr[Index]); + SPrint (PBuffer, 0, L"%02x", (UINTN) IP->LocalIpAddress.Addr[Index]); } AppendCSDStr (MappingItem, Buffer); AppendCSDNum (MappingItem, IP->LocalPort); for (Index = 0, PBuffer = Buffer; Index < 16; Index++, PBuffer += 2) { - SPrint (PBuffer, 0, L"%02x", IP->RemoteIpAddress.Addr[Index]); + SPrint (PBuffer, 0, L"%02x", (UINTN) IP->RemoteIpAddress.Addr[Index]); } AppendCSDStr (MappingItem, Buffer); @@ -1016,7 +1016,7 @@ ConsistMappingGenMappingName ( CatPrint (&Str, L"%s", mMTDName[Index].Name); } - CatPrint (&Str, L"%d", MappingInfo.HI); + CatPrint (&Str, L"%d", (UINTN) MappingInfo.HI); if (MappingInfo.CSD.str != NULL) { CatPrint (&Str, L"%s", MappingInfo.CSD.str); } diff --git a/Library/DPath.c b/Library/DPath.c index 0f0a56c..4a57bb6 100644 --- a/Library/DPath.c +++ b/Library/DPath.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -22,6 +22,12 @@ Revision History #include "EfiShelllib.h" +EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL; + +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) +EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS; +#endif + EFI_DEVICE_PATH_PROTOCOL * DevicePathInstance ( IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, @@ -420,7 +426,7 @@ _DevPathPci ( ASSERT (DevPath != NULL); Pci = DevPath; - CatPrint (Str, L"Pci(%x|%x)", Pci->Device, Pci->Function); + CatPrint (Str, L"Pci(%x|%x)", (UINTN) Pci->Device, (UINTN) Pci->Function); } VOID @@ -435,7 +441,7 @@ _DevPathPccard ( ASSERT (DevPath != NULL); Pccard = DevPath; - CatPrint (Str, L"Pccard(Function%x)", Pccard->FunctionNumber); + CatPrint (Str, L"Pccard(Function%x)", (UINTN) Pccard->FunctionNumber); } VOID @@ -452,8 +458,8 @@ _DevPathMemMap ( MemMap = DevPath; CatPrint ( Str, - L"MemMap(%d:%.lx-%.lx)", - MemMap->MemoryType, + L"MemMap(%d:%lx-%lx)", + (UINTN) MemMap->MemoryType, MemMap->StartingAddress, MemMap->EndingAddress ); @@ -474,7 +480,7 @@ _DevPathController ( CatPrint ( Str, L"Ctrl(%d)", - Controller->Controller + (UINTN) Controller->Controller ); } @@ -484,9 +490,14 @@ _DevPathVendor ( IN VOID *DevPath ) { - VENDOR_DEVICE_PATH *Vendor; - CHAR16 *Type; - UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownDevPath; + VENDOR_DEVICE_PATH *Vendor; + CHAR16 *Type; + UINTN DataLength; + UINTN Index; + UINT32 FlowControlMap; +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + UINT16 Info; +#endif ASSERT (Str != NULL); ASSERT (DevPath != NULL); @@ -499,6 +510,74 @@ _DevPathVendor ( case MESSAGING_DEVICE_PATH: Type = L"Msg"; + if (CompareGuid (&Vendor->Guid, &gEfiPcAnsiGuid) == 0) { + CatPrint (Str, L"VenPcAnsi()"); + return ; + } else if (CompareGuid (&Vendor->Guid, &gEfiVT100Guid) == 0) { + CatPrint (Str, L"VenVt100()"); + return ; + } else if (CompareGuid (&Vendor->Guid, &gEfiVT100PlusGuid) == 0) { + CatPrint (Str, L"VenVt100Plus()"); + return ; + } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid) == 0) { + CatPrint (Str, L"VenUft8()"); + return ; + } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid) == 0) { + FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap); + switch (FlowControlMap & 0x00000003) { + case 0: + CatPrint (Str, L"UartFlowCtrl(%s)", L"None"); + break; + + case 1: + CatPrint (Str, L"UartFlowCtrl(%s)", L"Hardware"); + break; + + case 2: + CatPrint (Str, L"UartFlowCtrl(%s)", L"XonXoff"); + break; + + default: + break; + } + + return ; +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid) == 0) { + CatPrint ( + Str, + L"SAS(%lx,%lx,%x,", + ((SAS_DEVICE_PATH *) Vendor)->SasAddress, + ((SAS_DEVICE_PATH *) Vendor)->Lun, + ((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort + ); + Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology); + if ((Info & 0x0f) == 0) { + CatPrint (Str, L"NoTopology,0,0,0,"); + } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) { + CatPrint ( + Str, + L"%s,%s,%s,", + (Info & (0x1 << 4)) ? L"SATA" : L"SAS", + (Info & (0x1 << 5)) ? L"External" : L"Internal", + (Info & (0x1 << 6)) ? L"Expanded" : L"Direct" + ); + if ((Info & 0x0f) == 1) { + CatPrint (Str, L"0,"); + } else { + CatPrint (Str, L"%x,", (UINTN) ((Info >> 8) & 0xff)); + } + } else { + CatPrint (Str, L"0,0,0,0,"); + } + + CatPrint (Str, L"%x)", (UINTN) ((SAS_DEVICE_PATH *) Vendor)->Reserved); + return ; +#endif + } else if (CompareGuid (&Vendor->Guid, &gEfiDebugPortProtocolGuid) == 0) { + CatPrint (Str, L"DebugPort()"); + return ; + } break; case MEDIA_DEVICE_PATH: @@ -511,15 +590,14 @@ _DevPathVendor ( } CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid); - if (CompareGuid (&Vendor->Guid, &UnknownDeviceGuid) == 0) { - // - // GUID used by EFI to enumerate an EDD 1.1 device - // - UnknownDevPath = (UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *) Vendor; - CatPrint (Str, L":%02x)", UnknownDevPath->LegacyDriveLetter); - } else { - CatPrint (Str, L")"); + DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH); + if (DataLength > 0) { + CatPrint (Str, L","); + for (Index = 0; Index < DataLength; Index++) { + CatPrint (Str, L"%02x", (UINTN) ((VENDOR_DEVICE_PATH_WITH_DATA *) Vendor)->VendorDefinedData[Index]); + } } + CatPrint (Str, L")"); } VOID @@ -535,9 +613,9 @@ _DevPathAcpi ( Acpi = DevPath; if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"Acpi(PNP%04x,%x)", EISA_ID_TO_NUM (Acpi->HID), Acpi->UID); + CatPrint (Str, L"Acpi(PNP%04x,%x)", (UINTN) EISA_ID_TO_NUM (Acpi->HID), (UINTN) Acpi->UID); } else { - CatPrint (Str, L"Acpi(%08x,%x)", Acpi->HID, Acpi->UID); + CatPrint (Str, L"Acpi(%08x,%x)", (UINTN) Acpi->HID, (UINTN) Acpi->UID); } } @@ -547,87 +625,78 @@ _DevPathExtendedAcpi ( IN VOID *DevPath ) { - ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; + ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *ExtendedAcpi; // - // Index for HID, UID and CID strings, 0 for non-exist + // HID, UID and CID strings // - UINT16 HIDSTRIdx; - UINT16 UIDSTRIdx; - UINT16 CIDSTRIdx; - UINT16 Index; - UINT16 Length; - UINT16 Anchor; - CHAR8 *AsChar8Array; + CHAR8 *HIDString; + CHAR8 *UIDString; + CHAR8 *CIDString; + ASSERT (Str != NULL); ASSERT (DevPath != NULL); + ASSERT (DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) DevPath) >= + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR)); - HIDSTRIdx = 0; - UIDSTRIdx = 0; - CIDSTRIdx = 0; - ExtendedAcpi = DevPath; - Length = DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) ExtendedAcpi); + ExtendedAcpi = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) DevPath; - ASSERT (Length >= 19); - AsChar8Array = (CHAR8 *) ExtendedAcpi; + HIDString = ExtendedAcpi->HidUidCidStr; + UIDString = NextStrA (HIDString); + CIDString = NextStrA (UIDString); - // - // find HIDSTR - // - Anchor = 16; - for (Index = Anchor; Index < Length && AsChar8Array[Index]; Index++) { - ; - } - if (Index > Anchor) { - HIDSTRIdx = Anchor; - } - // - // find UIDSTR - // - Anchor = Index + 1; - for (Index = Anchor; Index < Length && AsChar8Array[Index]; Index++) { - ; - } - if (Index > Anchor) { - UIDSTRIdx = Anchor; - } - // - // find CIDSTR - // - Anchor = Index + 1; - for (Index = Anchor; Index < Length && AsChar8Array[Index]; Index++) { - ; + CatPrint (Str, L"AcpiEx("); + if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->HID)); + } else { + CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->HID); } - if (Index > Anchor) { - CIDSTRIdx = Anchor; + if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + CatPrint (Str, L"PNP%04x,", (UINTN) EISA_ID_TO_NUM (ExtendedAcpi->CID)); + } else { + CatPrint (Str, L"%08x,", (UINTN) ExtendedAcpi->CID); } - - CatPrint (Str, L"Acpi("); - if (HIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + HIDSTRIdx); + CatPrint (Str, L"%x,", (UINTN) ExtendedAcpi->UID); + + if (*HIDString != '\0') { + CatPrint (Str, L"%a,", HIDString); } else { - if ((ExtendedAcpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", EISA_ID_TO_NUM (ExtendedAcpi->HID)); - } else { - CatPrint (Str, L"%08x,", ExtendedAcpi->HID); - } + CatPrint (Str, L"NULL,"); } - if (CIDSTRIdx != 0) { - CatPrint (Str, L"%a,", AsChar8Array + CIDSTRIdx); + if (*CIDString != '\0') { + CatPrint (Str, L"%a,", CIDString); } else { - if ((ExtendedAcpi->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - CatPrint (Str, L"PNP%04x,", EISA_ID_TO_NUM (ExtendedAcpi->CID)); - } else { - CatPrint (Str, L"%08x,", ExtendedAcpi->CID); - } + CatPrint (Str, L"NULL,"); } - if (UIDSTRIdx != 0) { - CatPrint (Str, L"%a)", AsChar8Array + UIDSTRIdx); + if (*UIDString != '\0') { + CatPrint (Str, L"%a)", UIDString); } else { - CatPrint (Str, L"%x)", ExtendedAcpi->UID); + CatPrint (Str, L"NULL)"); } } +VOID +_DevPathAdrAcpi ( + IN OUT POOL_PRINT *Str, + IN VOID *DevPath + ) +{ + ACPI_ADR_DEVICE_PATH *AcpiAdr; + UINT16 Index; + UINT16 Length; + UINT16 AdditionalAdrCount; + + AcpiAdr = DevPath; + Length = DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr); + AdditionalAdrCount = (Length - 8) / 4; + + CatPrint (Str, L"AcpiAdr(%x", (UINTN) AcpiAdr->ADR); + for (Index = 0; Index < AdditionalAdrCount; Index++) { + CatPrint (Str, L",%x", (UINTN) *(UINT32 *) ((UINT8 *) AcpiAdr + 8 + Index * 4)); + } + CatPrint (Str, L")"); +} + VOID _DevPathAtapi ( IN OUT POOL_PRINT *Str, @@ -660,7 +729,7 @@ _DevPathScsi ( ASSERT (DevPath != NULL); Scsi = DevPath; - CatPrint (Str, L"Scsi(Pun%x,Lun%x)", Scsi->Pun, Scsi->Lun); + CatPrint (Str, L"Scsi(Pun%x,Lun%x)", (UINTN) Scsi->Pun, (UINTN) Scsi->Lun); } VOID @@ -705,9 +774,47 @@ _DevPathUsb ( ASSERT (DevPath != NULL); Usb = DevPath; - CatPrint (Str, L"Usb(%x, %x)", Usb->ParentPortNumber, Usb->InterfaceNumber); + CatPrint (Str, L"Usb(%x,%x)", (UINTN) Usb->ParentPortNumber, (UINTN) Usb->InterfaceNumber); } +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) +void +_DevPathUsbWWID ( + IN OUT POOL_PRINT *Str, + IN VOID *DevPath + ) +{ + USB_WWID_DEVICE_PATH *UsbWWId; + + ASSERT (Str != NULL); + ASSERT (DevPath != NULL); + + UsbWWId = DevPath; + CatPrint ( + Str, + L"UsbWwid(%x,%x,%x,\"WWID\")", + (UINTN) UsbWWId->VendorId, + (UINTN) UsbWWId->ProductId, + (UINTN) UsbWWId->InterfaceNumber + ); +} + +void +_DevPathLogicalUnit ( + IN OUT POOL_PRINT *Str, + IN VOID *DevPath + ) +{ + DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; + + ASSERT (Str != NULL); + ASSERT (DevPath != NULL); + + LogicalUnit = DevPath; + CatPrint (Str, L"Unit(%x)", (UINTN) LogicalUnit->Lun); +} +#endif + VOID _DevPathUsbClass ( IN OUT POOL_PRINT *Str, @@ -725,12 +832,12 @@ _DevPathUsbClass ( UsbClass = DevPath; CatPrint ( Str, - L"Usb Class(%x, %x, %x, %x, %x)", - UsbClass->VendorId, - UsbClass->ProductId, - UsbClass->DeviceClass, - UsbClass->DeviceSubClass, - UsbClass->DeviceProtocol + L"Usb Class(%x,%x,%x,%x,%x)", + (UINTN) UsbClass->VendorId, + (UINTN) UsbClass->ProductId, + (UINTN) UsbClass->DeviceClass, + (UINTN) UsbClass->DeviceSubClass, + (UINTN) UsbClass->DeviceProtocol ); } @@ -746,7 +853,7 @@ _DevPathI2O ( ASSERT (DevPath != NULL); I2O = DevPath; - CatPrint (Str, L"I2O(%x)", I2O->Tid); + CatPrint (Str, L"I2O(%x)", (UINTN) I2O->Tid); } VOID @@ -772,7 +879,7 @@ _DevPathMacAddr ( CatPrint (Str, L"Mac("); for (Index = 0; Index < HwAddressSize; Index++) { - CatPrint (Str, L"%02x", MAC->MacAddress.Addr[Index]); + CatPrint (Str, L"%02x", (UINTN) MAC->MacAddress.Addr[Index]); } CatPrint (Str, L")"); @@ -793,11 +900,11 @@ _DevPathIPv4 ( CatPrint ( Str, L"IPv4(%d.%d.%d.%d:%d)", - IP->RemoteIpAddress.Addr[0], - IP->RemoteIpAddress.Addr[1], - IP->RemoteIpAddress.Addr[2], - IP->RemoteIpAddress.Addr[3], - IP->RemotePort + (UINTN) IP->RemoteIpAddress.Addr[0], + (UINTN) IP->RemoteIpAddress.Addr[1], + (UINTN) IP->RemoteIpAddress.Addr[2], + (UINTN) IP->RemoteIpAddress.Addr[3], + (UINTN) IP->RemotePort ); } @@ -807,9 +914,31 @@ _DevPathIPv6 ( IN VOID *DevPath ) { + IPv6_DEVICE_PATH *IP; + ASSERT (Str != NULL); - CatPrint (Str, L"IP-v6(not-done)"); + IP = DevPath; + CatPrint ( + Str, + L"IPv6(%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x)", + (UINTN) IP->RemoteIpAddress.Addr[0], + (UINTN) IP->RemoteIpAddress.Addr[1], + (UINTN) IP->RemoteIpAddress.Addr[2], + (UINTN) IP->RemoteIpAddress.Addr[3], + (UINTN) IP->RemoteIpAddress.Addr[4], + (UINTN) IP->RemoteIpAddress.Addr[5], + (UINTN) IP->RemoteIpAddress.Addr[6], + (UINTN) IP->RemoteIpAddress.Addr[7], + (UINTN) IP->RemoteIpAddress.Addr[8], + (UINTN) IP->RemoteIpAddress.Addr[9], + (UINTN) IP->RemoteIpAddress.Addr[10], + (UINTN) IP->RemoteIpAddress.Addr[11], + (UINTN) IP->RemoteIpAddress.Addr[12], + (UINTN) IP->RemoteIpAddress.Addr[13], + (UINTN) IP->RemoteIpAddress.Addr[14], + (UINTN) IP->RemoteIpAddress.Addr[15] + ); } VOID @@ -818,9 +947,20 @@ _DevPathInfiniBand ( IN VOID *DevPath ) { + INFINIBAND_DEVICE_PATH *InfiniBand; + ASSERT (Str != NULL); - CatPrint (Str, L"InfiniBand(not-done)"); + InfiniBand = DevPath; + CatPrint ( + Str, + L"Infiniband(%x,%g,%lx,%lx,%lx)", + (UINTN) InfiniBand->ResourceFlags, + InfiniBand->PortGid, + InfiniBand->ServiceId, + InfiniBand->TargetPortId, + InfiniBand->DeviceId + ); } VOID @@ -867,15 +1007,15 @@ _DevPathUart ( } if (Uart->BaudRate == 0) { - CatPrint (Str, L"Uart(DEFAULT %c", Parity); + CatPrint (Str, L"Uart(DEFAULT,%c,", Parity); } else { - CatPrint (Str, L"Uart(%ld %c", Uart->BaudRate, Parity); + CatPrint (Str, L"Uart(%ld,%c,", Uart->BaudRate, Parity); } if (Uart->DataBits == 0) { - CatPrint (Str, L"D"); + CatPrint (Str, L"D,"); } else { - CatPrint (Str, L"%d", Uart->DataBits); + CatPrint (Str, L"%d,", (UINTN) Uart->DataBits); } switch (Uart->StopBits) { @@ -901,6 +1041,44 @@ _DevPathUart ( } } +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) +VOID +_DevPathiSCSI ( + IN OUT POOL_PRINT *Str, + IN VOID *DevPath + ) +{ + ISCSI_DEVICE_PATH_WITH_NAME *iSCSI; + UINT16 Options; + + ASSERT (Str != NULL); + ASSERT (DevPath != NULL); + + iSCSI = DevPath; + CatPrint ( + Str, + L"iSCSI(%s,%x,%lx,", + iSCSI->iSCSITargetName, + (UINTN) iSCSI->TargetPortalGroupTag, + iSCSI->Lun + ); + + Options = iSCSI->LoginOption; + CatPrint (Str, L"%s,", ((Options >> 1) & 0x0001) ? L"CRC32C" : L"None"); + CatPrint (Str, L"%s,", ((Options >> 3) & 0x0001) ? L"CRC32C" : L"None"); + if ((Options >> 11) & 0x0001) { + CatPrint (Str, L"%s,", L"None"); + } else if ((Options >> 12) & 0x0001) { + CatPrint (Str, L"%s,", L"CHAP_UNI"); + } else { + CatPrint (Str, L"%s,", L"CHAP_BI"); + + } + + CatPrint (Str, L"%s)", (iSCSI->NetworkProtocol == 0) ? L"TCP" : L"reserved"); +} +#endif + VOID _DevPathHardDrive ( IN OUT POOL_PRINT *Str, @@ -918,8 +1096,8 @@ _DevPathHardDrive ( CatPrint ( Str, L"HD(Part%d,Sig%08x)", - Hd->PartitionNumber, - *((UINT32 *) (&(Hd->Signature[0]))) + (UINTN) Hd->PartitionNumber, + (UINTN) *((UINT32 *) (&(Hd->Signature[0]))) ); break; @@ -927,7 +1105,7 @@ _DevPathHardDrive ( CatPrint ( Str, L"HD(Part%d,Sig%g)", - Hd->PartitionNumber, + (UINTN) Hd->PartitionNumber, (EFI_GUID *) &(Hd->Signature[0]) ); break; @@ -936,9 +1114,9 @@ _DevPathHardDrive ( CatPrint ( Str, L"HD(Part%d,MBRType=%02x,SigType=%02x)", - Hd->PartitionNumber, - Hd->MBRType, - Hd->SignatureType + (UINTN) Hd->PartitionNumber, + (UINTN) Hd->MBRType, + (UINTN) Hd->SignatureType ); break; } @@ -956,7 +1134,7 @@ _DevPathCDROM ( ASSERT (DevPath != NULL); Cd = DevPath; - CatPrint (Str, L"CDROM(Entry%x)", Cd->BootEntry); + CatPrint (Str, L"CDROM(Entry%x)", (UINTN) Cd->BootEntry); } VOID @@ -1106,6 +1284,9 @@ DevPathTable[] = { ACPI_DEVICE_PATH, ACPI_EXTENDED_DP, _DevPathExtendedAcpi, + ACPI_DEVICE_PATH, + ACPI_ADR_DP, + _DevPathAdrAcpi, MESSAGING_DEVICE_PATH, MSG_ATAPI_DP, _DevPathAtapi, @@ -1121,6 +1302,14 @@ DevPathTable[] = { MESSAGING_DEVICE_PATH, MSG_USB_DP, _DevPathUsb, +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + MESSAGING_DEVICE_PATH, + MSG_USB_WWID_DP, + _DevPathUsbWWID, + MESSAGING_DEVICE_PATH, + MSG_DEVICE_LOGICAL_UNIT_DP, + _DevPathLogicalUnit, +#endif MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP, _DevPathUsbClass, @@ -1145,6 +1334,11 @@ DevPathTable[] = { MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, _DevPathVendor, +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + MESSAGING_DEVICE_PATH, + MSG_ISCSI_DP, + _DevPathiSCSI, +#endif MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, _DevPathHardDrive, @@ -1732,13 +1926,11 @@ Routine Description: --*/ { #if (EFI_SPECIFICATION_VERSION < 0x00020000) - BOOLEAN Found; // // Use old Device Path that conflicts with UEFI // - if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH || + if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH && DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) { - Found = TRUE; return &FvDevicePathNode->NameGuid; } @@ -1746,8 +1938,8 @@ Routine Description: // // Use the new Device path that does not conflict with the UEFI // - if (FvDevicePathNode->Piwg.Header.Type == MEDIA_DEVICE_PATH || - FvDevicePathNode->Piwg.Header.SubType == MEDIA_VENDOR_DP) { + if (DevicePathType (&FvDevicePathNode->Piwg.Header) == MEDIA_DEVICE_PATH && + DevicePathSubType (&FvDevicePathNode->Piwg.Header) == MEDIA_VENDOR_DP) { if (CompareMem (&gEfiFrameworkDevicePathGuid, &FvDevicePathNode->Piwg.PiwgSpecificDevicePath, sizeof(EFI_GUID)) == 0) { if (FvDevicePathNode->Piwg.Type == PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) { return &FvDevicePathNode->NameGuid; diff --git a/Library/DPath.h b/Library/DPath.h index 665c331..3bc5173 100644 --- a/Library/DPath.h +++ b/Library/DPath.h @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -23,6 +23,43 @@ Revision History --*/ #ifndef _D_PATH_H #define _D_PATH_H + +#define NextStrA(a) ((UINT8 *) (((UINT8 *) (a)) + strlena (a) + 1)) + +#include EFI_GUID_DEFINITION (PcAnsi) + +extern EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid; + +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 HID; + UINT32 UID; + UINT32 CID; + CHAR8 HidUidCidStr[3]; +} ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR; + +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_GUID Guid; + UINT8 VendorDefinedData[1]; +} VENDOR_DEVICE_PATH_WITH_DATA; + +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + +extern EFI_GUID mEfiDevicePathMessagingSASGuid; + +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 NetworkProtocol; + UINT16 LoginOption; + UINT16 Reserved; + UINT16 TargetPortalGroupTag; + UINT64 Lun; + CHAR16 iSCSITargetName[1]; +} ISCSI_DEVICE_PATH_WITH_NAME; + +#endif + EFI_DEVICE_PATH_PROTOCOL * DevicePathFromHandle ( IN EFI_HANDLE Handle @@ -120,4 +157,4 @@ GetNameGuidFromFwVolDevicePathNode ( IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode ); -#endif \ No newline at end of file +#endif diff --git a/Library/Data.c b/Library/Data.c index 6993f67..d2ffe4a 100644 --- a/Library/Data.c +++ b/Library/Data.c @@ -78,5 +78,3 @@ EFI_DEVICE_PATH_PROTOCOL LibEndDevicePath[] = { // EFI_GUID NullGuid = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; EFI_GUID UnknownDeviceGuid = UNKNOWN_DEVICE_GUID; -EFI_GUID gEfiMpsTableGuid = EFI_MPS_TABLE_GUID; - diff --git a/Library/EfiShellLib.h b/Library/EfiShellLib.h index cd3679e..e3ca523 100644 --- a/Library/EfiShellLib.h +++ b/Library/EfiShellLib.h @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -44,6 +44,7 @@ Revision History #include EFI_GUID_DEFINITION (ConsoleOutDevice) #include EFI_GUID_DEFINITION (DxeServices) #include EFI_GUID_DEFINITION (GlobalVariable) +#include EFI_GUID_DEFINITION (GenericVariable) #include EFI_GUID_DEFINITION (Gpt) #include EFI_GUID_DEFINITION (Mps) #include EFI_GUID_DEFINITION (PrimaryConsoleInDevice) @@ -56,6 +57,7 @@ Revision History #include EFI_PROTOCOL_DEFINITION (BlockIo) #include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride) #include EFI_PROTOCOL_DEFINITION (ComponentName) +#include EFI_PROTOCOL_DEFINITION (ConsoleControl) #include EFI_PROTOCOL_DEFINITION (CpuIo) #include EFI_PROTOCOL_DEFINITION (DataHub) #include EFI_PROTOCOL_DEFINITION (DebugPort) @@ -105,6 +107,17 @@ Revision History #include EFI_PROTOCOL_DEFINITION (UsbHostController) #include EFI_PROTOCOL_DEFINITION (UsbIo) #include EFI_PROTOCOL_DEFINITION (VariableStore) +#include EFI_PROTOCOL_DEFINITION (UsbHostController) +#include EFI_PROTOCOL_DEFINITION (ScsiPassThruExt) +#include EFI_PROTOCOL_DEFINITION (ManagedNetwork) +#include EFI_PROTOCOL_DEFINITION (Arp) +#include EFI_PROTOCOL_DEFINITION (Dhcp4) +#include EFI_PROTOCOL_DEFINITION (Tcp4) +#include EFI_PROTOCOL_DEFINITION (Ip4) +#include EFI_PROTOCOL_DEFINITION (Ip4Config) +#include EFI_PROTOCOL_DEFINITION (Udp4) +#include EFI_PROTOCOL_DEFINITION (Mtftp4) +#include EFI_PROTOCOL_DEFINITION (DevicePath) #include "efilibplat.h" #include "efipart.h" diff --git a/Library/EfiShellLib.inf b/Library/EfiShellLib.inf index 1407b44..ee07ec8 100644 --- a/Library/EfiShellLib.inf +++ b/Library/EfiShellLib.inf @@ -1,6 +1,6 @@ #/*++ # -# Copyright (c) 2005, Intel Corporation +# Copyright (c) 2005 - 2006, Intel Corporation # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -40,7 +40,6 @@ COMPONENT_TYPE = LIBRARY ConsistMapping.c CRC.c Event.c - Lock.c Perf.c VarCheck.c @@ -79,6 +78,6 @@ COMPONENT_TYPE = LIBRARY EdkProtocolLib EfiProtocolLib EfiGuidLib + EdkGuidLib [nmake.common] - C_STD_INCLUDE= diff --git a/Library/Event.c b/Library/Event.c index bdf348b..4929e4b 100644 --- a/Library/Event.c +++ b/Library/Event.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -29,7 +29,7 @@ LibCreateProtocolNotifyEvent ( IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext, - OUT VOID *Registration + OUT VOID **Registration ) /*++ diff --git a/Library/Event.h b/Library/Event.h index 4550deb..b8df801 100644 --- a/Library/Event.h +++ b/Library/Event.h @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -30,7 +30,7 @@ LibCreateProtocolNotifyEvent ( IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext, - OUT VOID *Registration + OUT VOID **Registration ); EFI_STATUS diff --git a/Library/Misc.c b/Library/Misc.c index db35428..ac06e3c 100644 --- a/Library/Misc.c +++ b/Library/Misc.c @@ -95,50 +95,6 @@ KnownGuids[] = { NULL }; -struct { - EFI_STATUS Status; - CHAR16 *Message; -} -StatusMsgs[] = { - EFI_SUCCESS, L"Success", - EFI_LOAD_ERROR, L"Load Error", - EFI_INVALID_PARAMETER, L"Invalid Parameter", - EFI_UNSUPPORTED, L"Unsupported", - EFI_BAD_BUFFER_SIZE, L"Bad Buffer Size", - EFI_BUFFER_TOO_SMALL, L"Buffer Too Small", - EFI_NOT_READY, L"Not Ready", - EFI_DEVICE_ERROR, L"Device Error", - EFI_WRITE_PROTECTED, L"Write Protected", - EFI_OUT_OF_RESOURCES, L"Out of Resources", - EFI_VOLUME_CORRUPTED, L"Volume Corrupted", - EFI_VOLUME_FULL, L"Volume Full", - EFI_NO_MEDIA, L"No Media", - EFI_MEDIA_CHANGED, L"Media Changed", - EFI_NOT_FOUND, L"Not Found", - EFI_ACCESS_DENIED, L"Access Denied", - EFI_NO_RESPONSE, L"No Response", - EFI_NO_MAPPING, L"No Mapping", - EFI_TIMEOUT, L"Time Out", - EFI_NOT_STARTED, L"Not Started", - EFI_ALREADY_STARTED, L"Already Started", - EFI_ABORTED, L"Aborted", - EFI_ICMP_ERROR, L"ICMP Error", - EFI_TFTP_ERROR, L"TFTP Error", - EFI_PROTOCOL_ERROR, L"Protocol Error", - EFI_WARN_UNKNOWN_GLYPH, L"Warning Unknown Glyph", - EFI_WARN_DELETE_FAILURE, L"Warning Delete Failure", - EFI_WARN_WRITE_FAILURE, L"Warning Write Failure", - EFI_WARN_BUFFER_TOO_SMALL, L"Warning Buffer Too Small", - EFI_INCOMPATIBLE_VERSION, L"Incompatible Version", - EFI_SECURITY_VIOLATION, L"Security Violation", - EFI_CRC_ERROR, L"CRC Error", - EFI_NOT_AVAILABLE_YET, L"Not Available Yet", - EFI_UNLOAD_IMAGE, L"Unload Image", - EFI_WARN_RETURN_FROM_LONG_JUMP, L"Warning Return From Long Jump", - 0, NULL -}; - - STATIC CHAR8 Hex[] = { '0', '1', @@ -418,17 +374,17 @@ Routine Description: Buffer, 0, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - Guid->Data1, - Guid->Data2, - Guid->Data3, - Guid->Data4[0], - Guid->Data4[1], - Guid->Data4[2], - Guid->Data4[3], - Guid->Data4[4], - Guid->Data4[5], - Guid->Data4[6], - Guid->Data4[7] + (UINTN) Guid->Data1, + (UINTN) Guid->Data2, + (UINTN) Guid->Data3, + (UINTN) Guid->Data4[0], + (UINTN) Guid->Data4[1], + (UINTN) Guid->Data4[2], + (UINTN) Guid->Data4[3], + (UINTN) Guid->Data4[4], + (UINTN) Guid->Data4[5], + (UINTN) Guid->Data4[6], + (UINTN) Guid->Data4[7] ); } @@ -460,21 +416,60 @@ Routine Description: --*/ { - UINTN Index; + CHAR16 *Message; ASSERT (Buffer != NULL); - for (Index = 0; StatusMsgs[Index].Message != NULL; Index++) { - if (StatusMsgs[Index].Status == Status) { - StrCpy (Buffer, StatusMsgs[Index].Message); - return; - } - } + Message = NULL; + + // + // Can't use global Status String Array as UINTN is not constant for EBC + // + if (Status == EFI_SUCCESS) { Message = L"Success"; } else + if (Status == EFI_LOAD_ERROR) { Message = L"Load Error"; } else + if (Status == EFI_INVALID_PARAMETER) { Message = L"Invalid Parameter"; } else + if (Status == EFI_UNSUPPORTED) { Message = L"Unsupported"; } else + if (Status == EFI_BAD_BUFFER_SIZE) { Message = L"Bad Buffer Size"; } else + if (Status == EFI_BUFFER_TOO_SMALL) { Message = L"Buffer Too Small"; } else + if (Status == EFI_NOT_READY) { Message = L"Not Ready"; } else + if (Status == EFI_DEVICE_ERROR) { Message = L"Device Error"; } else + if (Status == EFI_WRITE_PROTECTED) { Message = L"Write Protected"; } else + if (Status == EFI_OUT_OF_RESOURCES) { Message = L"Out of Resources"; } else + if (Status == EFI_VOLUME_CORRUPTED) { Message = L"Volume Corrupted"; } else + if (Status == EFI_VOLUME_FULL) { Message = L"Volume Full"; } else + if (Status == EFI_NO_MEDIA) { Message = L"No Media"; } else + if (Status == EFI_MEDIA_CHANGED) { Message = L"Media Changed"; } else + if (Status == EFI_NOT_FOUND) { Message = L"Not Found"; } else + if (Status == EFI_ACCESS_DENIED) { Message = L"Access Denied"; } else + if (Status == EFI_NO_RESPONSE) { Message = L"No Response"; } else + if (Status == EFI_NO_MAPPING) { Message = L"No Mapping"; } else + if (Status == EFI_TIMEOUT) { Message = L"Time Out"; } else + if (Status == EFI_NOT_STARTED) { Message = L"Not Started"; } else + if (Status == EFI_ALREADY_STARTED) { Message = L"Already Started"; } else + if (Status == EFI_ABORTED) { Message = L"Aborted"; } else + if (Status == EFI_ICMP_ERROR) { Message = L"ICMP Error"; } else + if (Status == EFI_TFTP_ERROR) { Message = L"TFTP Error"; } else + if (Status == EFI_PROTOCOL_ERROR) { Message = L"Protocol Error"; } else + if (Status == EFI_WARN_UNKNOWN_GLYPH) { Message = L"Warning Unknown Glyph"; } else + if (Status == EFI_WARN_DELETE_FAILURE) { Message = L"Warning Delete Failure"; } else + if (Status == EFI_WARN_WRITE_FAILURE) { Message = L"Warning Write Failure"; } else + if (Status == EFI_WARN_BUFFER_TOO_SMALL) { Message = L"Warning Buffer Too Small"; } else + if (Status == EFI_INCOMPATIBLE_VERSION) { Message = L"Incompatible Version"; } else + if (Status == EFI_SECURITY_VIOLATION) { Message = L"Security Violation"; } else + if (Status == EFI_CRC_ERROR) { Message = L"CRC Error"; } else + if (Status == EFI_NOT_AVAILABLE_YET) { Message = L"Not Available Yet"; } else + if (Status == EFI_UNLOAD_IMAGE) { Message = L"Unload Image"; } else + if (Status == EFI_WARN_RETURN_FROM_LONG_JUMP) { Message = L"Warning Return From Long Jump"; } + // // If we found a match, then copy it to the user's buffer. // Otherwise SPrint the hex value into their buffer. // - SPrint (Buffer, 0, L"%X", Status); + if (Message != NULL) { + StrCpy (Buffer, Message); + } else { + SPrint (Buffer, 0, L"%X", Status); + } } EFI_STATUS @@ -1573,11 +1568,11 @@ TimeToString ( Buffer, 0, L"%02d/%02d/%02d %02d:%02d%c", - Time->Month, - Time->Day, - Year, - Hour, - Time->Minute, + (UINTN) Time->Month, + (UINTN) Time->Day, + (UINTN) Year, + (UINTN) Hour, + (UINTN) Time->Minute, AmPm ); } @@ -1681,3 +1676,155 @@ Routine Description: return FALSE; } +UINT16 * +LibGetMachineTypeString ( + IN UINT16 MachineType + ) +/*++ + +Routine Description: + + Get Machine Type string according to Machine Type code + +Arguments: + MachineType - The Machine Type code + +Returns: + The Machine Type String + +--*/ +{ + switch (MachineType) { + case EFI_IMAGE_MACHINE_EBC: + return L"EBC"; + case EFI_IMAGE_MACHINE_IA32: + return L"IA32"; + case EFI_IMAGE_MACHINE_X64: + return L"X64"; + case EFI_IMAGE_MACHINE_IA64: + return L"IA64"; + default: + return L"UNKNOWN"; + } +} + +EFI_STATUS +LibGetImageHeader ( + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, + OUT EFI_IMAGE_DOS_HEADER *DosHeader, + OUT EFI_IMAGE_FILE_HEADER *ImageHeader, + OUT EFI_IMAGE_OPTIONAL_HEADER *OptionalHeader + ) +/*++ + +Routine Description: + + Get the headers (dos, image, optional header) from an image + +Arguments: + DevicePath - Location where the file locates + DosHeader - Pointer to dos header + ImageHeader - Pointer to image header + OptionalHeader - Pointer to optional header + +Returns: + EFI_SUCCESS - Successfully get the machine type. + EFI_NOT_FOUND - The file is not found. + EFI_LOAD_ERROR - File is not a valid image file. + +--*/ +{ + EFI_STATUS Status; + EFI_FILE_HANDLE ThisFile; + UINT32 Signature; + UINTN BufferSize; + UINT64 FileSize; + + Status = EFI_SUCCESS; + + ThisFile = LibOpenFilePath (DevicePath, EFI_FILE_MODE_READ); + if (ThisFile == NULL) { + Status = EFI_NOT_FOUND; + goto Done; + } + + // + // Get the file size + // + Status = LibGetFileSize (ThisFile, &FileSize); + if (EFI_ERROR (Status)) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + // + // Read dos header + // + BufferSize = sizeof (EFI_IMAGE_DOS_HEADER); + Status = LibReadFile (ThisFile, &BufferSize, DosHeader); + if (EFI_ERROR (Status) || + BufferSize < sizeof (EFI_IMAGE_DOS_HEADER) || + FileSize <= DosHeader->e_lfanew || + DosHeader->e_magic != EFI_IMAGE_DOS_SIGNATURE) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + // + // Move to PE signature + // + Status = LibSetPosition (ThisFile, DosHeader->e_lfanew); + if (EFI_ERROR (Status)) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + // + // Read and check PE signature + // + BufferSize = sizeof (Signature); + Status = LibReadFile (ThisFile, &BufferSize, &Signature); + if (EFI_ERROR (Status) || + BufferSize < sizeof (Signature) || + Signature != EFI_IMAGE_NT_SIGNATURE) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + // + // Read image header + // + BufferSize = EFI_IMAGE_SIZEOF_FILE_HEADER; + Status = LibReadFile (ThisFile, &BufferSize, ImageHeader); + if (EFI_ERROR (Status) || + BufferSize < EFI_IMAGE_SIZEOF_FILE_HEADER) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + // + // Read optional header + // + BufferSize = ImageHeader->SizeOfOptionalHeader; + Status = LibReadFile (ThisFile, &BufferSize, OptionalHeader); + if (EFI_ERROR (Status) || + BufferSize < ImageHeader->SizeOfOptionalHeader) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + // + // Check PE32 or PE32+ magic + // + if (OptionalHeader->Magic != EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC && + OptionalHeader->Magic != EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) { + Status = EFI_LOAD_ERROR; + goto Done; + } + + Done: + if (ThisFile != NULL) { + LibCloseFile (ThisFile); + } + return Status; +} diff --git a/Library/Misc.h b/Library/Misc.h index 21c162a..7098222 100644 --- a/Library/Misc.h +++ b/Library/Misc.h @@ -240,4 +240,17 @@ PrivateDumpHex ( IN VOID *UserData ); -#endif \ No newline at end of file +UINT16 * +LibGetMachineTypeString ( + IN UINT16 MachineType + ); + +EFI_STATUS +LibGetImageHeader ( + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, + OUT EFI_IMAGE_DOS_HEADER *DosHeader, + OUT EFI_IMAGE_FILE_HEADER *ImageHeader, + OUT EFI_IMAGE_OPTIONAL_HEADER *OptionalHeader + ); + +#endif diff --git a/Library/ShellDebug.c b/Library/ShellDebug.c index 8a4c9b0..b31ef06 100644 --- a/Library/ShellDebug.c +++ b/Library/ShellDebug.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -126,7 +126,7 @@ Routine Description: UINTN NewEFIDebug; DataSize = sizeof (EFIDebug); - Status = RT->GetVariable (L"EFIDebug", &gEfiGlobalVariableGuid, &Attributes, &DataSize, &NewEFIDebug); + Status = RT->GetVariable (L"EFIDebug", &gEfiGenericVariableGuid, &Attributes, &DataSize, &NewEFIDebug); if (!EFI_ERROR (Status)) { EFIDebug = NewEFIDebug; } diff --git a/Library/ShellDebug.h b/Library/ShellDebug.h index 7965e91..039197e 100644 --- a/Library/ShellDebug.h +++ b/Library/ShellDebug.h @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -34,7 +34,7 @@ extern UINTN EFIDebug; #define DEBUG(a) DbgPrint a #define UPDATE_DEBUG_MASK() { \ VOID *p; \ - p = LibGetVariable (L"EFIDebug", &gEfiGlobalVariableGuid); \ + p = LibGetVariable (L"EFIDebug", &gEfiGenericVariableGuid); \ if (NULL == p) { \ EFIDebug = EFI_D_ERROR; \ } else { \ diff --git a/Library/Str.c b/Library/Str.c index e84b3ef..c6d0d9b 100644 --- a/Library/Str.c +++ b/Library/Str.c @@ -333,7 +333,7 @@ StrStr ( i = Failure[i]; } - if (Pat[i] == Pat[i + 1]) { + if (Pat[j] == Pat[i + 1]) { Failure[j] = i + 1; } else { Failure[j] = -1; diff --git a/LoadPciRom/LoadPciRom.inf b/LoadPciRom/LoadPciRom.inf index 76d00f4..2449462 100644 --- a/LoadPciRom/LoadPciRom.inf +++ b/LoadPciRom/LoadPciRom.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeLoadPciRom C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/LoadPciRom/LoadPciRomStrings.uni b/LoadPciRom/LoadPciRomStrings.uni index 222b9d6..9ce7deb 100644 Binary files a/LoadPciRom/LoadPciRomStrings.uni and b/LoadPciRom/LoadPciRomStrings.uni differ diff --git a/ShCommonStrings.uni b/ShCommonStrings.uni index e49f057..dc4b5c4 100644 Binary files a/ShCommonStrings.uni and b/ShCommonStrings.uni differ diff --git a/Shell.inf b/Shell.inf index b46b345..00df0a3 100644 --- a/Shell.inf +++ b/Shell.inf @@ -1,6 +1,6 @@ #/*++ # -# Copyright (c) 2005, Intel Corporation +# Copyright (c) 2005 - 2007, Intel Corporation # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -41,7 +41,6 @@ COMPONENT_TYPE = APPLICATION Library\ConsistMapping.c Library\CRC.c Library\Event.c - Library\Lock.c Library\Perf.c Library\VarCheck.c @@ -176,6 +175,7 @@ COMPONENT_TYPE = APPLICATION Library\ipf\salpal.c [sources.EBC] + ver\ebc\verEbc.c Library\EBC\math.c Library\EBC\initplat.c @@ -197,28 +197,6 @@ COMPONENT_TYPE = APPLICATION $(EDK_SOURCE)\Foundation\FrameWork $(EDK_SOURCE)\Foundation\FrameWork\Include $(EDK_SOURCE)\Foundation\Core\Dxe - - $(DEST_DIR)\newshell - $(DEST_DIR)\lib - $(DEST_DIR)\shellenv - $(DEST_DIR)\attrib - $(DEST_DIR)\cp - $(DEST_DIR)\copy - $(DEST_DIR)\date - $(DEST_DIR)\Load - $(DEST_DIR)\ls - $(DEST_DIR)\dir - $(DEST_DIR)\mkdir - $(DEST_DIR)\mv - $(DEST_DIR)\reset - $(DEST_DIR)\rm - $(DEST_DIR)\del - $(DEST_DIR)\type - $(DEST_DIR)\time - $(DEST_DIR)\touch - $(DEST_DIR)\vol - $(DEST_DIR)\lang - $(DEST_DIR)\ver $(DEST_DIR) [libraries.common] @@ -243,5 +221,11 @@ COMPONENT_TYPE = APPLICATION C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" +[nmake.ebc] + EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DEFI_MONOSHELL + EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings + EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" + + \ No newline at end of file diff --git a/ShellFull.inf b/ShellFull.inf index c12e4a1..268a1d8 100644 --- a/ShellFull.inf +++ b/ShellFull.inf @@ -1,6 +1,6 @@ #/*++ # -# Copyright (c) 2006, Intel Corporation +# Copyright (c) 2006 - 2007, Intel Corporation # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -41,7 +41,6 @@ COMPONENT_TYPE = APPLICATION Library\ConsistMapping.c Library\CRC.c Library\Event.c - Library\Lock.c Library\Perf.c Library\VarCheck.c @@ -283,6 +282,7 @@ COMPONENT_TYPE = APPLICATION Library\ipf\salpal.c [sources.EBC] + ver\ebc\verEbc.c Library\EBC\math.c Library\EBC\initplat.c @@ -304,28 +304,6 @@ COMPONENT_TYPE = APPLICATION $(EDK_SOURCE)\Foundation\FrameWork $(EDK_SOURCE)\Foundation\FrameWork\Include $(EDK_SOURCE)\Foundation\Core\Dxe - - $(DEST_DIR)\newshell - $(DEST_DIR)\lib - $(DEST_DIR)\shellenv - $(DEST_DIR)\attrib - $(DEST_DIR)\cp - $(DEST_DIR)\copy - $(DEST_DIR)\date - $(DEST_DIR)\Load - $(DEST_DIR)\ls - $(DEST_DIR)\dir - $(DEST_DIR)\mkdir - $(DEST_DIR)\mv - $(DEST_DIR)\reset - $(DEST_DIR)\rm - $(DEST_DIR)\del - $(DEST_DIR)\type - $(DEST_DIR)\time - $(DEST_DIR)\touch - $(DEST_DIR)\vol - $(DEST_DIR)\lang - $(DEST_DIR)\ver $(DEST_DIR) [libraries.common] @@ -350,5 +328,10 @@ COMPONENT_TYPE = APPLICATION C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" +[nmake.ebc] + EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DEFI_MONOSHELL /DEFI_FULLSHELL + EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings + EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" + \ No newline at end of file diff --git a/SmbiosView/LibSmbiosView.c b/SmbiosView/LibSmbiosView.c index ea25128..d31ed01 100644 --- a/SmbiosView/LibSmbiosView.c +++ b/SmbiosView/LibSmbiosView.c @@ -171,10 +171,11 @@ LibGetSmbiosStructure ( Routine Description: Get SMBIOS structure given the Handle,copy data to the Buffer, - Handle is then the next. + Handle is changed to the next handle or 0xFFFF when the end is + reached or the handle is not found. Arguments: - Handle: - 0x0: get the first structure + Handle: - 0xFFFF: get the first structure - Others: get a structure according to this value. Buffter: - The pointer to the caller's memory buffer. Length: - Length of return buffer in bytes. @@ -193,21 +194,14 @@ LibGetSmbiosStructure ( SMBIOS_STRUCTURE_POINTER SmbiosEnd; UINT8 *Raw; - if (Buffer == NULL) { - PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_SPEC), HiiHandle); - return DMI_INVALID_HANDLE; - } - if (*Handle == INVALIDE_HANDLE) { - PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_INVALID_HANDLE), HiiHandle); + *Handle = mSmbiosStruct->Hdr->Handle; return DMI_INVALID_HANDLE; } - if (*Handle == 0) { - // - // first handle - // - *Handle = mSmbiosStruct->Hdr->Handle; + if (Buffer == NULL) { + PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_SPEC), HiiHandle); + return DMI_INVALID_HANDLE; } *Length = 0; @@ -228,7 +222,11 @@ LibGetSmbiosStructure ( // // update with the next structure handle. // - *Handle = Smbios.Hdr->Handle; + if (Smbios.Raw < SmbiosEnd.Raw) { + *Handle = Smbios.Hdr->Handle; + } else { + *Handle = INVALIDE_HANDLE; + } return DMI_SUCCESS; } // diff --git a/SmbiosView/SmBiosViewStrings.uni b/SmbiosView/SmBiosViewStrings.uni index dde9ca5..d7e89c3 100644 Binary files a/SmbiosView/SmBiosViewStrings.uni and b/SmbiosView/SmBiosViewStrings.uni differ diff --git a/SmbiosView/Smbiosview.inf b/SmbiosView/Smbiosview.inf index 585951f..2713d71 100644 --- a/SmbiosView/Smbiosview.inf +++ b/SmbiosView/Smbiosview.inf @@ -62,7 +62,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeSmbiosViewApplication L_PROJ_FLAGS=/align:4096 C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings diff --git a/SmbiosView/smbiosview.c b/SmbiosView/smbiosview.c index a9cbda1..b19de03 100644 --- a/SmbiosView/smbiosview.c +++ b/SmbiosView/smbiosview.c @@ -126,6 +126,7 @@ Routine Description: UINT8 StructType; UINT16 StructHandle; EFI_STATUS Status; + BOOLEAN RandomView; SHELL_VAR_CHECK_CODE RetCode; CHAR16 *Useful; @@ -218,7 +219,12 @@ Routine Description: } StructType = STRUCTURE_TYPE_RANDOM; - StructHandle = STRUCTURE_HANDLE_RANDOM; + RandomView = TRUE; + // + // Initialize the StructHandle to be the first handle + // + StructHandle = STRUCTURE_HANDLE_INVALID; + LibGetSmbiosStructure (&StructHandle, NULL, NULL); Item = LibCheckVarGetFlag (&ChkPck, L"-t"); if (Item) { @@ -232,6 +238,7 @@ Routine Description: Item = LibCheckVarGetFlag (&ChkPck, L"-h"); if (Item) { + RandomView = FALSE; StructHandle = (UINT16) (StrToUIntegerBase (Item->VarStr, 16, &Status)); if (EFI_ERROR (Status)) { PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_INVALID_ARG), HiiHandle, L"smbiosview", Item->VarStr); @@ -251,7 +258,7 @@ Routine Description: // // Show SMBIOS structure information // - Status = SMBiosView (StructType, StructHandle, gShowType); + Status = SMBiosView (StructType, StructHandle, gShowType, RandomView); Done: // @@ -274,7 +281,8 @@ EFI_STATUS SMBiosView ( IN UINT8 QueryType, IN UINT16 QueryHandle, - IN UINT8 Option + IN UINT8 Option, + IN BOOLEAN RandomView ) /*++ Routine Description: @@ -332,7 +340,7 @@ SMBiosView ( PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE), HiiHandle, QueryType); } - if (QueryHandle == STRUCTURE_HANDLE_RANDOM) { + if (RandomView) { PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE_RANDOM), HiiHandle); } else { PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE), HiiHandle, QueryHandle); @@ -369,7 +377,9 @@ SMBiosView ( // // handle then point to the next! // - LibGetSmbiosStructure (&Handle, Buffer, &Length); + if (LibGetSmbiosStructure (&Handle, Buffer, &Length) != DMI_SUCCESS) { + break; + } Offset = (UINT16) (Offset + Length); pStruct.Raw = Buffer; @@ -382,10 +392,6 @@ SMBiosView ( continue; } - if (QueryHandle != STRUCTURE_HANDLE_RANDOM && pStruct.Hdr->Handle != QueryHandle) { - continue; - } - Print (L"\n=========================================================\n"); PrintToken ( STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT), @@ -436,6 +442,9 @@ SMBiosView ( return Status; } } + if (!RandomView) { + break; + } } Print (L"\n=========================================================\n"); @@ -617,7 +626,8 @@ InitSmbiosTableStatistics ( // // search from the first one // - Handle = STRUCTURE_HANDLE_RANDOM; + Handle = STRUCTURE_HANDLE_INVALID; + LibGetSmbiosStructure (&Handle, NULL, NULL); for (Index = 1; Index <= SMBiosTable->NumberOfSmbiosStructures; Index++) { // // If reach the end of table, break.. diff --git a/SmbiosView/smbiosview.h b/SmbiosView/smbiosview.h index a309751..dd65bc1 100644 --- a/SmbiosView/smbiosview.h +++ b/SmbiosView/smbiosview.h @@ -27,7 +27,6 @@ Revision History #define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE #define STRUCTURE_TYPE_INVALID (UINT8) 0xFF -#define STRUCTURE_HANDLE_RANDOM (UINT16) 0x0000 #define STRUCTURE_HANDLE_INVALID (UINT16) 0xFFFF typedef struct { @@ -48,7 +47,8 @@ EFI_STATUS SMBiosView ( IN UINT8 QueryType, IN UINT16 QueryHandle, - IN UINT8 Option + IN UINT8 Option, + IN BOOLEAN RandomView ); EFI_STATUS diff --git a/TelnetMgmt/TelnetMgmtStrings.uni b/TelnetMgmt/TelnetMgmtStrings.uni index 31eed8e..a9d0934 100644 Binary files a/TelnetMgmt/TelnetMgmtStrings.uni and b/TelnetMgmt/TelnetMgmtStrings.uni differ diff --git a/attrib/AttribStrings.uni b/attrib/AttribStrings.uni index 87fd589..23e1835 100644 Binary files a/attrib/AttribStrings.uni and b/attrib/AttribStrings.uni differ diff --git a/attrib/attrib.inf b/attrib/attrib.inf index 0be88c6..38cc094 100644 --- a/attrib/attrib.inf +++ b/attrib/attrib.inf @@ -72,7 +72,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeAttrib C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/cls/cls.inf b/cls/cls.inf index c7840f3..1e5ef66 100644 --- a/cls/cls.inf +++ b/cls/cls.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeCls C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/cls/clsstrings.uni b/cls/clsstrings.uni index 441d4ab..67496c0 100644 Binary files a/cls/clsstrings.uni and b/cls/clsstrings.uni differ diff --git a/comp/CompStrings.uni b/comp/CompStrings.uni index 49c616d..580e3e6 100644 Binary files a/comp/CompStrings.uni and b/comp/CompStrings.uni differ diff --git a/cp/CpStrings.uni b/cp/CpStrings.uni index d4ced0b..6c7aba1 100644 Binary files a/cp/CpStrings.uni and b/cp/CpStrings.uni differ diff --git a/cp/cp.inf b/cp/cp.inf index 44bd3a9..714c7bb 100644 --- a/cp/cp.inf +++ b/cp/cp.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeCP C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/date/DateStrings.uni b/date/DateStrings.uni index 8b4e889..cd034d1 100644 Binary files a/date/DateStrings.uni and b/date/DateStrings.uni differ diff --git a/date/date.inf b/date/date.inf index 0cfd6ef..2c40f72 100644 --- a/date/date.inf +++ b/date/date.inf @@ -70,7 +70,6 @@ COMPONENT_TYPE = APPLICATION EfiGuidLib [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeDate C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/dblk/DblkStrings.uni b/dblk/DblkStrings.uni index 5937447..5c93158 100644 Binary files a/dblk/DblkStrings.uni and b/dblk/DblkStrings.uni differ diff --git a/devices/DevicesStrings.uni b/devices/DevicesStrings.uni index 763102d..56a8bee 100644 Binary files a/devices/DevicesStrings.uni and b/devices/DevicesStrings.uni differ diff --git a/devices/devices.inf b/devices/devices.inf index bc57ee2..c380f7d 100644 --- a/devices/devices.inf +++ b/devices/devices.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=DevicesMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/dmem/DebugStrings.uni b/dmem/DebugStrings.uni index 9862559..47e9407 100644 Binary files a/dmem/DebugStrings.uni and b/dmem/DebugStrings.uni differ diff --git a/dmem/MemCommonPart.c b/dmem/MemCommonPart.c index dc0d89a..377da17 100644 --- a/dmem/MemCommonPart.c +++ b/dmem/MemCommonPart.c @@ -171,7 +171,7 @@ Routine Description: return Status; } - PciRootBridgeIo->Mem.Read (PciRootBridgeIo, IO_UINT8, Address, Size, Buffer); + PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer); } else { Buffer = (UINT8 *) (UINTN) Address; } @@ -331,7 +331,7 @@ Routine Description: return Status; } - PciRootBridgeIo->Mem.Read (PciRootBridgeIo, IO_UINT8, Address, Size, Buffer); + PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer); } else { Buffer = (UINT8 *) (UINTN) Address; } diff --git a/dmem/MemStrings.uni b/dmem/MemStrings.uni index 679bace..4f4aefa 100644 Binary files a/dmem/MemStrings.uni and b/dmem/MemStrings.uni differ diff --git a/dmpstore/DmpstoreStrings.uni b/dmpstore/DmpstoreStrings.uni index a6fc163..f975035 100644 Binary files a/dmpstore/DmpstoreStrings.uni and b/dmpstore/DmpstoreStrings.uni differ diff --git a/drivers/DriversStrings.uni b/drivers/DriversStrings.uni index cb0663d..30f238b 100644 Binary files a/drivers/DriversStrings.uni and b/drivers/DriversStrings.uni differ diff --git a/drivers/drivers.c b/drivers/drivers.c index 9e0dde7..02ca5ee 100644 --- a/drivers/drivers.c +++ b/drivers/drivers.c @@ -420,7 +420,8 @@ Routine Description: FormattedDriverName[StringIndex] = L' '; } - FormattedDriverName[35] = 0; + FormattedDriverName[35] = ' '; + FormattedDriverName[36] = 0; PrintToken (STRING_TOKEN (STR_SHELLENV_PROTID_ONE_VAR_S_2), HiiHandle, FormattedDriverName); if (LoadedImage == NULL) { @@ -433,8 +434,8 @@ Routine Description: FreePool (ImageName); } else { DriverName = LibDevicePathToStr (LoadedImage->FilePath); - if (StrLen (DriverName) > 19) { - DriverName[19] = 0; + if (StrLen (DriverName) > 18) { + DriverName[18] = 0; } PrintToken (STRING_TOKEN (STR_SHELLENV_PROTID_ONE_VAR_S), HiiHandle, DriverName); diff --git a/drivers/drivers.inf b/drivers/drivers.inf index 4ecc6d9..befa6cd 100644 --- a/drivers/drivers.inf +++ b/drivers/drivers.inf @@ -72,7 +72,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=DriversMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/drvcfg/drvcfg.inf b/drvcfg/drvcfg.inf index e8fab46..74f7084 100644 --- a/drvcfg/drvcfg.inf +++ b/drvcfg/drvcfg.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=DrvcfgMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/drvcfg/drvcfgStrings.uni b/drvcfg/drvcfgStrings.uni index b8e8329..a9e4b0e 100644 Binary files a/drvcfg/drvcfgStrings.uni and b/drvcfg/drvcfgStrings.uni differ diff --git a/drvdiag/drvdiag.inf b/drvdiag/drvdiag.inf index f5b95b4..8537e0f 100644 --- a/drvdiag/drvdiag.inf +++ b/drvdiag/drvdiag.inf @@ -72,7 +72,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=DrvdiagMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/drvdiag/drvdiagStrings.uni b/drvdiag/drvdiagStrings.uni index 0452fc7..24184e8 100644 Binary files a/drvdiag/drvdiagStrings.uni and b/drvdiag/drvdiagStrings.uni differ diff --git a/edit/EditStrings.uni b/edit/EditStrings.uni index 3d1eae1..4d4421c 100644 Binary files a/edit/EditStrings.uni and b/edit/EditStrings.uni differ diff --git a/edit/libFileBuffer.c b/edit/libFileBuffer.c index 14db208..19d4bab 100644 --- a/edit/libFileBuffer.c +++ b/edit/libFileBuffer.c @@ -96,7 +96,7 @@ FileBufferInit ( // // default set FileName to NewFile.txt // - FileBuffer.FileName = PoolPrint (L"NewFile.txt"); + FileBuffer.FileName = EditGetDefaultFileName (); if (FileBuffer.FileName == NULL) { return EFI_LOAD_ERROR; } @@ -3463,3 +3463,74 @@ FileBufferReplaceAll ( return EFI_SUCCESS; } + +CHAR16 * +EditGetDefaultFileName ( + VOID + ) +{ + EFI_STATUS Status; + UINTN Suffix; + BOOLEAN FoundNewFile; + CHAR16 *FileNameTmp; + EFI_LIST_ENTRY DirList; + SHELL_FILE_ARG *Arg; + + Suffix = 0; + FoundNewFile = FALSE; + + do { + if (Suffix != 0) { + FileNameTmp = PoolPrint (L"NewFile%d.txt", Suffix); + } else { + FileNameTmp = PoolPrint (L"NewFile.txt"); + } + + // + // GET CURRENT DIR HANDLE + // + InitializeListHead (&DirList); + + // + // after that filename changed to path + // + Status = ShellFileMetaArgNoWildCard (FileNameTmp, &DirList); + + if (EFI_ERROR (Status)) { + break; + } + + if (DirList.Flink == &DirList) { + break; + } + + Arg = CR (DirList.Flink, SHELL_FILE_ARG, Link, SHELL_FILE_ARG_SIGNATURE); + + // + // Make sure Arg is valid + // + if (Arg == NULL || Arg->Parent == NULL) { + ShellFreeFileList (&DirList); + break; + } + + if (Arg->Status == EFI_NOT_FOUND) { + FoundNewFile = TRUE; + ShellFreeFileList (&DirList); + break; + } else { + FreePool (FileNameTmp); + FileNameTmp = NULL; + } + + ShellFreeFileList (&DirList); + Suffix++; + + } while (Suffix != 0); + + if (!FoundNewFile && FileNameTmp != NULL) { + FreePool (FileNameTmp); + FileNameTmp = NULL; + } + return FileNameTmp; +} diff --git a/edit/libInputBar.c b/edit/libInputBar.c index 6b51545..0ec6858 100644 --- a/edit/libInputBar.c +++ b/edit/libInputBar.c @@ -75,6 +75,7 @@ MainInputBarCleanup ( return EFI_SUCCESS; } +VOID MainInputBarPrintInput ( VOID ) diff --git a/edit/libfilebuffer.h b/edit/libfilebuffer.h index aacdf82..ddbd5e9 100644 --- a/edit/libfilebuffer.h +++ b/edit/libfilebuffer.h @@ -203,4 +203,9 @@ FileBufferAdjustMousePosition ( INT32 ); +CHAR16 * +EditGetDefaultFileName ( + VOID + ); + #endif diff --git a/edit/main.c b/edit/main.c index 44772dc..6c8a2ec 100644 --- a/edit/main.c +++ b/edit/main.c @@ -234,15 +234,10 @@ Routine Description: // // print editor exit code on screen // - switch (Status) { - case EFI_SUCCESS: - break; - - case EFI_OUT_OF_RESOURCES: + if (Status == EFI_SUCCESS) { + } else if (Status == EFI_OUT_OF_RESOURCES) { PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_OUT_RESOURCE), HiiHandle, L"edit"); - break; - - default: + } else { if (Buffer != NULL) { if (StrCmp (Buffer, L"") != 0) { // @@ -255,8 +250,6 @@ Routine Description: } else { PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), HiiHandle); } - - break; } if (Status != EFI_OUT_OF_RESOURCES) { diff --git a/err/ErrStrings.uni b/err/ErrStrings.uni index f003135..954366e 100644 Binary files a/err/ErrStrings.uni and b/err/ErrStrings.uni differ diff --git a/err/err.c b/err/err.c index aafb39f..e41a9d6 100644 --- a/err/err.c +++ b/err/err.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -86,7 +86,7 @@ _DumpGlobalMask ( ) { VOID *Variable; - Variable = LibGetVariable (L"EFIDebug", &gEfiGlobalVariableGuid); + Variable = LibGetVariable (L"EFIDebug", &gEfiGenericVariableGuid); if (NULL == Variable) { EFIDebug = EFI_D_ERROR; } else { @@ -123,7 +123,7 @@ _SetGlobalMask ( BufSize = sizeof (EFIDebug); Status = RT->SetVariable ( L"EFIDebug", - &gEfiGlobalVariableGuid, + &gEfiGenericVariableGuid, (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS), BufSize, &DebugLevel diff --git a/guid/GuidStrings.uni b/guid/GuidStrings.uni index 078bc36..70ad0a2 100644 Binary files a/guid/GuidStrings.uni and b/guid/GuidStrings.uni differ diff --git a/guid/guid.inf b/guid/guid.inf index 0ac965b..60639d2 100644 --- a/guid/guid.inf +++ b/guid/guid.inf @@ -64,7 +64,6 @@ EdkFrameworkGuidLib EfiGuidLib [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=GuidMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/hexedit/HexeditStrings.uni b/hexedit/HexeditStrings.uni index 6affe61..3991309 100644 Binary files a/hexedit/HexeditStrings.uni and b/hexedit/HexeditStrings.uni differ diff --git a/hexedit/libInputBar.c b/hexedit/libInputBar.c index 1138be9..3a4cc7e 100644 --- a/hexedit/libInputBar.c +++ b/hexedit/libInputBar.c @@ -85,6 +85,7 @@ Routine Description: return EFI_SUCCESS; } +VOID HMainInputBarPrintInput ( VOID ) diff --git a/hexedit/libMemImage.c b/hexedit/libMemImage.c index 14f1440..407bb2e 100644 --- a/hexedit/libMemImage.c +++ b/hexedit/libMemImage.c @@ -31,6 +31,8 @@ extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor; HEFI_EDITOR_MEM_IMAGE HMemImage; HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar; +EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL DummyPciRootBridgeIo; + // // for basic initialization of HDiskImage // @@ -40,6 +42,24 @@ HEFI_EDITOR_MEM_IMAGE HMemImageConst = { 0 }; +EFI_STATUS +DummyMemRead ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +EFI_STATUS +DummyMemWrite ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ); + EFI_STATUS HMemImageInit ( VOID @@ -73,6 +93,17 @@ Routine Description: NULL, &HMemImage.IoFncs ); + if (Status == EFI_NOT_FOUND) { + // + // For NT32, no EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL is available + // Use Dummy PciRootBridgeIo for memory access + // + ZeroMem (&DummyPciRootBridgeIo, sizeof (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL)); + DummyPciRootBridgeIo.Mem.Read = DummyMemRead; + DummyPciRootBridgeIo.Mem.Write = DummyMemWrite; + HMemImage.IoFncs = &DummyPciRootBridgeIo; + Status = EFI_SUCCESS; + } if (!EFI_ERROR (Status)) { return EFI_SUCCESS; } else { @@ -359,3 +390,27 @@ Routine Description: return EFI_SUCCESS; } + +EFI_STATUS +DummyMemRead ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +DummyMemWrite ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +{ + return EFI_UNSUPPORTED; +} diff --git a/hexedit/libMisc.c b/hexedit/libMisc.c index bc03645..35e2d42 100644 --- a/hexedit/libMisc.c +++ b/hexedit/libMisc.c @@ -518,7 +518,7 @@ Routine Description: i = Failure[i]; } - if (Pat[i] == Pat[i + 1]) { + if (Pat[j] == Pat[i + 1]) { Failure[j] = i + 1; } else { Failure[j] = -1; diff --git a/hexedit/main.c b/hexedit/main.c index f2e8a65..879d531 100644 --- a/hexedit/main.c +++ b/hexedit/main.c @@ -80,6 +80,11 @@ EFI_BOOTSHELL_CODE( EFI_DRIVER_ENTRY_POINT (InitializeEFIHexEditor) ) +CHAR16 * +HexEditGetDefaultFileName ( + VOID + ); + VOID PrintUsage ( VOID @@ -329,7 +334,7 @@ Routine Description: WhatToDo = OPEN_FILE; } else if (0 == ChkPck.FlagCount || (ChkPck.FlagCount == 1 && LibCheckVarGetFlag (&ChkPck, L"-b") != NULL)) { if (0 == ChkPck.ValueCount) { - Name = PoolPrint (L"NewFile.bin"); + Name = HexEditGetDefaultFileName (); FreeName = TRUE; } else if (1 == ChkPck.ValueCount) { Name = ChkPck.VarList->VarStr; @@ -433,15 +438,10 @@ Routine Description: // // print editor exit code on screen // - switch (Status) { - case EFI_SUCCESS: - break; - - case EFI_OUT_OF_RESOURCES: + if (Status == EFI_SUCCESS) { + } else if (Status == EFI_OUT_OF_RESOURCES) { PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_OUT_RESOURCE), HiiHandle, L"hexedit"); - break; - - default: + } else { if (Buffer != NULL) { if (StrCmp (Buffer, L"") != 0) { // @@ -454,8 +454,6 @@ Routine Description: } else { PrintToken (STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), HiiHandle); } - - break; } if (Status != EFI_OUT_OF_RESOURCES) { @@ -494,3 +492,74 @@ Routine Description: { return LibCmdGetStringByToken (STRING_ARRAY_NAME, &EfiHexeditGuid, STRING_TOKEN (STR_HEXEDIT_LINE_HELP), Str); } + +CHAR16 * +HexEditGetDefaultFileName ( + VOID + ) +{ + EFI_STATUS Status; + UINTN Suffix; + BOOLEAN FoundNewFile; + CHAR16 *FileNameTmp; + EFI_LIST_ENTRY DirList; + SHELL_FILE_ARG *Arg; + + Suffix = 0; + FoundNewFile = FALSE; + + do { + if (Suffix != 0) { + FileNameTmp = PoolPrint (L"NewFile%d.bin", Suffix); + } else { + FileNameTmp = PoolPrint (L"NewFile.bin"); + } + + // + // GET CURRENT DIR HANDLE + // + InitializeListHead (&DirList); + + // + // after that filename changed to path + // + Status = ShellFileMetaArgNoWildCard (FileNameTmp, &DirList); + + if (EFI_ERROR (Status)) { + break; + } + + if (DirList.Flink == &DirList) { + break; + } + + Arg = CR (DirList.Flink, SHELL_FILE_ARG, Link, SHELL_FILE_ARG_SIGNATURE); + + // + // Make sure Arg is valid + // + if (Arg == NULL || Arg->Parent == NULL) { + ShellFreeFileList (&DirList); + break; + } + + if (Arg->Status == EFI_NOT_FOUND) { + FoundNewFile = TRUE; + ShellFreeFileList (&DirList); + break; + } else { + FreePool (FileNameTmp); + FileNameTmp = NULL; + } + + ShellFreeFileList (&DirList); + Suffix++; + + } while (Suffix != 0); + + if (!FoundNewFile && FileNameTmp != NULL) { + FreePool (FileNameTmp); + FileNameTmp = NULL; + } + return FileNameTmp; +} diff --git a/load/LoadStrings.uni b/load/LoadStrings.uni index 74d3675..23adb56 100644 Binary files a/load/LoadStrings.uni and b/load/LoadStrings.uni differ diff --git a/load/load.c b/load/load.c index 096d59b..adf41bb 100644 --- a/load/load.c +++ b/load/load.c @@ -213,6 +213,8 @@ Routine Description: Status = ShellFileMetaArg (Item->VarStr, &FileList); if (EFI_ERROR (Status) && EFI_NOT_FOUND != Status) { goto FreeDone; + } else if (Status == EFI_NOT_FOUND) { + PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_FILE_NOT_FOUND), HiiLoadHandle, L"load", Item->VarStr); } Item = GetNextArg (Item); diff --git a/load/load.inf b/load/load.inf index e62847d..3ba1dbf 100644 --- a/load/load.inf +++ b/load/load.inf @@ -69,7 +69,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeLoad C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/ls/LsStrings.uni b/ls/LsStrings.uni index 10d6a9a..6a75e2c 100644 Binary files a/ls/LsStrings.uni and b/ls/LsStrings.uni differ diff --git a/ls/ls.h b/ls/ls.h index 2936cbc..e967235 100644 --- a/ls/ls.h +++ b/ls/ls.h @@ -52,7 +52,7 @@ typedef enum { EFI_STATUS Listing ( - IN EFI_HANDLE ParentHandle, + IN EFI_FILE_HANDLE ParentHandle, IN CHAR16 *ParentPath, IN CHAR16 *Pattern ); diff --git a/ls/ls.inf b/ls/ls.inf index 6884491..854a5b1 100644 --- a/ls/ls.inf +++ b/ls/ls.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeLS C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/mem/DebugStrings.uni b/mem/DebugStrings.uni index b558770..a810fa3 100644 Binary files a/mem/DebugStrings.uni and b/mem/DebugStrings.uni differ diff --git a/mem/MemCommonPart.c b/mem/MemCommonPart.c index 7c4a4fb..54af027 100644 --- a/mem/MemCommonPart.c +++ b/mem/MemCommonPart.c @@ -172,7 +172,7 @@ Routine Description: return Status; } - PciRootBridgeIo->Mem.Read (PciRootBridgeIo, IO_UINT8, Address, Size, Buffer); + PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer); } else { Buffer = (UINT8 *) (UINTN) Address; } @@ -327,7 +327,7 @@ Routine Description: return Status; } - PciRootBridgeIo->Mem.Read (PciRootBridgeIo, IO_UINT8, Address, Size, Buffer); + PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer); } else { Buffer = (UINT8 *) (UINTN) Address; } diff --git a/mem/MemStrings.uni b/mem/MemStrings.uni index 5f422d3..7d231ed 100644 Binary files a/mem/MemStrings.uni and b/mem/MemStrings.uni differ diff --git a/memmap/MemmapStrings.uni b/memmap/MemmapStrings.uni index 73a3723..dec1c11 100644 Binary files a/memmap/MemmapStrings.uni and b/memmap/MemmapStrings.uni differ diff --git a/memmap/memmap.inf b/memmap/memmap.inf index 907cf49..03e8061 100644 --- a/memmap/memmap.inf +++ b/memmap/memmap.inf @@ -72,7 +72,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeMemmap C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/mkdir/MkdirStrings.uni b/mkdir/MkdirStrings.uni index 1946951..595a3d1 100644 Binary files a/mkdir/MkdirStrings.uni and b/mkdir/MkdirStrings.uni differ diff --git a/mkdir/mkdir.inf b/mkdir/mkdir.inf index b4f3545..e49daac 100644 --- a/mkdir/mkdir.inf +++ b/mkdir/mkdir.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeMkDir C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/mm/mm.c b/mm/mm.c index fc53bae..67e3113 100644 --- a/mm/mm.c +++ b/mm/mm.c @@ -206,6 +206,7 @@ Routine Description: UINT64 Address; UINT64 PciEAddress; UINT64 Value; + UINT32 SegmentNumber; EFI_IO_WIDTH Width; EFI_ACCESS_TYPE AccessType; UINT64 Buffer; @@ -216,6 +217,8 @@ Routine Description: BOOLEAN Complete; CHAR16 InputStr[80]; BOOLEAN Interactive; + EFI_HANDLE *HandleBuffer; + UINTN BufferSize; SHELL_VAR_CHECK_CODE RetCode; CHAR16 *Useful; @@ -223,9 +226,12 @@ Routine Description: UINTN ItemValue; SHELL_VAR_CHECK_PACKAGE ChkPck; - Address = 0; - PciEAddress = 0; - IoDev = NULL; + Address = 0; + PciEAddress = 0; + IoDev = NULL; + HandleBuffer = NULL; + BufferSize = 0; + SegmentNumber = 0; ZeroMem (&ChkPck, sizeof (SHELL_VAR_CHECK_PACKAGE)); EFI_SHELL_APP_INIT (ImageHandle, SystemTable); @@ -446,15 +452,52 @@ Routine Description: // locate DeviceIO protocol interface // if (AccessType != EfiMemory) { - Status = BS->LocateProtocol ( - &gEfiPciRootBridgeIoProtocolGuid, - NULL, - (VOID *) &IoDev - ); + Status = LibLocateHandle ( + ByProtocol, + &gEfiPciRootBridgeIoProtocolGuid, + NULL, + &BufferSize, + &HandleBuffer + ); if (EFI_ERROR (Status)) { PrintToken (STRING_TOKEN (STR_IOMOD_HANDLE_PCI), HiiHandle, L"mm", Status); goto Done; } + // + // In the case of PCI or PCIE + // Get segment number and mask the segment bits in Address + // + if (AccessType == EfiPciEConfig) { + SegmentNumber = (UINT32) RShiftU64 (Address, 36) & 0xff; + Address &= 0xfffffffff; + } else { + if (AccessType == EfiPciConfig) { + SegmentNumber = (UINT32) RShiftU64 (Address, 32) & 0xff; + Address &= 0xffffffff; + } + } + // + // Find the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL of the specified segment number + // + for (Index = 0; Index < BufferSize; Index++) { + Status = BS->HandleProtocol ( + HandleBuffer[Index], + &gEfiPciRootBridgeIoProtocolGuid, + (VOID *) &IoDev + ); + if (EFI_ERROR (Status)) { + continue; + } + if (IoDev->SegmentNumber != SegmentNumber) { + IoDev = NULL; + } + } + if (IoDev == NULL) { + // TODO add token + PrintToken (STRING_TOKEN (STR_IOMOD_SEGMENT_NOT_FOUND), HiiHandle, SegmentNumber); + Status = EFI_INVALID_PARAMETER; + goto Done; + } } if (AccessType == EfiIo && Address + Size > 0x10000) { @@ -609,6 +652,9 @@ Routine Description: Status = EFI_SUCCESS; Done: + if (HandleBuffer != NULL) { + FreePool (HandleBuffer); + } LibCheckVarFreeVarList (&ChkPck); LibUnInitializeStrings (); return Status; diff --git a/mm/mm.inf b/mm/mm.inf index c358a5a..7530b37 100644 --- a/mm/mm.inf +++ b/mm/mm.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=DumpIoModify C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/mm/mmStrings.uni b/mm/mmStrings.uni index 387fef6..75ae84b 100644 Binary files a/mm/mmStrings.uni and b/mm/mmStrings.uni differ diff --git a/mode/ModeStrings.uni b/mode/ModeStrings.uni index e7bf4c0..028268f 100644 Binary files a/mode/ModeStrings.uni and b/mode/ModeStrings.uni differ diff --git a/mode/mode.inf b/mode/mode.inf index 43cb2c4..01d3ff0 100644 --- a/mode/mode.inf +++ b/mode/mode.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeMode C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/mount/MountStrings.uni b/mount/MountStrings.uni index 406e531..d3aeeab 100644 Binary files a/mount/MountStrings.uni and b/mount/MountStrings.uni differ diff --git a/mount/mount.inf b/mount/mount.inf index 9a2dd2b..e739df5 100644 --- a/mount/mount.inf +++ b/mount/mount.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=MountMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/mv/MvStrings.uni b/mv/MvStrings.uni index abe819f..2083ad6 100644 Binary files a/mv/MvStrings.uni and b/mv/MvStrings.uni differ diff --git a/mv/mv.inf b/mv/mv.inf index 14096e1..b52e28d 100644 --- a/mv/mv.inf +++ b/mv/mv.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeMv C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/newshell/FakeHii.c b/newshell/FakeHii.c index 5e4638b..44dee95 100644 --- a/newshell/FakeHii.c +++ b/newshell/FakeHii.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -26,10 +26,7 @@ Revision History #include "FakeHii.h" -EFI_GUID gEfiHiiProtocolGuidOld = EFI_HII_PROTOCOL_GUID_OLD; - EFI_HANDLE mFakeHiiHandle = NULL; -EFI_HANDLE mOldFakeHiiHandle = NULL; EFI_STATUS FakeInitializeHiiDatabase ( @@ -55,13 +52,10 @@ Routine Description: UINTN HandleCount; EFI_HANDLE *HandleBuffer; EFI_FAKE_HII_DATA *HiiData; - EFI_FAKE_HII_DATA_OLD *OldHiiData; EFI_HANDLE Handle; BOOLEAN HiiInstalled; - BOOLEAN OldHiiInstalled; HiiInstalled = FALSE; - OldHiiInstalled = FALSE; HiiData = NULL; Status = LibLocateHandle ( ByProtocol, @@ -107,50 +101,6 @@ Routine Description: } } - Status = LibLocateHandle ( - ByProtocol, - &gEfiHiiProtocolGuidOld, - NULL, - &HandleCount, - &HandleBuffer - ); - if (!EFI_ERROR (Status)) { - if (NULL != HandleBuffer) { - FreePool (HandleBuffer); - OldHiiInstalled = TRUE; - } - } - - if (!OldHiiInstalled) - { - OldHiiData = AllocateZeroPool (sizeof (EFI_FAKE_HII_DATA_OLD)); - if (NULL == OldHiiData) { - FakeUninstallHiiDatabase (); - return EFI_OUT_OF_RESOURCES; - } - - OldHiiData->Signature = EFI_FAKE_HII_DATA_SIGNATURE; - OldHiiData->DatabaseHead = NULL; - OldHiiData->Hii.NewPack = FakeHiiNewPackOld; - OldHiiData->Hii.RemovePack = FakeHiiRemovePack; - OldHiiData->Hii.FindHandles = FakeHiiFindHandles; - OldHiiData->Hii.GetPrimaryLanguages = FakeHiiGetPrimaryLanguages; - OldHiiData->Hii.GetString = FakeHiiGetString; - OldHiiData->Hii.GetForms = FakeHiiGetForms; - - Handle = NULL; - Status = BS->InstallProtocolInterface ( - &mOldFakeHiiHandle, - &gEfiHiiProtocolGuidOld, - EFI_NATIVE_INTERFACE, - &OldHiiData->Hii - ); - - if (EFI_ERROR (Status)) { - FakeUninstallHiiDatabase (); - } - } - return Status; } @@ -162,9 +112,7 @@ FakeUninstallHiiDatabase ( { EFI_STATUS Status; EFI_HII_PROTOCOL *FakeHii; - EFI_HII_PROTOCOL_OLD *FakeHiiOld; EFI_FAKE_HII_DATA *HiiData; - EFI_FAKE_HII_DATA_OLD *OldHiiData; if (mFakeHiiHandle != NULL) { Status = BS->HandleProtocol ( @@ -182,22 +130,6 @@ FakeUninstallHiiDatabase ( FreePool (HiiData); } - if (mOldFakeHiiHandle != NULL) { - Status = BS->HandleProtocol ( - mOldFakeHiiHandle, - &gEfiHiiProtocolGuidOld, - &FakeHiiOld - ); - Status = BS->UninstallProtocolInterface ( - mOldFakeHiiHandle, - &gEfiHiiProtocolGuidOld, - FakeHiiOld - ); - OldHiiData = EFI_FAKE_HII_DATA_OLD_FROM_THIS (FakeHiiOld); - mOldFakeHiiHandle = NULL; - FreePool (OldHiiData); - } - return EFI_SUCCESS; } @@ -356,7 +288,7 @@ Routine Description: // If there is no string package, and the PackageInstance->IfrPack.Guid and PackageInstance->Guid are // different, we should return the correct handle for the caller to use for strings. // - if ((PackageInstance->StringSize == 0) && (!CompareGuid (&Guid, &PackageInstance->Guid))) { + if ((PackageInstance->StringSize == 0) && (CompareGuid (&Guid, &PackageInstance->Guid) != 0)) { // // Search the database for a handle that matches the PackageInstance->Guid // @@ -386,7 +318,7 @@ Routine Description: // If the Guid from the new handle matches the original Guid referenced in the original package data // return the appropriate package instance data to use. // - if (CompareGuid (&Guid, &PackageInstance->Guid)) { + if (CompareGuid (&Guid, &PackageInstance->Guid) == 0) { if (TotalStringCount != NULL) { *TotalStringCount = HandleDatabase->NumberOfTokens; } @@ -547,7 +479,7 @@ Routine Description: // // Check to see if IfrPack->Guid != GuidId // - if (!CompareGuid (&Guid, Packages->GuidId)) { + if (CompareGuid (&Guid, Packages->GuidId) != 0) { // // If a string package is present, the GUIDs should have agreed. Return an error // @@ -1545,292 +1477,3 @@ Routine Description: return EFI_SUCCESS; } - -EFI_STATUS -EFIAPI -FakeHiiNewPackOld ( - IN EFI_HII_PROTOCOL *This, - IN EFI_HII_PACK_LIST *Package, - OUT EFI_HII_HANDLE *Handle - ) -/*++ - -Routine Description: - Extracts the various packs from a package list. - -Arguments: - -Returns: - ---*/ -{ - EFI_FAKE_HII_PACKAGE_INSTANCE *PackageInstance; - EFI_FAKE_HII_DATA_OLD *HiiData; - EFI_FAKE_HII_HANDLE_DATABASE *HandleDatabase; - EFI_FAKE_HII_HANDLE_DATABASE *Database; - EFI_FAKE_HII_GLOBAL_DATA *GlobalData; - EFI_STATUS Status; - UINTN IfrSize; - UINTN StringSize; - UINTN InstanceSize; - UINTN Count; - UINT16 Member; - EFI_GUID Guid; - EFI_FORM_SET_STUB FormSetStub; - UINT8 *Location; - UINT16 Unicode; - UINT16 NumWideGlyphs; - UINT16 NumNarrowGlyphs; - UINT32 NumberOfTokens; - UINT8 *Local; - EFI_NARROW_GLYPH *NarrowGlyph; - EFI_WIDE_GLYPH *WideGlyph; - - if (Package == NULL || This == NULL) { - return EFI_INVALID_PARAMETER; - } - - HiiData = EFI_FAKE_HII_DATA_OLD_FROM_THIS(This); - - GlobalData = HiiData->GlobalData; - - Database = HiiData->DatabaseHead; - - InstanceSize = 0; - IfrSize = 0; - StringSize = 0; - NumberOfTokens = 0; - - // - // If sending a StringPack without an IfrPack, you must include a GuidId - // - if ((Package->StringPack != NULL) && (Package->IfrPack == NULL)) { - if (Package->GuidId == NULL) { - return EFI_INVALID_PARAMETER; - } - } - - // - // If passing in an IfrPack and a GuidId is provided, ensure they are the same value. - // - if ((Package->IfrPack != NULL) && (Package->GuidId != NULL)) { - Location = ((UINT8 *)Package->IfrPack); - Location = (UINT8 *)(((UINTN)Location) + sizeof (EFI_HII_PACK_HEADER)); - - // - // Advance to the Form Set Op-code - // - for (Count = 0; ((EFI_IFR_OP_HEADER *)&Location[Count])->OpCode != EFI_IFR_FORM_SET_OP; ) { - Count = Count + ((EFI_IFR_OP_HEADER *)&Location[Count])->Length; - } - - // - // Copy to local variable - // - CopyMem(&Guid, &((EFI_IFR_FORM_SET *)&Location[Count])->Guid, sizeof (EFI_GUID)); - - // - // Check to see if IfrPack->Guid != GuidId - // - if (!CompareGuid(&Guid, Package->GuidId)) { - // - // If a string package is present, the GUIDs should have agreed. Return an error - // - if (Package->StringPack != NULL) { - return EFI_INVALID_PARAMETER; - } - } - } - - if (Package->FontPack != NULL) { - // - // Add whatever narrow glyphs were passed to us if undefined - // - CopyMem(&NumNarrowGlyphs, &Package->FontPack->NumberOfNarrowGlyphs, sizeof (UINT16)); - for (Count = 0; Count <= NumNarrowGlyphs; Count++) { - Local = (UINT8*)(&Package->FontPack->NumberOfWideGlyphs + sizeof(UINT8)) + (sizeof(EFI_NARROW_GLYPH)) * Count; - NarrowGlyph = (EFI_NARROW_GLYPH*)Local; - CopyMem(&Member, &NarrowGlyph->UnicodeWeight, sizeof (UINT16)); - // - // If the glyph is already defined, do not overwrite it. It is what it is. - // - CopyMem(&Unicode, &GlobalData->NarrowGlyphs[Member].UnicodeWeight, sizeof (UINT16)); - if (Unicode == 0) { - CopyMem(&GlobalData->NarrowGlyphs[Member], Local, sizeof (EFI_NARROW_GLYPH)); - } - } - - // - // Add whatever wide glyphs were passed to us if undefined - // - CopyMem(&NumWideGlyphs, &Package->FontPack->NumberOfWideGlyphs, sizeof (UINT16)); - for (Count = 0; Count <= NumWideGlyphs; Count++) { - Local = (UINT8*)(&Package->FontPack->NumberOfWideGlyphs + sizeof(UINT8)) + (sizeof(EFI_NARROW_GLYPH)) * NumNarrowGlyphs; - WideGlyph = (EFI_WIDE_GLYPH*)Local; - CopyMem(&Member, - (UINTN*)(Local + sizeof (EFI_WIDE_GLYPH) * Count), - sizeof (UINT16)); - // - // If the glyph is already defined, do not overwrite it. It is what it is. - // - CopyMem(&Unicode, &GlobalData->WideGlyphs[Member].UnicodeWeight, sizeof (UINT16)); - if (Unicode == 0) { - Local = (UINT8*)(&Package->FontPack->NumberOfWideGlyphs + sizeof(UINT8)) + (sizeof(EFI_NARROW_GLYPH)) * NumNarrowGlyphs; - WideGlyph = (EFI_WIDE_GLYPH*)Local; - CopyMem(&GlobalData->WideGlyphs[Member], - (UINTN *)(Local + sizeof (EFI_WIDE_GLYPH) * Count), - sizeof (EFI_WIDE_GLYPH)); - } - } - } - - if (Package->KeyboardPack != NULL) { - // - // Sending me a Keyboard Package - // - if (Package->KeyboardPack->DescriptorCount > 105) { - return EFI_INVALID_PARAMETER; - } - - // - // If someone updates the Descriptors with a count of 0, blow aware the overrides. - // - if (Package->KeyboardPack->DescriptorCount == 0) { - ZeroMem (GlobalData->OverrideKeyboardLayout, sizeof (EFI_KEY_DESCRIPTOR) * 106); - } - - if (Package->KeyboardPack->DescriptorCount < 106 && Package->KeyboardPack->DescriptorCount > 0) { - // - // If SystemKeyboard was updated already, then steer changes to the override database - // - if (GlobalData->SystemKeyboardUpdate) { - ZeroMem (GlobalData->OverrideKeyboardLayout, sizeof (EFI_KEY_DESCRIPTOR) * 106); - for (Count = 0;Count < Package->KeyboardPack->DescriptorCount; Count++) { - CopyMem(&Member, &Package->KeyboardPack->Descriptor[Count].Key, sizeof (UINT16)); - CopyMem(&GlobalData->OverrideKeyboardLayout[Member], &Package->KeyboardPack->Descriptor[Count], sizeof (EFI_KEY_DESCRIPTOR)); - } - } else { - // - // SystemKeyboard was never updated, so this is likely the keyboard driver setting the System database. - // - ZeroMem (GlobalData->SystemKeyboardLayout, sizeof (EFI_KEY_DESCRIPTOR) * 106); - for (Count = 0;Count < Package->KeyboardPack->DescriptorCount; Count++) { - CopyMem(&Member, &Package->KeyboardPack->Descriptor->Key, sizeof (UINT16)); - CopyMem(&GlobalData->SystemKeyboardLayout[Member], &Package->KeyboardPack->Descriptor[Count], sizeof (EFI_KEY_DESCRIPTOR)); - } - - // - // Just updated the system keyboard database, reflect that in the global flag. - // - GlobalData->SystemKeyboardUpdate = TRUE; - } - } - } - - // - // If someone is passing in a string only, create a dummy IfrPack with a Guid - // to enable future searching of this data. - // - if ((Package->IfrPack == NULL) && (Package->StringPack != NULL)) { - ZeroMem (&FormSetStub, sizeof (FormSetStub)); - - FormSetStub.Header.Type = EFI_HII_IFR; - FormSetStub.Header.Length = sizeof (EFI_FORM_SET_STUB); - - FormSetStub.FormSet.Header.OpCode = EFI_IFR_FORM_SET_OP; - FormSetStub.FormSet.Header.Length = (UINT8)sizeof (EFI_IFR_FORM_SET); - FormSetStub.FormSet.FormSetTitle = 0x02; // Dummy string - CopyMem (&FormSetStub.FormSet.Guid, Package->GuidId, sizeof(EFI_GUID)); - - FormSetStub.EndFormSet.Header.OpCode = EFI_IFR_END_FORM_SET_OP; - FormSetStub.EndFormSet.Header.Length = (UINT8)sizeof (EFI_IFR_END_FORM_SET); - Package->IfrPack = (EFI_HII_IFR_PACK *)&FormSetStub; - } - - if (Package->IfrPack != NULL) { - // - // Sending me an IFR Package - // Get its size - // - Status = FakeGetPackSize ((VOID *)Package->IfrPack, &IfrSize, NULL); - } - - if (Package->StringPack != NULL) { - // - // Sending me a String Package - // Get its size - // - Status = FakeGetPackSize ((VOID *)Package->StringPack, &StringSize, &NumberOfTokens); - } - - InstanceSize = IfrSize + StringSize; - - if (InstanceSize != 0) { - PackageInstance = AllocateZeroPool (InstanceSize + sizeof (EFI_FAKE_HII_PACKAGE_INSTANCE)); - - ASSERT (PackageInstance); - - // - // If there is no DatabaseHead allocated - allocate one - // - if (HiiData->DatabaseHead == NULL) { - HiiData->DatabaseHead = AllocateZeroPool (sizeof(EFI_FAKE_HII_HANDLE_DATABASE)); - ASSERT (HiiData->DatabaseHead); - } - - // - // If the head is being used (Handle is non-zero), allocate next Database and - // add it to the linked-list - // - if (HiiData->DatabaseHead->Handle != 0) { - HandleDatabase = AllocateZeroPool (sizeof(EFI_FAKE_HII_HANDLE_DATABASE)); - - ASSERT (HandleDatabase); - - for ( ; Database->NextHandleDatabase != NULL; Database = Database->NextHandleDatabase); - - // - // We are sitting on the Database entry which contains the null Next pointer. Fix it. - // - Database->NextHandleDatabase = HandleDatabase; - - } - - Database = HiiData->DatabaseHead; - - // - // Initialize this instance data - // - for (*Handle = 1; Database->NextHandleDatabase != NULL; Database = Database->NextHandleDatabase) { - // - // Since the first Database instance will have a passed back handle of 1, we will continue - // down the linked list of entries until we encounter the end of the linked list. Each time - // we go down one level deeper, increment the handle value that will be passed back. - // - if (Database->Handle >= *Handle) { - *Handle = Database->Handle + 1; - } - } - - PackageInstance->Handle = *Handle; - PackageInstance->IfrSize = IfrSize; - PackageInstance->StringSize = StringSize; - if (Package->GuidId != NULL) { - CopyMem (&PackageInstance->Guid, Package->GuidId, sizeof (EFI_GUID)); - } - - Database->Buffer = PackageInstance; - Database->Handle = PackageInstance->Handle; - Database->NumberOfTokens = NumberOfTokens; - Database->NextHandleDatabase = NULL; - - if (IfrSize > 0) { - CopyMem (&PackageInstance->IfrData, Package->IfrPack, IfrSize); - } - - if (StringSize > 0) { - CopyMem ((CHAR8 *)(&PackageInstance->IfrData) + IfrSize, Package->StringPack, StringSize); - } - } - return EFI_SUCCESS; -} diff --git a/newshell/FakeHii.h b/newshell/FakeHii.h index 57815e6..7af4edc 100644 --- a/newshell/FakeHii.h +++ b/newshell/FakeHii.h @@ -34,11 +34,6 @@ Revision History #define EFI_FAKE_HII_DATA_SIGNATURE EFI_SIGNATURE_32 ('F', 'H', 'I', 'I') -#define EFI_HII_PROTOCOL_GUID_OLD \ - { \ - 0xcd361957, 0xafbe, 0x425e, 0xa3, 0x58, 0x5f, 0x58, 0x89, 0xcf, 0xfe, 0x7b \ - } - #define DEFAULT_FORM_BUFFER_SIZE 0xFFFF #define DEFAULT_STRING_BUFFER_SIZE 0xFFFF @@ -49,45 +44,6 @@ Revision History #define NARROW_WIDTH 8 #define WIDE_WIDTH 16 -typedef struct { - EFI_HII_IFR_PACK *IfrPack; - EFI_HII_FONT_PACK *FontPack; - EFI_HII_STRING_PACK *StringPack; - EFI_HII_KEYBOARD_PACK *KeyboardPack; - EFI_GUID *GuidId; -} EFI_HII_PACK_LIST; - -typedef -EFI_STATUS -(EFIAPI *EFI_HII_NEW_PACK_OLD) ( - IN EFI_HII_PROTOCOL *This, - IN EFI_HII_PACK_LIST *Package, - OUT EFI_HII_HANDLE *Handle - ); - -typedef struct _EFI_HII_PROTOCOL_OLD { - EFI_HII_NEW_PACK_OLD NewPack; - EFI_HII_REMOVE_PACK RemovePack; - EFI_HII_FIND_HANDLES FindHandles; - EFI_HII_EXPORT ExportDatabase; - - EFI_HII_TEST_STRING TestString; - EFI_HII_GET_GLYPH GetGlyph; - EFI_HII_GLYPH_TO_BLT GlyphToBlt; - - EFI_HII_NEW_STRING NewString; - EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages; - EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages; - EFI_HII_GET_STRING GetString; - EFI_HII_RESET_STRINGS ResetStrings; - EFI_HII_GET_LINE GetLine; - EFI_HII_GET_FORMS GetForms; - EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage; - EFI_HII_UPDATE_FORM UpdateForm; - - EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; -} EFI_HII_PROTOCOL_OLD; - typedef struct { EFI_HII_PACK_HEADER Header; EFI_IFR_FORM_SET FormSet; @@ -109,13 +65,6 @@ typedef struct _EFI_FAKE_HII_HANDLE_DATABASE { struct _EFI_FAKE_HII_HANDLE_DATABASE *NextHandleDatabase; } EFI_FAKE_HII_HANDLE_DATABASE; -typedef struct _EFI_FAKE_HII_DATA_OLD { - UINTN Signature; - EFI_FAKE_HII_GLOBAL_DATA *GlobalData; - EFI_FAKE_HII_HANDLE_DATABASE *DatabaseHead; // Head of the Null-terminated singly-linked list of handles. - EFI_HII_PROTOCOL_OLD Hii; -} EFI_FAKE_HII_DATA_OLD; - typedef struct _EFI_FAKE_HII_DATA { UINTN Signature; EFI_FAKE_HII_GLOBAL_DATA *GlobalData; @@ -134,7 +83,6 @@ typedef struct { } EFI_FAKE_HII_PACKAGE_INSTANCE; #define EFI_FAKE_HII_DATA_FROM_THIS(a) CR (a, EFI_FAKE_HII_DATA, Hii, EFI_FAKE_HII_DATA_SIGNATURE) -#define EFI_FAKE_HII_DATA_OLD_FROM_THIS(a) CR (a, EFI_FAKE_HII_DATA_OLD, Hii, EFI_FAKE_HII_DATA_SIGNATURE) EFI_STATUS FakeInitializeHiiDatabase ( @@ -147,14 +95,6 @@ FakeUninstallHiiDatabase ( VOID ); -EFI_STATUS -EFIAPI -FakeHiiNewPackOld ( - IN EFI_HII_PROTOCOL *This, - IN EFI_HII_PACK_LIST *PackageList, - OUT EFI_HII_HANDLE *Handle - ); - EFI_STATUS EFIAPI FakeHiiNewPack ( diff --git a/newshell/init.c b/newshell/init.c index 162d4c2..978d9c6 100644 --- a/newshell/init.c +++ b/newshell/init.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -40,6 +40,8 @@ CHAR16 *ShellEnvPathName[] = { NULL }; +EFI_CONSOLE_CONTROL_SCREEN_MODE mOldCurrentMode = EfiConsoleControlScreenText; + EFI_SHELL_INTERFACE *OldSI; EFI_STATUS @@ -205,9 +207,26 @@ _DoInit ( IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; - EFI_GUID EfiLibGuid = EFI_NSHELL_GUID; + EFI_STATUS Status; + EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl; + EFI_GUID EfiLibGuid = EFI_NSHELL_GUID; InitializeShellLib (ImageHandle, SystemTable); + + // + // If EFI_CONSOLE_CONTROL_PROTOCOL is available, + // use it to switch to text mode first. + // + Status = LibLocateProtocol ( + &gEfiConsoleControlProtocolGuid, + &ConsoleControl + ); + if (!EFI_ERROR (Status)) { + Status = ConsoleControl->GetMode (ConsoleControl, &mOldCurrentMode, NULL, NULL); + if (!EFI_ERROR (Status) && mOldCurrentMode != EfiConsoleControlScreenText) { + ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenText); + } + } + // // When running under EFI1.1, there is no HII support // so we have to provide our embedded HII support @@ -456,7 +475,10 @@ _CleanUpOnExit ( IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; + EFI_STATUS Status; + EFI_STATUS ConsoleControlStatus; + EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl; + EFI_CONSOLE_CONTROL_SCREEN_MODE CurrentMode; Status = EFI_SUCCESS; if (OldSI) { @@ -499,6 +521,21 @@ _CleanUpOnExit ( // LibUnInitializeStrings (); FakeUninstallHiiDatabase(); + + // + // If EFI_CONSOLE_CONTROL_PROTOCOL is available, + // switch back to the original console mode. + // + ConsoleControlStatus = LibLocateProtocol ( + &gEfiConsoleControlProtocolGuid, + &ConsoleControl + ); + if (!EFI_ERROR (ConsoleControlStatus)) { + ConsoleControlStatus = ConsoleControl->GetMode (ConsoleControl, &CurrentMode, NULL, NULL); + if (!EFI_ERROR (ConsoleControlStatus) && CurrentMode != mOldCurrentMode) { + ConsoleControl->SetMode (ConsoleControl, mOldCurrentMode); + } + } return Status; } // @@ -769,7 +806,7 @@ _ShellLoadEnvDriver ( (VOID *) &Junk ); if (!EFI_ERROR (Status)) { - if (!CompareGuid (&Junk->SESGuid, &SESGuid)) { + if (CompareGuid (&Junk->SESGuid, &SESGuid) == 0) { if (Junk->MajorVersion >= EFI_NSHELL_MAJOR_VERSION) { return Status; } @@ -822,7 +859,7 @@ _ShellLoadEnvDriver ( ); if (!EFI_ERROR (Status)) { Status = EFI_UNSUPPORTED; - if (!CompareGuid (&Junk->SESGuid, &SESGuid)) { + if (CompareGuid (&Junk->SESGuid, &SESGuid) == 0) { if (Junk->MajorVersion >= EFI_NSHELL_MAJOR_VERSION) { Status = EFI_SUCCESS; } diff --git a/openinfo/OpeninfoStrings.uni b/openinfo/OpeninfoStrings.uni index f2c230f..13adc0f 100644 Binary files a/openinfo/OpeninfoStrings.uni and b/openinfo/OpeninfoStrings.uni differ diff --git a/openinfo/openinfo.inf b/openinfo/openinfo.inf index b0566e1..7c14b07 100644 --- a/openinfo/openinfo.inf +++ b/openinfo/openinfo.inf @@ -72,7 +72,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=OpeninfoMain C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/pci/PciStrings.uni b/pci/PciStrings.uni index 006681f..9b65a2f 100644 Binary files a/pci/PciStrings.uni and b/pci/PciStrings.uni differ diff --git a/pci/pci.c b/pci/pci.c index c0bed9a..74321ad 100644 --- a/pci/pci.c +++ b/pci/pci.c @@ -1355,7 +1355,7 @@ Routine Description: HiiHandle, INDEX_OF (&(Bridge->PrefetchableMemBase)), Bridge->PrefetchableBaseUpper, - Bridge->PrefetchableMemBase << 16 + (Bridge->PrefetchableMemBase << 16) & 0xfff00000 ); PrintToken ( diff --git a/pci/pci.inf b/pci/pci.inf index 2be95de..00102ec 100644 --- a/pci/pci.inf +++ b/pci/pci.inf @@ -73,7 +73,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=PciDump C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/reset/ResetStrings.uni b/reset/ResetStrings.uni index a2aca91..fe023bd 100644 Binary files a/reset/ResetStrings.uni and b/reset/ResetStrings.uni differ diff --git a/reset/reset.inf b/reset/reset.inf index 9b35600..3af6b2c 100644 --- a/reset/reset.inf +++ b/reset/reset.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeReset C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/rm/RmStrings.uni b/rm/RmStrings.uni index f41e9ba..4e31b37 100644 Binary files a/rm/RmStrings.uni and b/rm/RmStrings.uni differ diff --git a/rm/rm.inf b/rm/rm.inf index f490f1c..ed6ee5d 100644 --- a/rm/rm.inf +++ b/rm/rm.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeRM C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/sermode/SermodeStrings.uni b/sermode/SermodeStrings.uni index f4a83de..cd685ec 100644 Binary files a/sermode/SermodeStrings.uni and b/sermode/SermodeStrings.uni differ diff --git a/sermode/sermode.inf b/sermode/sermode.inf index 7a5cf83..0b0b9ca 100644 --- a/sermode/sermode.inf +++ b/sermode/sermode.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeSerialMode C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/shellenv/ConnectStrings.uni b/shellenv/ConnectStrings.uni index 48a817d..5ef75e0 100644 Binary files a/shellenv/ConnectStrings.uni and b/shellenv/ConnectStrings.uni differ diff --git a/shellenv/MapStrings.uni b/shellenv/MapStrings.uni index 8f7ae19..2fb3808 100644 Binary files a/shellenv/MapStrings.uni and b/shellenv/MapStrings.uni differ diff --git a/shellenv/ScriptCmdStrings.uni b/shellenv/ScriptCmdStrings.uni index 8b4c456..3e2b553 100644 Binary files a/shellenv/ScriptCmdStrings.uni and b/shellenv/ScriptCmdStrings.uni differ diff --git a/shellenv/ShellenvHelpStrings.uni b/shellenv/ShellenvHelpStrings.uni index e2ff399..6c8b564 100644 Binary files a/shellenv/ShellenvHelpStrings.uni and b/shellenv/ShellenvHelpStrings.uni differ diff --git a/shellenv/ShellenvStrings.uni b/shellenv/ShellenvStrings.uni index d4b1e36..ea7043f 100644 Binary files a/shellenv/ShellenvStrings.uni and b/shellenv/ShellenvStrings.uni differ diff --git a/shellenv/dprot.c b/shellenv/dprot.c index be4a147..b41dd4e 100644 --- a/shellenv/dprot.c +++ b/shellenv/dprot.c @@ -36,7 +36,7 @@ STATIC CHAR16 *SEnvDP_HardwareStr[] = { L"Controller" }; -STATIC CHAR16 *SEnvDP_ACPI_Str[] = { L"Illegal", L"ACPI" }; +STATIC CHAR16 *SEnvDP_ACPI_Str[] = { L"Illegal", L"Acpi", L"AcpiEx", L"AcpiAdr" }; STATIC CHAR16 *SEnvDP_MessageStr[] = { L"Illegal", @@ -179,7 +179,16 @@ Routine Description: --*/ { - ACPI_HID_DEVICE_PATH *AcpiDevicePath; + ACPI_HID_DEVICE_PATH *AcpiDevicePath; + ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *AcpiExDevicepath; + ACPI_ADR_DEVICE_PATH *AcpiAdrDevicePath; + UINT16 Index; + UINT16 Length; + UINT16 AdditionalAdrCount; + CHAR8 *HIDString; + CHAR8 *UIDString; + CHAR8 *CIDString; + CHAR8 NullString[5]; if (DevicePathType (DevicePath) != ACPI_DEVICE_PATH) { return ; @@ -187,14 +196,103 @@ Routine Description: // // Process ACPI device path entry // - if (DevicePathSubType (DevicePath) == ACPI_DP) { + switch (DevicePathSubType (DevicePath)) { + case ACPI_DP: AcpiDevicePath = (ACPI_HID_DEVICE_PATH *) DevicePath; - PrintToken ( - STRING_TOKEN (STR_SHELLENV_DPROT_HID_UID), - HiiEnvHandle, - AcpiDevicePath->HID, - AcpiDevicePath->UID - ); + if ((AcpiDevicePath->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HIDPNP_UID), + HiiEnvHandle, + EISA_ID_TO_NUM (AcpiDevicePath->HID), + AcpiDevicePath->UID + ); + } else { + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HID_UID), + HiiEnvHandle, + AcpiDevicePath->HID, + AcpiDevicePath->UID + ); + } + break; + case ACPI_EXTENDED_DP: + AcpiExDevicepath = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) DevicePath; + HIDString = AcpiExDevicepath->HidUidCidStr; + UIDString = NextStrA (HIDString); + CIDString = NextStrA (UIDString); + CopyMem (NullString, "NULL", sizeof (NullString)); + if (*HIDString == '\0') { + HIDString = NullString; + } + if (*UIDString == '\0') { + UIDString = NullString; + } + if (*CIDString == '\0') { + CIDString = NullString; + } + if ((AcpiExDevicepath->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + if ((AcpiExDevicepath->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HIDPNP_CIDPNP_UID), + HiiEnvHandle, + EISA_ID_TO_NUM (AcpiExDevicepath->HID), + EISA_ID_TO_NUM (AcpiExDevicepath->CID), + AcpiExDevicepath->UID, + HIDString, + CIDString, + UIDString + ); + } else { + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HIDPNP_CID_UID), + HiiEnvHandle, + EISA_ID_TO_NUM (AcpiExDevicepath->HID), + AcpiExDevicepath->CID, + AcpiExDevicepath->UID, + HIDString, + CIDString, + UIDString + ); + } + } else { + if ((AcpiExDevicepath->CID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HID_CIDPNP_UID), + HiiEnvHandle, + AcpiExDevicepath->HID, + EISA_ID_TO_NUM (AcpiExDevicepath->CID), + AcpiExDevicepath->UID, + HIDString, + CIDString, + UIDString + ); + } else { + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HID_CID_UID), + HiiEnvHandle, + AcpiExDevicepath->HID, + AcpiExDevicepath->CID, + AcpiExDevicepath->UID, + HIDString, + CIDString, + UIDString + ); + } + } + break; + case ACPI_ADR_DP: + AcpiAdrDevicePath = (ACPI_ADR_DEVICE_PATH *) DevicePath; + Length = DevicePathNodeLength (DevicePath); + AdditionalAdrCount = (Length - 8) / 4; + + PrintToken (STRING_TOKEN (STR_SHELLENV_DPROT_ADR), HiiEnvHandle); + Print (L"%hx", AcpiAdrDevicePath->ADR); + for (Index = 0; Index < AdditionalAdrCount; Index++) { + Print (L",%hx", *(UINT32 *) ((UINT8 *) AcpiAdrDevicePath + 8 + Index * 4)); + } + break; + default: + break; } } @@ -565,7 +663,7 @@ struct DevicePathTypes SEnvDP_Strings[] = { SEnvDP_HardwareStr, SEnvHardwareDevicePathEntry, 0x02, - 0x01, + 0x03, L"ACPI", SEnvDP_ACPI_Str, SEnvAcpiDevicePathEntry, @@ -871,7 +969,9 @@ Routine Description: UINT32 DirCount; EFI_IMAGE_DOS_HEADER *DosHdr; EFI_IMAGE_NT_HEADERS *NtHdr; - EFI_IMAGE_OPTIONAL_HEADER *OptionalHdr; + UINT16 Magic; + EFI_IMAGE_OPTIONAL_HEADER32 *OptionalHdr32; + EFI_IMAGE_OPTIONAL_HEADER64 *OptionalHdr64; EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry; EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry; VOID *CodeViewEntryPointer; @@ -881,8 +981,28 @@ Routine Description: DosHdr = ImageBase; if (DosHdr && DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) { NtHdr = (EFI_IMAGE_NT_HEADERS *) ((UINT8 *) DosHdr + DosHdr->e_lfanew); - OptionalHdr = (VOID *) &NtHdr->OptionalHeader; - DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]); + // + // NOTE: We use Machine to identify PE32/PE32+, instead of Magic. + // It is for backward-compatibility consideration, because + // some system will generate PE32+ image with PE32 Magic. + // + if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) { + Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC; + } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) { + Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC; + } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) { + Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC; + } else { + Magic = NtHdr->OptionalHeader.Magic; + } + if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { + OptionalHdr32 = (VOID *) &NtHdr->OptionalHeader; + DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]); + } else { + OptionalHdr64 = (VOID *) &NtHdr->OptionalHeader; + DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]); + } + if (DirectoryEntry->VirtualAddress != 0) { for (DirCount = 0; (DirCount < DirectoryEntry->Size / sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) && CodeViewEntryPointer == NULL; @@ -1415,3 +1535,84 @@ Routine Description: } } while (!EFI_ERROR (Status)); } + +VOID +EFIAPI +SEnvGraphicsOutput ( + IN EFI_HANDLE h, + IN VOID *Interface + ) +{ + EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; + EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; + + GraphicsOutput = (EFI_GRAPHICS_OUTPUT_PROTOCOL *) Interface; + Mode = GraphicsOutput->Mode; + Info = Mode->Info; + + // + // Dump GraphicsOutput Info: + // HorizontalResolution + // VerticalResolution + // PixelFormat + // PixelInformation + // PixelPerScanLine + // FrameBufferBase + // FrameBufferSize + // + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_HRESOL), + HiiEnvHandle, + Info->HorizontalResolution + ); + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_VRESOL), + HiiEnvHandle, + Info->VerticalResolution + ); + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_PIXELFORMAT), + HiiEnvHandle + ); + switch (Info->PixelFormat) { + case PixelRedGreenBlueReserved8BitPerColor: + Print (L"PixelRedGreenBlueReserved8BitPerColor"); + break; + case PixelBlueGreenRedReserved8BitPerColor: + Print (L"PixelBlueGreenRedReserved8BitPerColor"); + break; + case PixelBitMask: + Print (L"PixelBitMask"); + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_PIXELINFORMATION), + HiiEnvHandle, + Info->PixelInformation.RedMask, + Info->PixelInformation.GreenMask, + Info->PixelInformation.BlueMask, + Info->PixelInformation.ReservedMask + ); + break; + case PixelBltOnly: + Print (L"PixelBltOnly"); + break; + default: + Print (L"Unknown"); + break; + } + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_PIXELSPERSCANLINE), + HiiEnvHandle, + Info->PixelsPerScanLine + ); + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_FRAMEBUFFERBASE), + HiiEnvHandle, + Mode->FrameBufferBase + ); + PrintToken ( + STRING_TOKEN (STR_SHELLENV_DPROT_FRAMEBUFFERSIZE), + HiiEnvHandle, + Mode->FrameBufferSize + ); +} diff --git a/shellenv/exec.c b/shellenv/exec.c index ac69cf8..8f0b2ac 100644 --- a/shellenv/exec.c +++ b/shellenv/exec.c @@ -213,7 +213,9 @@ SEnvLoadImage ( IN EFI_HANDLE ParentImage, IN CHAR16 *IName, OUT EFI_HANDLE *pImageHandle, - OUT EFI_FILE_HANDLE *pScriptsHandle + OUT EFI_FILE_HANDLE *pScriptsHandle, + OUT UINT16 *ImageMachineType, + OUT BOOLEAN *MachineTypeMismatch ); // @@ -1282,6 +1284,8 @@ Routine Description: CHAR16 *CurrentDir; CHAR16 *OptionsBuffer; UINT32 OptionsSize; + UINT16 MachineType; + BOOLEAN MachineTypeMismatch; // // Initializing Status to aVOID a level 4 warning @@ -1431,12 +1435,24 @@ Routine Description: // // Load the app, or open the script // - SEnvLoadImage (ParentImageHandle, Shell->ShellInt.Argv[0], &NewImage, &Script); + SEnvLoadImage (ParentImageHandle, Shell->ShellInt.Argv[0], &NewImage, &Script, &MachineType, &MachineTypeMismatch); if (!NewImage && !Script) { if (Output) { - PrintToken (STRING_TOKEN (STR_SHELLENV_EXEC_NOT_FOUND), HiiEnvHandle, Shell->ShellInt.Argv[0]); + if (MachineTypeMismatch == FALSE) { + PrintToken (STRING_TOKEN (STR_SHELLENV_EXEC_NOT_FOUND), HiiEnvHandle, Shell->ShellInt.Argv[0]); + } else { + // + // Image is not loaded successfully because of the machine type mismatch. + // Print the error info. + // + PrintToken ( + STRING_TOKEN (STR_SHELLENV_EXEC_IMAGE_TYPE_UNSUPPORTED), + HiiEnvHandle, + LibGetMachineTypeString (MachineType), + LibGetMachineTypeString (EFI_IMAGE_MACHINE_TYPE) + ); + } } - Status = EFI_INVALID_PARAMETER; goto Done; } @@ -1596,14 +1612,9 @@ Routine Description: Done: DEBUG_CODE ( if (EFI_ERROR (Status) && Output) { - switch (Status) { - case -1: - case -2: - case EFI_REDIRECTION_NOT_ALLOWED: - case EFI_REDIRECTION_SAME: - break; - - default: + if ((Status == -1) || (Status == -2) || (Status == EFI_REDIRECTION_NOT_ALLOWED) + || (Status == EFI_REDIRECTION_SAME)) { + } else { PrintToken (STRING_TOKEN (STR_SHELLENV_EXEC_EXIT_STATUS_CODE), HiiEnvHandle, Status); } } @@ -1772,7 +1783,9 @@ SEnvLoadImage ( IN EFI_HANDLE ParentImage, IN CHAR16 *IName, OUT EFI_HANDLE *pImageHandle, - OUT EFI_FILE_HANDLE *pScriptHandle + OUT EFI_FILE_HANDLE *pScriptHandle, + OUT UINT16 *ImageMachineType, + OUT BOOLEAN *MachineTypeMismatch ) /*++ @@ -1810,19 +1823,24 @@ Routine Description: UINTN Size; EFI_FILE_INFO *Info; UINTN InfoBufSize; + EFI_IMAGE_DOS_HEADER DosHeader; + EFI_IMAGE_FILE_HEADER ImageHeader; + EFI_IMAGE_OPTIONAL_HEADER OptionalHeader; + + PathName = NULL; + FileName = NULL; + DevicePath = NULL; + TempDevicePath = NULL; + ImageHandle = NULL; + ScriptHandle = NULL; + OpenDir = NULL; + OpenDirHead = NULL; + *pImageHandle = NULL; + *pScriptHandle = NULL; + PathNeedFree = FALSE; + Info = NULL; + *MachineTypeMismatch = FALSE; - PathName = NULL; - FileName = NULL; - DevicePath = NULL; - TempDevicePath = NULL; - ImageHandle = NULL; - ScriptHandle = NULL; - OpenDir = NULL; - OpenDirHead = NULL; - *pImageHandle = NULL; - *pScriptHandle = NULL; - PathNeedFree = FALSE; - Info = NULL; // // Check if IName contains path info @@ -2060,6 +2078,20 @@ Routine Description: ); if (!EFI_ERROR (Status)) { goto Done; + } else { + Status = LibGetImageHeader ( + DevicePath, + &DosHeader, + &ImageHeader, + &OptionalHeader + ); + if (!EFI_ERROR (Status) && + !EFI_IMAGE_MACHINE_TYPE_SUPPORTED (ImageHeader.Machine) && + OptionalHeader.Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) { + *MachineTypeMismatch = TRUE; + *ImageMachineType = ImageHeader.Machine; + goto Done; + } } // // Try as a ".nsh" file diff --git a/shellenv/init.c b/shellenv/init.c index 1b80aa0..1debf66 100644 --- a/shellenv/init.c +++ b/shellenv/init.c @@ -25,7 +25,7 @@ Revision History #include "shellenvguid.h" extern UINT8 STRING_ARRAY_NAME[]; -extern +extern EFI_STATUS FakeInitializeHiiDatabase ( EFI_HANDLE, EFI_SYSTEM_TABLE *, diff --git a/shellenv/map.c b/shellenv/map.c index 5b7d068..a7dd5d7 100644 --- a/shellenv/map.c +++ b/shellenv/map.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005, Intel Corporation +Copyright (c) 2005 - 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -409,7 +409,7 @@ DumpMappingItem ( HiiEnvHandle, SLen, Var->Name, - Removeable ? L"Removeable " : L"", + Removeable ? L"Removable " : L"", MediaName, ConsistName ); @@ -1206,15 +1206,23 @@ Routine Description: FreeDPath = TRUE; } - // - // Build a file path for the rest of the name string - // - FPath = SEnvIFileNameToPath (Path); + if (StrCmp (L".", Path) == 0) { + // + // Need not append "." device path, use DPath directly w/o freeing it + // + FilePath = DPath; + FreeDPath = FALSE; + } else { + // + // Build a file path for the rest of the name string + // + FPath = SEnvIFileNameToPath (Path); - // - // Append the 2 paths - // - FilePath = AppendDevicePath (DPath, FPath); + // + // Append the 2 paths + // + FilePath = AppendDevicePath (DPath, FPath); + } ASSERT (FilePath); Done: diff --git a/shellenv/protid.c b/shellenv/protid.c index 0655c40..c03bd5b 100644 --- a/shellenv/protid.c +++ b/shellenv/protid.c @@ -123,7 +123,7 @@ SEnvInternalProtocolInfo[] = { NULL, EFI_UGA_IO_PROTOCOL_GUID, L"GraphicsOutput", - NULL, + SEnvGraphicsOutput, NULL, EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID, L"EdidDiscovered", @@ -307,6 +307,96 @@ SEnvInternalProtocolInfo[] = { NULL, EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID, + L"UsbHc", + NULL, + NULL, + EFI_USB_HC_PROTOCOL_GUID, + + L"UsbHc2", + NULL, + NULL, + EFI_USB2_HC_PROTOCOL_GUID, + + L"ExtScsiPassThru", + NULL, + NULL, + EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID, + + L"MNPSb", + NULL, + NULL, + EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID, + + L"MNP", + NULL, + NULL, + EFI_MANAGED_NETWORK_PROTOCOL_GUID, + + L"ARPSb", + NULL, + NULL, + EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID, + + L"ARP", + NULL, + NULL, + EFI_ARP_PROTOCOL_GUID, + + L"DHCPv4Sb", + NULL, + NULL, + EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID, + + L"DHCPv4", + NULL, + NULL, + EFI_DHCP4_PROTOCOL_GUID, + + L"TCPv4Sb", + NULL, + NULL, + EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID, + + L"TCPv4", + NULL, + NULL, + EFI_TCP4_PROTOCOL_GUID, + + L"IPv4Sb", + NULL, + NULL, + EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID, + + L"IPv4", + NULL, + NULL, + EFI_IP4_PROTOCOL_GUID, + + L"IPv4Config", + NULL, + NULL, + EFI_IP4_CONFIG_PROTOCOL_GUID, + + L"UDPv4Sb", + NULL, + NULL, + EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID, + + L"UDPv4", + NULL, + NULL, + EFI_UDP4_PROTOCOL_GUID, + + L"MTFTPv4Sb", + NULL, + NULL, + EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID, + + L"MTFTPv4", + NULL, + NULL, + EFI_MTFTP4_PROTOCOL_GUID, + L"Dpath", SEnvDPath, SEnvDPathTok, diff --git a/shellenv/shelle.h b/shellenv/shelle.h index 68ed225..7523690 100644 --- a/shellenv/shelle.h +++ b/shellenv/shelle.h @@ -1273,7 +1273,7 @@ SEnvCmdCd ( EFI_STATUS SEnvGetFsName ( - IN EFI_HANDLE Handle, + IN EFI_DEVICE_PATH_PROTOCOL *DevPath, IN BOOLEAN ConsistMapping, OUT CHAR16 **Name ); @@ -2046,4 +2046,11 @@ SEnvGetShellMode ( OUT CHAR16 **Mode ); +VOID +EFIAPI +SEnvGraphicsOutput ( + IN EFI_HANDLE h, + IN VOID *Interface + ); + #endif // _SHELLE_H_ diff --git a/stall/StallStrings.uni b/stall/StallStrings.uni index 3a24bd2..f29975f 100644 Binary files a/stall/StallStrings.uni and b/stall/StallStrings.uni differ diff --git a/stall/stall.inf b/stall/stall.inf index c4e4408..578b58e 100644 --- a/stall/stall.inf +++ b/stall/stall.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeStall C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/time/TimeStrings.uni b/time/TimeStrings.uni index f9c7dd1..f5c4644 100644 Binary files a/time/TimeStrings.uni and b/time/TimeStrings.uni differ diff --git a/time/time.c b/time/time.c index 6e68de3..dc09b6c 100644 --- a/time/time.c +++ b/time/time.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -190,7 +190,7 @@ Routine Description: if (!EFI_ERROR (Status)) { Status = RT->GetVariable ( L"TimeZone", - &gEfiGlobalVariableGuid, + &gEfiGenericVariableGuid, NULL, &uValueSize, &nValue diff --git a/time/time.inf b/time/time.inf index eb28549..5181280 100644 --- a/time/time.inf +++ b/time/time.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeTime C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/touch/TouchStrings.uni b/touch/TouchStrings.uni index 5b88b39..9971b10 100644 Binary files a/touch/TouchStrings.uni and b/touch/TouchStrings.uni differ diff --git a/touch/touch.inf b/touch/touch.inf index 18a6e74..5382ff6 100644 --- a/touch/touch.inf +++ b/touch/touch.inf @@ -69,7 +69,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeTouch C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/type/TypeStrings.uni b/type/TypeStrings.uni index e3817ef..3a8dfd6 100644 Binary files a/type/TypeStrings.uni and b/type/TypeStrings.uni differ diff --git a/type/type.inf b/type/type.inf index 08282ef..e766baf 100644 --- a/type/type.inf +++ b/type/type.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeType C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/tzone/TZoneStrings.uni b/tzone/TZoneStrings.uni index 8b5cd0f..87b1f6a 100644 Binary files a/tzone/TZoneStrings.uni and b/tzone/TZoneStrings.uni differ diff --git a/tzone/tzone.c b/tzone/tzone.c index 04ad339..7f5002b 100644 --- a/tzone/tzone.c +++ b/tzone/tzone.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2005 - 2006, Intel Corporation +Copyright (c) 2005 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -392,7 +392,7 @@ InitializeTZone ( } else { Status = RT->GetVariable ( L"TimeZone", - &gEfiGlobalVariableGuid, + &gEfiGenericVariableGuid, NULL, &uValueSize, &nValue @@ -545,7 +545,7 @@ TZoneSetValue ( { return RT->SetVariable ( L"TimeZone", - &gEfiGlobalVariableGuid, + &gEfiGenericVariableGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, sizeof (INTN), &nValue diff --git a/unload/UnloadStrings.uni b/unload/UnloadStrings.uni index 7386b2f..70d52a7 100644 Binary files a/unload/UnloadStrings.uni and b/unload/UnloadStrings.uni differ diff --git a/unload/unload.inf b/unload/unload.inf index 4ee7718..e91869e 100644 --- a/unload/unload.inf +++ b/unload/unload.inf @@ -69,7 +69,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeUnload C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/ver/Ebc/verEbc.c b/ver/Ebc/verEbc.c new file mode 100644 index 0000000..1d7368d --- /dev/null +++ b/ver/Ebc/verEbc.c @@ -0,0 +1,62 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + verEbc.c + +Abstract: + + Part of shell app "ver". + + + +Revision History + +--*/ + +#include "EfiShellLib.h" +#include "ver.h" +#include EFI_PROTOCOL_DEFINITION (Ebc) + +// +// +// +VOID +DisplayExtendedVersionInfo ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_EBC_PROTOCOL *Ebc; + EFI_STATUS Status; + UINT64 Version; + + Print (L"\n"); + + Status = BS->LocateProtocol ( + &gEfiEbcProtocolGuid, + NULL, + &Ebc + ); + if (EFI_ERROR (Status)) { + return ; + } + + Status = Ebc->GetVersion (Ebc, &Version); + if (EFI_ERROR (Status)) { + return ; + } + + Print (L"EBC VM Version: 0x%x.0x%x\r\n", (UINTN)(UINT16)(Version >> 16), (UINTN)(UINT16)Version); + + return ; +} diff --git a/ver/Ver.inf b/ver/Ver.inf index 4cb4d1b..eedaab2 100644 --- a/ver/Ver.inf +++ b/ver/Ver.inf @@ -1,6 +1,6 @@ #/*++ # -# Copyright (c) 2005, Intel Corporation +# Copyright (c) 2005 - 2007, Intel Corporation # All rights reserved. This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -50,6 +50,9 @@ COMPONENT_TYPE = APPLICATION [sources.ipf] ipf\ver64.c + +[sources.ebc] + ebc\verEbc.c [includes.common] . @@ -78,7 +81,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeVer C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/ver/VerStrings.uni b/ver/VerStrings.uni index 744d30d..5e77a46 100644 Binary files a/ver/VerStrings.uni and b/ver/VerStrings.uni differ diff --git a/ver/ver.c b/ver/ver.c index 34aa25d..36ed140 100644 --- a/ver/ver.c +++ b/ver/ver.c @@ -198,6 +198,7 @@ Routine Description: if (LibCheckVarGetFlag (&ChkPck, L"-s")) { PrintToken (STRING_TOKEN (STR_VER_SHELL_VER), HiiHandle, SE2->MajorVersion, SE2->MinorVersion); + PrintToken (STRING_TOKEN (STR_VER_SHELL_MACHINE_TYPE), HiiHandle, LibGetMachineTypeString (EFI_IMAGE_MACHINE_TYPE)); PrintToken (STRING_TOKEN (STR_VER_SHELL_SIG), HiiHandle, &SE2->SESGuid); } else { // diff --git a/vol/Vol.inf b/vol/Vol.inf index 02eac3f..d1eef46 100644 --- a/vol/Vol.inf +++ b/vol/Vol.inf @@ -71,7 +71,6 @@ COMPONENT_TYPE = APPLICATION [nmake.common] - C_STD_INCLUDE= IMAGE_ENTRY_POINT=InitializeVol C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\" diff --git a/vol/VolStrings.uni b/vol/VolStrings.uni index c3ac615..16252c6 100644 Binary files a/vol/VolStrings.uni and b/vol/VolStrings.uni differ