mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
Remove volatile for local Index, and Use Memory library functions to fix the reference to compiler intrinsic functions.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7359 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
70e5ca2731
commit
02313d1e79
@ -14,11 +14,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <Base.h>
|
#include <Base.h>
|
||||||
|
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/UefiDecompressLib.h>
|
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/UefiDecompressLib.h>
|
||||||
|
|
||||||
#include "BaseUefiDecompressLibInternals.h"
|
#include "BaseUefiDecompressLibInternals.h"
|
||||||
|
|
||||||
@ -142,7 +141,7 @@ MakeTable (
|
|||||||
UINT16 Start[18];
|
UINT16 Start[18];
|
||||||
UINT16 *Pointer;
|
UINT16 *Pointer;
|
||||||
UINT16 Index3;
|
UINT16 Index3;
|
||||||
volatile UINT16 Index;
|
UINT16 Index;
|
||||||
UINT16 Len;
|
UINT16 Len;
|
||||||
UINT16 Char;
|
UINT16 Char;
|
||||||
UINT16 JuBits;
|
UINT16 JuBits;
|
||||||
@ -192,8 +191,8 @@ MakeTable (
|
|||||||
|
|
||||||
if (Index != 0) {
|
if (Index != 0) {
|
||||||
Index3 = (UINT16) (1U << TableBits);
|
Index3 = (UINT16) (1U << TableBits);
|
||||||
while (Index != Index3) {
|
if (Index < Index3) {
|
||||||
Table[Index++] = 0;
|
SetMem16 (Table + Index, (Index3 - Index) * sizeof (*Table), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +321,7 @@ ReadPTLen (
|
|||||||
{
|
{
|
||||||
UINT16 Number;
|
UINT16 Number;
|
||||||
UINT16 CharC;
|
UINT16 CharC;
|
||||||
volatile UINT16 Index;
|
UINT16 Index;
|
||||||
UINT32 Mask;
|
UINT32 Mask;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -340,9 +339,7 @@ ReadPTLen (
|
|||||||
Sd->mPTTable[Index] = CharC;
|
Sd->mPTTable[Index] = CharC;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < nn; Index++) {
|
SetMem (Sd->mPTLen, nn, 0);
|
||||||
Sd->mPTLen[Index] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -407,7 +404,7 @@ ReadCLen (
|
|||||||
{
|
{
|
||||||
UINT16 Number;
|
UINT16 Number;
|
||||||
UINT16 CharC;
|
UINT16 CharC;
|
||||||
volatile UINT16 Index;
|
UINT16 Index;
|
||||||
UINT32 Mask;
|
UINT32 Mask;
|
||||||
|
|
||||||
Number = (UINT16) GetBits (Sd, CBIT);
|
Number = (UINT16) GetBits (Sd, CBIT);
|
||||||
@ -418,9 +415,7 @@ ReadCLen (
|
|||||||
//
|
//
|
||||||
CharC = (UINT16) GetBits (Sd, CBIT);
|
CharC = (UINT16) GetBits (Sd, CBIT);
|
||||||
|
|
||||||
for (Index = 0; Index < NC; Index++) {
|
SetMem (Sd->mCLen, NC, 0);
|
||||||
Sd->mCLen[Index] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Index = 0; Index < 4096; Index++) {
|
for (Index = 0; Index < 4096; Index++) {
|
||||||
Sd->mCTable[Index] = CharC;
|
Sd->mCTable[Index] = CharC;
|
||||||
@ -473,9 +468,7 @@ ReadCLen (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (Index < NC) {
|
SetMem (Sd->mCLen + Index, NC - Index, 0);
|
||||||
Sd->mCLen[Index++] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
MakeTable (Sd, NC, Sd->mCLen, 12, Sd->mCTable);
|
MakeTable (Sd, NC, Sd->mCLen, 12, Sd->mCTable);
|
||||||
|
|
||||||
@ -743,7 +736,6 @@ UefiDecompress (
|
|||||||
IN OUT VOID *Scratch OPTIONAL
|
IN OUT VOID *Scratch OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
volatile UINT32 Index;
|
|
||||||
UINT32 CompSize;
|
UINT32 CompSize;
|
||||||
UINT32 OrigSize;
|
UINT32 OrigSize;
|
||||||
SCRATCH_DATA *Sd;
|
SCRATCH_DATA *Sd;
|
||||||
@ -770,10 +762,8 @@ UefiDecompress (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Src = Src + 8;
|
Src = Src + 8;
|
||||||
|
SetMem (Sd, sizeof (SCRATCH_DATA), 0);
|
||||||
|
|
||||||
for (Index = 0; Index < sizeof (SCRATCH_DATA); Index++) {
|
|
||||||
((UINT8 *) Sd)[Index] = 0;
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// The length of the field 'Position Set Code Length Array Size' in Block Header.
|
// The length of the field 'Position Set Code Length Array Size' in Block Header.
|
||||||
// For UEFI 2.0 de/compression algorithm(Version 1), mPBit = 4
|
// For UEFI 2.0 de/compression algorithm(Version 1), mPBit = 4
|
||||||
|
@ -38,4 +38,5 @@
|
|||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib
|
BaseLib
|
||||||
DebugLib
|
DebugLib
|
||||||
|
BaseMemoryLib
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user