Changeset View
Changeset View
Standalone View
Standalone View
head/stand/common/load_elf.c
Show First 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | if (off & 0xf0000000u) { | ||||
/* | /* | ||||
* XXX the physical load address should not be | * XXX the physical load address should not be | ||||
* hardcoded. Note that the Book-E kernel assumes that | * hardcoded. Note that the Book-E kernel assumes that | ||||
* it's loaded at a 16MB boundary for now... | * it's loaded at a 16MB boundary for now... | ||||
*/ | */ | ||||
off += 0x01000000; | off += 0x01000000; | ||||
ehdr->e_entry += off; | ehdr->e_entry += off; | ||||
#ifdef ELF_VERBOSE | #ifdef ELF_VERBOSE | ||||
printf("Converted entry 0x%08x\n", ehdr->e_entry); | printf("Converted entry 0x%jx\n", (uintmax_t)ehdr->e_entry); | ||||
#endif | #endif | ||||
} else | } else | ||||
off = 0; | off = 0; | ||||
#elif defined(__arm__) && !defined(EFI) | #elif defined(__arm__) && !defined(EFI) | ||||
/* | /* | ||||
* The elf headers in arm kernels specify virtual addresses in | * The elf headers in arm kernels specify virtual addresses in | ||||
* all header fields, even the ones that should be physical | * all header fields, even the ones that should be physical | ||||
* addresses. We assume the entry point is in the first page, | * addresses. We assume the entry point is in the first page, | ||||
Show All 9 Lines | #elif defined(__arm__) && !defined(EFI) | ||||
* handle adjusting the location relative to the first virtual | * handle adjusting the location relative to the first virtual | ||||
* address. Because of this there is no need to adjust the | * address. Because of this there is no need to adjust the | ||||
* offset or entry point address as these will both be handled | * offset or entry point address as these will both be handled | ||||
* by the efi code. | * by the efi code. | ||||
*/ | */ | ||||
off -= ehdr->e_entry & ~PAGE_MASK; | off -= ehdr->e_entry & ~PAGE_MASK; | ||||
ehdr->e_entry += off; | ehdr->e_entry += off; | ||||
#ifdef ELF_VERBOSE | #ifdef ELF_VERBOSE | ||||
printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", | printf("ehdr->e_entry 0x%jx", va<->pa off %llx\n", | ||||
ehdr->e_entry, off); | (uintmax_t)ehdr->e_entry, off); | ||||
#endif | #endif | ||||
#else | #else | ||||
off = 0; /* other archs use direct mapped kernels */ | off = 0; /* other archs use direct mapped kernels */ | ||||
#endif | #endif | ||||
} | } | ||||
ef->off = off; | ef->off = off; | ||||
if (ef->kernel) | if (ef->kernel) | ||||
▲ Show 20 Lines • Show All 703 Lines • Show Last 20 Lines |