Lines Matching refs:phdr

989 static bool q6v5_phdr_valid(const struct elf32_phdr *phdr)  in q6v5_phdr_valid()  argument
991 if (phdr->p_type != PT_LOAD) in q6v5_phdr_valid()
994 if ((phdr->p_flags & QCOM_MDT_TYPE_MASK) == QCOM_MDT_TYPE_HASH) in q6v5_phdr_valid()
997 if (!phdr->p_memsz) in q6v5_phdr_valid()
1257 const struct elf32_phdr *phdr; in q6v5_mpss_load() local
1300 phdr = &phdrs[i]; in q6v5_mpss_load()
1302 if (!q6v5_phdr_valid(phdr)) in q6v5_mpss_load()
1305 if (phdr->p_flags & QCOM_MDT_RELOCATABLE) in q6v5_mpss_load()
1308 if (phdr->p_paddr < min_addr) in q6v5_mpss_load()
1309 min_addr = phdr->p_paddr; in q6v5_mpss_load()
1311 if (phdr->p_paddr + phdr->p_memsz > max_addr) in q6v5_mpss_load()
1312 max_addr = ALIGN(phdr->p_paddr + phdr->p_memsz, SZ_4K); in q6v5_mpss_load()
1336 phdr = &phdrs[i]; in q6v5_mpss_load()
1338 if (!q6v5_phdr_valid(phdr)) in q6v5_mpss_load()
1341 offset = phdr->p_paddr - mpss_reloc; in q6v5_mpss_load()
1342 if (offset < 0 || offset + phdr->p_memsz > qproc->mpss_size) { in q6v5_mpss_load()
1348 if (phdr->p_filesz > phdr->p_memsz) { in q6v5_mpss_load()
1356 ptr = memremap(qproc->mpss_phys + offset, phdr->p_memsz, MEMREMAP_WC); in q6v5_mpss_load()
1360 &qproc->mpss_phys, offset, phdr->p_memsz); in q6v5_mpss_load()
1364 if (phdr->p_filesz && phdr->p_offset < fw->size) { in q6v5_mpss_load()
1366 if (phdr->p_offset + phdr->p_filesz > fw->size) { in q6v5_mpss_load()
1375 memcpy(ptr, fw->data + phdr->p_offset, phdr->p_filesz); in q6v5_mpss_load()
1376 } else if (phdr->p_filesz) { in q6v5_mpss_load()
1380 ptr, phdr->p_filesz); in q6v5_mpss_load()
1387 if (seg_fw->size != phdr->p_filesz) { in q6v5_mpss_load()
1400 if (phdr->p_memsz > phdr->p_filesz) { in q6v5_mpss_load()
1401 memset(ptr + phdr->p_filesz, 0, in q6v5_mpss_load()
1402 phdr->p_memsz - phdr->p_filesz); in q6v5_mpss_load()
1405 size += phdr->p_memsz; in q6v5_mpss_load()
1556 const struct elf32_phdr *phdr; in qcom_q6v5_register_dump_segments() local
1576 phdr = &phdrs[i]; in qcom_q6v5_register_dump_segments()
1578 if (!q6v5_phdr_valid(phdr)) in qcom_q6v5_register_dump_segments()
1581 ret = rproc_coredump_add_custom_segment(rproc, phdr->p_paddr, in qcom_q6v5_register_dump_segments()
1582 phdr->p_memsz, in qcom_q6v5_register_dump_segments()
1588 qproc->total_dump_size += phdr->p_memsz; in qcom_q6v5_register_dump_segments()