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

@@ -60,6 +60,9 @@ struct thread_info {
uintptr_t arch_clv;
}; /* struct thread_info */
/* Virtual address where McKernel is mapped to */
unsigned long MAP_KERNEL_START;
static struct options opt;
static volatile int f_done = 0;
static bfd *symbfd = NULL;
@@ -83,7 +86,6 @@ uintptr_t lookup_symbol(char *name)
return (symtab[i]->section->vma + symtab[i]->value);
}
}
#define NOSYMBOL ((uintptr_t)-1)
return NOSYMBOL;
} /* lookup_symbol() */
@@ -794,10 +796,11 @@ static void command(const char *cmd, char *res, size_t res_size) {
rbp += sprintf(rbp, "T0;tnotrun:0");
}
else if (!strncmp(p, "qXfer:memory-map:read::", 23)) {
char *str =
"<memory-map>"
"<memory type=\"rom\" start=\""MAP_KERNEL_TEXT"\" length=\"0x27000\"/>"
"</memory-map>";
char str[1024];
sprintf(str, "<memory-map>"
"<memory type=\"rom\" start=\"0x%lx\" length=\"0x27000\"/>"
"</memory-map>", MAP_KERNEL_START);
rbp += sprintf(rbp, "l");
if (0)
rbp += print_hex(rbp, res_size, str);