aboot.h 572 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright 2014 Broadcom Corporation.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <part.h>
  7. #include <sparse_format.h>
  8. #define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
  9. static inline int is_sparse_image(void *buf)
  10. {
  11. sparse_header_t *s_header = (sparse_header_t *)buf;
  12. if ((le32_to_cpu(s_header->magic) == SPARSE_HEADER_MAGIC) &&
  13. (le16_to_cpu(s_header->major_version) == 1))
  14. return 1;
  15. return 0;
  16. }
  17. int write_sparse_image(block_dev_desc_t *dev_desc,
  18. disk_partition_t *info, const char *part_name,
  19. void *data, unsigned sz);