eclair: obtain MAP_KERNEL_START from kernel image

Change-Id: I946c640ddb2e2b32362760254a86c611517becf3
This commit is contained in:
Balazs Gerofi
2020-02-10 07:04:37 +00:00
parent d1df17ffb7
commit 7882110e9f
6 changed files with 29 additions and 17 deletions

View File

@@ -124,6 +124,16 @@ uintptr_t virt_to_phys(uintptr_t va)
int arch_setup_constants(void)
{
MAP_KERNEL_START = lookup_symbol("_head");
if (MAP_KERNEL_START == NOSYMBOL) {
fprintf(stderr, "error: obtaining MAP_KERNEL_START\n");
return 1;
}
/* One page extra head, see smp-x86.lds */
MAP_KERNEL_START -= 0x1000;
printf("x86 MAP_KERNEL_START 0x%lx\n", MAP_KERNEL_START);
if (read_symbol_64("linux_page_offset_base",
&linux_page_offset) != 0) {
fprintf(stderr, "error: obtaining Linux page offset\n");