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 // The following fields are relevant only if the file is open.
63 // If the file needs to be flushed then this list contain the memory
64 // buffer that creates this file
65 LIST_ENTRY RegionToFlushLink
;
69 #define BOOTMON_FS_FILE_SIGNATURE SIGNATURE_32('b', 'o', 't', 'f')
70 #define BOOTMON_FS_FILE_FROM_FILE_THIS(a) CR (a, BOOTMON_FS_FILE, File, BOOTMON_FS_FILE_SIGNATURE)
71 #define BOOTMON_FS_FILE_FROM_LINK_THIS(a) CR (a, BOOTMON_FS_FILE, Link, BOOTMON_FS_FILE_SIGNATURE)
73 struct _BOOTMON_FS_INSTANCE
{
75 EFI_HANDLE ControllerHandle
;
79 EFI_DRIVER_BINDING_PROTOCOL
*Binding
;
80 EFI_DISK_IO_PROTOCOL
*DiskIo
;
81 EFI_BLOCK_IO_PROTOCOL
*BlockIo
;
82 EFI_BLOCK_IO_MEDIA
*Media
;
83 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
85 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL Fs
;
87 EFI_FILE_SYSTEM_INFO FsInfo
;
90 BOOTMON_FS_FILE
*RootFile
; // All the other files are linked to this root
94 #define BOOTMON_FS_SIGNATURE SIGNATURE_32('b', 'o', 't', 'm')
95 #define BOOTMON_FS_FROM_FS_THIS(a) CR (a, BOOTMON_FS_INSTANCE, Fs, BOOTMON_FS_SIGNATURE)
96 #define BOOTMON_FS_FROM_LINK(a) CR (a, BOOTMON_FS_INSTANCE, Link, BOOTMON_FS_SIGNATURE)
98 #include "BootMonFsApi.h"