3 * (C) Copyright 2018, Linaro Limited
5 * SPDX-License-Identifier: GPL-2.0+
11 #include <../lib/libavb/libavb.h>
14 #define ALLOWED_BUF_ALIGN 8
24 struct blk_desc *mmc_blk;
25 disk_partition_t info;
33 AvbOps *avb_ops_alloc(int boot_device);
34 void avb_ops_free(AvbOps *ops);
37 * ============================================================================
38 * I/O helper inline functions
39 * ============================================================================
41 static inline uint64_t calc_offset(struct mmc_part *part, int64_t offset)
43 u64 part_size = part->info.size * part->info.blksz;
46 return part_size + offset;
51 static inline size_t get_sector_buf_size(void)
53 return (size_t)CONFIG_FASTBOOT_BUF_SIZE;
56 static inline void *get_sector_buf(void)
58 return (void *)CONFIG_FASTBOOT_BUF_ADDR;
61 static inline bool is_buf_unaligned(void *buffer)
63 return (bool)((uintptr_t)buffer % ALLOWED_BUF_ALIGN);
66 static inline int get_boot_device(AvbOps *ops)
68 struct AvbOpsData *data;
71 data = ops->user_data;
79 #endif /* _AVB_VERIFY_H */