]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsInternal.h
ArmPlatformPkg/BootMonFs: Fix error codes returned by Open() and Read()
[mirror_edk2.git] / ArmPlatformPkg / FileSystem / BootMonFs / BootMonFsInternal.h
... / ...
CommitLineData
1/** @file\r
2*\r
3* Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
4*\r
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this distribution. The full text of the license may be found at\r
8* http://opensource.org/licenses/bsd-license.php\r
9*\r
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12*\r
13**/\r
14\r
15#ifndef __BOOTMONFS_INTERNAL_H__\r
16#define __BOOTMONFS_INTERNAL_H__\r
17\r
18#include <PiDxe.h>\r
19#include <Library/UefiLib.h>\r
20#include <Library/DebugLib.h>\r
21#include <Library/BaseMemoryLib.h>\r
22#include <Library/MemoryAllocationLib.h>\r
23\r
24#include <Protocol/BlockIo.h>\r
25#include <Protocol/DiskIo.h>\r
26#include <Protocol/FirmwareVolumeBlock.h>\r
27#include <Protocol/SimpleFileSystem.h>\r
28\r
29#include <Guid/BootMonFsFileInfo.h>\r
30#include <Guid/FileInfo.h>\r
31#include <Guid/FileSystemInfo.h>\r
32#include <Guid/FileSystemVolumeLabelInfo.h>\r
33\r
34#include "BootMonFsHw.h"\r
35\r
36#define BOOTMON_FS_VOLUME_LABEL L"NOR Flash"\r
37\r
38typedef struct _BOOTMON_FS_INSTANCE BOOTMON_FS_INSTANCE;\r
39\r
40typedef struct {\r
41 LIST_ENTRY Link;\r
42 VOID* Buffer;\r
43 UINTN Size;\r
44 UINT64 Offset; // Offset from the start of the file\r
45} BOOTMON_FS_FILE_REGION;\r
46\r
47typedef struct {\r
48 UINT32 Signature;\r
49 LIST_ENTRY Link;\r
50 BOOTMON_FS_INSTANCE *Instance;\r
51\r
52 UINTN HwDescAddress;\r
53 HW_IMAGE_DESCRIPTION HwDescription;\r
54\r
55 EFI_FILE_PROTOCOL File;\r
56\r
57 UINT64 Position;\r
58 // If the file needs to be flushed then this list contain the memory buffer that creates this file\r
59 LIST_ENTRY RegionToFlushLink;\r
60 UINT64 OpenMode;\r
61} BOOTMON_FS_FILE;\r
62\r
63#define BOOTMON_FS_FILE_SIGNATURE SIGNATURE_32('b', 'o', 't', 'f')\r
64#define BOOTMON_FS_FILE_FROM_FILE_THIS(a) CR (a, BOOTMON_FS_FILE, File, BOOTMON_FS_FILE_SIGNATURE)\r
65#define BOOTMON_FS_FILE_FROM_LINK_THIS(a) CR (a, BOOTMON_FS_FILE, Link, BOOTMON_FS_FILE_SIGNATURE)\r
66\r
67struct _BOOTMON_FS_INSTANCE {\r
68 UINT32 Signature;\r
69 EFI_HANDLE ControllerHandle;\r
70\r
71 LIST_ENTRY Link;\r
72\r
73 EFI_DRIVER_BINDING_PROTOCOL *Binding;\r
74 EFI_DISK_IO_PROTOCOL *DiskIo;\r
75 EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
76 EFI_BLOCK_IO_MEDIA *Media;\r
77 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
78\r
79 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL Fs;\r
80\r
81 EFI_FILE_SYSTEM_INFO FsInfo;\r
82 CHAR16 Label[20];\r
83\r
84 BOOTMON_FS_FILE *RootFile; // All the other files are linked to this root\r
85 BOOLEAN Initialized;\r
86};\r
87\r
88#define BOOTMON_FS_SIGNATURE SIGNATURE_32('b', 'o', 't', 'm')\r
89#define BOOTMON_FS_FROM_FS_THIS(a) CR (a, BOOTMON_FS_INSTANCE, Fs, BOOTMON_FS_SIGNATURE)\r
90#define BOOTMON_FS_FROM_LINK(a) CR (a, BOOTMON_FS_INSTANCE, Link, BOOTMON_FS_SIGNATURE)\r
91\r
92#include "BootMonFsApi.h"\r
93\r
94#endif\r
95\r