Refactor stage1's and stage2's main.c files
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "chainloader.h"
|
||||
|
||||
int g_chainloader_argc = 0;
|
||||
char g_chainloader_arg_data[CHAINLOADER_ARG_DATA_MAX_SIZE] = {0};
|
||||
chainloader_entry_t g_chainloader_entries[CHAINLOADER_MAX_ENTRIES] = {0}; /* keep them sorted */
|
||||
size_t g_chainloader_num_entries = 0;
|
||||
@@ -24,11 +25,11 @@ static void *xmemmove(void *dst, const void *src, size_t len)
|
||||
return dst;
|
||||
}
|
||||
|
||||
void relocate_and_chainload_main(int argc) {
|
||||
void relocate_and_chainload_main(void) {
|
||||
for(size_t i = 0; i < g_chainloader_num_entries; i++) {
|
||||
chainloader_entry_t *entry = &g_chainloader_entries[i];
|
||||
xmemmove((void *)entry->load_address, (const void *)entry->src_address, entry->size);
|
||||
}
|
||||
|
||||
((void (*)(int, void *))g_chainloader_entrypoint)(argc, g_chainloader_arg_data);
|
||||
((void (*)(int, void *))g_chainloader_entrypoint)(g_chainloader_argc, g_chainloader_arg_data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user