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.tar.gz
rockbox-67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd.zip
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 cb751328ae..3736ac7924 100644
--- a/firmware/export/profile.h
+++ b/firmware/export/profile.h
@@ -8,7 +8,7 @@
8 * $Id$ 8 * $Id$
9 * 9 *
10 * Profiling routines counts ticks and calls to each profiled function. 10 * Profiling routines counts ticks and calls to each profiled function.
11 * 11 *
12 * Copyright (C) 2005 by Brandon Low 12 * Copyright (C) 2005 by Brandon Low
13 * 13 *
14 * All files in this archive are subject to the GNU General Public License. 14 * All files in this archive are subject to the GNU General Public License.
@@ -31,8 +31,8 @@
31#define INDEX_MASK 0x7FF /* lower INDEX_BITS 1 */ 31#define INDEX_MASK 0x7FF /* lower INDEX_BITS 1 */
32 32
33/* 33/*
34 * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM 34 * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM
35 * for profiling, and allows for profiling sections of code with up-to 35 * for profiling, and allows for profiling sections of code with up-to
36 * 1024 function caller->callee pairs 36 * 1024 function caller->callee pairs
37 */ 37 */
38#define NUMPFDS 1024 38#define NUMPFDS 1024
@@ -54,8 +54,6 @@ struct pfd_struct {
54#define PROF_OFF_THREAD 0x10 54#define PROF_OFF_THREAD 0x10
55#define PROF_ON_THREAD 0x0F 55#define PROF_ON_THREAD 0x0F
56 56
57extern int current_thread;
58
59/* Initialize and start profiling */ 57/* Initialize and start profiling */
60void profstart(int current_thread) 58void profstart(int current_thread)
61 NO_PROF_ATTR; 59 NO_PROF_ATTR;
@@ -72,7 +70,7 @@ void profile_thread_stopped(int current_thread)
72void profile_thread_started(int current_thread) 70void profile_thread_started(int current_thread)
73 NO_PROF_ATTR; 71 NO_PROF_ATTR;
74 72
75void profile_func_exit(void *this_fn, void *call_site) 73void profile_func_exit(void *this_fn, void *call_site)
76 NO_PROF_ATTR ICODE_ATTR; 74 NO_PROF_ATTR ICODE_ATTR;
77void profile_func_enter(void *this_fn, void *call_site) 75void profile_func_enter(void *this_fn, void *call_site)
78 NO_PROF_ATTR ICODE_ATTR; 76 NO_PROF_ATTR ICODE_ATTR;
diff --git a/firmware/thread.c b/firmware/thread.c
index c194b2694d..8f89d1c71d 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -94,7 +94,7 @@ static inline void load_context(const void* addr) __attribute__ ((always_inline)
94#ifdef RB_PROFILE 94#ifdef RB_PROFILE
95#include <profile.h> 95#include <profile.h>
96void profile_thread(void) { 96void profile_thread(void) {
97 profstart(current_thread); 97 profstart(current_thread[CURRENT_CORE]);
98} 98}
99#endif 99#endif
100 100
@@ -265,7 +265,7 @@ static inline void load_context(const void* addr)
265void switch_thread(void) 265void switch_thread(void)
266{ 266{
267#ifdef RB_PROFILE 267#ifdef RB_PROFILE
268 profile_thread_stopped(current_thread); 268 profile_thread_stopped(current_thread[CURRENT_CORE]);
269#endif 269#endif
270 int current; 270 int current;
271 unsigned int *stackptr; 271 unsigned int *stackptr;
@@ -313,7 +313,7 @@ void switch_thread(void)
313 current_thread[CURRENT_CORE] = current; 313 current_thread[CURRENT_CORE] = current;
314 load_context(&thread_contexts[CURRENT_CORE][current]); 314 load_context(&thread_contexts[CURRENT_CORE][current]);
315#ifdef RB_PROFILE 315#ifdef RB_PROFILE
316 profile_thread_started(current_thread); 316 profile_thread_started(current_thread[CURRENT_CORE]);
317#endif 317#endif
318} 318}
319 319