From 5e0daf6d1a6f40f33fca3b44e903a40912a98f96 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 6 Apr 2020 12:41:34 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13517 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- ...52ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch | 2 +- os/common/ports/ARMv8-M-ML/chcore.c | 5 ++--- os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S | 2 ++ os/rt/include/chschd.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch b/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch index ed9b9ef3c..30754e98c 100644 --- a/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch +++ b/demos/STM32/RT-STM32L552ZE-NUCLEO144/debug/RT-STM32L552ZE-NUCLEO144 (ST-Link GDB Server, Flash and Run).launch @@ -33,7 +33,7 @@ - + diff --git a/os/common/ports/ARMv8-M-ML/chcore.c b/os/common/ports/ARMv8-M-ML/chcore.c index 4f4dfec4e..be365dddf 100644 --- a/os/common/ports/ARMv8-M-ML/chcore.c +++ b/os/common/ports/ARMv8-M-ML/chcore.c @@ -54,8 +54,7 @@ /** * @brief Tail ISR context switch code. * - * @param[in] sp the stack pointer being switched-out - * @return The stack pointer being switched-in. + * @return The thread being switched-in. */ thread_t *port_schedule_next(void) { thread_t *ntp; @@ -63,7 +62,7 @@ thread_t *port_schedule_next(void) { chSysLock(); /* TODO statistics, tracing etc */ - ntp = chSchRunAhead(); + ntp = chSchSelectFirstI(); chSysUnlock(); diff --git a/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S b/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S index 24ab6b6be..6e85b0a21 100644 --- a/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S +++ b/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S @@ -122,6 +122,8 @@ SVC_Handler: PendSV_Handler: /* Pointer to the current thread.*/ ldr r1, =ch +// movw r1, #:lower16:ch +// movt r1, #:upper16:ch ldr r1, [r1, #CURRENT_OFFSET] /* Saving callee context of thread being swapped out.*/ diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h index 1c770a30b..b3d6449ea 100644 --- a/os/rt/include/chschd.h +++ b/os/rt/include/chschd.h @@ -724,7 +724,7 @@ static inline void chSchPreemption(void) { * * @special */ -static inline thread_t *chSchRunAhead(void) { +static inline thread_t *chSchSelectFirstI(void) { thread_t *otp = currp; thread_t *ntp;