summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ankers <dan@weirdo.org.uk>2006-08-24 13:10:20 +0000
committerDaniel Ankers <dan@weirdo.org.uk>2006-08-24 13:10:20 +0000
commit67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd (patch)
tree21314732a4a7ca6d470cf9056a94aa256a05b6ea
parentdbf98172b9140adb846aab9650a4f08deab7d29d (diff)
downloadrockbox-67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd.zip
rockbox-67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd.tar.gz
rockbox-67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd.tar.bz2
rockbox-67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd.tar.xz
Fix profile builds
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10734 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/profile.h10
-rw-r--r--firmware/thread.c6
2 files changed, 7 insertions, 9 deletions
diff --git a/firmware/export/profile.h b/firmware/export/profile.h
index cb75132..3736ac7 100644
--- a/firmware/export/profile.h
+++ b/firmware/export/profile.h
@@ -8,7 +8,7 @@
* $Id$
*
* Profiling routines counts ticks and calls to each profiled function.
- *
+ *
* Copyright (C) 2005 by Brandon Low
*
* All files in this archive are subject to the GNU General Public License.
@@ -31,8 +31,8 @@
#define INDEX_MASK 0x7FF /* lower INDEX_BITS 1 */
/*
- * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM
- * for profiling, and allows for profiling sections of code with up-to
+ * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM
+ * for profiling, and allows for profiling sections of code with up-to
* 1024 function caller->callee pairs
*/
#define NUMPFDS 1024
@@ -54,8 +54,6 @@ struct pfd_struct {
#define PROF_OFF_THREAD 0x10
#define PROF_ON_THREAD 0x0F
-extern int current_thread;
-
/* Initialize and start profiling */
void profstart(int current_thread)
NO_PROF_ATTR;
@@ -72,7 +70,7 @@ void profile_thread_stopped(int current_thread)
void profile_thread_started(int current_thread)
NO_PROF_ATTR;
-void profile_func_exit(void *this_fn, void *call_site)
+void profile_func_exit(void *this_fn, void *call_site)
NO_PROF_ATTR ICODE_ATTR;
void profile_func_enter(void *this_fn, void *call_site)
NO_PROF_ATTR ICODE_ATTR;
diff --git a/firmware/thread.c b/firmware/thread.c
index c194b26..8f89d1c 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -94,7 +94,7 @@ static inline void load_context(const void* addr) __attribute__ ((always_inline)
#ifdef RB_PROFILE
#include <profile.h>
void profile_thread(void) {
- profstart(current_thread);
+ profstart(current_thread[CURRENT_CORE]);
}
#endif
@@ -265,7 +265,7 @@ static inline void load_context(const void* addr)
void switch_thread(void)
{
#ifdef RB_PROFILE
- profile_thread_stopped(current_thread);
+ profile_thread_stopped(current_thread[CURRENT_CORE]);
#endif
int current;
unsigned int *stackptr;
@@ -313,7 +313,7 @@ void switch_thread(void)
current_thread[CURRENT_CORE] = current;
load_context(&thread_contexts[CURRENT_CORE][current]);
#ifdef RB_PROFILE
- profile_thread_started(current_thread);
+ profile_thread_started(current_thread[CURRENT_CORE]);
#endif
}