/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Sample/Tools/Source/Strip/ |
D | strip.c | 97 int FileSize; in main() local 120 FileSize = ftell (InFile); in main() 122 if (FileSize < 0x200) { in main() 123 printf ("%d is not a legal size, exit\n", FileSize); in main() 129 Buffer = malloc (FileSize); in main() 135 fread (Buffer, 1, FileSize, InFile); in main() 139 Index = FileSize - 0x200; in main()
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/GenCrc32/ |
D | GenCrc32.c | 132 UINT32 FileSize; in main() local 286 FileSize = ftell (InFile); in main() 289 FileBuffer = (UINT8 *) malloc (FileSize); in main() 296 fread (FileBuffer, 1, FileSize, InFile); in main() 298 VerboseMsg ("the size of the input file is %u bytes", (unsigned) FileSize); in main() 313 Status = CalculateCrc32 (FileBuffer, FileSize, &Crc32Value); in main() 323 fwrite (FileBuffer, 1, FileSize, OutFile); in main() 324 VerboseMsg ("the size of the encoded file is %u bytes", (unsigned) FileSize + sizeof (UINT32)); in main() 329 Status = CalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - sizeof (UINT32), &Crc32Value); in main() 343 fwrite (FileBuffer + sizeof (UINT32), 1, FileSize - sizeof (UINT32), OutFile); in main() [all …]
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/GenFfs/ |
D | GenFfs.c | 279 UINT32 FileSize; in GetSectionContents() local 318 FileSize = ftell (InFile); in GetSectionContents() 321 …he input section name is %s and the size is %u bytes", InputFileName[Index], (unsigned) FileSize); in GetSectionContents() 327 if (FileSize >= MAX_FFS_SIZE) { in GetSectionContents() 343 if (FileSize >= MAX_SECTION_SIZE) { in GetSectionContents() 426 if ((FileSize > 0) && (FileBuffer != NULL) && ((Size + FileSize) <= *BufferLength)) { in GetSectionContents() 427 if (fread (FileBuffer + Size, (size_t) FileSize, 1, InFile) != 1) { in GetSectionContents() 435 Size += FileSize; in GetSectionContents() 484 UINT32 FileSize; in main() local 506 FileSize = 0; in main() [all …]
|
/device/linaro/bootloader/edk2/IntelFrameworkModulePkg/Universal/FirmwareVolume/FwVolDxe/ |
D | FwVolRead.c | 324 UINTN FileSize; in FvReadFile() local 371 &FileSize in FvReadFile() 395 FileSize = FFS_FILE2_SIZE (FfsHeader) - sizeof (EFI_FFS_FILE_HEADER2); in FvReadFile() 397 FileSize = FFS_FILE_SIZE (FfsHeader) - sizeof (EFI_FFS_FILE_HEADER); in FvReadFile() 417 *BufferSize = FileSize; in FvReadFile() 433 while (FileSize >= 4) { in FvReadFile() 437 FileSize -= 4; in FvReadFile() 447 FileBuffer = AllocateCopyPool (FileSize, SrcPtr); in FvReadFile() 452 *BufferSize = FileSize; in FvReadFile() 461 if (FileSize > *BufferSize) { in FvReadFile() [all …]
|
/device/linaro/bootloader/edk2/ArmPkg/Filesystem/SemihostFs/Arm/ |
D | SemihostFs.c | 284 FileFcb->Info.FileSize = Length; in FileOpen() 424 if (Fcb->Info.FileSize < Fcb->Info.PhysicalSize) { in FileClose() 425 TruncateFile (Fcb->FileName, Fcb->Info.FileSize); in FileClose() 524 if (Fcb->Position >= Fcb->Info.FileSize) { in FileRead() 526 if (Fcb->Position > Fcb->Info.FileSize) { in FileRead() 567 Return = SemihostFileSeek (Fcb->SemihostHandle, Fcb->Info.FileSize); in ExtendFile() 634 if (Fcb->Position > Fcb->Info.FileSize) { in FileWrite() 635 Status = ExtendFile (Fcb, Fcb->Position - Fcb->Info.FileSize); in FileWrite() 639 Fcb->Info.FileSize = Fcb->Position; in FileWrite() 649 if (Fcb->Position > Fcb->Info.FileSize) { in FileWrite() [all …]
|
/device/linaro/bootloader/edk2/MdeModulePkg/Core/Dxe/FwVol/ |
D | FwVolRead.c | 279 UINTN FileSize; in FvReadFile() local 305 &FileSize in FvReadFile() 354 *BufferSize = FileSize; in FvReadFile() 377 *Buffer = AllocatePool (FileSize); in FvReadFile() 381 } else if (FileSize > InputBufferSize) { in FvReadFile() 386 FileSize = InputBufferSize; in FvReadFile() 392 CopyMem (*Buffer, SrcPtr, FileSize); in FvReadFile() 443 UINTN FileSize; in FvReadFileSection() local 460 &FileSize, in FvReadFileSection() 491 FileSize, in FvReadFileSection()
|
/device/linaro/bootloader/edk2/OvmfPkg/Library/NvVarsFileLib/ |
D | FsAccess.c | 120 *Size = (UINTN) FileInfo->FileSize; in NvVarsFileReadCheckup() 163 if (FileInfo->FileSize == 0) { in FileHandleEmpty() 171 FileInfo->FileSize = 0; in FileHandleEmpty() 233 UINTN FileSize; in ReadNvVarsFile() local 244 NvVarsFileReadCheckup (File, &FileExists, &FileSize); in ReadNvVarsFile() 245 if (FileSize == 0) { in ReadNvVarsFile() 250 FileContents = FileHandleReadToNewBuffer (File, FileSize); in ReadNvVarsFile() 259 (UINT64)FileSize in ReadNvVarsFile() 265 FileSize in ReadNvVarsFile()
|
/device/linaro/bootloader/edk2/ArmPlatformPkg/FileSystem/BootMonFs/ |
D | BootMonFsReadWrite.c | 76 if (File->Position >= File->Info->FileSize) { in BootMonFsReadFile() 80 if (File->Position > File->Info->FileSize) { in BootMonFsReadFile() 88 RemainingFileSize = File->Info->FileSize - File->Position; in BootMonFsReadFile() 175 if (File->Position > File->Info->FileSize) { in BootMonFsWriteFile() 176 File->Info->FileSize = File->Position; in BootMonFsWriteFile() 216 Position = File->Info->FileSize; in BootMonFsSetPosition()
|
D | BootMonFsDir.c | 44 UINT32 FileSize; in BootMonFsGetImageLength() local 48 FileSize = 0; in BootMonFsGetImageLength() 52 FileSize += File->HwDescription.Region[Index].Size; in BootMonFsGetImageLength() 62 if (Region->Offset + Region->Size > FileSize) { in BootMonFsGetImageLength() 63 FileSize += Region->Offset + Region->Size; in BootMonFsGetImageLength() 67 return FileSize; in BootMonFsGetImageLength() 365 OldSize = BootMonFsFile->Info->FileSize; in SetFileSize() 425 BootMonFsFile->Info->FileSize = NewSize; in SetFileSize() 474 FileSizeIsDifferent = (Info->FileSize != File->Info->FileSize); in SetFileInfo() 509 Status = SetFileSize (Instance, File, Info->FileSize); in SetFileInfo() [all …]
|
D | BootMonFsOpenClose.c | 88 UINT32 FileSize; in WriteFileDescription() local 99 FileSize = DataSize + sizeof (HW_IMAGE_DESCRIPTION); in WriteFileDescription() 103 Description->BlockEnd = Description->BlockStart + (FileSize / BlockSize); in WriteFileDescription() 158 IN UINT64 FileSize, in BootMonFsFindSpaceForNewFile() argument 192 >= FileSize) { in BootMonFsFindSpaceForNewFile() 206 if ((((Media->LastBlock + 1) * BlockSize) - *FileStart) >= FileSize) { in BootMonFsFindSpaceForNewFile() 304 Info->FileSize + sizeof (HW_IMAGE_DESCRIPTION), in BootMonFsFlushFile() 419 (Info->FileSize != File->HwDescription.Region[0].Size) ) { in BootMonFsFlushFile() 420 Status = WriteFileDescription (File, AsciiFileName, Info->FileSize, FileStart); in BootMonFsFlushFile() 692 Info->FileSize = BootMonFsGetImageLength (File); in BootMonFsOpenFile()
|
/device/linaro/bootloader/edk2/MdeModulePkg/Application/CapsuleApp/ |
D | CapsuleApp.c | 188 UINTN FileSize; in CreateBmpFmp() local 219 FileSize = 0; in CreateBmpFmp() 223 Status = ReadFileToBuffer(BmpName, &FileSize, &BmpBuffer); in CreateBmpFmp() 229 FullCapsuleBufferSize = sizeof(EFI_DISPLAY_CAPSULE) + FileSize; in CreateBmpFmp() 251 CopyMem((DisplayCapsule + 1), BmpBuffer, FileSize); in CreateBmpFmp() 344 UINTN FileSize; in CreateNestedFmp() local 365 FileSize = 0; in CreateNestedFmp() 369 Status = ReadFileToBuffer(CapsuleName, &FileSize, &CapsuleBuffer); in CreateNestedFmp() 386 FullCapsuleBufferSize = NESTED_CAPSULE_HEADER_SIZE + FileSize; in CreateNestedFmp() 401 CopyMem((UINT8 *)NestedCapsuleHeader + NestedCapsuleHeader->HeaderSize, CapsuleBuffer, FileSize); in CreateNestedFmp() [all …]
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/GenVtf/ |
D | GenVtf.c | 1181 UINT64 FileSize; in CreateAndUpdateComponent() local 1200 FileSize = _filelength (fileno (Fp)); in CreateAndUpdateComponent() 1206 FileSize -= SIZE_OF_PAL_HEADER; in CreateAndUpdateComponent() 1210 if (FileSize > VtfInfo->CompSize) { in CreateAndUpdateComponent() 1216 FileSize = VtfInfo->CompSize; in CreateAndUpdateComponent() 1219 Buffer = malloc ((UINTN) FileSize); in CreateAndUpdateComponent() 1224 memset (Buffer, 0, (UINTN) FileSize); in CreateAndUpdateComponent() 1242 fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp); in CreateAndUpdateComponent() 1257 CompStartAddress = (Vtf2LastStartAddress - FileSize); in CreateAndUpdateComponent() 1259 CompStartAddress = (Vtf1LastStartAddress - FileSize); in CreateAndUpdateComponent() [all …]
|
/device/linaro/bootloader/edk2/ShellPkg/Library/UefiShellTftpCommandLib/ |
D | Tftp.c | 155 OUT UINTN *FileSize 183 IN UINTN FileSize, 286 UINTN FileSize; in ShellCommandRunTftp() local 296 FileSize = 0; in ShellCommandRunTftp() 502 Status = GetFileSize (Mtftp4, AsciiRemoteFilePath, &FileSize); in ShellCommandRunTftp() 511 Status = DownloadFile (Mtftp4, RemoteFilePath, AsciiRemoteFilePath, FileSize, BlockSize, &Data); in ShellCommandRunTftp() 540 Status = ShellWriteFile (FileHandle, &FileSize, Data); in ShellCommandRunTftp() 554 gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Data, EFI_SIZE_TO_PAGES (FileSize)); in ShellCommandRunTftp() 805 OUT UINTN *FileSize in GetFileSize() argument 851 *FileSize = AsciiStrDecimalToUintn ((CHAR8 *)Option->ValueStr); in GetFileSize() [all …]
|
/device/linaro/bootloader/edk2/MdeModulePkg/Library/UefiBootManagerLib/ |
D | BmBoot.c | 148 OUT UINTN *FileSize in BmGetFileBufferByFvFilePath() argument 168 FileBuffer = GetFileBufferByFilePath (TRUE, FilePath, FileSize, &AuthenticationStatus); in BmGetFileBufferByFvFilePath() 193 FileBuffer = BmGetFileBufferByFvFilePath (NewDevicePath, FullPath, FileSize); in BmGetFileBufferByFvFilePath() 218 FileBuffer = BmGetFileBufferByFvFilePath (NewDevicePath, FullPath, FileSize); in BmGetFileBufferByFvFilePath() 570 OUT UINTN *FileSize, in BmExpandUsbDevicePath() argument 589 FileBuffer = EfiBootManagerGetLoadOptionBuffer (FullDevicePath, FullPath, FileSize); in BmExpandUsbDevicePath() 616 OUT UINTN *FileSize in BmExpandFileDevicePath() argument 651 … FileBuffer = GetFileBufferByFilePath (TRUE, FullDevicePath, FileSize, &AuthenticationStatus); in BmExpandFileDevicePath() 686 OUT UINTN *FileSize in BmExpandUriDevicePath() argument 704 FileBuffer = BmGetFileBufferFromLoadFile (Handles[Index], FilePath, FullPath, FileSize); in BmExpandUriDevicePath() [all …]
|
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/ |
D | EfiRom.c | 433 UINT32 FileSize; in ProcessBinFile() local 456 FileSize = ftell (InFptr); in ProcessBinFile() 458 fprintf (stdout, " File size = 0x%X\n", FileSize); in ProcessBinFile() 462 Buffer = (INT8 *) malloc (FileSize); in ProcessBinFile() 469 if (fread (Buffer, FileSize, 1, InFptr) != 1) { in ProcessBinFile() 491 if ((RomHdr->PcirOffset > FileSize) || (RomHdr->PcirOffset == 0)) { in ProcessBinFile() 503 if ((UINT32) (PciDs->ImageLength * 512) == FileSize) { in ProcessBinFile() 507 DataSize = FileSize - 1; in ProcessBinFile() 509 TotalSize = FileSize; in ProcessBinFile() 520 TotalSize = (FileSize + 0x200) & ~0x1ff; in ProcessBinFile() [all …]
|
/device/linaro/bootloader/edk2/MdeModulePkg/Library/DxeSecurityManagementLib/ |
D | DxeSecurityManagementLib.c | 224 UINTN FileSize; in ExecuteSecurityHandlers() local 242 FileSize = 0; in ExecuteSecurityHandlers() 259 FileBuffer = GetFileBufferByFilePath (FALSE, FilePath, &FileSize, &AuthenticationStatus); in ExecuteSecurityHandlers() 264 FileBuffer = GetFileBufferByFilePath (TRUE, FilePath, &FileSize, &AuthenticationStatus); in ExecuteSecurityHandlers() 278 FileSize in ExecuteSecurityHandlers() 482 IN UINTN FileSize, in ExecuteSecurity2Handlers() argument 522 FileSize, in ExecuteSecurity2Handlers()
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/EfiRom/ |
D | EfiRom.c | 227 UINT32 FileSize; in ProcessBinFile() local 253 FileSize = ftell (InFptr); in ProcessBinFile() 255 VerboseMsg(" File size = 0x%X\n", (unsigned) FileSize); in ProcessBinFile() 259 Buffer = (UINT8 *) malloc (FileSize); in ProcessBinFile() 266 if (fread (Buffer, FileSize, 1, InFptr) != 1) { in ProcessBinFile() 275 TotalSize = FileSize; in ProcessBinFile() 303 if ((RomHdr->PcirOffset > FileSize) || (RomHdr->PcirOffset == 0)) { in ProcessBinFile() 362 for (Index = 0; Index < FileSize - 1; Index++) { in ProcessBinFile() 366 Buffer[FileSize - 1] = (UINT8) ((~ByteCheckSum) + 1); in ProcessBinFile() 368 VerboseMsg(" Checksum = %02x\n\n", Buffer[FileSize - 1]); in ProcessBinFile() [all …]
|
/device/linaro/bootloader/edk2/MdeModulePkg/Include/Library/ |
D | SecurityManagementLib.h | 92 IN UINTN FileSize 197 IN UINTN FileSize, 272 IN UINTN FileSize,
|
/device/linaro/bootloader/OpenPlatformPkg/Applications/FirmwareUpdate/ |
D | FUpdate.c | 168 IN OUT UINTN *FileSize in PrepareFirmwareImage() argument 198 Status = FileHandleGetSize (*FileHandle, FileSize); in PrepareFirmwareImage() 204 Buffer = AllocateZeroPool (*FileSize); in PrepareFirmwareImage() 206 Status = FileHandleRead (*FileHandle, FileSize, Buffer); in PrepareFirmwareImage() 259 UINTN FileSize; in ShellCommandRunFUpdate() local 308 Status = PrepareFirmwareImage (CheckPackage, &FileHandle, &FileBuffer, &FileSize); in ShellCommandRunFUpdate() 333 Status = SpiFlashProtocol->Update (Slave, 0, FileSize, (UINT8 *)FileBuffer); in ShellCommandRunFUpdate() 345 Print (L"%s: Update %d bytes at offset 0x0 succeeded!\n", CMD_NAME_STRING, FileSize); in ShellCommandRunFUpdate()
|
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Sample/Tools/Source/Common/ |
D | CommonLib.c | 184 UINT32 FileSize; in GetFileImage() local 214 FileSize = ftell (InputFile); in GetFileImage() 215 if (FileSize == -1) { in GetFileImage() 223 *InputFileImage = malloc (FileSize); in GetFileImage() 241 *BytesRead = fread (*InputFileImage, sizeof (UINT8), FileSize, InputFile); in GetFileImage() 242 if (*BytesRead != sizeof (UINT8) * FileSize) { in GetFileImage()
|
/device/linaro/bootloader/edk2/FatPkg/EnhancedFatDxe/ |
D | ReadWrite.c | 104 Position = OFile->FileSize; in FatSetPosition() 236 if (IFile->Position > OFile->FileSize) { in FatIFileAccess() 284 if (EndPosition > OFile->FileSize) { in FatIFileAccess() 292 *BufferSize -= (UINTN) EndPosition - OFile->FileSize; in FatIFileAccess() 513 ASSERT (Position <= OFile->FileSize); in FatAccessOFile() 542 WritePos = OFile->FileSize; in FatExpandOFile() 575 AppendedSize = OFile->FileSize - WritePos; in FatWriteZeroPool() 624 OFile->FileSize = TruncatedSize; in FatTruncateOFile()
|
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FvSimpleFileSystemDxe/ |
D | FvSimpleFileSystem.c | 136 FvFileInfo->FileInfo.FileSize = 0; in FvFsGetFileSize() 142 …indExecutableSection (FvProtocol, FvFileInfo, (UINTN*)&FvFileInfo->FileInfo.FileSize, &IgnoredPtr); in FvFsGetFileSize() 156 (UINTN*)&FvFileInfo->FileInfo.FileSize, in FvFsGetFileSize() 170 (UINTN*)&FvFileInfo->FileInfo.FileSize, in FvFsGetFileSize() 184 (UINTN*)&FvFileInfo->FileInfo.FileSize, in FvFsGetFileSize() 661 UINTN FileSize; in FvSimpleFileSystemRead() local 697 FileSize = (UINTN)File->FvFileInfo->FileInfo.FileSize; in FvSimpleFileSystemRead() 699 FileBuffer = AllocateZeroPool (FileSize); in FvSimpleFileSystemRead() 704 Status = FvFsReadFile (File->Instance->FvProtocol, File->FvFileInfo, &FileSize, &FileBuffer); in FvSimpleFileSystemRead() 709 if (*BufferSize + File->Position > FileSize) { in FvSimpleFileSystemRead() [all …]
|
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Sample/Tools/Source/GenFfsFile/ |
D | GenFfsFile.c | 1508 IN UINT32 FileSize in AdjustFileSize() argument 1536 SectionStreamLength = FileSize; in AdjustFileSize() 1605 UINT32 FileSize; in MainEntry() local 2140 FileSize = 0; in MainEntry() 2161 … FileSize += ProcessScript (FileBuffer, OverridePackage, mGlobals.BuildDirectory, ForceUncompress); in MainEntry() 2162 if (FileSize == -1) { in MainEntry() 2168 FileSize = AdjustFileSize (FileBuffer, FileSize); in MainEntry() 2251 FileSize += sizeof (EFI_FFS_FILE_HEADER); in MainEntry() 2252 FileHeader.Size[0] = (UINT8) (FileSize & 0xFF); in MainEntry() 2253 FileHeader.Size[1] = (UINT8) ((FileSize & 0xFF00) >> 8); in MainEntry() [all …]
|
/device/linaro/bootloader/edk2/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ |
D | RunAxf.c | 99 UINTN FileSize; in ShellDynCmdRunAxfHandler() local 181 FileSize = (UINTN) Info->FileSize; in ShellDynCmdRunAxfHandler() 188 FileData = AllocateRuntimeZeroPool (FileSize); in ShellDynCmdRunAxfHandler() 196 Status = ShellReadFile (FileHandle, &FileSize, FileData); in ShellDynCmdRunAxfHandler()
|
/device/linaro/bootloader/edk2/EmulatorPkg/Library/SecPeiServicesLib/ |
D | FwVol.c | 246 UINT32 FileSize; in SecFfsFindSectionData() local 257 FileSize = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF; in SecFfsFindSectionData() 258 FileSize -= sizeof (EFI_FFS_FILE_HEADER); in SecFfsFindSectionData() 262 while (ParsedLength < FileSize) { in SecFfsFindSectionData()
|