From 8c806ff4394c819fcad5d7a4fb127a525b51ca50 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 13 Jul 2020 14:24:43 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13756 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- .../ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chcore.c | 8 +++++++- .../ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chcore.h | 6 +++--- .../{ARMv8-M-ML => ARMv8-M-ML-TZ}/chcore_timer.h | 0 .../ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chtypes.h | 0 .../compilers/GCC/chcoreasm.S | 2 +- .../ports/ARMv8-M-ML-TZ/compilers/GCC/mk/port.mk | 12 ++++++++++++ .../ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/mpu_v8m.h | 0 os/common/ports/ARMv8-M-ML/compilers/GCC/mk/port.mk | 12 ------------ 8 files changed, 23 insertions(+), 17 deletions(-) rename os/common/ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chcore.c (94%) rename os/common/ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chcore.h (96%) rename os/common/ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chcore_timer.h (100%) rename os/common/ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/chtypes.h (100%) rename os/common/ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/compilers/GCC/chcoreasm.S (96%) create mode 100644 os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/mk/port.mk rename os/common/ports/{ARMv8-M-ML => ARMv8-M-ML-TZ}/mpu_v8m.h (100%) delete mode 100644 os/common/ports/ARMv8-M-ML/compilers/GCC/mk/port.mk diff --git a/os/common/ports/ARMv8-M-ML/chcore.c b/os/common/ports/ARMv8-M-ML-TZ/chcore.c similarity index 94% rename from os/common/ports/ARMv8-M-ML/chcore.c rename to os/common/ports/ARMv8-M-ML-TZ/chcore.c index 407032ebd..b5166f7b5 100644 --- a/os/common/ports/ARMv8-M-ML/chcore.c +++ b/os/common/ports/ARMv8-M-ML-TZ/chcore.c @@ -84,8 +84,14 @@ thread_t *port_schedule_next(void) { /** * @brief Port-related initialization code. + * + * @param[in, out] oip pointer to the @p os_instance_t structure + * + * @notapi */ -void port_init(void) { +void port_init(os_instance_t *oip) { + + (void)oip; #if PORT_KERNEL_MODE == PORT_KERNEL_MODE_HOST { diff --git a/os/common/ports/ARMv8-M-ML/chcore.h b/os/common/ports/ARMv8-M-ML-TZ/chcore.h similarity index 96% rename from os/common/ports/ARMv8-M-ML/chcore.h rename to os/common/ports/ARMv8-M-ML-TZ/chcore.h index 6b9a0bf91..e5ac0e8e3 100644 --- a/os/common/ports/ARMv8-M-ML/chcore.h +++ b/os/common/ports/ARMv8-M-ML-TZ/chcore.h @@ -632,11 +632,11 @@ struct port_context { * @param[in] otp the thread to be switched out */ #define port_switch(ntp, otp) do { \ - _dbg_leave_lock(); \ + __dbg_check_lock(); \ register thread_t *_ntp asm ("r0") = (ntp); \ register thread_t *_otp asm ("r1") = (otp); \ asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp) : "memory"); \ - _dbg_enter_lock(); \ + __dbg_check_unlock(); \ } while (false) /*===========================================================================*/ @@ -648,7 +648,7 @@ struct port_context { #ifdef __cplusplus extern "C" { #endif - void port_init(void); + void port_init(os_instance_t *oip); void __port_thread_start(void); #if PORT_KERNEL_MODE == PORT_KERNEL_MODE_HOST void __port_ns_boot(void *vtor); diff --git a/os/common/ports/ARMv8-M-ML/chcore_timer.h b/os/common/ports/ARMv8-M-ML-TZ/chcore_timer.h similarity index 100% rename from os/common/ports/ARMv8-M-ML/chcore_timer.h rename to os/common/ports/ARMv8-M-ML-TZ/chcore_timer.h diff --git a/os/common/ports/ARMv8-M-ML/chtypes.h b/os/common/ports/ARMv8-M-ML-TZ/chtypes.h similarity index 100% rename from os/common/ports/ARMv8-M-ML/chtypes.h rename to os/common/ports/ARMv8-M-ML-TZ/chtypes.h diff --git a/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S b/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/chcoreasm.S similarity index 96% rename from os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S rename to os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/chcoreasm.S index fb4569ebc..7a87b2e53 100644 --- a/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S +++ b/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/chcoreasm.S @@ -272,7 +272,7 @@ __port_thread_start: blx r4 movs r0, #0 /* MSG_OK */ bl chThdExit -_zombies: b _zombies +.zombies: b .zombies #if PORT_KERNEL_MODE == PORT_KERNEL_MODE_HOST /*--------------------------------------------------------------------------* diff --git a/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/mk/port.mk b/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/mk/port.mk new file mode 100644 index 000000000..2816c6e6e --- /dev/null +++ b/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/mk/port.mk @@ -0,0 +1,12 @@ +# List of the ChibiOS/RT ARMv8-M mainline generic port files. +PORTSRC = $(CHIBIOS)/os/common/ports/ARMv8-M-ML-TZ/chcore.c + +PORTASM = $(CHIBIOS)/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC/chcoreasm.S + +PORTINC = $(CHIBIOS)/os/common/ports/ARMv8-M-ML-TZ \ + $(CHIBIOS)/os/common/ports/ARMv8-M-ML-TZ/compilers/GCC + +# Shared variables +ALLXASMSRC += $(PORTASM) +ALLCSRC += $(PORTSRC) +ALLINC += $(PORTINC) diff --git a/os/common/ports/ARMv8-M-ML/mpu_v8m.h b/os/common/ports/ARMv8-M-ML-TZ/mpu_v8m.h similarity index 100% rename from os/common/ports/ARMv8-M-ML/mpu_v8m.h rename to os/common/ports/ARMv8-M-ML-TZ/mpu_v8m.h diff --git a/os/common/ports/ARMv8-M-ML/compilers/GCC/mk/port.mk b/os/common/ports/ARMv8-M-ML/compilers/GCC/mk/port.mk deleted file mode 100644 index 0f16c8941..000000000 --- a/os/common/ports/ARMv8-M-ML/compilers/GCC/mk/port.mk +++ /dev/null @@ -1,12 +0,0 @@ -# List of the ChibiOS/RT ARMv8-M mainline generic port files. -PORTSRC = $(CHIBIOS)/os/common/ports/ARMv8-M-ML/chcore.c - -PORTASM = $(CHIBIOS)/os/common/ports/ARMv8-M-ML/compilers/GCC/chcoreasm.S - -PORTINC = $(CHIBIOS)/os/common/ports/ARMv8-M-ML \ - $(CHIBIOS)/os/common/ports/ARMv8-M-ML/compilers/GCC - -# Shared variables -ALLXASMSRC += $(PORTASM) -ALLCSRC += $(PORTSRC) -ALLINC += $(PORTINC)