Lines Matching refs:phdr

20 static bool mdt_phdr_valid(const struct elf32_phdr *phdr)  in mdt_phdr_valid()  argument
22 if (phdr->p_type != PT_LOAD) in mdt_phdr_valid()
25 if ((phdr->p_flags & QCOM_MDT_TYPE_MASK) == QCOM_MDT_TYPE_HASH) in mdt_phdr_valid()
28 if (!phdr->p_memsz) in mdt_phdr_valid()
43 const struct elf32_phdr *phdr; in qcom_mdt_get_size() local
53 phdr = &phdrs[i]; in qcom_mdt_get_size()
55 if (!mdt_phdr_valid(phdr)) in qcom_mdt_get_size()
58 if (phdr->p_paddr < min_addr) in qcom_mdt_get_size()
59 min_addr = phdr->p_paddr; in qcom_mdt_get_size()
61 if (phdr->p_paddr + phdr->p_memsz > max_addr) in qcom_mdt_get_size()
62 max_addr = ALIGN(phdr->p_paddr + phdr->p_memsz, SZ_4K); in qcom_mdt_get_size()
135 const struct elf32_phdr *phdr; in __qcom_mdt_load() local
186 phdr = &phdrs[i]; in __qcom_mdt_load()
188 if (!mdt_phdr_valid(phdr)) in __qcom_mdt_load()
191 if (phdr->p_flags & QCOM_MDT_RELOCATABLE) in __qcom_mdt_load()
194 if (phdr->p_paddr < min_addr) in __qcom_mdt_load()
195 min_addr = phdr->p_paddr; in __qcom_mdt_load()
197 if (phdr->p_paddr + phdr->p_memsz > max_addr) in __qcom_mdt_load()
198 max_addr = ALIGN(phdr->p_paddr + phdr->p_memsz, SZ_4K); in __qcom_mdt_load()
227 phdr = &phdrs[i]; in __qcom_mdt_load()
229 if (!mdt_phdr_valid(phdr)) in __qcom_mdt_load()
232 offset = phdr->p_paddr - mem_reloc; in __qcom_mdt_load()
233 if (offset < 0 || offset + phdr->p_memsz > mem_size) { in __qcom_mdt_load()
239 if (phdr->p_filesz > phdr->p_memsz) { in __qcom_mdt_load()
249 if (phdr->p_filesz && phdr->p_offset < fw->size) { in __qcom_mdt_load()
251 if (phdr->p_offset + phdr->p_filesz > fw->size) { in __qcom_mdt_load()
258 memcpy(ptr, fw->data + phdr->p_offset, phdr->p_filesz); in __qcom_mdt_load()
259 } else if (phdr->p_filesz) { in __qcom_mdt_load()
263 ptr, phdr->p_filesz); in __qcom_mdt_load()
270 if (seg_fw->size != phdr->p_filesz) { in __qcom_mdt_load()
282 if (phdr->p_memsz > phdr->p_filesz) in __qcom_mdt_load()
283 memset(ptr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz); in __qcom_mdt_load()