Support compiling with `gcc -pedantic' (don't use hard newlines in
(asm) string constants).
This commit is contained in:
parent
1696756396
commit
212b37ff18
|
@ -23,7 +23,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: prof_machdep.c,v 1.8 1997/12/26 20:42:08 phk Exp $
|
* $Id: prof_machdep.c,v 1.9 1998/04/15 17:45:43 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GUPROF
|
#ifdef GUPROF
|
||||||
|
@ -66,53 +66,54 @@ static struct gmonparam saved_gmp;
|
||||||
#endif /* GUPROF */
|
#endif /* GUPROF */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__asm("
|
__asm(" \n\
|
||||||
GM_STATE = 0
|
GM_STATE = 0 \n\
|
||||||
GMON_PROF_OFF = 3
|
GMON_PROF_OFF = 3 \n\
|
||||||
|
\n\
|
||||||
.text
|
.text \n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl __mcount
|
.globl __mcount \n\
|
||||||
__mcount:
|
__mcount: \n\
|
||||||
#
|
# \n\
|
||||||
# Check that we are profiling. Do it early for speed.
|
# Check that we are profiling. Do it early for speed. \n\
|
||||||
#
|
# \n\
|
||||||
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE
|
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE \n\
|
||||||
je Lmcount_exit
|
je Lmcount_exit \n\
|
||||||
#
|
# \n\
|
||||||
# __mcount is the same as mcount except the caller hasn't changed
|
# __mcount is the same as mcount except the caller \n\
|
||||||
# the stack except to call here, so the caller's raddr is above
|
# hasn't changed the stack except to call here, so the \n\
|
||||||
# our raddr.
|
# caller's raddr is above our raddr. \n\
|
||||||
#
|
# \n\
|
||||||
movl 4(%esp),%edx
|
movl 4(%esp),%edx \n\
|
||||||
jmp Lgot_frompc
|
jmp Lgot_frompc \n\
|
||||||
|
\n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl mcount
|
.globl mcount \n\
|
||||||
mcount:
|
mcount: \n\
|
||||||
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE
|
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE \n\
|
||||||
je Lmcount_exit
|
je Lmcount_exit \n\
|
||||||
#
|
# \n\
|
||||||
# The caller's stack frame has already been built, so %ebp is
|
# The caller's stack frame has already been built, so \n\
|
||||||
# the caller's frame pointer. The caller's raddr is in the
|
# %ebp is the caller's frame pointer. The caller's \n\
|
||||||
# caller's frame following the caller's caller's frame pointer.
|
# raddr is in the caller's frame following the caller's \n\
|
||||||
#
|
# caller's frame pointer. \n\
|
||||||
movl 4(%ebp),%edx
|
# \n\
|
||||||
Lgot_frompc:
|
movl 4(%ebp),%edx \n\
|
||||||
#
|
Lgot_frompc: \n\
|
||||||
# Our raddr is the caller's pc.
|
# \n\
|
||||||
#
|
# Our raddr is the caller's pc. \n\
|
||||||
movl (%esp),%eax
|
# \n\
|
||||||
|
movl (%esp),%eax \n\
|
||||||
pushfl
|
\n\
|
||||||
pushl %eax
|
pushfl \n\
|
||||||
pushl %edx
|
pushl %eax \n\
|
||||||
cli
|
pushl %edx \n\
|
||||||
call _mcount
|
cli \n\
|
||||||
addl $8,%esp
|
call _mcount \n\
|
||||||
popfl
|
addl $8,%esp \n\
|
||||||
Lmcount_exit:
|
popfl \n\
|
||||||
ret
|
Lmcount_exit: \n\
|
||||||
|
ret \n\
|
||||||
");
|
");
|
||||||
#else /* !__GNUC__ */
|
#else /* !__GNUC__ */
|
||||||
#error
|
#error
|
||||||
|
@ -126,36 +127,36 @@ Lmcount_exit:
|
||||||
* can't just be put in machdep.c because it has to be compiled without -pg.
|
* can't just be put in machdep.c because it has to be compiled without -pg.
|
||||||
*/
|
*/
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__asm("
|
__asm(" \n\
|
||||||
.text
|
.text \n\
|
||||||
#
|
# \n\
|
||||||
# Dummy label to be seen when gprof -u hides mexitcount.
|
# Dummy label to be seen when gprof -u hides mexitcount. \n\
|
||||||
#
|
# \n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl __mexitcount
|
.globl __mexitcount \n\
|
||||||
__mexitcount:
|
__mexitcount: \n\
|
||||||
nop
|
nop \n\
|
||||||
|
\n\
|
||||||
GMON_PROF_HIRES = 4
|
GMON_PROF_HIRES = 4 \n\
|
||||||
|
\n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl mexitcount
|
.globl mexitcount \n\
|
||||||
mexitcount:
|
mexitcount: \n\
|
||||||
cmpl $GMON_PROF_HIRES,__gmonparam+GM_STATE
|
cmpl $GMON_PROF_HIRES,__gmonparam+GM_STATE \n\
|
||||||
jne Lmexitcount_exit
|
jne Lmexitcount_exit \n\
|
||||||
pushl %edx
|
pushl %edx \n\
|
||||||
pushl %eax
|
pushl %eax \n\
|
||||||
movl 8(%esp),%eax
|
movl 8(%esp),%eax \n\
|
||||||
pushfl
|
pushfl \n\
|
||||||
pushl %eax
|
pushl %eax \n\
|
||||||
cli
|
cli \n\
|
||||||
call _mexitcount
|
call _mexitcount \n\
|
||||||
addl $4,%esp
|
addl $4,%esp \n\
|
||||||
popfl
|
popfl \n\
|
||||||
popl %eax
|
popl %eax \n\
|
||||||
popl %edx
|
popl %edx \n\
|
||||||
Lmexitcount_exit:
|
Lmexitcount_exit: \n\
|
||||||
ret
|
ret \n\
|
||||||
");
|
");
|
||||||
#else /* !__GNUC__ */
|
#else /* !__GNUC__ */
|
||||||
#error
|
#error
|
||||||
|
@ -333,12 +334,12 @@ stopguprof(gp)
|
||||||
|
|
||||||
#else /* !GUPROF */
|
#else /* !GUPROF */
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__asm("
|
__asm(" \n\
|
||||||
.text
|
.text \n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl mexitcount
|
.globl mexitcount \n\
|
||||||
mexitcount:
|
mexitcount: \n\
|
||||||
ret
|
ret \n\
|
||||||
");
|
");
|
||||||
#else /* !__GNUC__ */
|
#else /* !__GNUC__ */
|
||||||
#error
|
#error
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: prof_machdep.c,v 1.8 1997/12/26 20:42:08 phk Exp $
|
* $Id: prof_machdep.c,v 1.9 1998/04/15 17:45:43 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GUPROF
|
#ifdef GUPROF
|
||||||
|
@ -66,53 +66,54 @@ static struct gmonparam saved_gmp;
|
||||||
#endif /* GUPROF */
|
#endif /* GUPROF */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__asm("
|
__asm(" \n\
|
||||||
GM_STATE = 0
|
GM_STATE = 0 \n\
|
||||||
GMON_PROF_OFF = 3
|
GMON_PROF_OFF = 3 \n\
|
||||||
|
\n\
|
||||||
.text
|
.text \n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl __mcount
|
.globl __mcount \n\
|
||||||
__mcount:
|
__mcount: \n\
|
||||||
#
|
# \n\
|
||||||
# Check that we are profiling. Do it early for speed.
|
# Check that we are profiling. Do it early for speed. \n\
|
||||||
#
|
# \n\
|
||||||
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE
|
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE \n\
|
||||||
je Lmcount_exit
|
je Lmcount_exit \n\
|
||||||
#
|
# \n\
|
||||||
# __mcount is the same as mcount except the caller hasn't changed
|
# __mcount is the same as mcount except the caller \n\
|
||||||
# the stack except to call here, so the caller's raddr is above
|
# hasn't changed the stack except to call here, so the \n\
|
||||||
# our raddr.
|
# caller's raddr is above our raddr. \n\
|
||||||
#
|
# \n\
|
||||||
movl 4(%esp),%edx
|
movl 4(%esp),%edx \n\
|
||||||
jmp Lgot_frompc
|
jmp Lgot_frompc \n\
|
||||||
|
\n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl mcount
|
.globl mcount \n\
|
||||||
mcount:
|
mcount: \n\
|
||||||
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE
|
cmpl $GMON_PROF_OFF,__gmonparam+GM_STATE \n\
|
||||||
je Lmcount_exit
|
je Lmcount_exit \n\
|
||||||
#
|
# \n\
|
||||||
# The caller's stack frame has already been built, so %ebp is
|
# The caller's stack frame has already been built, so \n\
|
||||||
# the caller's frame pointer. The caller's raddr is in the
|
# %ebp is the caller's frame pointer. The caller's \n\
|
||||||
# caller's frame following the caller's caller's frame pointer.
|
# raddr is in the caller's frame following the caller's \n\
|
||||||
#
|
# caller's frame pointer. \n\
|
||||||
movl 4(%ebp),%edx
|
# \n\
|
||||||
Lgot_frompc:
|
movl 4(%ebp),%edx \n\
|
||||||
#
|
Lgot_frompc: \n\
|
||||||
# Our raddr is the caller's pc.
|
# \n\
|
||||||
#
|
# Our raddr is the caller's pc. \n\
|
||||||
movl (%esp),%eax
|
# \n\
|
||||||
|
movl (%esp),%eax \n\
|
||||||
pushfl
|
\n\
|
||||||
pushl %eax
|
pushfl \n\
|
||||||
pushl %edx
|
pushl %eax \n\
|
||||||
cli
|
pushl %edx \n\
|
||||||
call _mcount
|
cli \n\
|
||||||
addl $8,%esp
|
call _mcount \n\
|
||||||
popfl
|
addl $8,%esp \n\
|
||||||
Lmcount_exit:
|
popfl \n\
|
||||||
ret
|
Lmcount_exit: \n\
|
||||||
|
ret \n\
|
||||||
");
|
");
|
||||||
#else /* !__GNUC__ */
|
#else /* !__GNUC__ */
|
||||||
#error
|
#error
|
||||||
|
@ -126,36 +127,36 @@ Lmcount_exit:
|
||||||
* can't just be put in machdep.c because it has to be compiled without -pg.
|
* can't just be put in machdep.c because it has to be compiled without -pg.
|
||||||
*/
|
*/
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__asm("
|
__asm(" \n\
|
||||||
.text
|
.text \n\
|
||||||
#
|
# \n\
|
||||||
# Dummy label to be seen when gprof -u hides mexitcount.
|
# Dummy label to be seen when gprof -u hides mexitcount. \n\
|
||||||
#
|
# \n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl __mexitcount
|
.globl __mexitcount \n\
|
||||||
__mexitcount:
|
__mexitcount: \n\
|
||||||
nop
|
nop \n\
|
||||||
|
\n\
|
||||||
GMON_PROF_HIRES = 4
|
GMON_PROF_HIRES = 4 \n\
|
||||||
|
\n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl mexitcount
|
.globl mexitcount \n\
|
||||||
mexitcount:
|
mexitcount: \n\
|
||||||
cmpl $GMON_PROF_HIRES,__gmonparam+GM_STATE
|
cmpl $GMON_PROF_HIRES,__gmonparam+GM_STATE \n\
|
||||||
jne Lmexitcount_exit
|
jne Lmexitcount_exit \n\
|
||||||
pushl %edx
|
pushl %edx \n\
|
||||||
pushl %eax
|
pushl %eax \n\
|
||||||
movl 8(%esp),%eax
|
movl 8(%esp),%eax \n\
|
||||||
pushfl
|
pushfl \n\
|
||||||
pushl %eax
|
pushl %eax \n\
|
||||||
cli
|
cli \n\
|
||||||
call _mexitcount
|
call _mexitcount \n\
|
||||||
addl $4,%esp
|
addl $4,%esp \n\
|
||||||
popfl
|
popfl \n\
|
||||||
popl %eax
|
popl %eax \n\
|
||||||
popl %edx
|
popl %edx \n\
|
||||||
Lmexitcount_exit:
|
Lmexitcount_exit: \n\
|
||||||
ret
|
ret \n\
|
||||||
");
|
");
|
||||||
#else /* !__GNUC__ */
|
#else /* !__GNUC__ */
|
||||||
#error
|
#error
|
||||||
|
@ -333,12 +334,12 @@ stopguprof(gp)
|
||||||
|
|
||||||
#else /* !GUPROF */
|
#else /* !GUPROF */
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__asm("
|
__asm(" \n\
|
||||||
.text
|
.text \n\
|
||||||
.align 4,0x90
|
.align 4,0x90 \n\
|
||||||
.globl mexitcount
|
.globl mexitcount \n\
|
||||||
mexitcount:
|
mexitcount: \n\
|
||||||
ret
|
ret \n\
|
||||||
");
|
");
|
||||||
#else /* !__GNUC__ */
|
#else /* !__GNUC__ */
|
||||||
#error
|
#error
|
||||||
|
|
Loading…
Reference in New Issue