Last change
on this file since 612 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
696 bytes
|
Rev | Line | |
---|
[444] | 1 | #define PROFILE_SUPPORT 1 |
---|
| 2 | |
---|
| 3 | #include "crt0.S" |
---|
| 4 | |
---|
| 5 | .global __mcount |
---|
| 6 | __mcount: |
---|
| 7 | ;; When a function is compiled for profiling, gcc creates code |
---|
| 8 | ;; like this at the start of each profiled function: |
---|
| 9 | ;; |
---|
| 10 | ;; .global <func_name> |
---|
| 11 | ;; <func_name>: |
---|
| 12 | ;; bsr __mcount |
---|
| 13 | ;; <...function's prologue...> |
---|
| 14 | ;; <...function's body...> |
---|
| 15 | ;; |
---|
| 16 | ;; We must save all of the argument registers, extract the |
---|
| 17 | ;; address of <func_name>, call _mcount_internal to do the |
---|
| 18 | ;; real work and then restore the argument registers before |
---|
| 19 | ;; returning. |
---|
| 20 | |
---|
| 21 | pushm r1-r4 |
---|
| 22 | mov.l 16[r0], r1 |
---|
| 23 | bsr __mcount_internal |
---|
| 24 | rtsd #16, r1-r4 |
---|
| 25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.