coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fmap.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _FMAP_H_
4 #define _FMAP_H_
5 
7 #include <commonlib/region.h>
8 #include <stddef.h>
9 #include <stdint.h>
10 
11 /* Locate the named area in the fmap and fill in a region device representing
12  * that area. The region is a sub-region of the readonly boot media. Return
13  * 0 on success, < 0 on error. */
14 int fmap_locate_area_as_rdev(const char *name, struct region_device *area);
15 
16 /* Just like fmap_locate_area_as_rdev(), however the region device is
17  * created from the RW boot device. */
18 int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area);
19 
20 /* Locate the named area in the fmap and fill in a region with the
21  * offset and size of that area within the boot media. Return 0 on success,
22  * < 0 on error. */
23 int fmap_locate_area(const char *name, struct region *r);
24 
25 /* Find fmap area name by offset and size.
26  * Return 0 on success, < 0 on error. */
27 int fmap_find_region_name(const struct region * const ar,
28  char name[FMAP_STRLEN]);
29 
30 /* Read fmap area into provided buffer.
31  * Return size read on success, < 0 on error. */
32 ssize_t fmap_read_area(const char *name, void *buffer, size_t size);
33 
34 /* Write provided buffer into fmap area.
35  * Return size written on success, < 0 on error. */
36 ssize_t fmap_overwrite_area(const char *name, const void *buffer, size_t size);
37 
38 /* Get offset of FMAP in flash. */
40 
41 #endif
const char * name
Definition: mmu.c:92
ssize_t fmap_overwrite_area(const char *name, const void *buffer, size_t size)
Definition: fmap.c:263
uint64_t get_fmap_flash_offset(void)
Definition: fmap.c:27
ssize_t fmap_read_area(const char *name, void *buffer, size_t size)
Definition: fmap.c:254
int fmap_locate_area(const char *name, struct region *r)
Definition: fmap.c:164
int fmap_find_region_name(const struct region *const ar, char name[FMAP_STRLEN])
Definition: fmap.c:208
int fmap_locate_area_as_rdev(const char *name, struct region_device *area)
Definition: fmap.c:144
int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area)
Definition: fmap.c:154
#define FMAP_STRLEN
u8 buffer[C2P_BUFFER_MAXSIZE]
Definition: psp_smm.c:18
__SIZE_TYPE__ ssize_t
Definition: stddef.h:13
unsigned long long uint64_t
Definition: stdint.h:17
Definition: region.h:76