Skip to content

Commit

Permalink
SHEL8
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/efi-shell/code/trunk/Shell@24 98faeb64-521c-4ab6-bae1-df9f193a316f
  • Loading branch information
hfang authored and hfang committed Mar 16, 2007
1 parent 85a7bf3 commit 5be55e8
Show file tree
Hide file tree
Showing 136 changed files with 1,560 additions and 957 deletions.
Binary file modified DeviceTree/DevicetreeStrings.uni
Binary file not shown.
1 change: 0 additions & 1 deletion DeviceTree/devicetree.inf
Original file line number Diff line number Diff line change
Expand Up @@ -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\"
Expand Down
6 changes: 3 additions & 3 deletions EDK_Snapshot.txt
Original file line number Diff line number Diff line change
@@ -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.
36 changes: 18 additions & 18 deletions EfiCompress/CompressMain.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
Binary file modified EfiCompress/CompressStrings.uni
Binary file not shown.
144 changes: 69 additions & 75 deletions EfiCompress/compress.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*++
/*
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,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Compress.c
compress.c
Abstract:
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -691,7 +693,7 @@ Returns: (VOID)
}

if (t < WNDSIZ) {
mPosition[t] = (NODE) (mPos | (UINT32) PERC_FLAG);
mPosition[t] = (NODE) (mPos | PERC_FLAG);
}
} else {
//
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -817,16 +819,16 @@ Returns: (VOID)
return ;
}

t = (NODE) (mPosition[r] & (UINT32)~PERC_FLAG);
t = (NODE) (mPosition[r] & ~PERC_FLAG);
if (t >= mPos) {
t -= WNDSIZ;
}

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;
}
Expand All @@ -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]]);
Expand Down Expand Up @@ -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 ();
Expand Down Expand Up @@ -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)));
}
}

Expand All @@ -1216,8 +1217,6 @@ Routine Description:
{
UINT32 i;

UINT32 j;

UINT32 k;

UINT32 Flags;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1309,34 +1304,25 @@ 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;
}

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]++;
}
}
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions EfiDecompress/Decompress.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Binary file modified EfiDecompress/DecompressStrings.uni
Binary file not shown.
Binary file modified IpConfig/IpConfigStrings.uni
Binary file not shown.
Loading

0 comments on commit 5be55e8

Please sign in to comment.