From c24b183c60ac92d3862d13668fdf6ecc1cb51a41 Mon Sep 17 00:00:00 2001 From: fef Date: Thu, 5 Aug 2021 16:29:18 +0200 Subject: [PATCH] init: fix init array pointer dereference bullshit --- arch/at91sam3x8e/handle_reset.c | 8 ++++---- arch/at91sam3x8e/include/arch/linker.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/at91sam3x8e/handle_reset.c b/arch/at91sam3x8e/handle_reset.c index 4ceaab3..82c69c3 100644 --- a/arch/at91sam3x8e/handle_reset.c +++ b/arch/at91sam3x8e/handle_reset.c @@ -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(); diff --git a/arch/at91sam3x8e/include/arch/linker.h b/arch/at91sam3x8e/include/arch/linker.h index efed353..d3a1041 100644 --- a/arch/at91sam3x8e/include/arch/linker.h +++ b/arch/at91sam3x8e/include/arch/linker.h @@ -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.