Lines Matching full:hdr

16 static ulong android_image_get_kernel_addr(const struct andr_img_hdr *hdr)  in android_image_get_kernel_addr()  argument
29 if (hdr->kernel_addr == ANDROID_IMAGE_DEFAULT_KERNEL_ADDR) in android_image_get_kernel_addr()
30 return (ulong)hdr + hdr->page_size; in android_image_get_kernel_addr()
32 return hdr->kernel_addr; in android_image_get_kernel_addr()
37 * @hdr: Pointer to image header, which is at the start
50 int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify, in android_image_get_kernel() argument
53 u32 kernel_addr = android_image_get_kernel_addr(hdr); in android_image_get_kernel()
60 strncpy(andr_tmp_str, hdr->name, ANDR_BOOT_NAME_SIZE); in android_image_get_kernel()
66 kernel_addr, DIV_ROUND_UP(hdr->kernel_size, 1024)); in android_image_get_kernel()
69 if (*hdr->cmdline) { in android_image_get_kernel()
70 printf("Kernel command line: %s\n", hdr->cmdline); in android_image_get_kernel()
71 len += strlen(hdr->cmdline); in android_image_get_kernel()
89 if (*hdr->cmdline) in android_image_get_kernel()
90 strcat(newbootargs, hdr->cmdline); in android_image_get_kernel()
95 *os_data = (ulong)hdr; in android_image_get_kernel()
96 *os_data += hdr->page_size; in android_image_get_kernel()
99 *os_len = hdr->kernel_size; in android_image_get_kernel()
103 int android_image_check_header(const struct andr_img_hdr *hdr) in android_image_check_header() argument
105 return memcmp(ANDR_BOOT_MAGIC, hdr->magic, ANDR_BOOT_MAGIC_SIZE); in android_image_check_header()
108 ulong android_image_get_end(const struct andr_img_hdr *hdr) in android_image_get_end() argument
115 end = (ulong)hdr; in android_image_get_end()
116 end += hdr->page_size; in android_image_get_end()
117 end += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_end()
118 end += ALIGN(hdr->ramdisk_size, hdr->page_size); in android_image_get_end()
119 end += ALIGN(hdr->second_size, hdr->page_size); in android_image_get_end()
124 ulong android_image_get_kload(const struct andr_img_hdr *hdr) in android_image_get_kload() argument
126 return android_image_get_kernel_addr(hdr); in android_image_get_kload()
129 int android_image_get_ramdisk(const struct andr_img_hdr *hdr, in android_image_get_ramdisk() argument
132 if (!hdr->ramdisk_size) { in android_image_get_ramdisk()
138 hdr->ramdisk_addr, DIV_ROUND_UP(hdr->ramdisk_size, 1024)); in android_image_get_ramdisk()
140 *rd_data = (unsigned long)hdr; in android_image_get_ramdisk()
141 *rd_data += hdr->page_size; in android_image_get_ramdisk()
142 *rd_data += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_ramdisk()
144 *rd_len = hdr->ramdisk_size; in android_image_get_ramdisk()
148 int android_image_get_second(const struct andr_img_hdr *hdr, in android_image_get_second() argument
151 if (!hdr->second_size) { in android_image_get_second()
156 *second_data = (unsigned long)hdr; in android_image_get_second()
157 *second_data += hdr->page_size; in android_image_get_second()
158 *second_data += ALIGN(hdr->kernel_size, hdr->page_size); in android_image_get_second()
159 *second_data += ALIGN(hdr->ramdisk_size, hdr->page_size); in android_image_get_second()
163 *second_len = hdr->second_size; in android_image_get_second()
170 * @hdr: pointer to the Android format image header
179 void android_print_contents(const struct andr_img_hdr *hdr) in android_print_contents() argument
183 u32 os_ver = hdr->os_version >> 11; in android_print_contents()
184 u32 os_lvl = hdr->os_version & ((1U << 11) - 1); in android_print_contents()
186 printf("%skernel size: %x\n", p, hdr->kernel_size); in android_print_contents()
187 printf("%skernel address: %x\n", p, hdr->kernel_addr); in android_print_contents()
188 printf("%sramdisk size: %x\n", p, hdr->ramdisk_size); in android_print_contents()
189 printf("%sramdisk addrress: %x\n", p, hdr->ramdisk_addr); in android_print_contents()
190 printf("%ssecond size: %x\n", p, hdr->second_size); in android_print_contents()
191 printf("%ssecond address: %x\n", p, hdr->second_addr); in android_print_contents()
192 printf("%stags address: %x\n", p, hdr->tags_addr); in android_print_contents()
193 printf("%spage size: %x\n", p, hdr->page_size); in android_print_contents()
197 p, hdr->os_version, in android_print_contents()
200 printf("%sname: %s\n", p, hdr->name); in android_print_contents()
201 printf("%scmdline: %s\n", p, hdr->cmdline); in android_print_contents()