From 09699519abd25a24edd20efda0e24838f272db0b Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Thu, 24 Oct 1996 19:30:10 +0000 Subject: Mon Oct 21 22:05:48 1996 Thomas Bushnell, n/BSG * i386/csw.S (CALL_MCOUNT): New macro. (cproc_swtich, cproc_start_wait, cproc_prepare): Use CALL_MCOUNT. --- libthreads/i386/csw.S | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libthreads/i386') diff --git a/libthreads/i386/csw.S b/libthreads/i386/csw.S index ea77b739..5e4427b7 100644 --- a/libthreads/i386/csw.S +++ b/libthreads/i386/csw.S @@ -26,6 +26,9 @@ /* * HISTORY * $Log: csw.S,v $ + * Revision 1.6 1996/08/29 17:44:42 thomas + * *** empty log message *** + * * Revision 1.5 1995/10/04 20:55:28 roland * (JUMPTARGET): New macro, versions for [PIC] and not. * Use it in place of EXT. @@ -72,12 +75,21 @@ #define JUMPTARGET(name) EXT(name) #endif +#ifdef PROF +#define CALL_MCOUNT \ + pushl %ebp; movl %esp, %ebp; call JUMPTARGET(mcount); popl %ebp; +#else +#define CALL_MCOUNT +#endif + + /* * Suspend the current thread and resume the next one. * * void cproc_switch(int *cur, int *next, int *lock) */ ENTRY(cproc_switch) + CALL_MCOUNT pushl %ebp /* save ebp */ movl %esp,%ebp /* set frame pointer to get arguments */ pushl %ebx /* save ebx */ @@ -109,6 +121,7 @@ ENTRY(cproc_switch) * int *lock) */ ENTRY(cproc_start_wait) + CALL_MCOUNT pushl %ebp /* save ebp */ movl %esp,%ebp /* set frame pointer */ pushl %ebx /* save ebx */ @@ -134,6 +147,7 @@ ENTRY(cproc_start_wait) * void cproc_prepare(cproc_t child, int *context, int stack) */ ENTRY(cproc_prepare) + CALL_MCOUNT pushl %ebp /* save ebp */ movl %esp,%ebp /* set frame pointer */ movl B_ARG2,%edx /* get child`s stack */ -- cgit v1.2.3