| 1 |
|
| 2 |
|
| 3 |
#ifndef _FMAP_H_ |
| 4 |
#define _FMAP_H_ |
| 5 |
|
| 6 |
#include <commonlib/bsd/fmap_serialized.h> |
| 7 |
#include <commonlib/region.h> |
| 8 |
#include <fmap_config.h> |
| 9 |
#include <stddef.h> |
| 10 |
#include <stdint.h> |
| 11 |
|
| 12 |
#if FMAP_SECTION_FLASH_START != 0 |
| 13 |
#error "FMAP must always start flash address 0" |
| 14 |
#endif |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
int fmap_locate_area_as_rdev(const char *name, struct region_device *area); |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area); |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
int fmap_locate_area(const char *name, struct region *r); |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
int fmap_find_region_name(const struct region * const ar, |
| 33 |
char name[FMAP_STRLEN]); |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
ssize_t fmap_read_area(const char *name, void *buffer, size_t size); |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
ssize_t fmap_overwrite_area(const char *name, const void *buffer, size_t size); |
| 42 |
|
| 43 |
|
| 44 |
uint64_t get_fmap_flash_offset(void); |
| 45 |
|
| 46 |
#endif |