From be16a3aba0c2d57f43a1e8a0fa0267ddf3fd9660 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 25 Jan 2000 09:01:55 +0000 Subject: [PATCH] Fixed the profiling version ALTENTRY(). Again. The previous version didn't set up the frame pointer before calling mcount, and then jumped to the wrong place in ENTRY() to defeat the point of the jump. --- sys/amd64/include/asm.h | 14 +++++++++----- sys/i386/include/asm.h | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h index 51ec27845b5..340b1701f7c 100644 --- a/sys/amd64/include/asm.h +++ b/sys/amd64/include/asm.h @@ -84,15 +84,19 @@ .globl CNAME(x); .type CNAME(x),@function; CNAME(x): #ifdef PROF -#define ENTRY(x) _ENTRY(x); 9: \ +#define ALTENTRY(x) _ENTRY(x); \ pushl %ebp; movl %esp,%ebp; \ call PIC_PLT(HIDENAME(mcount)); \ - popl %ebp - -#define ALTENTRY(x) _ENTRY(x) ; call PIC_PLT(HIDENAME(mcount)) ; jmp 9f + popl %ebp; \ + jmp 9f +#define ENTRY(x) _ENTRY(x); \ + pushl %ebp; movl %esp,%ebp; \ + call PIC_PLT(HIDENAME(mcount)); \ + popl %ebp; \ + 9: #else +#define ALTENTRY(x) _ENTRY(x) #define ENTRY(x) _ENTRY(x) -#define ALTENTRY(x) _ENTRY(x) #endif #define RCSID(x) .text; .asciz x diff --git a/sys/i386/include/asm.h b/sys/i386/include/asm.h index 51ec27845b5..340b1701f7c 100644 --- a/sys/i386/include/asm.h +++ b/sys/i386/include/asm.h @@ -84,15 +84,19 @@ .globl CNAME(x); .type CNAME(x),@function; CNAME(x): #ifdef PROF -#define ENTRY(x) _ENTRY(x); 9: \ +#define ALTENTRY(x) _ENTRY(x); \ pushl %ebp; movl %esp,%ebp; \ call PIC_PLT(HIDENAME(mcount)); \ - popl %ebp - -#define ALTENTRY(x) _ENTRY(x) ; call PIC_PLT(HIDENAME(mcount)) ; jmp 9f + popl %ebp; \ + jmp 9f +#define ENTRY(x) _ENTRY(x); \ + pushl %ebp; movl %esp,%ebp; \ + call PIC_PLT(HIDENAME(mcount)); \ + popl %ebp; \ + 9: #else +#define ALTENTRY(x) _ENTRY(x) #define ENTRY(x) _ENTRY(x) -#define ALTENTRY(x) _ENTRY(x) #endif #define RCSID(x) .text; .asciz x