1 /* Copyright (C) 2007-2012 Free Software Foundation, Inc.
2 Contributor: Joern Rennecke <joern.rennecke@embecosm.com>
3 on behalf of Synopsys Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 #ifndef MACHINE_GMON_H
27 #define MACHINE_GMON_H
29 /* We can't fake out own <sys/types.h> header because the newlib / uclibc
30 headers in GCC_FOR_TARGET take precedence. */
37 extern int __dcache_linesz (void);
39 #define _MCOUNT_DECL(countp, selfpc) \
40 static inline void _mcount_internal (void *countp, u_long selfpc)
42 extern void _mcount (void);
43 extern void _mcount_call (void);
45 /* N.B.: the calling point might be a sibcall, thus blink does not necessarily
46 hold the caller's address. r8 doesn't hold the caller's address, either,
47 but rather a pointer to the counter data structure associated with the
49 This function must be compiled with optimization turned on in order to
50 enable a sibcall for the final call to selfpc; this is important when trying
51 to profile a program with deep tail-recursion that would get a stack
52 overflow otherwise. */
57 register void *countp __asm("r8"); \
58 register u_long selfpc __asm("r9"); \
59 _mcount_internal (countp, selfpc); \
60 ((void (*)(void)) selfpc) (); \
63 extern int __profil (u_short
*,size_t, size_t, u_int
);
65 #endif /* MACHINE_GMON_H */