diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/kernel/thread.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/kernel/thread.c b/firmware/kernel/thread.c index bbd610122b..01395a9d6d 100644 --- a/firmware/kernel/thread.c +++ b/firmware/kernel/thread.c | |||
@@ -254,18 +254,18 @@ static NO_INLINE void thread_stkov(struct thread_entry *thread) | |||
254 | 254 | ||
255 | static FORCE_INLINE void thread_store_context(struct thread_entry *thread) | 255 | static FORCE_INLINE void thread_store_context(struct thread_entry *thread) |
256 | { | 256 | { |
257 | store_context(&thread->context); | ||
257 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) | 258 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
258 | thread->__errno = errno; | 259 | thread->__errno = errno; |
259 | #endif | 260 | #endif |
260 | store_context(&thread->context); | ||
261 | } | 261 | } |
262 | 262 | ||
263 | static FORCE_INLINE void thread_load_context(struct thread_entry *thread) | 263 | static FORCE_INLINE void thread_load_context(struct thread_entry *thread) |
264 | { | 264 | { |
265 | load_context(&thread->context); | ||
266 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) | 265 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
267 | errno = thread->__errno; | 266 | errno = thread->__errno; |
268 | #endif | 267 | #endif |
268 | load_context(&thread->context); | ||
269 | } | 269 | } |
270 | 270 | ||
271 | static FORCE_INLINE unsigned int | 271 | static FORCE_INLINE unsigned int |
@@ -1101,12 +1101,12 @@ void switch_thread(void) | |||
1101 | RTR_UNLOCK(corep); | 1101 | RTR_UNLOCK(corep); |
1102 | enable_irq(); | 1102 | enable_irq(); |
1103 | 1103 | ||
1104 | /* And finally, give control to the next thread. */ | ||
1105 | thread_load_context(thread); | ||
1106 | |||
1107 | #ifdef RB_PROFILE | 1104 | #ifdef RB_PROFILE |
1108 | profile_thread_started(THREAD_ID_SLOT(thread->id)); | 1105 | profile_thread_started(THREAD_ID_SLOT(thread->id)); |
1109 | #endif | 1106 | #endif |
1107 | |||
1108 | /* And finally, give control to the next thread. */ | ||
1109 | thread_load_context(thread); | ||
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | /*--------------------------------------------------------------------------- | 1112 | /*--------------------------------------------------------------------------- |