diff options
Diffstat (limited to 'ArmPlatformPkg/FileSystem/BootMonFs')
-rw-r--r-- | ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf | 1 | ||||
-rw-r--r-- | ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsDir.c | 49 | ||||
-rw-r--r-- | ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsInternal.h | 1 |
3 files changed, 51 insertions, 0 deletions
diff --git a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf index d7770f0b96..94e8916e1b 100644 --- a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf +++ b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf @@ -43,6 +43,7 @@ UefiLib
[Guids]
+ gArmBootMonFsFileInfoGuid
gEfiFileSystemInfoGuid
gEfiFileInfoGuid
gEfiFileSystemVolumeLabelInfoIdGuid
diff --git a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsDir.c b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsDir.c index 7ef180f54a..835cdae18a 100644 --- a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsDir.c +++ b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsDir.c @@ -252,6 +252,53 @@ GetFileInfo ( STATIC
EFI_STATUS
+GetBootMonFsFileInfo (
+ IN BOOTMON_FS_INSTANCE *Instance,
+ IN BOOTMON_FS_FILE *File,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ )
+{
+ EFI_STATUS Status;
+ BOOTMON_FS_FILE_INFO *Info;
+ UINTN ResultSize;
+ UINTN Index;
+
+ if (File == Instance->RootFile) {
+ Status = EFI_UNSUPPORTED;
+ } else {
+ ResultSize = SIZE_OF_BOOTMON_FS_FILE_INFO;
+
+ if (*BufferSize < ResultSize) {
+ *BufferSize = ResultSize;
+ Status = EFI_BUFFER_TOO_SMALL;
+ } else {
+ Info = Buffer;
+
+ // Zero out the structure
+ ZeroMem (Info, ResultSize);
+
+ // Fill in the structure
+ Info->Size = ResultSize;
+
+ Info->EntryPoint = File->HwDescription.EntryPoint;
+ Info->RegionCount = File->HwDescription.RegionCount;
+ for (Index = 0; Index < File->HwDescription.RegionCount; Index++) {
+ Info->Region[Index].LoadAddress = File->HwDescription.Region[Index].LoadAddress;
+ Info->Region[Index].Size = File->HwDescription.Region[Index].Size;
+ Info->Region[Index].Offset = File->HwDescription.Region[Index].Offset;
+ Info->Region[Index].Checksum = File->HwDescription.Region[Index].Checksum;
+ }
+ *BufferSize = ResultSize;
+ Status = EFI_SUCCESS;
+ }
+ }
+
+ return Status;
+}
+
+STATIC
+EFI_STATUS
SetFileName (
IN BOOTMON_FS_FILE *File,
IN CHAR16 *FileNameUnicode
@@ -452,6 +499,8 @@ BootMonFsGetInfo ( Status = GetFilesystemInfo (Instance, BufferSize, Buffer);
} else if (CompareGuid (InformationType, &gEfiFileInfoGuid) != 0) {
Status = GetFileInfo (Instance, File, BufferSize, Buffer);
+ } else if (CompareGuid (InformationType, &gArmBootMonFsFileInfoGuid) != 0) {
+ Status = GetBootMonFsFileInfo (Instance, File, BufferSize, Buffer);
} else {
Status = EFI_UNSUPPORTED;
}
diff --git a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsInternal.h b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsInternal.h index 3167bba00a..57343618ab 100644 --- a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsInternal.h +++ b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsInternal.h @@ -26,6 +26,7 @@ #include <Protocol/FirmwareVolumeBlock.h>
#include <Protocol/SimpleFileSystem.h>
+#include <Guid/BootMonFsFileInfo.h>
#include <Guid/FileInfo.h>
#include <Guid/FileSystemInfo.h>
#include <Guid/FileSystemVolumeLabelInfo.h>
|