2be15d0fe6
* sparc.c (sparc_override_options): Don't allow profiling for code models other than medlow. (sparc_function_profiler): New function from old FUNCTION_PROFILER macro. Use ASM_GENERATE_INTERNAL_LABEL and MCOUNT_FUNCTION. (sparc_function_block_profiler): Likewise. Use user_label_prefix. (sparc_block_profiler): Likewise. (sparc_function_block_profiler_exit): Likewise. * sparc.h (FUNCTION_PROFILER): Call new sparc.c function. (FUNCTION_BLOCK_PROFILER): Likewise. (BLOCK_PROFILER): Likewise. (FUNCTION_BLOCK_PROFILER_EXIT): Likewise. (MCOUNT_FUNCTION): New. * sparc/pbd.h (FUNCTION_PROFILER): Delete. (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER): Delete. * sparc/sun4o3.h (FUNCTION_PROFILER): Delete. (MCOUNT_FUNCTION): New. * sparc/sysv4.h (FUNCTION_BLOCK_PROFILER): Delete. (BLOCK_PROFILER): Delete. (MCOUNT_FUNCTION): New. From-SVN: r27672
30 lines
840 B
C
30 lines
840 B
C
#include "sparc/sparc.h"
|
|
|
|
/* Override the name of the mcount profiling function. */
|
|
|
|
#undef MCOUNT_FUNCTION
|
|
#define MCOUNT_FUNCTION "*.mcount"
|
|
|
|
/* LINK_SPEC is needed only for SunOS 4. */
|
|
|
|
#undef LINK_SPEC
|
|
|
|
/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
|
|
traps available which can get and set the condition codes
|
|
reliably. */
|
|
#undef MACHINE_STATE_SAVE
|
|
#define MACHINE_STATE_SAVE(ID) \
|
|
unsigned long int ms_flags, ms_saveret; \
|
|
asm volatile("ta 0x20\n\t" \
|
|
"mov %%g1, %0\n\t" \
|
|
"mov %%g2, %1\n\t" \
|
|
: "=r" (ms_flags), "=r" (ms_saveret));
|
|
|
|
#undef MACHINE_STATE_RESTORE
|
|
#define MACHINE_STATE_RESTORE(ID) \
|
|
asm volatile("mov %0, %%g1\n\t" \
|
|
"mov %1, %%g2\n\t" \
|
|
"ta 0x21\n\t" \
|
|
: /* no outputs */ \
|
|
: "r" (ms_flags), "r" (ms_saveret));
|