From 67ddef9aac17a1cbd5cf620d377a67b0ed08d1dd Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Thu, 24 Aug 2006 13:10:20 +0000 Subject: Fix profile builds git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10734 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/profile.h | 10 ++++------ firmware/thread.c | 6 +++--- 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 @@ * $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 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) #ifdef RB_PROFILE #include 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 } -- cgit v1.2.3