Verified Commit c24b183c authored by Felix Kopp's avatar Felix Kopp
Browse files

init: fix init array pointer dereference bullshit

parent 6287cb79
......@@ -22,11 +22,11 @@ __naked __noreturn void handle_reset(void)
memmove(&_srelocate, &_etext, (size_t)(&_erelocate) - (size_t)(&_srelocate));
memset(&_szero, 0, (size_t)(&_ezero) - (size_t)(&_szero));
for (uint32_t *fn = &__preinit_array_start; fn != &__preinit_array_end; fn++)
( (void (*)(void))fn )();
for (uintptr_t *fn = &__preinit_array_start; fn != &__preinit_array_end; fn++)
( (void (*)(void))*fn )();
for (uint32_t *fn = &__init_array_start; fn != &__init_array_end; fn++)
( (void (*)(void))fn )();
for (uintptr_t *fn = &__init_array_start; fn != &__init_array_end; fn++)
( (void (*)(void))*fn )();
/* start the Kernel */
main();
......
......@@ -60,9 +60,9 @@ extern uintptr_t __preinit_array_end;
* standard C library. They are executed after the preinit array, so memory
* allocation is already available.
*/
extern uint32_t __init_array_start;
extern uintptr_t __init_array_start;
/** @brief End of init array. */
extern uint32_t __init_array_end;
extern uintptr_t __init_array_end;
/*
* This file is part of Ardix.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment