2 * Copyright 2014 Broadcom Corporation.
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <sparse_format.h>
10 #define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
12 struct sparse_storage {
18 lbaint_t (*write)(struct sparse_storage *info,
23 lbaint_t (*reserve)(struct sparse_storage *info,
28 static inline int is_sparse_image(void *buf)
30 sparse_header_t *s_header = (sparse_header_t *)buf;
32 if ((le32_to_cpu(s_header->magic) == SPARSE_HEADER_MAGIC) &&
33 (le16_to_cpu(s_header->major_version) == 1))
39 void write_sparse_image(struct sparse_storage *info, const char *part_name,
40 void *data, unsigned sz);