SmartAudio/lichee/brandy/pack_tools/update_signature/imgheader.h

66 lines
1.8 KiB
C
Raw Normal View History

2018-07-13 01:31:50 +00:00
#ifndef __IMAGE_HEADER_H
#define __IMAGE_HEADER_H
/* Android bootimage file format */
#define FASTBOOT_BOOT_MAGIC "ANDROID!"
#define FASTBOOT_BOOT_MAGIC_SIZE 8
#define FASTBOOT_BOOT_NAME_SIZE 16
#define FASTBOOT_BOOT_ARGS_SIZE 512
struct fastboot_boot_img_hdr {
unsigned char magic[FASTBOOT_BOOT_MAGIC_SIZE];
unsigned kernel_size; /* size in bytes */
unsigned kernel_addr; /* physical load addr */
unsigned ramdisk_size; /* size in bytes */
unsigned ramdisk_addr; /* physical load addr */
unsigned second_size; /* size in bytes */
unsigned second_addr; /* physical load addr */
unsigned tags_addr; /* physical addr for kernel tags */
unsigned page_size; /* flash page size we assume */
unsigned unused[2]; /* future expansion: should be 0 */
unsigned char name[FASTBOOT_BOOT_NAME_SIZE]; /* asciiz product name */
unsigned char cmdline[FASTBOOT_BOOT_ARGS_SIZE];
unsigned id[8]; /* timestamp / checksum / sha1 / etc */
};
#define IH_MAGIC 0x27051956 /* Image Magic Number */
#define IH_NMLEN 32 /* Image Name Length */
#define CFG_FASTBOOT_MKBOOTIMAGE_SECTOR (2048/512)
/*
* Legacy format image header,
* all data in network byte order (aka natural aka bigendian).
*/
typedef struct image_header {
unsigned int ih_magic; /* Image Header Magic Number */
unsigned int ih_hcrc; /* Image Header CRC Checksum */
unsigned int ih_time; /* Image Creation Timestamp */
unsigned int ih_size; /* Image Data Size */
unsigned int ih_load; /* Data Load Address */
unsigned int ih_ep; /* Entry Point Address */
unsigned int ih_dcrc; /* Image Data CRC Checksum */
unsigned char ih_os; /* Operating System */
unsigned char ih_arch; /* CPU architecture */
unsigned char ih_type; /* Image Type */
unsigned char ih_comp; /* Compression Type */
unsigned char ih_name[IH_NMLEN]; /* Image Name */
} image_header_t;
#endif