From 052791474e3d4aed8062064d2ac94be6f0169ede Mon Sep 17 00:00:00 2001 From: Florian Sylvestre Date: Tue, 25 Apr 2023 15:00:10 +0200 Subject: [PATCH 01/20] machines: cortex-a: * Remove unused rpi dependent header from common cortex-a file * Cleanup inclusion of 'CallTerminateISR2' and 'CallTerminateTask' depending of their existence --- machines/cortex-a/tpl_machine_arm.c | 38 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/machines/cortex-a/tpl_machine_arm.c b/machines/cortex-a/tpl_machine_arm.c index e40f6e0d..a34fd870 100644 --- a/machines/cortex-a/tpl_machine_arm.c +++ b/machines/cortex-a/tpl_machine_arm.c @@ -32,8 +32,6 @@ #endif #include "tpl_os_interrupt.h" -#include "rpi2_trace.h" - #define OS_START_SEC_VAR_UNSPECIFIED #include "tpl_memmap.h" /** @@ -57,10 +55,21 @@ volatile VAR (uint32, OS_VAR) nested_kernel_entrance_counter; #include "tpl_memmap.h" #if TASK_COUNT > 0 +/** + * Call Terminate Task function when no TerminateTask hasn't been called + * or when TerminateTask didn't success because of resource hold or + * interrupts disabled. + * + */ extern FUNC(void, OS_CODE) CallTerminateTask(void); #endif #if ISR_COUNT > 0 +/** + * Call Terminate ISR2 function when TerminateISR didn't success doing it + * because of resource hold or interrupts disabled. + * + */ extern FUNC(void, OS_CODE) CallTerminateISR2(void); #endif @@ -90,22 +99,6 @@ void idle_function(void) }; } -/** - * Call Terminate Task function when no TerminateTask hasn't been called - * or when TerminateTask didn't success because of resource hold or - * interrupts disabled. - * - */ -extern FUNC(void, OS_CODE) CallTerminateTask(void); - - -/** - * Call Terminate ISR2 function when TerminateISR didn't success doing it - * because of resource hold or interrupts disabled. - * - */ -extern FUNC(void, OS_CODE) CallTerminateISR2(void); - /* * As kernel mode is non-interruptible, these function does nothing */ @@ -195,8 +188,17 @@ FUNC(void, OS_CODE) tpl_init_context( * the behaviour is controled */ core_context->r[armreg_lr] = (IS_ROUTINE == the_proc->type) ? +#if ISR_COUNT > 0 (uint32)(CallTerminateISR2) : +#else + (uint32)(NULL) : +#endif + +#if TASK_COUNT > 0 (uint32)(CallTerminateTask); /* lr */ +#else + (uint32)(NULL); /* lr */ +#endif // trace_var((const unsigned char*)"core_context->r[armreg_sp]", core_context->r[armreg_sp]); /* TODO: initialize stack footprint */ -- 2.34.1