diff options
Diffstat (limited to 'lib/avb/fsl/utils.h')
-rw-r--r-- | lib/avb/fsl/utils.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/avb/fsl/utils.h b/lib/avb/fsl/utils.h new file mode 100644 index 0000000..6fe72f5 --- /dev/null +++ b/lib/avb/fsl/utils.h @@ -0,0 +1,25 @@ +#ifndef __UTILS_H__ +#define __UTILS_H__ + +#include <common.h> + +#define ALIGN_BYTES 64 /*mmc block read/write need 64 bytes aligned */ + +struct margin_pos { + /* which blk the read/write starts */ + uint64_t blk_start; + /* which blk the read/write ends */ + uint64_t blk_end; + /* start position inside the start blk */ + unsigned long start; + /* end position inside the end blk */ + unsigned long end; + /* how many blks can be read/write one time */ + unsigned long multi; +}; +typedef struct margin_pos margin_pos_t; + +int get_margin_pos(uint64_t part_start, uint64_t part_end, unsigned long blksz, + margin_pos_t *margin, int64_t offset, size_t num_bytes, bool allow_partial); + +#endif |