summaryrefslogtreecommitdiff
path: root/firmware/thread.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2006-09-23 14:38:04 +0000
committerMagnus Holmgren <magnushol@gmail.com>2006-09-23 14:38:04 +0000
commit13f3c5b2cbef027356cd61a149a632df7760240e (patch)
treec13c3fc5b7f3002542cca84834b66e0f1b214690 /firmware/thread.c
parent5dc08bbfb28853a374c7d9ff57a3070324a6cd5c (diff)
Fix profiling builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11034 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/thread.c')
-rw-r--r--firmware/thread.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index aeedbac349..205375a44d 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -24,6 +24,9 @@
#include "kernel.h"
#include "cpu.h"
#include "string.h"
+#ifdef RB_PROFILE
+#include <profile.h>
+#endif
#define DEADBEEF ((unsigned int)0xdeadbeef)
/* Cast to the the machine int type, whose size could be < 4. */
@@ -67,13 +70,6 @@ void switch_thread(bool save_context, struct thread_entry **blocked_list)
static inline void store_context(void* addr) __attribute__ ((always_inline));
static inline void load_context(const void* addr) __attribute__ ((always_inline));
-#ifdef RB_PROFILE
-#include <profile.h>
-void profile_thread(void) {
- profstart(cores[CURRENT_CORE].current_thread);
-}
-#endif
-
#if defined(CPU_ARM)
/*---------------------------------------------------------------------------
* Store non-volatile context.
@@ -372,6 +368,10 @@ static int get_threadnum(struct thread_entry *thread)
return -1;
}
+
+void profile_thread(void) {
+ profstart(get_threadnum(cores[CURRENT_CORE].running));
+}
#endif
/* Compiler trick: Don't declare as static to prevent putting