summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-01-10 13:34:21 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-01-10 13:34:21 +0000
commit771be10e033278ba3fe87b2fad592c9852b3e663 (patch)
tree0a6d3d603627743134eb50aae080763e88c0d49d /sys
parenta0a5a476bb860c6ea968db2071b67dd7d860bec2 (diff)
Generalize cpu_set_kpc to take any kind of arg; mostly from NetBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/alpha/vm_machdep.c15
-rw-r--r--sys/arch/amiga/amiga/vm_machdep.c11
-rw-r--r--sys/arch/arm32/arm32/vm_machdep.c13
-rw-r--r--sys/arch/atari/atari/vm_machdep.c11
-rw-r--r--sys/arch/hp300/hp300/vm_machdep.c13
-rw-r--r--sys/arch/hppa/hppa/vm_machdep.c7
-rw-r--r--sys/arch/i386/i386/vm_machdep.c16
-rw-r--r--sys/arch/kbus/include/cpu.h4
-rw-r--r--sys/arch/kbus/kbus/vm_machdep.c7
-rw-r--r--sys/arch/mac68k/mac68k/vm_machdep.c7
-rw-r--r--sys/arch/mvme68k/mvme68k/vm_machdep.c13
-rw-r--r--sys/arch/mvme88k/mvme88k/vm_machdep.c10
-rw-r--r--sys/arch/powerpc/powerpc/vm_machdep.c11
-rw-r--r--sys/arch/sparc/include/cpu.h4
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c9
-rw-r--r--sys/arch/sun3/sun3/vm_machdep.c15
-rw-r--r--sys/arch/vax/include/cpu.h3
-rw-r--r--sys/arch/vax/vax/vm_machdep.c9
-rw-r--r--sys/kern/init_main.c29
-rw-r--r--sys/sys/systm.h4
20 files changed, 117 insertions, 94 deletions
diff --git a/sys/arch/alpha/alpha/vm_machdep.c b/sys/arch/alpha/alpha/vm_machdep.c
index 7f64013518e..2d79c11bd89 100644
--- a/sys/arch/alpha/alpha/vm_machdep.c
+++ b/sys/arch/alpha/alpha/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.8 1998/07/28 00:13:26 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.9 1999/01/10 13:34:17 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.21 1996/11/13 21:13:15 cgd Exp $ */
/*
@@ -240,6 +240,8 @@ printf("FORK CHILD: pc = %p, ra = %p\n", p2tf->tf_regs[FRAME_PC], p2tf->tf_regs[
(u_int64_t)child_return; /* s0: pc */
up->u_pcb.pcb_context[1] =
(u_int64_t)exception_return; /* s1: ra */
+ up->u_pcb.pcb_context[2] =
+ (u_int64_t)p2; /* s2: arg */
up->u_pcb.pcb_context[7] =
(u_int64_t)switch_trampoline; /* ra: assembly magic */
}
@@ -250,7 +252,7 @@ printf("FORK CHILD: pc = %p, ra = %p\n", p2tf->tf_regs[FRAME_PC], p2tf->tf_regs[
*
* Arrange for in-kernel execution of a process to continue at the
* named pc, as if the code at that address were called as a function
- * with argument, the current process's process pointer.
+ * with argument, the current process' process pointer.
*
* Note that it's assumed that when the named process returns,
* exception_return() should be invoked, to return to user mode.
@@ -258,15 +260,18 @@ printf("FORK CHILD: pc = %p, ra = %p\n", p2tf->tf_regs[FRAME_PC], p2tf->tf_regs[
* (Note that cpu_fork(), above, uses an open-coded version of this.)
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *pcbp;
pcbp = &p->p_addr->u_pcb;
pcbp->pcb_context[0] = (u_int64_t)pc; /* s0 - pc to invoke */
- pcbp->pcb_context[1] = (u_int64_t)exception_return; /* s1 - return address */
+ pcbp->pcb_context[1] = (u_int64_t)exception_return;
+ /* s1 - return address */
+ pcbp->pcb_context[2] = (u_int64_t)arg; /* s2 - arg */
pcbp->pcb_context[7] =
(u_int64_t)switch_trampoline; /* ra - assembly magic */
}
diff --git a/sys/arch/amiga/amiga/vm_machdep.c b/sys/arch/amiga/amiga/vm_machdep.c
index aadf76fa8d5..2a682cc8a23 100644
--- a/sys/arch/amiga/amiga/vm_machdep.c
+++ b/sys/arch/amiga/amiga/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.8 1998/07/28 00:13:28 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.9 1999/01/10 13:34:17 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/05/19 10:14:50 veego Exp $ */
/*
@@ -92,7 +92,7 @@ cpu_fork(p1, p2)
/*
* Copy the trap frame, and arrange for the child to return directly
- * through return_to_user().
+ * through return_to_user(). Note the inline cpu_set_kpc();
*/
tf = (struct trapframe *)((u_int)p2->p_addr + USPACE) - 1;
p2->p_md.md_regs = (int *)tf;
@@ -115,9 +115,10 @@ cpu_fork(p1, p2)
* should be invoked, to return to user mode.
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *pcbp;
struct switchframe *sf;
@@ -126,7 +127,7 @@ cpu_set_kpc(p, pc)
sf = (struct switchframe *)pcbp->pcb_regs[11];
sf->sf_pc = (u_int)proc_trampoline;
pcbp->pcb_regs[6] = (int)pc; /* A2 */
- pcbp->pcb_regs[7] = (int)p; /* A3 */
+ pcbp->pcb_regs[7] = (int)arg; /* A3 */
}
/*
diff --git a/sys/arch/arm32/arm32/vm_machdep.c b/sys/arch/arm32/arm32/vm_machdep.c
index e39b3229f0d..f2f0c290caf 100644
--- a/sys/arch/arm32/arm32/vm_machdep.c
+++ b/sys/arch/arm32/arm32/vm_machdep.c
@@ -231,6 +231,10 @@ cpu_fork(p1, p2)
arm_fpe_copycontext(FP_CONTEXT(p1), FP_CONTEXT(p2));
#endif
+ /*
+ * Copy the trap frame, and arrange for the child to return directly
+ * through return_to_user(). Note the inline cpu_set_kpc().
+ */
p2->p_md.md_regs = tf = (struct trapframe *)pcb->pcb_sp - 1;
*tf = *p1->p_md.md_regs;
@@ -244,14 +248,15 @@ cpu_fork(p1, p2)
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- u_long pc;
+ void (*pc) __P((void *));
+ void *arg;
{
struct switchframe *sf = (struct switchframe *)p->p_addr->u_pcb.pcb_sp;
- sf->sf_r4 = pc;
- sf->sf_r5 = (u_int)p;
+ sf->sf_r4 = (u_int)pc;
+ sf->sf_r5 = (u_int)arg;
}
diff --git a/sys/arch/atari/atari/vm_machdep.c b/sys/arch/atari/atari/vm_machdep.c
index c5742798609..8799926f17d 100644
--- a/sys/arch/atari/atari/vm_machdep.c
+++ b/sys/arch/atari/atari/vm_machdep.c
@@ -86,7 +86,7 @@ cpu_fork(p1, p2)
/*
* Copy the trap frame, and arrange for the child to return directly
- * through return_to_user().
+ * through return_to_user(). Note the inline cpu_set_kpc().
*/
tf = (struct trapframe *)((u_int)p2->p_addr + USPACE) - 1;
p2->p_md.md_regs = (int *)tf;
@@ -109,9 +109,10 @@ cpu_fork(p1, p2)
* should be invoked, to return to user mode.
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- u_int32_t pc;
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *pcbp;
struct switchframe *sf;
@@ -120,8 +121,8 @@ cpu_set_kpc(p, pc)
pcbp = &p->p_addr->u_pcb;
sf = (struct switchframe *)pcbp->pcb_regs[11];
sf->sf_pc = (u_int)proc_trampoline;
- pcbp->pcb_regs[6] = pc; /* A2 */
- pcbp->pcb_regs[7] = (int)p; /* A3 */
+ pcbp->pcb_regs[6] = (int)pc; /* A2 */
+ pcbp->pcb_regs[7] = (int)arg; /* A3 */
}
/*
diff --git a/sys/arch/hp300/hp300/vm_machdep.c b/sys/arch/hp300/hp300/vm_machdep.c
index bb54c8c3215..c9eeb9ab78f 100644
--- a/sys/arch/hp300/hp300/vm_machdep.c
+++ b/sys/arch/hp300/hp300/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.11 1998/07/28 00:13:34 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.12 1999/01/10 13:34:17 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.37 1997/05/26 00:27:43 thorpej Exp $ */
/*
@@ -90,7 +90,7 @@ cpu_fork(p1, p2)
/*
* Copy the trap frame, and arrange for the child to return directly
- * through return_to_user().
+ * through return_to_user(). Note the inline cpu_set_kpc().
*/
tf = (struct trapframe *)((u_int)p2->p_addr + USPACE) - 1;
p2->p_md.md_regs = (int *)tf;
@@ -103,12 +103,13 @@ cpu_fork(p1, p2)
}
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
-
- p->p_addr->u_pcb.pcb_regs[6] = (int) pc; /* A2 */
+ p->p_addr->u_pcb.pcb_regs[6] = (int)pc; /* A2 */
+ p->p_addr->u_pcb.pcb_regs[7] = (int)arg; /* A3 */
}
/*
diff --git a/sys/arch/hppa/hppa/vm_machdep.c b/sys/arch/hppa/hppa/vm_machdep.c
index 5cbc0b2a395..31a3b72fd8b 100644
--- a/sys/arch/hppa/hppa/vm_machdep.c
+++ b/sys/arch/hppa/hppa/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.1 1998/12/29 18:06:48 mickey Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.2 1999/01/10 13:34:18 niklas Exp $ */
#include <sys/param.h>
#include <sys/systm.h>
@@ -86,9 +86,10 @@ cpu_wait(p)
}
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
}
diff --git a/sys/arch/i386/i386/vm_machdep.c b/sys/arch/i386/i386/vm_machdep.c
index 98c132130e4..f313e6439ad 100644
--- a/sys/arch/i386/i386/vm_machdep.c
+++ b/sys/arch/i386/i386/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.13 1998/07/28 00:13:36 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.14 1999/01/10 13:34:18 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */
/*-
@@ -137,7 +137,7 @@ cpu_fork(p1, p2)
/*
* Copy the trapframe, and arrange for the child to return directly
- * through rei().
+ * through rei(). Note the inline version of cpu_set_kpc().
*/
p2->p_md.md_regs = tf = (struct trapframe *)pcb->pcb_tss.tss_esp0 - 1;
*tf = *p1->p_md.md_regs;
@@ -150,13 +150,17 @@ cpu_fork(p1, p2)
}
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
- struct switchframe *sf = (struct switchframe *)p->p_addr->u_pcb.pcb_esp;
+ struct switchframe *sf =
+ (struct switchframe *)p->p_addr->u_pcb.pcb_esp;
- sf->sf_esi = (int) pc;
+ sf->sf_esi = (int)pc;
+ sf->sf_ebx = (int)arg;
+ sf->sf_eip = (int)proc_trampoline;
}
void
diff --git a/sys/arch/kbus/include/cpu.h b/sys/arch/kbus/include/cpu.h
index b1de5bf7b5a..e77dcc59a81 100644
--- a/sys/arch/kbus/include/cpu.h
+++ b/sys/arch/kbus/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.2 1998/03/01 00:37:34 niklas Exp $ */
+/* $OpenBSD: cpu.h,v 1.3 1999/01/10 13:34:19 niklas Exp $ */
/* $NetBSD: cpu.h,v 1.12 1995/06/28 02:55:56 cgd Exp $ */
/*-
@@ -242,8 +242,6 @@ void kgdb_panic __P((void));
/* pmap.c */
void pmap_bootstrap __P((vm_offset_t));
vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int));
-/* vm_machdep.c */
-void cpu_set_kpc __P((struct proc *, void (*)(struct proc *)));
/* iommu.c */
void iommu_enter __P((u_int, u_int));
void iommu_remove __P((u_int, u_int));
diff --git a/sys/arch/kbus/kbus/vm_machdep.c b/sys/arch/kbus/kbus/vm_machdep.c
index 56b77a5f768..18a8f77c4a0 100644
--- a/sys/arch/kbus/kbus/vm_machdep.c
+++ b/sys/arch/kbus/kbus/vm_machdep.c
@@ -381,9 +381,10 @@ cpu_swapin(p)
* (Note that cpu_fork(), above, uses an open-coded version of this.)
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *pcb;
struct rwindow *rp;
@@ -392,7 +393,7 @@ cpu_set_kpc(p, pc)
rp = (struct rwindow *)((u_int)pcb + TOPFRAMEOFF);
rp->rw_local[0] = (int)pc; /* Function to call */
- rp->rw_local[1] = (int)p; /* and its argument */
+ rp->rw_local[1] = (int)arg; /* and its argument */
/*
* Frob PCB:
diff --git a/sys/arch/mac68k/mac68k/vm_machdep.c b/sys/arch/mac68k/mac68k/vm_machdep.c
index b387023f4b6..3bb8b5a3b9e 100644
--- a/sys/arch/mac68k/mac68k/vm_machdep.c
+++ b/sys/arch/mac68k/mac68k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.10 1998/07/28 00:13:40 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.11 1999/01/10 13:34:18 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.21 1996/09/16 18:00:31 scottr Exp $ */
/*
@@ -117,9 +117,10 @@ cpu_fork(p1, p2)
* should be invoked to return to user mode.
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *pcbp;
struct switchframe *sf;
diff --git a/sys/arch/mvme68k/mvme68k/vm_machdep.c b/sys/arch/mvme68k/mvme68k/vm_machdep.c
index 42a81206b20..982b3c45290 100644
--- a/sys/arch/mvme68k/mvme68k/vm_machdep.c
+++ b/sys/arch/mvme68k/mvme68k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.9 1998/07/28 00:13:44 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.10 1999/01/10 13:34:18 niklas Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -84,7 +84,7 @@ cpu_fork(p1, p2)
/*
* Copy the trap frame, and arrange for the child to return directly
- * through return_to_user().
+ * through return_to_user(). Note the inline version of cpu_set_kpc().
*/
tf = (struct trapframe *)((u_int)p2->p_addr + USPACE) - 1;
p2->p_md.md_regs = (int *)tf;
@@ -97,12 +97,13 @@ cpu_fork(p1, p2)
}
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
-
- p->p_addr->u_pcb.pcb_regs[6] = (int)pc; /* A2 */
+ p->p_addr->u_pcb.pcb_regs[6] = (int)pc; /* A2 */
+ p->p_addr->u_pcb.pcb_regs[7] = (int)arg; /* A3 */
}
/*
diff --git a/sys/arch/mvme88k/mvme88k/vm_machdep.c b/sys/arch/mvme88k/mvme88k/vm_machdep.c
index 4f81fb2300a..7b53aefa791 100644
--- a/sys/arch/mvme88k/mvme88k/vm_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/vm_machdep.c
@@ -41,7 +41,7 @@
* from: Utah $Hdr: vm_machdep.c 1.21 91/04/06$
* from: @(#)vm_machdep.c 7.10 (Berkeley) 5/7/91
* vm_machdep.c,v 1.3 1993/07/07 07:09:32 cgd Exp
- * $Id: vm_machdep.c,v 1.5 1998/12/15 05:11:03 smurph Exp $
+ * $Id: vm_machdep.c,v 1.6 1999/01/10 13:34:18 niklas Exp $
*/
#include <sys/param.h>
@@ -137,21 +137,21 @@ cpu_fork(struct proc *p1, struct proc *p2)
}
void
-cpu_set_kpc(struct proc *p, void (*func)(struct proc *))
+cpu_set_kpc(struct proc *p, void (*func)(void *), void *arg)
{
/*
* override func pointer in ksigframe with func.
*/
struct ksigframe {
- void (*func)(struct proc *);
- void *proc;
+ void (*func)(void *);
+ void *arg;
} *ksfp;
ksfp = (struct ksigframe *)p->p_addr->u_pcb.kernel_state.pcb_sp;
ksfp->func = func;
-
+ ksfp->arg = arg;
}
/*
diff --git a/sys/arch/powerpc/powerpc/vm_machdep.c b/sys/arch/powerpc/powerpc/vm_machdep.c
index 5739a2295db..8649e0485eb 100644
--- a/sys/arch/powerpc/powerpc/vm_machdep.c
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.4 1998/08/07 02:22:10 rahnds Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.5 1999/01/10 13:34:19 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 1996/09/30 16:34:57 ws Exp $ */
/*
@@ -103,15 +103,16 @@ cpu_fork(p1, p2)
* Set initial pc of process forked by above.
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- u_long pc;
+ void (*pc) __P((void *));
+ void *arg;
{
struct switchframe *sf = (struct switchframe *)p->p_addr->u_pcb.pcb_sp;
struct callframe *cf = (struct callframe *)sf->sp;
- cf->r30 = (int)p;
- cf->r31 = pc;
+ cf->r30 = (int)arg;
+ cf->r31 = (int)pc;
cf++->lr = pc;
}
diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h
index 60e158da345..4220b274ef7 100644
--- a/sys/arch/sparc/include/cpu.h
+++ b/sys/arch/sparc/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.4 1997/08/25 08:38:45 downsj Exp $ */
+/* $OpenBSD: cpu.h,v 1.5 1999/01/10 13:34:20 niklas Exp $ */
/* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */
/*
@@ -229,8 +229,6 @@ void kgdb_attach __P((int (*)(void *), void (*)(void *, int), void *));
void kgdb_connect __P((int));
void kgdb_panic __P((void));
#endif
-/* vm_machdep.c */
-void cpu_set_kpc __P((struct proc *, void (*)(struct proc *)));
/* iommu.c */
void iommu_enter __P((u_int, u_int));
void iommu_remove __P((u_int, u_int));
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index f76109e5c2e..27e52c1de8b 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.6 1998/07/28 00:13:52 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.7 1999/01/10 13:34:19 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -433,9 +433,10 @@ cpu_fork(p1, p2)
* (Note that cpu_fork(), above, uses an open-coded version of this.)
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *pcb;
struct rwindow *rp;
@@ -444,7 +445,7 @@ cpu_set_kpc(p, pc)
rp = (struct rwindow *)((u_int)pcb + TOPFRAMEOFF);
rp->rw_local[0] = (int)pc; /* Function to call */
- rp->rw_local[1] = (int)p; /* and its argument */
+ rp->rw_local[1] = (int)arg; /* and its argument */
/*
* Frob PCB:
diff --git a/sys/arch/sun3/sun3/vm_machdep.c b/sys/arch/sun3/sun3/vm_machdep.c
index 89203485617..168d29b530d 100644
--- a/sys/arch/sun3/sun3/vm_machdep.c
+++ b/sys/arch/sun3/sun3/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.7 1998/07/28 00:13:54 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.8 1999/01/10 13:34:19 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.35 1996/04/26 18:38:06 gwr Exp $ */
/*
@@ -128,7 +128,7 @@ cpu_fork(p1, p2)
* onto the stack of p2, very much like signal delivery.
* When p2 runs, it will find itself in child_return().
*/
- cpu_set_kpc(p2, child_return);
+ cpu_set_kpc(p2, child_return, p2);
}
/*
@@ -153,15 +153,16 @@ cpu_fork(p1, p2)
* before we "pushed" this call.
*/
void
-cpu_set_kpc(proc, func)
+cpu_set_kpc(proc, func, arg)
struct proc *proc;
- void (*func)(struct proc *);
+ void (*func)(void *);
+ void *arg;
{
struct pcb *pcbp;
struct ksigframe {
struct switchframe sf;
- void (*func)(struct proc *);
- void *proc;
+ void (*func)(void *);
+ void *arg;
} *ksfp;
pcbp = &proc->p_addr->u_pcb;
@@ -173,7 +174,7 @@ cpu_set_kpc(proc, func)
/* Now fill it in for proc_trampoline. */
ksfp->sf.sf_pc = (u_int)proc_trampoline;
ksfp->func = func;
- ksfp->proc = proc;
+ ksfp->arg = arg;
}
/*
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h
index 3639ebf1e4b..7462a4a397f 100644
--- a/sys/arch/vax/include/cpu.h
+++ b/sys/arch/vax/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.8 1997/09/12 09:21:19 maja Exp $ */
+/* $OpenBSD: cpu.h,v 1.9 1999/01/10 13:34:20 niklas Exp $ */
/* $NetBSD: cpu.h,v 1.24 1997/07/26 10:12:40 ragge Exp $ */
/*
@@ -107,7 +107,6 @@ extern int want_resched; /* resched() was called */
/* Some low-level prototypes */
int badaddr __P((caddr_t, int));
-void cpu_set_kpc __P((struct proc *, void (*)(struct proc *)));
void cpu_swapin __P((struct proc *));
int hp_getdev __P((int, int, char **));
int ra_getdev __P((int, int, int, char **));
diff --git a/sys/arch/vax/vax/vm_machdep.c b/sys/arch/vax/vax/vm_machdep.c
index 1979af06a0e..f6351660939 100644
--- a/sys/arch/vax/vax/vm_machdep.c
+++ b/sys/arch/vax/vax/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.13 1998/07/28 00:13:56 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.14 1999/01/10 13:34:19 niklas Exp $ */
/* $NetBSD: vm_machdep.c,v 1.33 1997/07/06 22:38:22 ragge Exp $ */
/*
@@ -157,9 +157,10 @@ cpu_fork(p1, p2)
* user mode.
*/
void
-cpu_set_kpc(p, pc)
+cpu_set_kpc(p, pc, arg)
struct proc *p;
- void (*pc) __P((struct proc *));
+ void (*pc) __P((void *));
+ void *arg;
{
struct pcb *nyproc;
struct {
@@ -175,7 +176,7 @@ cpu_set_kpc(p, pc)
kc->cf.ca_maskpsw = 0x20000000;
kc->cf.ca_pc = (unsigned)&sret;
kc->cf.ca_argno = 1;
- kc->cf.ca_arg1 = (unsigned)p;
+ kc->cf.ca_arg1 = (unsigned)arg;
kc->tf.r11 = boothowto; /* If we have old init */
kc->tf.psl = 0x3c00000;
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 00bb7d0d476..35577b21656 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.33 1999/01/02 00:38:37 deraadt Exp $ */
+/* $OpenBSD: init_main.c,v 1.34 1999/01/10 13:34:17 niklas Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -126,9 +126,9 @@ struct timeval runtime;
/* XXX return int so gcc -Werror won't complain */
int main __P((void *));
void check_console __P((struct proc *));
-void start_init __P((struct proc *));
-void start_pagedaemon __P((struct proc *));
-void start_update __P((struct proc *));
+void start_init __P((void *));
+void start_pagedaemon __P((void *));
+void start_update __P((void *));
#ifdef cpu_set_init_frame
void *initframep; /* XXX should go away */
@@ -389,7 +389,7 @@ main(framep)
return 0;
}
#else
- cpu_set_kpc(pfind(1), start_init);
+ cpu_set_kpc(pfind(1), start_init, pfind(1));
#endif
/* Create process 2 (the pageout daemon). */
@@ -403,7 +403,7 @@ main(framep)
start_pagedaemon(curproc);
}
#else
- cpu_set_kpc(pfind(2), start_pagedaemon);
+ cpu_set_kpc(pfind(2), start_pagedaemon, pfind(2));
#endif
/* Create process 3 (the update daemon). */
@@ -417,7 +417,7 @@ main(framep)
start_update(curproc);
}
#else
- cpu_set_kpc(pfind(3), start_update);
+ cpu_set_kpc(pfind(3), start_update, pfind(3));
#endif
microtime(&rtv);
@@ -462,9 +462,10 @@ check_console(p)
* The program is invoked with one argument containing the boot flags.
*/
void
-start_init(p)
- struct proc *p;
+start_init(arg)
+ void *arg;
{
+ struct proc *p = arg;
vm_offset_t addr;
struct sys_execve_args /* {
syscallarg(char *) path;
@@ -577,9 +578,10 @@ start_init(p)
}
void
-start_pagedaemon(p)
- struct proc *p;
+start_pagedaemon(arg)
+ void *arg;
{
+ struct proc *p = arg;
/*
* Now in process 2.
@@ -591,9 +593,10 @@ start_pagedaemon(p)
}
void
-start_update(p)
- struct proc *p;
+start_update(arg)
+ void *arg;
{
+ struct proc *p = arg;
/*
* Now in process 3.
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index fd00a213668..d9308b689ff 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.24 1997/11/06 05:59:12 csapuntz Exp $ */
+/* $OpenBSD: systm.h,v 1.25 1999/01/10 13:34:16 niklas Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -232,7 +232,7 @@ void longjmp __P((label_t *));
void consinit __P((void));
void cpu_startup __P((void));
-void cpu_set_kpc __P((struct proc *, void (*)(struct proc *)));
+void cpu_set_kpc __P((struct proc *, void (*)(void *), void *));
#ifdef GPROF