summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/exception.S27
-rw-r--r--sys/amd64/amd64/exception.s27
-rw-r--r--sys/i386/i386/exception.s27
3 files changed, 9 insertions, 72 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S
index aafbf0b..54d7f82 100644
--- a/sys/amd64/amd64/exception.S
+++ b/sys/amd64/amd64/exception.S
@@ -289,31 +289,10 @@ IDTVEC(int0x80_syscall)
jmp _doreti
ENTRY(fork_trampoline)
- MTX_EXIT(_sched_lock, MTX_SPIN)
- sti /* XXX: we need this for kernel threads
- created very early before interrupts
- are enabled */
-
-#ifdef SMP
- cmpl $0,PCPU(SWITCHTIME)
- jne 1f
- PCPU_ADDR(SWITCHTIME, %eax)
- pushl %eax
- call _microuptime
- popl %edx
- movl _ticks,%eax
- movl %eax,PCPU(SWITCHTICKS)
-1:
-#endif
-
- /*
- * cpu_set_fork_handler intercepts this function call to
- * have this call a non-return function to stay in kernel mode.
- * initproc has its own fork handler, but it does return.
- */
pushl %ebx /* arg1 */
- call *%esi /* function */
- addl $4,%esp
+ pushl %esi /* function */
+ call _fork_exit
+ addl $8,%esp
/* cut from syscall */
/*
diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s
index aafbf0b..54d7f82 100644
--- a/sys/amd64/amd64/exception.s
+++ b/sys/amd64/amd64/exception.s
@@ -289,31 +289,10 @@ IDTVEC(int0x80_syscall)
jmp _doreti
ENTRY(fork_trampoline)
- MTX_EXIT(_sched_lock, MTX_SPIN)
- sti /* XXX: we need this for kernel threads
- created very early before interrupts
- are enabled */
-
-#ifdef SMP
- cmpl $0,PCPU(SWITCHTIME)
- jne 1f
- PCPU_ADDR(SWITCHTIME, %eax)
- pushl %eax
- call _microuptime
- popl %edx
- movl _ticks,%eax
- movl %eax,PCPU(SWITCHTICKS)
-1:
-#endif
-
- /*
- * cpu_set_fork_handler intercepts this function call to
- * have this call a non-return function to stay in kernel mode.
- * initproc has its own fork handler, but it does return.
- */
pushl %ebx /* arg1 */
- call *%esi /* function */
- addl $4,%esp
+ pushl %esi /* function */
+ call _fork_exit
+ addl $8,%esp
/* cut from syscall */
/*
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index aafbf0b..54d7f82 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -289,31 +289,10 @@ IDTVEC(int0x80_syscall)
jmp _doreti
ENTRY(fork_trampoline)
- MTX_EXIT(_sched_lock, MTX_SPIN)
- sti /* XXX: we need this for kernel threads
- created very early before interrupts
- are enabled */
-
-#ifdef SMP
- cmpl $0,PCPU(SWITCHTIME)
- jne 1f
- PCPU_ADDR(SWITCHTIME, %eax)
- pushl %eax
- call _microuptime
- popl %edx
- movl _ticks,%eax
- movl %eax,PCPU(SWITCHTICKS)
-1:
-#endif
-
- /*
- * cpu_set_fork_handler intercepts this function call to
- * have this call a non-return function to stay in kernel mode.
- * initproc has its own fork handler, but it does return.
- */
pushl %ebx /* arg1 */
- call *%esi /* function */
- addl $4,%esp
+ pushl %esi /* function */
+ call _fork_exit
+ addl $8,%esp
/* cut from syscall */
/*
OpenPOWER on IntegriCloud