diff options
-rw-r--r-- | apps/codecs/lib/codeclib.c | 4 | ||||
-rw-r--r-- | apps/plugins/lib/profile_plugin.c | 4 | ||||
-rw-r--r-- | firmware/profile.c | 5 |
3 files changed, 12 insertions, 1 deletions
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c index e6780c68fe..e76d03f4a2 100644 --- a/apps/codecs/lib/codeclib.c +++ b/apps/codecs/lib/codeclib.c | |||
@@ -145,8 +145,12 @@ void qsort(void *base, size_t nmemb, size_t size, | |||
145 | 145 | ||
146 | #ifdef RB_PROFILE | 146 | #ifdef RB_PROFILE |
147 | void __cyg_profile_func_enter(void *this_fn, void *call_site) { | 147 | void __cyg_profile_func_enter(void *this_fn, void *call_site) { |
148 | #ifdef CPU_COLDFIRE | ||
148 | (void)call_site; | 149 | (void)call_site; |
149 | local_rb->profile_func_enter(this_fn, __builtin_return_address(1)); | 150 | local_rb->profile_func_enter(this_fn, __builtin_return_address(1)); |
151 | #else | ||
152 | local_rb->profile_func_enter(this_fn, call_site); | ||
153 | #endif | ||
150 | } | 154 | } |
151 | 155 | ||
152 | void __cyg_profile_func_exit(void *this_fn, void *call_site) { | 156 | void __cyg_profile_func_exit(void *this_fn, void *call_site) { |
diff --git a/apps/plugins/lib/profile_plugin.c b/apps/plugins/lib/profile_plugin.c index 3318476a89..38c6d81598 100644 --- a/apps/plugins/lib/profile_plugin.c +++ b/apps/plugins/lib/profile_plugin.c | |||
@@ -29,8 +29,12 @@ void profile_init(struct plugin_api* pa) | |||
29 | } | 29 | } |
30 | 30 | ||
31 | void __cyg_profile_func_enter(void *this_fn, void *call_site) { | 31 | void __cyg_profile_func_enter(void *this_fn, void *call_site) { |
32 | #ifdef CPU_COLDFIRE | ||
32 | (void)call_site; | 33 | (void)call_site; |
33 | local_rb->profile_func_enter(this_fn, __builtin_return_address(1)); | 34 | local_rb->profile_func_enter(this_fn, __builtin_return_address(1)); |
35 | #else | ||
36 | local_rb->profile_func_enter(this_fn, call_site); | ||
37 | #endif | ||
34 | } | 38 | } |
35 | 39 | ||
36 | void __cyg_profile_func_exit(void *this_fn, void *call_site) { | 40 | void __cyg_profile_func_exit(void *this_fn, void *call_site) { |
diff --git a/firmware/profile.c b/firmware/profile.c index 8ad46515f8..f6cffa7c53 100644 --- a/firmware/profile.c +++ b/firmware/profile.c | |||
@@ -76,10 +76,14 @@ static void profile_timer_unregister(void); | |||
76 | static void write_function_recursive(int fd, struct pfd_struct *pfd, int depth); | 76 | static void write_function_recursive(int fd, struct pfd_struct *pfd, int depth); |
77 | 77 | ||
78 | /* Be careful to use the right one for the size of your variable */ | 78 | /* Be careful to use the right one for the size of your variable */ |
79 | #ifdef CPU_COLDFIRE | ||
79 | #define ADDQI_L(_var,_value) \ | 80 | #define ADDQI_L(_var,_value) \ |
80 | asm ("addq.l %[value],%[var];" \ | 81 | asm ("addq.l %[value],%[var];" \ |
81 | : [var] "+g" (_var) \ | 82 | : [var] "+g" (_var) \ |
82 | : [value] "I" (_value) ) | 83 | : [value] "I" (_value) ) |
84 | #else | ||
85 | #define ADDQI_L(var, value) var += value | ||
86 | #endif | ||
83 | 87 | ||
84 | void profile_thread_stopped(int current_thread) { | 88 | void profile_thread_stopped(int current_thread) { |
85 | if (current_thread == profiling_thread) { | 89 | if (current_thread == profiling_thread) { |
@@ -227,7 +231,6 @@ void profile_func_enter(void *self_pc, void *from_pc) { | |||
227 | if (profiling) { | 231 | if (profiling) { |
228 | return; | 232 | return; |
229 | } | 233 | } |
230 | /* this is equivalent to 'profiling = PROF_BUSY;' but it's faster */ | ||
231 | profiling = PROF_BUSY; | 234 | profiling = PROF_BUSY; |
232 | /* A check that the PC is in the code range here wouldn't hurt, but this is | 235 | /* A check that the PC is in the code range here wouldn't hurt, but this is |
233 | * logically guaranteed to be a valid address unless the constants are | 236 | * logically guaranteed to be a valid address unless the constants are |