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,
16
FMAP_AREA_COMPRESSED
= 1 << 1,
17
FMAP_AREA_RO
= 1 << 2,
18
FMAP_AREA_PRESERVE
= 1 << 3,
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 */
27
}
__packed
;
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__ */
FMAP_STRLEN
#define FMAP_STRLEN
Definition:
fmap_serialized.h:11
fmap_flags
fmap_flags
Definition:
fmap_serialized.h:14
FMAP_AREA_COMPRESSED
@ FMAP_AREA_COMPRESSED
Definition:
fmap_serialized.h:16
FMAP_AREA_STATIC
@ FMAP_AREA_STATIC
Definition:
fmap_serialized.h:15
FMAP_AREA_RO
@ FMAP_AREA_RO
Definition:
fmap_serialized.h:17
FMAP_AREA_PRESERVE
@ FMAP_AREA_PRESERVE
Definition:
fmap_serialized.h:18
__packed
struct fmap_area __packed
stdint.h
uint16_t
unsigned short uint16_t
Definition:
stdint.h:11
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
uint64_t
unsigned long long uint64_t
Definition:
stdint.h:17
uint8_t
unsigned char uint8_t
Definition:
stdint.h:8
fmap_area
Definition:
fmap_serialized.h:22
fmap_area::flags
uint16_t flags
Definition:
fmap_serialized.h:26
fmap_area::offset
uint32_t offset
Definition:
fmap_serialized.h:23
fmap_area::name
uint8_t name[FMAP_STRLEN]
Definition:
fmap_serialized.h:25
fmap_area::size
uint32_t size
Definition:
fmap_serialized.h:24
fmap
Definition:
fmap_serialized.h:29
fmap::ver_minor
uint8_t ver_minor
Definition:
fmap_serialized.h:32
fmap::areas
struct fmap_area areas[]
Definition:
fmap_serialized.h:38
fmap::signature
uint8_t signature[8]
Definition:
fmap_serialized.h:30
fmap::nareas
uint16_t nareas
Definition:
fmap_serialized.h:36
fmap::ver_major
uint8_t ver_major
Definition:
fmap_serialized.h:31
fmap::name
uint8_t name[FMAP_STRLEN]
Definition:
fmap_serialized.h:35
fmap::size
uint32_t size
Definition:
fmap_serialized.h:34
fmap::base
uint64_t base
Definition:
fmap_serialized.h:33
src
commonlib
bsd
include
commonlib
bsd
fmap_serialized.h
Generated by
1.9.1