Lines Matching defs:head
73 static int is_binary_header_invalid(struct mcu_image_head *head,
77 if ((head->image_size == 0) ||
78 (head->image_size > length) ||
79 (head->secs_num > MCU_SECTION_MAX) ||
80 (head->secs_num == 0))
87 struct mcu_image_head *head)
91 if ((sec->serial >= head->secs_num) ||
92 (sec->src_offset + sec->size > head->image_size))
160 struct mcu_image_head *head;
163 head = (struct mcu_image_head *)image_base;
164 if (is_binary_header_invalid(head, image_size)) {
165 ERROR("Invalid %s image header.\n", head->time_stamp);
169 buf = (char *)head;
170 for (i = 0; i < head->secs_num; i++) {
175 if (is_binary_section_invalid(&head->secs[i], head)) {
181 if (head->secs[i].load_attr != MCU_IMAGE_SEC_LOAD_STATIC)
185 src = (int *)(intptr_t)(buf + head->secs[i].src_offset);
186 dst = (int *)(intptr_t)mcu2ap_addr(head->secs[i].dst_offset);
188 memcpy((void *)dst, (void *)src, head->secs[i].size);
195 INFO("%s: size = %d\n", __func__, head->secs[i].size);