summaryrefslogtreecommitdiff
path: root/libthreads/i386/csw.S
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-10-24 19:30:10 +0000
committerThomas Bushnell <thomas@gnu.org>1996-10-24 19:30:10 +0000
commit09699519abd25a24edd20efda0e24838f272db0b (patch)
tree12855768e5e9c9aadead5af74483bdb343fbd8bb /libthreads/i386/csw.S
parent535f8e46a030eda99b08e7a4fd03b0e6cdaa6d5e (diff)
Mon Oct 21 22:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* i386/csw.S (CALL_MCOUNT): New macro. (cproc_swtich, cproc_start_wait, cproc_prepare): Use CALL_MCOUNT.
Diffstat (limited to 'libthreads/i386/csw.S')
-rw-r--r--libthreads/i386/csw.S14
1 files changed, 14 insertions, 0 deletions
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 */