coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fmap_serialized.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only */
2 
3 #ifndef FLASHMAP_SERIALIZED_H__
4 #define FLASHMAP_SERIALIZED_H__
5 
6 #include <stdint.h>
7 
8 #define FMAP_SIGNATURE "__FMAP__"
9 #define FMAP_VER_MAJOR 1 /* this header's FMAP minor version */
10 #define FMAP_VER_MINOR 1 /* this header's FMAP minor version */
11 #define FMAP_STRLEN 32 /* maximum length for strings, */
12  /* including null-terminator */
13 
14 enum fmap_flags {
15  FMAP_AREA_STATIC = 1 << 0,
17  FMAP_AREA_RO = 1 << 2,
19 };
20 
21 /* Mapping of volatile and static regions in firmware binary */
22 struct fmap_area {
23  uint32_t offset; /* offset relative to base */
24  uint32_t size; /* size in bytes */
25  uint8_t name[FMAP_STRLEN]; /* descriptive name */
26  uint16_t flags; /* flags for this area */
28 
29 struct fmap {
30  uint8_t signature[8]; /* "__FMAP__" (0x5F5F464D41505F5F) */
31  uint8_t ver_major; /* major version */
32  uint8_t ver_minor; /* minor version */
33  uint64_t base; /* address of the firmware binary */
34  uint32_t size; /* size of firmware binary in bytes */
35  uint8_t name[FMAP_STRLEN]; /* name of this firmware binary */
36  uint16_t nareas; /* number of areas described by
37  fmap_areas[] below */
38  struct fmap_area areas[];
39 } __packed;
40 
41 #endif /* FLASHMAP_SERIALIZED_H__ */
#define FMAP_STRLEN
fmap_flags
@ FMAP_AREA_COMPRESSED
@ FMAP_AREA_STATIC
@ FMAP_AREA_RO
@ FMAP_AREA_PRESERVE
struct fmap_area __packed
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
unsigned long long uint64_t
Definition: stdint.h:17
unsigned char uint8_t
Definition: stdint.h:8
uint16_t flags
uint32_t offset
uint8_t name[FMAP_STRLEN]
uint32_t size
uint8_t ver_minor
struct fmap_area areas[]
uint8_t signature[8]
uint16_t nareas
uint8_t ver_major
uint8_t name[FMAP_STRLEN]
uint32_t size
uint64_t base