Lines Matching refs:e
107 struct bpdt_entry e[0]; member
161 struct subpart_dir_entry e[0]; member
772 s->e[i].name, s->e[i].offset, s->e[i].length, in print_subpart_dir()
773 s->e[i].rsvd); in print_subpart_dir()
794 static void bpdt_print_entries(struct bpdt_entry *e, size_t count, in bpdt_print_entries() argument
812 i + 1, subparts[e[i].type].name, in bpdt_print_entries()
813 subparts[e[i].type].readable_name, e[i].type, e[i].flags, in bpdt_print_entries()
814 e[i].offset, e[i].size, in bpdt_print_entries()
815 e[i].offset + ifwi_image.input_ifwi_start_offset); in bpdt_print_entries()
857 struct bpdt_entry *e = &bpdt->e[0]; in bpdt_read_entries() local
861 offset = read_member(data, offset, sizeof(e[i].type), in bpdt_read_entries()
862 &e[i].type); in bpdt_read_entries()
863 offset = read_member(data, offset, sizeof(e[i].flags), in bpdt_read_entries()
864 &e[i].flags); in bpdt_read_entries()
865 offset = read_member(data, offset, sizeof(e[i].offset), in bpdt_read_entries()
866 &e[i].offset); in bpdt_read_entries()
867 offset = read_member(data, offset, sizeof(e[i].size), in bpdt_read_entries()
868 &e[i].size); in bpdt_read_entries()
871 bpdt_print_entries(e, count, name); in bpdt_read_entries()
878 static struct bpdt_entry *__find_entry_by_type(struct bpdt_entry *e, in __find_entry_by_type() argument
884 if (e[i].type == type) in __find_entry_by_type()
891 return &e[i]; in __find_entry_by_type()
901 struct bpdt_entry *curr = __find_entry_by_type(&b->e[0], in find_entry_by_type()
912 return __find_entry_by_type(&b->e[0], b->h.descriptor_count, type); in find_entry_by_type()
943 static size_t read_subpart_buf(void *data, size_t size, struct bpdt_entry *e, in read_subpart_buf() argument
951 type = e[i].type; in read_subpart_buf()
964 if (e[i].size == 0) { in read_subpart_buf()
970 assert((e[i].offset + e[i].size) <= size); in read_subpart_buf()
977 if ((e[i].offset + e[i].size) > max_offset) in read_subpart_buf()
978 max_offset = e[i].offset + e[i].size; in read_subpart_buf()
994 alloc_buffer(buf, e[i].size, subparts[type].name); in read_subpart_buf()
995 memcpy(buffer_get(buf), (uint8_t *)data + e[i].offset, in read_subpart_buf()
996 e[i].size); in read_subpart_buf()
1035 return read_subpart_buf(data, size, &bpdt->e[0], in alloc_bpdt_buffer()
1137 struct subpart_dir_entry *e = &subpart_dir->e[0]; in parse_subpart_dir() local
1141 memcpy(e[i].name, data + offset, sizeof(e[i].name)); in parse_subpart_dir()
1142 offset += sizeof(e[i].name); in parse_subpart_dir()
1143 offset = read_member(data, offset, sizeof(e[i].offset), in parse_subpart_dir()
1144 &e[i].offset); in parse_subpart_dir()
1145 offset = read_member(data, offset, sizeof(e[i].length), in parse_subpart_dir()
1146 &e[i].length); in parse_subpart_dir()
1147 offset = read_member(data, offset, sizeof(e[i].rsvd), in parse_subpart_dir()
1148 &e[i].rsvd); in parse_subpart_dir()
1238 uint8_t *ptr = (uint8_t *)&bpdt->e[0]; in __bpdt_reset()
1313 curr->e[*count_ptr].type = type; in bpdt_entries_init_header_order()
1314 curr->e[*count_ptr].flags = 0; in bpdt_entries_init_header_order()
1315 curr->e[*count_ptr].offset = 0; in bpdt_entries_init_header_order()
1316 curr->e[*count_ptr].size = size; in bpdt_entries_init_header_order()
1438 struct bpdt_entry *e = &s->e[0]; in bpdt_fixup_write_buffer() local
1457 offset = fix_member(&e[i].type, offset, sizeof(e[i].type)); in bpdt_fixup_write_buffer()
1458 offset = fix_member(&e[i].flags, offset, sizeof(e[i].flags)); in bpdt_fixup_write_buffer()
1459 offset = fix_member(&e[i].offset, offset, sizeof(e[i].offset)); in bpdt_fixup_write_buffer()
1460 offset = fix_member(&e[i].size, offset, sizeof(e[i].size)); in bpdt_fixup_write_buffer()
1580 bpdt_print_entries(&b->e[0], b->h.descriptor_count, "BPDT"); in ifwi_repack()
1583 bpdt_print_entries(&b->e[0], b->h.descriptor_count, "S-BPDT"); in ifwi_repack()
1602 static size_t init_subpart_dir_entry(struct subpart_dir_entry *e, in init_subpart_dir_entry() argument
1605 memset(e, 0, sizeof(*e)); in init_subpart_dir_entry()
1607 assert(strlen(b->name) <= sizeof(e->name)); in init_subpart_dir_entry()
1608 strncpy((char *)e->name, (char *)b->name, sizeof(e->name)); in init_subpart_dir_entry()
1609 e->offset = offset; in init_subpart_dir_entry()
1610 e->length = buffer_size(b); in init_subpart_dir_entry()
1653 struct subpart_dir_entry *e = &s->e[0]; in subpart_dir_fixup_write_buffer() local
1672 offset += sizeof(e[i].name); in subpart_dir_fixup_write_buffer()
1673 offset = fix_member(&e[i].offset, offset, sizeof(e[i].offset)); in subpart_dir_fixup_write_buffer()
1674 offset = fix_member(&e[i].length, offset, sizeof(e[i].length)); in subpart_dir_fixup_write_buffer()
1675 offset = fix_member(&e[i].rsvd, offset, sizeof(e[i].rsvd)); in subpart_dir_fixup_write_buffer()
1688 struct subpart_dir_entry *e = (struct subpart_dir_entry *)(h + 1); in create_subpart() local
1696 curr_offset = init_subpart_dir_entry(&e[i], info[i], in create_subpart()
1704 memcpy(data + e[i].offset, buffer_get(info[i]), in create_subpart()
1889 if (!strncmp((char *)s->e[i].name, param.dentry_name, in ifwi_dir_extract()
1890 sizeof(s->e[i].name))) in ifwi_dir_extract()
1902 DEBUG("Splicing buffer at 0x%x size 0x%x\n", s->e[i].offset, in ifwi_dir_extract()
1903 s->e[i].length); in ifwi_dir_extract()
1904 buffer_splice(&dst, &ifwi_image.subpart_buf[type], s->e[i].offset, in ifwi_dir_extract()
1905 s->e[i].length); in ifwi_dir_extract()
1970 bpdt_print_entries(&b->e[0], b->h.descriptor_count, "BPDT"); in ifwi_print()
1974 bpdt_print_entries(&b->e[0], b->h.descriptor_count, "S-BPDT"); in ifwi_print()
2027 if (!strcmp((char *)s->e[i].name, param.dentry_name)) in ifwi_dir_replace()
2046 buffer_size(&b) - s->e[i].length; in ifwi_dir_replace()
2047 size_t subpart_start = s->e[i].offset; in ifwi_dir_replace()
2048 size_t subpart_end = s->e[i].offset + s->e[i].length; in ifwi_dir_replace()
2069 int offset = s->e[i].offset; in ifwi_dir_replace()
2075 s->e[i].length = buffer_size(&b); in ifwi_dir_replace()
2079 offset = s->e[i].offset - offset; in ifwi_dir_replace()
2081 s->e[i].offset += offset; in ifwi_dir_replace()