mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/FvSimpleFileSystem: Fix building error with 32bit tool chains.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16558 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
0927c81df6
commit
270fc03f3e
|
@ -139,7 +139,7 @@ FvFsGetFileSize (
|
||||||
//
|
//
|
||||||
// Get the size of the first executable section out of the file.
|
// Get the size of the first executable section out of the file.
|
||||||
//
|
//
|
||||||
Status = FvFsFindExecutableSection (FvProtocol, FvFileInfo, &FvFileInfo->FileInfo.FileSize, &IgnoredPtr);
|
Status = FvFsFindExecutableSection (FvProtocol, FvFileInfo, (UINTN*)&FvFileInfo->FileInfo.FileSize, &IgnoredPtr);
|
||||||
if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
|
if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ FvFsGetFileSize (
|
||||||
EFI_SECTION_RAW,
|
EFI_SECTION_RAW,
|
||||||
0,
|
0,
|
||||||
&IgnoredPtr,
|
&IgnoredPtr,
|
||||||
&FvFileInfo->FileInfo.FileSize,
|
(UINTN*)&FvFileInfo->FileInfo.FileSize,
|
||||||
&AuthenticationStatus
|
&AuthenticationStatus
|
||||||
);
|
);
|
||||||
if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
|
if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
|
||||||
|
@ -167,7 +167,7 @@ FvFsGetFileSize (
|
||||||
FvProtocol,
|
FvProtocol,
|
||||||
&FvFileInfo->NameGuid,
|
&FvFileInfo->NameGuid,
|
||||||
NULL,
|
NULL,
|
||||||
&FvFileInfo->FileInfo.FileSize,
|
(UINTN*)&FvFileInfo->FileInfo.FileSize,
|
||||||
&FoundType,
|
&FoundType,
|
||||||
&Attributes,
|
&Attributes,
|
||||||
&AuthenticationStatus
|
&AuthenticationStatus
|
||||||
|
@ -181,7 +181,7 @@ FvFsGetFileSize (
|
||||||
FvProtocol,
|
FvProtocol,
|
||||||
&FvFileInfo->NameGuid,
|
&FvFileInfo->NameGuid,
|
||||||
NULL,
|
NULL,
|
||||||
&FvFileInfo->FileInfo.FileSize,
|
(UINTN*)&FvFileInfo->FileInfo.FileSize,
|
||||||
&FoundType,
|
&FoundType,
|
||||||
&Attributes,
|
&Attributes,
|
||||||
&AuthenticationStatus
|
&AuthenticationStatus
|
||||||
|
@ -303,7 +303,7 @@ FvFsGetFileInfo (
|
||||||
{
|
{
|
||||||
UINTN InfoSize;
|
UINTN InfoSize;
|
||||||
|
|
||||||
InfoSize = FvFileInfo->FileInfo.Size;
|
InfoSize = (UINTN)FvFileInfo->FileInfo.Size;
|
||||||
if (*BufferSize < InfoSize) {
|
if (*BufferSize < InfoSize) {
|
||||||
*BufferSize = InfoSize;
|
*BufferSize = InfoSize;
|
||||||
return EFI_BUFFER_TOO_SMALL;
|
return EFI_BUFFER_TOO_SMALL;
|
||||||
|
@ -650,7 +650,7 @@ FvSimpleFileSystemRead (
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FileSize = File->FvFileInfo->FileInfo.FileSize;
|
FileSize = (UINTN)File->FvFileInfo->FileInfo.FileSize;
|
||||||
|
|
||||||
FileBuffer = AllocateZeroPool (FileSize);
|
FileBuffer = AllocateZeroPool (FileSize);
|
||||||
if (FileBuffer == NULL) {
|
if (FileBuffer == NULL) {
|
||||||
|
@ -663,7 +663,7 @@ FvSimpleFileSystemRead (
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*BufferSize + File->Position > FileSize) {
|
if (*BufferSize + File->Position > FileSize) {
|
||||||
*BufferSize = FileSize - File->Position;
|
*BufferSize = (UINTN)(FileSize - File->Position);
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyMem (Buffer, (UINT8*)FileBuffer + File->Position, *BufferSize);
|
CopyMem (Buffer, (UINT8*)FileBuffer + File->Position, *BufferSize);
|
||||||
|
|
Loading…
Reference in New Issue