3 * Copyright (c) 2012-2014, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __BOOTMONFS_INTERNAL_H__
16 #define __BOOTMONFS_INTERNAL_H__
19 #include <Library/UefiLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/MemoryAllocationLib.h>
24 #include <Protocol/BlockIo.h>
25 #include <Protocol/DiskIo.h>
26 #include <Protocol/FirmwareVolumeBlock.h>
27 #include <Protocol/SimpleFileSystem.h>
29 #include <Guid/FileInfo.h>
30 #include <Guid/FileSystemInfo.h>
31 #include <Guid/FileSystemVolumeLabelInfo.h>
33 #include "BootMonFsHw.h"
35 #define BOOTMON_FS_VOLUME_LABEL L"NOR Flash"
37 typedef struct _BOOTMON_FS_INSTANCE BOOTMON_FS_INSTANCE
;
43 UINT64 Offset
; // Offset from the start of the file
44 } BOOTMON_FS_FILE_REGION
;
49 BOOTMON_FS_INSTANCE
*Instance
;
52 HW_IMAGE_DESCRIPTION HwDescription
;
54 EFI_FILE_PROTOCOL File
;
57 // If the file needs to be flushed then this list contain the memory buffer that creates this file
58 LIST_ENTRY RegionToFlushLink
;
62 #define BOOTMON_FS_FILE_SIGNATURE SIGNATURE_32('b', 'o', 't', 'f')
63 #define BOOTMON_FS_FILE_FROM_FILE_THIS(a) CR (a, BOOTMON_FS_FILE, File, BOOTMON_FS_FILE_SIGNATURE)
64 #define BOOTMON_FS_FILE_FROM_LINK_THIS(a) CR (a, BOOTMON_FS_FILE, Link, BOOTMON_FS_FILE_SIGNATURE)
66 struct _BOOTMON_FS_INSTANCE
{
68 EFI_HANDLE ControllerHandle
;
72 EFI_DRIVER_BINDING_PROTOCOL
*Binding
;
73 EFI_DISK_IO_PROTOCOL
*DiskIo
;
74 EFI_BLOCK_IO_PROTOCOL
*BlockIo
;
75 EFI_BLOCK_IO_MEDIA
*Media
;
76 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
78 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL Fs
;
80 EFI_FILE_SYSTEM_INFO FsInfo
;
83 BOOTMON_FS_FILE
*RootFile
; // All the other files are linked to this root
87 #define BOOTMON_FS_SIGNATURE SIGNATURE_32('b', 'o', 't', 'm')
88 #define BOOTMON_FS_FROM_FS_THIS(a) CR (a, BOOTMON_FS_INSTANCE, Fs, BOOTMON_FS_SIGNATURE)
89 #define BOOTMON_FS_FROM_LINK(a) CR (a, BOOTMON_FS_INSTANCE, Link, BOOTMON_FS_SIGNATURE)
91 #include "BootMonFsApi.h"