diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2014-08-20 05:58:59 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2014-08-20 05:58:59 -0400 |
commit | 5fb370267f81a8429a76f0237767804b849d1f81 (patch) | |
tree | 413f79df97f76560799ad35ccb5eee792f5003cc /firmware/kernel | |
parent | 9fed5fd9e944ce255f4df0ac2ada233ae5f58ec2 (diff) | |
download | rockbox-5fb370267f81a8429a76f0237767804b849d1f81.tar.gz rockbox-5fb370267f81a8429a76f0237767804b849d1f81.zip |
Make sure load_context is the last thing in switch_thread.
This should fix the android crash issue (fingers crossed).
Change-Id: I9d3f773dbdf7dde60bd76962dcf66a3bad8b0925
Diffstat (limited to 'firmware/kernel')
-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 | /*--------------------------------------------------------------------------- |