From 32c10ae2c98d408de196fbb41a901aa9aadbeb66 Mon Sep 17 00:00:00 2001
From: Kaspar Schleiser <kaspar@schleiser.de>
Date: Fri, 20 Oct 2017 17:46:16 +0200
Subject: [PATCH] core, cpu: rename thread_start_threading() ->
 cpu_switch_context_exit()

---
 core/include/sched.h              | 6 +-----
 core/include/thread.h             | 5 -----
 cpu/atmega_common/thread_arch.c   | 4 ++--
 cpu/cortexm_common/thread_arch.c  | 4 ++--
 cpu/mips32r2_common/thread_arch.c | 2 +-
 5 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/core/include/sched.h b/core/include/sched.h
index 63a27c5e7c..67c85fa203 100644
--- a/core/include/sched.h
+++ b/core/include/sched.h
@@ -136,11 +136,7 @@ void sched_switch(uint16_t other_prio);
 /**
  * @brief   Call context switching at thread exit
  */
-extern void thread_start_threading(void);
-NORETURN static inline void cpu_switch_context_exit(void)
-{
-    thread_start_threading();
-}
+NORETURN void cpu_switch_context_exit(void);
 
 /**
  * Flag indicating whether a context switch is necessary after handling an
diff --git a/core/include/thread.h b/core/include/thread.h
index 706f3e57bd..dfa9a4fdee 100644
--- a/core/include/thread.h
+++ b/core/include/thread.h
@@ -491,11 +491,6 @@ void thread_stack_print(void);
  */
 void thread_print_stack(void);
 
-/**
- * @brief Start threading by loading a threads initial information from the stack
- */
-void thread_start_threading(void) NORETURN;
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpu/atmega_common/thread_arch.c b/cpu/atmega_common/thread_arch.c
index 17c4abcdd2..d7932d55b4 100644
--- a/cpu/atmega_common/thread_arch.c
+++ b/cpu/atmega_common/thread_arch.c
@@ -222,8 +222,8 @@ void thread_stack_print(void)
     printf("stack size: %u bytes\n", size);
 }
 
-void thread_start_threading(void) __attribute__((naked));
-void thread_start_threading(void)
+void cpu_switch_context_exit(void) __attribute__((naked));
+void cpu_switch_context_exit(void)
 {
     sched_run();
     AVR_CONTEXT_SWAP_INIT;
diff --git a/cpu/cortexm_common/thread_arch.c b/cpu/cortexm_common/thread_arch.c
index beff93eb4d..7523e45a4d 100644
--- a/cpu/cortexm_common/thread_arch.c
+++ b/cpu/cortexm_common/thread_arch.c
@@ -105,7 +105,7 @@ extern uint32_t _sstack;
 /**
  * @brief   Noticeable marker marking the beginning of a stack segment
  *
- * This marker is used e.g. by *thread_start_threading* to identify the
+ * This marker is used e.g. by *cpu_switch_context_exit* to identify the
  * stacks beginning.
  */
 #define STACK_MARKER                (0x77777777)
@@ -277,7 +277,7 @@ void *thread_isr_stack_start(void)
     return (void *)&_sstack;
 }
 
-__attribute__((naked)) void NORETURN thread_start_threading(void)
+__attribute__((naked)) void NORETURN cpu_switch_context_exit(void)
 {
     __asm__ volatile (
     "bl     irq_enable               \n" /* enable IRQs to make the SVC
diff --git a/cpu/mips32r2_common/thread_arch.c b/cpu/mips32r2_common/thread_arch.c
index 8103336486..4fae163d80 100644
--- a/cpu/mips32r2_common/thread_arch.c
+++ b/cpu/mips32r2_common/thread_arch.c
@@ -118,7 +118,7 @@ void thread_stack_print(void)
 }
 
 extern void __exception_restore(void);
-void thread_start_threading(void)
+void cpu_switch_context_exit(void)
 {
     unsigned int status = mips32_get_c0(C0_STATUS);
 
-- 
GitLab