blob: f36ee3b76ac64ea5ec39ef3068b84fd010947f7f [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2
3Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
4This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 EfiFlashMap.h
15
16Abstract:
17
18 Defines for the EFI Flash Map functionality
19
20**/
21
22#ifndef _EFI_FLASHMAP_H_
23#define _EFI_FLASHMAP_H_
24
25//
26// Definition for flash map GUIDed HOBs
27//
28typedef UINT32 EFI_FLASH_AREA_ATTRIBUTES;
29
30#define EFI_FLASH_AREA_FV 0x0001
31#define EFI_FLASH_AREA_SUBFV 0x0002
32#define EFI_FLASH_AREA_MEMMAPPED_FV 0x0004
33#define EFI_FLASH_AREA_REQUIRED 0x0008
34#define EFI_FLASH_AREA_CORRUPT 0x0010
35
36typedef UINT8 EFI_FLASH_AREA_TYPE;
37
38#define EFI_FLASH_AREA_RECOVERY_BIOS 0x0 // Recovery code
39#define EFI_FLASH_AREA_MAIN_BIOS 0x1 // Regular BIOS code
40#define EFI_FLASH_AREA_PAL_B 0x2 // PAL-B
41#define EFI_FLASH_AREA_RESERVED_03 0x3 // Reserved for backwards compatibility
42#define EFI_FLASH_AREA_RESERVED_04 0x4 // Reserved for backwards compatibility
43#define EFI_FLASH_AREA_DMI_FRU 0x5 // DMI FRU information
44#define EFI_FLASH_AREA_OEM_BINARY 0x6 // OEM Binary Code/data
45#define EFI_FLASH_AREA_RESERVED_07 0x7 // Reserved for backwards compatibility
46#define EFI_FLASH_AREA_RESERVED_08 0x8 // Reserved for backwards compatibility
47#define EFI_FLASH_AREA_RESERVED_09 0x9 // Reserved for backwards compatibility
48#define EFI_FLASH_AREA_RESERVED_0A 0x0a // Reserved for backwards compatibility
49#define EFI_FLASH_AREA_EFI_VARIABLES 0x0b // EFI variables
50#define EFI_FLASH_AREA_MCA_LOG 0x0c // MCA error log
51#define EFI_FLASH_AREA_SMBIOS_LOG 0x0d // SMBIOS error log
52#define EFI_FLASH_AREA_FTW_BACKUP 0x0e // A backup block during FTW operations
53#define EFI_FLASH_AREA_FTW_STATE 0x0f // State information during FTW operations
54#define EFI_FLASH_AREA_UNUSED 0x0fd // Not used
55#define EFI_FLASH_AREA_GUID_DEFINED 0x0fe // Usage defined by a GUID
56#pragma pack(1)
57//
58// An individual sub-area Entry.
59// A single flash area may consist of more than one sub-area.
60//
61/**
62typedef struct {
63 EFI_FLASH_AREA_ATTRIBUTES Attributes;
64 UINT32 Reserved;
65 EFI_PHYSICAL_ADDRESS Base;
66 EFI_PHYSICAL_ADDRESS Length;
67 EFI_GUID FileSystem;
68} EFI_FLASH_SUBAREA_ENTRY;
69
70typedef struct {
71 UINT8 Reserved[3];
72 EFI_FLASH_AREA_TYPE AreaType;
73 EFI_GUID AreaTypeGuid;
74 UINT32 NumEntries;
75 EFI_FLASH_SUBAREA_ENTRY Entries[1];
76} EFI_FLASH_MAP_ENTRY_DATA;
77
78typedef struct {
79 UINT8 Reserved[3];
80 EFI_FLASH_AREA_TYPE AreaType;
81 EFI_GUID AreaTypeGuid;
82 UINT32 NumberOfEntries;
83 EFI_FLASH_SUBAREA_ENTRY Entries[1];
84 //
85 // Extended Hob data.
86 //
87 // VolumeId and FilePath indicating a unique file.
88 //
89 UINT32 VolumeId;
90 CHAR16 FilePath[256];
91 UINT32 ActuralSize;
92 UINT32 Offset;
93} EFI_FLASH_MAP_FS_ENTRY_DATA;
94
95typedef struct {
96 EFI_HOB_GENERIC_HEADER Header;
97 EFI_GUID Name;
98 UINT8 Reserved[3];
99 EFI_FLASH_AREA_TYPE AreaType;
100 EFI_GUID AreaTypeGuid;
101 UINT32 NumEntries;
102 EFI_FLASH_SUBAREA_ENTRY Entries[1];
103} EFI_HOB_FLASH_MAP_ENTRY_TYPE;
104
105//
106// Internal definitions
107//
108typedef struct {
109 UINT8 Reserved[3];
110 EFI_FLASH_AREA_TYPE AreaType;
111 EFI_GUID AreaTypeGuid;
112 UINT32 NumberOfEntries;
113 EFI_FLASH_SUBAREA_ENTRY SubAreaData;
114} EFI_FLASH_AREA_HOB_DATA;
115
116typedef struct {
117 UINTN Base;
118 UINTN Length;
119 EFI_FLASH_AREA_ATTRIBUTES Attributes;
120 EFI_FLASH_AREA_TYPE AreaType;
121 UINT8 Reserved[3];
122 EFI_GUID AreaTypeGuid;
123} EFI_FLASH_AREA_DATA;
124**/
125
126typedef struct {
127 EFI_FLASH_AREA_ATTRIBUTES Attributes;
128 UINT32 Reserved;
129 EFI_PHYSICAL_ADDRESS Base;
130 EFI_PHYSICAL_ADDRESS Length;
131 EFI_GUID FileSystem;
132} EFI_FLASH_SUBAREA_ENTRY;
133
134typedef struct {
135 UINT8 Reserved[3];
136 EFI_FLASH_AREA_TYPE AreaType;
137 EFI_GUID AreaTypeGuid;
138 UINT32 NumberOfEntries;
139 EFI_FLASH_SUBAREA_ENTRY Entries[1];
140 //
141 // Extended Hob data.
142 //
143 // VolumeId and FilePath indicating a unique file.
144 //
145 UINT32 VolumeId;
146 CHAR16 FilePath[258];
147 UINT32 ActuralSize;
148 UINT32 Offset;
149} EFI_FLASH_MAP_FS_ENTRY_DATA;
150
151#pragma pack()
152
153#endif // #ifndef _EFI_FLASHMAP_H_