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/BootMonFsFileInfo.h>
30 #include <Guid/FileInfo.h>
31 #include <Guid/FileSystemInfo.h>
32 #include <Guid/FileSystemVolumeLabelInfo.h>
34 #include "BootMonFsHw.h"
36 #define BOOTMON_FS_VOLUME_LABEL L"NOR Flash"
38 typedef struct _BOOTMON_FS_INSTANCE BOOTMON_FS_INSTANCE
;
44 UINT64 Offset
; // Offset from the start of the file
45 } BOOTMON_FS_FILE_REGION
;
50 BOOTMON_FS_INSTANCE
*Instance
;
53 HW_IMAGE_DESCRIPTION HwDescription
;
55 EFI_FILE_PROTOCOL File
;
58 // If the file needs to be flushed then this list contain the memory buffer that creates this file
59 LIST_ENTRY RegionToFlushLink
;
63 #define BOOTMON_FS_FILE_SIGNATURE SIGNATURE_32('b', 'o', 't', 'f')
64 #define BOOTMON_FS_FILE_FROM_FILE_THIS(a) CR (a, BOOTMON_FS_FILE, File, BOOTMON_FS_FILE_SIGNATURE)
65 #define BOOTMON_FS_FILE_FROM_LINK_THIS(a) CR (a, BOOTMON_FS_FILE, Link, BOOTMON_FS_FILE_SIGNATURE)
67 struct _BOOTMON_FS_INSTANCE
{
69 EFI_HANDLE ControllerHandle
;
73 EFI_DRIVER_BINDING_PROTOCOL
*Binding
;
74 EFI_DISK_IO_PROTOCOL
*DiskIo
;
75 EFI_BLOCK_IO_PROTOCOL
*BlockIo
;
76 EFI_BLOCK_IO_MEDIA
*Media
;
77 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
79 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL Fs
;
81 EFI_FILE_SYSTEM_INFO FsInfo
;
84 BOOTMON_FS_FILE
*RootFile
; // All the other files are linked to this root
88 #define BOOTMON_FS_SIGNATURE SIGNATURE_32('b', 'o', 't', 'm')
89 #define BOOTMON_FS_FROM_FS_THIS(a) CR (a, BOOTMON_FS_INSTANCE, Fs, BOOTMON_FS_SIGNATURE)
90 #define BOOTMON_FS_FROM_LINK(a) CR (a, BOOTMON_FS_INSTANCE, Link, BOOTMON_FS_SIGNATURE)
92 #include "BootMonFsApi.h"