/* Loads an elf section into a PE For now only supports loading a section to dmem (all PE's), pmem (class and tmu PE's), DDDR (util PE code)  */
int pe_load_elf_section(int id, const void *data, Elf32_Shdr *shdr)
/* Loads an elf section into a PE For now only supports loading a section to dmem (all PE's), pmem (class and tmu PE's), DDDR (util PE code)  */
int pe_load_elf_section(int id, const void *data, Elf32_Shdr *shdr)
{
	u32 addr = be32_to_cpu(shdr->sh_addr);
	u32 size = be32_to_cpu(shdr->sh_size);
	if (IS_DMEM(addr, size))
		return pe_load_dmem_section(id, data, shdr);
	else if (IS_PMEM(addr, size))
		return pe_load_pmem_section(id, data, shdr);
	else if (IS_PFE_LMEM(addr, size))
		return 0;
	else if (IS_PHYS_DDR(addr, size))
		return pe_load_ddr_section(id, data, shdr);
	else if (IS_PE_LMEM(addr, size))
		return pe_load_pe_lmem_section(id, data, shdr);
	printf("%s: unsupported memory range(%x)\n", __func__, addr);
	return 0;
}