init: fix init array pointer dereference bullshit

This commit is contained in:
anna 2021-08-05 16:29:18 +02:00
parent 6287cb79be
commit c24b183c60
Signed by: fef
GPG key ID: EC22E476DC2D3D84
2 changed files with 6 additions and 6 deletions

View file

@ -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();

View file

@ -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.