]>
git.ipfire.org Git - people/ms/u-boot.git/blob - include/image-sparse.h
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 typedef struct sparse_storage
{
13 unsigned int block_sz
;
18 int (*write
)(struct sparse_storage
*storage
, void *priv
,
19 unsigned int offset
, unsigned int size
,
23 static inline int is_sparse_image(void *buf
)
25 sparse_header_t
*s_header
= (sparse_header_t
*)buf
;
27 if ((le32_to_cpu(s_header
->magic
) == SPARSE_HEADER_MAGIC
) &&
28 (le16_to_cpu(s_header
->major_version
) == 1))
34 int store_sparse_image(sparse_storage_t
*storage
, void *storage_priv
,
35 unsigned int session_id
, void *data
);