From 71e43d14abe4c370188739098a9b5c6b43894c53 Mon Sep 17 00:00:00 2001 From: gwr Date: Wed, 26 Mar 1997 22:38:40 +0000 Subject: [PATCH] Move findroot/setroot stuff from configure() to cpu_rootconf(). --- sys/arch/alpha/alpha/autoconf.c | 11 +++++++---- sys/arch/amiga/amiga/autoconf.c | 21 ++++++++++---------- sys/arch/arm32/arm32/autoconf.c | 11 +++-------- sys/arch/atari/atari/autoconf.c | 18 +++++++++-------- sys/arch/hp300/hp300/autoconf.c | 30 ++++++++++++++++------------- sys/arch/i386/i386/autoconf.c | 20 +++++++++---------- sys/arch/mac68k/mac68k/autoconf.c | 12 ++++++++---- sys/arch/mvme68k/mvme68k/autoconf.c | 13 ++++++++----- sys/arch/ofppc/ofppc/autoconf.c | 19 ++++++++++-------- sys/arch/pc532/pc532/autoconf.c | 18 ++++++++--------- sys/arch/pica/pica/autoconf.c | 16 ++++++++------- sys/arch/pmax/pmax/autoconf.c | 18 ++++++++++------- sys/arch/powerpc/powerpc/autoconf.c | 19 ++++++++++-------- sys/arch/sparc/sparc/autoconf.c | 20 +++++++++---------- sys/arch/sun3/sun3/autoconf.c | 10 +++------- sys/arch/vax/vax/autoconf.c | 19 ++++++++++-------- sys/arch/x68k/x68k/autoconf.c | 19 +++++++++--------- sys/kern/init_main.c | 7 ++++++- sys/sys/systm.h | 4 +++- 19 files changed, 164 insertions(+), 141 deletions(-) diff --git a/sys/arch/alpha/alpha/autoconf.c b/sys/arch/alpha/alpha/autoconf.c index a2e2d921f5ad..c0f75972c84c 100644 --- a/sys/arch/alpha/alpha/autoconf.c +++ b/sys/arch/alpha/alpha/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.19 1997/02/03 19:46:55 cgd Exp $ */ +/* $NetBSD: autoconf.c,v 1.20 1997/03/26 22:38:47 gwr Exp $ */ /* * Copyright (c) 1992, 1993 @@ -89,14 +89,17 @@ configure() if (config_rootfound("mainbus", "mainbus") == NULL) panic("no mainbus found"); (void)spl0(); + cold = 0; +} + +void +cpu_rootconf() +{ if (booted_device == NULL) printf("WARNING: can't figure what device matches \"%s\"\n", boot_dev); setroot(booted_device, booted_partition, alpha_nam2blk); - swapconf(); - dumpconf(); - cold = 0; } void diff --git a/sys/arch/amiga/amiga/autoconf.c b/sys/arch/amiga/amiga/autoconf.c index 47d271722a01..603aee126d00 100644 --- a/sys/arch/amiga/amiga/autoconf.c +++ b/sys/arch/amiga/amiga/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.48 1997/03/15 02:59:43 mhitch Exp $ */ +/* $NetBSD: autoconf.c,v 1.49 1997/03/26 22:38:50 gwr Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -67,9 +67,8 @@ u_long boot_partition; void configure() { - struct device *booted_device; - int booted_partition; int s; + /* * this is the real thing baby (i.e. not console init) */ @@ -105,6 +104,14 @@ configure() #ifdef DEBUG_KERNEL_START printf("survived interrupt enable\n"); #endif + cold = 0; +} + +void +cpu_rootconf() +{ + struct device *booted_device; + int booted_partition; findroot(&booted_device, &booted_partition); #ifdef DEBUG_KERNEL_START @@ -114,14 +121,6 @@ configure() #ifdef DEBUG_KERNEL_START printf("survived setroot()\n"); #endif - swapconf(); - dumpconf(); - if (dumplo < 0) - dumplo = 0; -#ifdef DEBUG_KERNEL_START - printf("survived swap device search\n"); -#endif - cold = 0; } /*ARGSUSED*/ diff --git a/sys/arch/arm32/arm32/autoconf.c b/sys/arch/arm32/arm32/autoconf.c index 88fda6801303..f33ef0d52430 100644 --- a/sys/arch/arm32/arm32/autoconf.c +++ b/sys/arch/arm32/arm32/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.15 1997/02/23 04:09:53 mark Exp $ */ +/* $NetBSD: autoconf.c,v 1.16 1997/03/26 22:38:52 gwr Exp $ */ /* * Copyright (c) 1994-1997 Mark Brinicombe. @@ -150,12 +150,10 @@ set_root_device() /* - * Set up the root and swap device numbers, configure the swap space and - * dump space + * Set up the root and swap devices from the boot args */ - void -set_boot_devs() +cpu_rootconf() { set_root_device(); @@ -163,9 +161,6 @@ set_boot_devs() booted_device != NULL ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, arm32_nam2blk); - - swapconf(); - dumpconf(); } diff --git a/sys/arch/atari/atari/autoconf.c b/sys/arch/atari/atari/autoconf.c index d8a34d4111e0..90560e057023 100644 --- a/sys/arch/atari/atari/autoconf.c +++ b/sys/arch/atari/atari/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.19 1997/03/26 15:49:31 leo Exp $ */ +/* $NetBSD: autoconf.c,v 1.20 1997/03/26 22:38:56 gwr Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -65,8 +65,6 @@ struct devnametobdevmaj atari_nam2blk[] = { void configure() { - struct device *booted_device; - int booted_partition; extern int atari_realconfig; atari_realconfig = 1; @@ -74,13 +72,17 @@ configure() if (config_rootfound("mainbus", "mainbus") == NULL) panic("no mainbus found"); + cold = 0; +} + +void +cpu_rootconf() +{ + struct device *booted_device; + int booted_partition; + findroot(&booted_device, &booted_partition); setroot(booted_device, booted_partition, atari_nam2blk); - swapconf(); - dumpconf(); - if( dumplo < 0) - dumplo = 0; - cold = 0; } /*ARGSUSED*/ diff --git a/sys/arch/hp300/hp300/autoconf.c b/sys/arch/hp300/hp300/autoconf.c index 687fd5950851..091a145590c9 100644 --- a/sys/arch/hp300/hp300/autoconf.c +++ b/sys/arch/hp300/hp300/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.33 1997/02/05 20:56:29 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.34 1997/03/26 22:38:58 gwr Exp $ */ /* * Copyright (c) 1996 Jason R. Thorpe. All rights reserved. @@ -244,10 +244,6 @@ struct devnametobdevmaj hp300_nam2blk[] = { void configure() { - extern int (*mountroot) __P((void)); - struct dev_data *dd; - struct device *dv; - struct vfsops *vops; /* * Initialize the dev_data_lists. @@ -279,6 +275,21 @@ configure() isrprintlevels(); + cold = 0; +} + +/********************************************************************** + * Code to find and set the boot device + **********************************************************************/ + +void +cpu_rootconf() +{ + extern int (*mountroot) __P((void)); + struct dev_data *dd; + struct device *dv; + struct vfsops *vops; + /* * Find boot device. */ @@ -337,22 +348,15 @@ configure() boothowto |= RB_ASKNAME; setroot(dv, booted_partition, hp300_nam2blk); - swapconf(); - dumpconf(); /* - * Set bootdev based on how we mounted root. + * Set bootdev based on what we found as the root. * This is given to the boot program when we reboot. */ setbootdev(); - cold = 0; } -/********************************************************************** - * Code to find and set the boot device - **********************************************************************/ - /* * Register a device. We're passed the device and the arguments * used to attach it. This is used to find the boot device. diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c index 0972917d0ee5..983504ce96fc 100644 --- a/sys/arch/i386/i386/autoconf.c +++ b/sys/arch/i386/i386/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.23 1997/01/31 01:51:17 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.24 1997/03/26 22:39:01 gwr Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -84,8 +84,6 @@ struct devnametobdevmaj i386_nam2blk[] = { void configure() { - struct device *booted_device; - int booted_partition; startrtclock(); @@ -97,6 +95,14 @@ configure() (u_short)imask[IPL_TTY]); spl0(); + cold = 0; +} + +void +cpu_rootconf() +{ + struct device *booted_device; + int booted_partition; findroot(&booted_device, &booted_partition); @@ -104,14 +110,6 @@ configure() booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, i386_nam2blk); - - /* - * Configure swap area and related system - * parameter based on device(s) used. - */ - swapconf(); - dumpconf(); - cold = 0; } u_long bootdev = 0; /* should be dev_t, but not until 32 bits */ diff --git a/sys/arch/mac68k/mac68k/autoconf.c b/sys/arch/mac68k/mac68k/autoconf.c index 22031e4b418d..1766e6431562 100644 --- a/sys/arch/mac68k/mac68k/autoconf.c +++ b/sys/arch/mac68k/mac68k/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.40 1997/02/14 06:13:50 scottr Exp $ */ +/* $NetBSD: autoconf.c,v 1.41 1997/03/26 22:39:03 gwr Exp $ */ /* * Copyright (c) 1992, 1993 @@ -102,15 +102,19 @@ configure() if (config_rootfound("mainbus", "mainbus") == NULL) panic("No mainbus found!"); + cold = 0; +} + +void +cpu_rootconf() +{ + findbootdev(); printf("boot device: %s\n", booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, mac68k_nam2blk); - swapconf(); - dumpconf(); - cold = 0; } /* diff --git a/sys/arch/mvme68k/mvme68k/autoconf.c b/sys/arch/mvme68k/mvme68k/autoconf.c index fa5187285a17..5496ee0b79c2 100644 --- a/sys/arch/mvme68k/mvme68k/autoconf.c +++ b/sys/arch/mvme68k/mvme68k/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.14 1997/03/18 21:21:52 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.15 1997/03/26 22:39:05 gwr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -202,14 +202,17 @@ configure() if (config_rootfound("mainbus", NULL) == NULL) panic("autoconfig failed, no root"); + cold = 0; +} + +void +cpu_rootconf() +{ + printf("boot device: %s\n", (booted_device) ? booted_device->dv_xname : ""); setroot(booted_device, 0, mvme68k_nam2blk); - - swapconf(); - dumpconf(); - cold = 0; } /* diff --git a/sys/arch/ofppc/ofppc/autoconf.c b/sys/arch/ofppc/ofppc/autoconf.c index ed3695c628ee..cc3f05ede9e3 100644 --- a/sys/arch/ofppc/ofppc/autoconf.c +++ b/sys/arch/ofppc/ofppc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.2 1997/01/31 02:04:43 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.3 1997/03/26 22:39:14 gwr Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -63,20 +63,23 @@ configure() { ofrootfound(); (void)spl0(); + cold = 0; +} + +/* + * Setup root device. + * Configure swap area. + */ +void +cpu_rootconf() +{ - /* - * Setup root device. - * Configure swap area. - */ findroot(); printf("boot device: %s\n", booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, powerpc_nam2blk); - swapconf(); - dumpconf(); - cold = 0; } /* diff --git a/sys/arch/pc532/pc532/autoconf.c b/sys/arch/pc532/pc532/autoconf.c index f9e415629014..9e814f30bb8e 100644 --- a/sys/arch/pc532/pc532/autoconf.c +++ b/sys/arch/pc532/pc532/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.27 1997/03/20 12:00:30 matthias Exp $ */ +/* $NetBSD: autoconf.c,v 1.28 1997/03/26 22:39:07 gwr Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -79,7 +79,6 @@ configure() { extern int safepri; int i; - int booted_partition = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK; static const char *ipl_names[] = IPL_NAMES; splhigh(); @@ -96,17 +95,16 @@ configure() safepri = imask[IPL_ZERO]; spl0(); + cold = 0; +} + +void +cpu_rootconf() +{ + int booted_partition = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK; printf("boot device: %s\n", booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, pc532_nam2blk); - - /* - * Configure swap area and related system - * parameter based on device(s) used. - */ - swapconf(); - dumpconf(); - cold = 0; } diff --git a/sys/arch/pica/pica/autoconf.c b/sys/arch/pica/pica/autoconf.c index 15b95948ab9d..dc80eb54c766 100644 --- a/sys/arch/pica/pica/autoconf.c +++ b/sys/arch/pica/pica/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.6 1997/01/31 01:58:44 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.7 1997/03/26 22:39:09 gwr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -87,13 +87,19 @@ struct devnametobdevmaj pica_nam2blk[] = { */ configure() { - struct device *booted_device; - int booted_partition; (void)splhigh(); /* To be really shure.. */ if(config_rootfound("mainbus", "mainbus") == NULL) panic("no mainbus found"); (void)spl0(); + cold = 0; +} + +void +cpu_rootconf() +{ + struct device *booted_device; + int booted_partition; findroot(&booted_device, &booted_partition); @@ -101,10 +107,6 @@ configure() booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, pica_nam2blk); - - swapconf(); - dumpconf(); - cold = 0; } u_long bootdev; /* should be dev_t, but not until 32 bits */ diff --git a/sys/arch/pmax/pmax/autoconf.c b/sys/arch/pmax/pmax/autoconf.c index 8c58d7568e8a..2cc603272d62 100644 --- a/sys/arch/pmax/pmax/autoconf.c +++ b/sys/arch/pmax/pmax/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.20 1997/02/05 17:53:52 mhitch Exp $ */ +/* $NetBSD: autoconf.c,v 1.21 1997/03/26 22:39:12 gwr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -120,8 +120,7 @@ struct devnametobdevmaj pmax_nam2blk[] = { void configure() { - struct device *booted_device; - int booted_partition, s; + int s; /* * Set CPU type for new-style config. @@ -173,16 +172,21 @@ configure() printf("Beginning old-style SCSI device autoconfiguration\n"); configure_scsi(); + cold = 0; +} + +void +cpu_rootconf() +{ + struct device *booted_device; + int booted_partition; + findroot(&booted_device, &booted_partition); printf("boot device: %s\n", booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, pmax_nam2blk); - - swapconf(); - dumpconf(); - cold = 0; } u_long bootdev = 0; /* should be dev_t, but not until 32 bits */ diff --git a/sys/arch/powerpc/powerpc/autoconf.c b/sys/arch/powerpc/powerpc/autoconf.c index ed3695c628ee..cc3f05ede9e3 100644 --- a/sys/arch/powerpc/powerpc/autoconf.c +++ b/sys/arch/powerpc/powerpc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.2 1997/01/31 02:04:43 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.3 1997/03/26 22:39:14 gwr Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -63,20 +63,23 @@ configure() { ofrootfound(); (void)spl0(); + cold = 0; +} + +/* + * Setup root device. + * Configure swap area. + */ +void +cpu_rootconf() +{ - /* - * Setup root device. - * Configure swap area. - */ findroot(); printf("boot device: %s\n", booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, powerpc_nam2blk); - swapconf(); - dumpconf(); - cold = 0; } /* diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index af31ebee5ae4..33f2247fb2ef 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.68 1997/03/12 11:04:35 pk Exp $ */ +/* $NetBSD: autoconf.c,v 1.69 1997/03/26 22:39:17 gwr Exp $ */ /* * Copyright (c) 1996 @@ -784,9 +784,6 @@ configure() struct confargs oca; register int node = 0; register char *cp; - struct bootpath *bp; - struct device *bootdv; - int bootpartition; /* build the bootpath */ bootpath_build(); @@ -863,20 +860,21 @@ configure() #endif (void)spl0(); + cold = 0; +} - /* - * Configure swap area and related system - * parameter based on device(s) used. - */ +void +cpu_rootconf() +{ + struct bootpath *bp; + struct device *bootdv; + int bootpartition; bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1]; bootdv = bp == NULL ? NULL : bp->dev; bootpartition = bp == NULL ? 0 : bp->val[2]; setroot(bootdv, bootpartition, sparc_nam2blk); - swapconf(); - dumpconf(); - cold = 0; } /* diff --git a/sys/arch/sun3/sun3/autoconf.c b/sys/arch/sun3/sun3/autoconf.c index 7236de4ac1ca..6581a07cc953 100644 --- a/sys/arch/sun3/sun3/autoconf.c +++ b/sys/arch/sun3/sun3/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.45 1997/02/19 00:20:52 gwr Exp $ */ +/* $NetBSD: autoconf.c,v 1.46 1997/03/26 22:39:20 gwr Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -86,10 +86,6 @@ configure() */ printf("enabling interrupts\n"); (void)spl0(); - - rootconf(); - swapconf(); - dumpconf(); cold = 0; } @@ -211,8 +207,8 @@ static struct device * find_dev_byname __P((char *)); /* * Choose root and swap devices. */ -static void -rootconf() +void +cpu_rootconf() { MachMonBootParam *bp; struct prom_n2f *nf; diff --git a/sys/arch/vax/vax/autoconf.c b/sys/arch/vax/vax/autoconf.c index dc635d893074..da3f454190dd 100644 --- a/sys/arch/vax/vax/autoconf.c +++ b/sys/arch/vax/vax/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.25 1997/03/22 12:51:00 ragge Exp $ */ +/* $NetBSD: autoconf.c,v 1.26 1997/03/26 22:39:22 gwr Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -74,12 +74,20 @@ struct devnametobdevmaj vax_nam2blk[] = { void configure() { - struct device *booted_device = NULL; - int booted_partition = 0; if (config_rootfound("backplane", NULL) == NULL) panic("backplane not configured"); + cold = 0; + mtpr(GC_CCF, PR_TXDB); /* Clear cold start flag in cpu */ +} + +void +cpu_rootconf() +{ + struct device *booted_device = NULL; + int booted_partition = 0; + /* * The device we booted from are looked for during autoconfig. * There can only be one match. @@ -93,11 +101,6 @@ configure() booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, vax_nam2blk); - - swapconf(); - dumpconf(); - cold = 0; - mtpr(GC_CCF, PR_TXDB); /* Clear cold start flag in cpu */ } int printut __P((void *, const char *)); diff --git a/sys/arch/x68k/x68k/autoconf.c b/sys/arch/x68k/x68k/autoconf.c index e078c1c550fa..f79364ac8f31 100644 --- a/sys/arch/x68k/x68k/autoconf.c +++ b/sys/arch/x68k/x68k/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.9 1997/02/03 21:08:48 oki Exp $ */ +/* $NetBSD: autoconf.c,v 1.10 1997/03/26 22:39:25 gwr Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -62,8 +62,6 @@ struct devnametobdevmaj x68k_nam2blk[] = { void configure() { - struct device *booted_device; - int booted_partition; extern int x68k_realconfig; x68k_realconfig = 1; @@ -71,18 +69,21 @@ configure() if (config_rootfound("mainbus", "mainbus") == NULL) panic("no mainbus found"); + cold = 0; +} + +void +cpu_rootconf() +{ + struct device *booted_device; + int booted_partition; + findroot(&booted_device, &booted_partition); printf("boot device: %s\n", booted_device ? booted_device->dv_xname : ""); setroot(booted_device, booted_partition, x68k_nam2blk); - - swapconf(); - dumpconf(); - if (dumplo < 0) - dumplo = 0; - cold = 0; } /*ARGSUSED*/ diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ab0117dfab59..5b605202fb64 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.97 1997/02/02 02:55:06 thorpej Exp $ */ +/* $NetBSD: init_main.c,v 1.98 1997/03/26 22:38:45 gwr Exp $ */ /* * Copyright (c) 1995 Christopher G. Demetriou. All rights reserved. @@ -319,6 +319,11 @@ main(framep) roundrobin(NULL); schedcpu(NULL); + /* Determine the root/swap/dump devices, etc. */ + cpu_rootconf(); + swapconf(); + cpu_dumpconf(); + /* Mount the root file system. */ do { domountroothook(); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index db14497e0f91..d26a261877cf 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -1,4 +1,4 @@ -/* $NetBSD: systm.h,v 1.64 1997/01/31 03:04:31 thorpej Exp $ */ +/* $NetBSD: systm.h,v 1.65 1997/03/26 22:38:40 gwr Exp $ */ /*- * Copyright (c) 1982, 1988, 1991, 1993 @@ -261,6 +261,8 @@ void longjmp __P((label_t *)); void consinit __P((void)); void cpu_startup __P((void)); +void cpu_rootconf __P((void)); +void cpu_dumpconf __P((void)); void cpu_set_kpc __P((struct proc *, void (*)(struct proc *)));