Cleanup magiskboot code

This commit is contained in:
topjohnwu
2021-08-28 14:07:34 -07:00
parent 92a8a3e91f
commit 0af041b54e
3 changed files with 126 additions and 157 deletions

View File

@@ -45,16 +45,11 @@ struct zimage_hdr {
uint8_t head[36];
uint32_t magic; /* zImage magic */
uint32_t load_addr; /* absolute load/run zImage address */
uint32_t end_addr; /* zImage end address */
uint32_t end_offset; /* zImage end offset */
uint32_t endianess; /* endianess flag */
uint8_t code[];
} __attribute__((packed));
struct zimage_tail {
uint8_t *data;
uint32_t size;
} __attribute__((packed));
/**************
* AVB Headers
**************/
@@ -488,9 +483,20 @@ struct boot_img {
mtk_hdr *k_hdr;
mtk_hdr *r_hdr;
// ZIMAGE data
// The pointers/values after parse_image
// +---------------+
// | z_hdr | z_info.hdr_sz
// +---------------+
// | kernel | hdr->kernel_size()
// +---------------+
// | z_info.tail | z_info.tail_sz
// +---------------+
zimage_hdr *z_hdr;
zimage_tail z_tail;
struct {
uint32_t hdr_sz;
uint32_t tail_sz = 0;
uint8_t *tail = nullptr;
} z_info;
// Pointer to dtb that is embedded in kernel
uint8_t *kernel_dtb;