Use ANSI function decls, static, and const.

This commit is contained in:
thorpej 2004-08-28 19:11:19 +00:00
parent a95e4d7c87
commit 3083c70ccc
13 changed files with 189 additions and 320 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.68 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: autoconf.c,v 1.69 2004/08/28 19:11:19 thorpej Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@ -143,7 +143,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.68 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.69 2004/08/28 19:11:19 thorpej Exp $");
#include "hil.h" #include "hil.h"
#include "dvbox.h" #include "dvbox.h"
@ -214,8 +214,9 @@ extern int hypercnattach(bus_space_tag_t, bus_addr_t, int);
extern int topcatcnattach(bus_space_tag_t, bus_addr_t, int); extern int topcatcnattach(bus_space_tag_t, bus_addr_t, int);
extern int dnkbdcnattach(bus_space_tag_t, bus_addr_t); extern int dnkbdcnattach(bus_space_tag_t, bus_addr_t);
int dio_scan(int (*func)(bus_space_tag_t, bus_addr_t, int)); static int dio_scan(int (*func)(bus_space_tag_t, bus_addr_t, int));
int dio_scode_probe(int, int (*func)(bus_space_tag_t, bus_addr_t, int)); static int dio_scode_probe(int,
int (*func)(bus_space_tag_t, bus_addr_t, int));
extern caddr_t internalhpib; extern caddr_t internalhpib;
extern char *extiobase; extern char *extiobase;
@ -278,29 +279,26 @@ struct dev_data {
int dd_punit; /* and punit... */ int dd_punit; /* and punit... */
}; };
typedef LIST_HEAD(, dev_data) ddlist_t; typedef LIST_HEAD(, dev_data) ddlist_t;
ddlist_t dev_data_list; /* all dev_datas */ static ddlist_t dev_data_list; /* all dev_datas */
ddlist_t dev_data_list_hpib; /* hpib controller dev_datas */ static ddlist_t dev_data_list_hpib; /* hpib controller dev_datas */
ddlist_t dev_data_list_scsi; /* scsi controller dev_datas */ static ddlist_t dev_data_list_scsi; /* scsi controller dev_datas */
void findbootdev __P((void)); static void findbootdev(void);
void findbootdev_slave __P((ddlist_t *, int, int, int)); static void findbootdev_slave(ddlist_t *, int, int, int);
void setbootdev __P((void)); static void setbootdev(void);
static struct dev_data *dev_data_lookup __P((struct device *)); static struct dev_data *dev_data_lookup(struct device *);
static void dev_data_insert __P((struct dev_data *, ddlist_t *)); static void dev_data_insert(struct dev_data *, ddlist_t *);
int mainbusmatch __P((struct device *, struct cfdata *, void *)); static int mainbusmatch(struct device *, struct cfdata *, void *);
void mainbusattach __P((struct device *, struct device *, void *)); static void mainbusattach(struct device *, struct device *, void *);
int mainbussearch __P((struct device *, struct cfdata *, void *)); static int mainbussearch(struct device *, struct cfdata *, void *);
CFATTACH_DECL(mainbus, sizeof(struct device), CFATTACH_DECL(mainbus, sizeof(struct device),
mainbusmatch, mainbusattach, NULL, NULL); mainbusmatch, mainbusattach, NULL, NULL);
int static int
mainbusmatch(parent, match, aux) mainbusmatch(struct device *parent, struct cfdata *match, void *aux)
struct device *parent;
struct cfdata *match;
void *aux;
{ {
static int mainbus_matched = 0; static int mainbus_matched = 0;
@ -312,10 +310,8 @@ mainbusmatch(parent, match, aux)
return (1); return (1);
} }
void static void
mainbusattach(parent, self, aux) mainbusattach(struct device *parent, struct device *self, void *aux)
struct device *parent, *self;
void *aux;
{ {
printf("\n"); printf("\n");
@ -324,11 +320,8 @@ mainbusattach(parent, self, aux)
config_search(mainbussearch, self, NULL); config_search(mainbussearch, self, NULL);
} }
int static int
mainbussearch(parent, cf, aux) mainbussearch(struct device *parent, struct cfdata *cf, void *aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{ {
if (config_match(parent, cf, NULL) > 0) if (config_match(parent, cf, NULL) > 0)
@ -340,7 +333,7 @@ mainbussearch(parent, cf, aux)
* Determine the device configuration for the running system. * Determine the device configuration for the running system.
*/ */
void void
cpu_configure() cpu_configure(void)
{ {
/* /*
@ -369,7 +362,7 @@ cpu_configure()
**********************************************************************/ **********************************************************************/
void void
cpu_rootconf() cpu_rootconf(void)
{ {
struct dev_data *dd; struct dev_data *dd;
struct device *dv; struct device *dv;
@ -447,9 +440,7 @@ cpu_rootconf()
* used to attach it. This is used to find the boot device. * used to attach it. This is used to find the boot device.
*/ */
void void
device_register(dev, aux) device_register(struct device *dev, void *aux)
struct device *dev;
void *aux;
{ {
struct dev_data *dd; struct dev_data *dd;
static int seen_netdevice = 0; static int seen_netdevice = 0;
@ -529,8 +520,8 @@ device_register(dev, aux)
} }
} }
void static void
findbootdev() findbootdev(void)
{ {
int type, ctlr, slave, punit, part; int type, ctlr, slave, punit, part;
int scsiboot, hpibboot, netboot; int scsiboot, hpibboot, netboot;
@ -626,10 +617,8 @@ findbootdev()
booted_partition = part; booted_partition = part;
} }
void static void
findbootdev_slave(ddlist, ctlr, slave, punit) findbootdev_slave(ddlist_t *ddlist, int ctlr, int slave, int punit)
ddlist_t *ddlist;
int ctlr, slave, punit;
{ {
struct dev_data *cdd, *dd; struct dev_data *cdd, *dd;
@ -670,8 +659,8 @@ findbootdev_slave(ddlist, ctlr, slave, punit)
} }
} }
void static void
setbootdev() setbootdev(void)
{ {
struct dev_data *cdd, *dd; struct dev_data *cdd, *dd;
int type, ctlr; int type, ctlr;
@ -758,8 +747,7 @@ setbootdev()
* Return the dev_data corresponding to the given device. * Return the dev_data corresponding to the given device.
*/ */
static struct dev_data * static struct dev_data *
dev_data_lookup(dev) dev_data_lookup(struct device *dev)
struct device *dev;
{ {
struct dev_data *dd; struct dev_data *dd;
@ -774,9 +762,7 @@ dev_data_lookup(dev)
* Insert a dev_data into the provided list, sorted by select code. * Insert a dev_data into the provided list, sorted by select code.
*/ */
static void static void
dev_data_insert(dd, ddlist) dev_data_insert(struct dev_data *dd, ddlist_t *ddlist)
struct dev_data *dd;
ddlist_t *ddlist;
{ {
struct dev_data *de; struct dev_data *de;
@ -821,7 +807,7 @@ dev_data_insert(dd, ddlist)
**********************************************************************/ **********************************************************************/
void void
hp300_cninit() hp300_cninit(void)
{ {
struct bus_space_tag tag; struct bus_space_tag tag;
bus_space_tag_t bst; bus_space_tag_t bst;
@ -905,9 +891,8 @@ find_kbd:
#endif /* NITE */ #endif /* NITE */
} }
int static int
dio_scan(func) dio_scan(int (*func)(bus_space_tag_t, bus_addr_t, int))
int (*func)(bus_space_tag_t, bus_addr_t, int);
{ {
#ifndef CONSCODE #ifndef CONSCODE
int scode, sctop; int scode, sctop;
@ -927,10 +912,9 @@ dio_scan(func)
return (1); return (1);
} }
int static int
dio_scode_probe(scode, func) dio_scode_probe(int scode,
int scode; int (*func)(bus_space_tag_t, bus_addr_t, int))
int (*func)(bus_space_tag_t, bus_addr_t, int);
{ {
struct bus_space_tag tag; struct bus_space_tag tag;
bus_space_tag_t bst; bus_space_tag_t bst;
@ -976,9 +960,7 @@ iomap_init(void)
* space mapping the indicated physical address range [pa - pa+size) * space mapping the indicated physical address range [pa - pa+size)
*/ */
caddr_t caddr_t
iomap(pa, size) iomap(caddr_t pa, int size)
caddr_t pa;
int size;
{ {
u_long kva; u_long kva;
int error; int error;
@ -1002,9 +984,7 @@ iomap(pa, size)
* Unmap a previously mapped device. * Unmap a previously mapped device.
*/ */
void void
iounmap(kva, size) iounmap(caddr_t kva, int size)
caddr_t kva;
int size;
{ {
#ifdef DEBUG #ifdef DEBUG

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus_space.c,v 1.9 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: bus_space.c,v 1.10 2004/08/28 19:11:19 thorpej Exp $ */
/*- /*-
* Copyright (c) 1998 The NetBSD Foundation, Inc. * Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.9 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.10 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -57,12 +57,8 @@ extern int *nofault;
/* ARGSUSED */ /* ARGSUSED */
int int
bus_space_map(t, bpa, size, flags, bshp) bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags,
bus_space_tag_t t; bus_space_handle_t *bshp)
bus_addr_t bpa;
bus_size_t size;
int flags;
bus_space_handle_t *bshp;
{ {
vaddr_t kva; vaddr_t kva;
vsize_t offset; vsize_t offset;
@ -105,14 +101,9 @@ bus_space_map(t, bpa, size, flags, bshp)
/* ARGSUSED */ /* ARGSUSED */
int int
bus_space_alloc(t, rstart, rend, size, alignment, boundary, flags, bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend,
bpap, bshp) bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags,
bus_space_tag_t t; bus_addr_t *bpap, bus_space_handle_t *bshp)
bus_addr_t rstart, rend;
bus_size_t size, alignment, boundary;
int flags;
bus_addr_t *bpap;
bus_space_handle_t *bshp;
{ {
/* /*
@ -123,10 +114,7 @@ bus_space_alloc(t, rstart, rend, size, alignment, boundary, flags,
/* ARGSUSED */ /* ARGSUSED */
void void
bus_space_free(t, bsh, size) bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
bus_space_tag_t t;
bus_space_handle_t bsh;
bus_size_t size;
{ {
/* /*
@ -136,10 +124,7 @@ bus_space_free(t, bsh, size)
} }
void void
bus_space_unmap(t, bsh, size) bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
bus_space_tag_t t;
bus_space_handle_t bsh;
bus_size_t size;
{ {
vaddr_t kva; vaddr_t kva;
vsize_t offset; vsize_t offset;
@ -181,11 +166,8 @@ bus_space_unmap(t, bsh, size)
/* ARGSUSED */ /* ARGSUSED */
int int
bus_space_subregion(t, bsh, offset, size, nbshp) bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
bus_space_tag_t t; bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp)
bus_space_handle_t bsh;
bus_size_t offset, size;
bus_space_handle_t *nbshp;
{ {
*nbshp = bsh + offset; *nbshp = bsh + offset;
@ -194,11 +176,8 @@ bus_space_subregion(t, bsh, offset, size, nbshp)
/* ARGSUSED */ /* ARGSUSED */
int int
hp300_bus_space_probe(t, bsh, offset, sz) hp300_bus_space_probe(bus_space_tag_t t, bus_space_handle_t bsh,
bus_space_tag_t t; bus_size_t offset, int sz)
bus_space_handle_t bsh;
bus_size_t offset;
int sz;
{ {
label_t faultbuf; label_t faultbuf;
int i; int i;

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.30 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: clock.c,v 1.31 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1990, 1993 * Copyright (c) 1982, 1990, 1993
@ -85,7 +85,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.31 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -103,11 +103,11 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30 2003/11/17 14:37:59 tsutsui Exp $");
#include <sys/gmon.h> #include <sys/gmon.h>
#endif #endif
void statintr __P((struct clockframe *)); void statintr(struct clockframe *);
static todr_chip_handle_t todr_handle; static todr_chip_handle_t todr_handle;
int clkstd[1]; static int clkstd[1];
static int clkint; /* clock interval, as loaded */ static int clkint; /* clock interval, as loaded */
/* /*
* Statistics clock interval and variance, in usec. Variance must be a * Statistics clock interval and variance, in usec. Variance must be a
@ -132,7 +132,6 @@ todr_attach(todr_chip_handle_t handle)
todr_handle = handle; todr_handle = handle;
} }
/* /*
* Machine-dependent clock routines. * Machine-dependent clock routines.
* *
@ -151,7 +150,7 @@ todr_attach(todr_chip_handle_t handle)
* mvme68k delay calibration algorithm. * mvme68k delay calibration algorithm.
*/ */
void void
hp300_calibrate_delay() hp300_calibrate_delay(void)
{ {
extern int delay_divisor; extern int delay_divisor;
volatile struct clkreg *clk; volatile struct clkreg *clk;
@ -231,7 +230,7 @@ hp300_calibrate_delay()
* no alternative timer is available. * no alternative timer is available.
*/ */
void void
cpu_initclocks() cpu_initclocks(void)
{ {
volatile struct clkreg *clk; volatile struct clkreg *clk;
int intvl, statint, profint, minint; int intvl, statint, profint, minint;
@ -303,8 +302,7 @@ cpu_initclocks()
* but that would be a drag. * but that would be a drag.
*/ */
void void
setstatclockrate(newhz) setstatclockrate(int newhz)
int newhz;
{ {
if (newhz == stathz) if (newhz == stathz)
@ -320,8 +318,7 @@ setstatclockrate(newhz)
* DO THIS INLINE IN locore.s? * DO THIS INLINE IN locore.s?
*/ */
void void
statintr(fp) statintr(struct clockframe *fp)
struct clockframe *fp;
{ {
volatile struct clkreg *clk; volatile struct clkreg *clk;
int newint, r, var; int newint, r, var;
@ -352,8 +349,7 @@ statintr(fp)
* Return the best possible estimate of the current time. * Return the best possible estimate of the current time.
*/ */
void void
microtime(tvp) microtime(struct timeval *tvp)
struct timeval *tvp;
{ {
volatile struct clkreg *clk; volatile struct clkreg *clk;
int s, u, t, u2, s2; int s, u, t, u2, s2;
@ -392,8 +388,7 @@ microtime(tvp)
* from a filesystem. * from a filesystem.
*/ */
void void
inittodr(base) inittodr(time_t base)
time_t base;
{ {
int badbase = 0, waszero = (base == 0); int badbase = 0, waszero = (base == 0);
@ -440,7 +435,7 @@ inittodr(base)
* when crashing during autoconfig. * when crashing during autoconfig.
*/ */
void void
resettodr() resettodr(void)
{ {
if (time.tv_sec == 0) if (time.tv_sec == 0)
return; return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.19 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: disksubr.c,v 1.20 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1988, 1993 * Copyright (c) 1982, 1986, 1988, 1993
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.19 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.20 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -56,11 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.19 2003/11/17 14:37:59 tsutsui Exp $"
* string on failure. * string on failure.
*/ */
const char * const char *
readdisklabel(dev, strat, lp, osdep) readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
dev_t dev; struct cpu_disklabel *osdep)
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
{ {
struct buf *bp; struct buf *bp;
struct disklabel *dlp; struct disklabel *dlp;
@ -106,10 +103,8 @@ readdisklabel(dev, strat, lp, osdep)
* Check new disk label for sensibility before setting it. * Check new disk label for sensibility before setting it.
*/ */
int int
setdisklabel(olp, nlp, openmask, osdep) setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
struct disklabel *olp, *nlp; struct cpu_disklabel *osdep)
u_long openmask;
struct cpu_disklabel *osdep;
{ {
int i; int i;
struct partition *opp, *npp; struct partition *opp, *npp;
@ -147,11 +142,8 @@ setdisklabel(olp, nlp, openmask, osdep)
* Write disk label back to device after modification. * Write disk label back to device after modification.
*/ */
int int
writedisklabel(dev, strat, lp, osdep) writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
dev_t dev; struct cpu_disklabel *osdep)
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
{ {
struct buf *bp; struct buf *bp;
struct disklabel *dlp; struct disklabel *dlp;
@ -198,10 +190,7 @@ done:
* if needed, and signal errors or early completion. * if needed, and signal errors or early completion.
*/ */
int int
bounds_check_with_label(dk, bp, wlabel) bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
struct disk *dk;
struct buf *bp;
int wlabel;
{ {
struct disklabel *lp = dk->dk_label; struct disklabel *lp = dk->dk_label;
struct partition *p = &lp->d_partitions[DISKPART(bp->b_dev)]; struct partition *p = &lp->d_partitions[DISKPART(bp->b_dev)];

View File

@ -1,4 +1,4 @@
/* $NetBSD: dkbad.c,v 1.8 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: dkbad.c,v 1.9 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1990, 1993 * Copyright (c) 1982, 1986, 1990, 1993
@ -32,15 +32,13 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dkbad.c,v 1.8 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: dkbad.c,v 1.9 2004/08/28 19:11:19 thorpej Exp $");
#ifndef NOBADSECT #ifndef NOBADSECT
#include <sys/param.h> #include <sys/param.h>
#include <sys/buf.h> #include <sys/buf.h>
#include <sys/dkbad.h> #include <sys/dkbad.h>
int isbad __P((struct dkbad *, int, int, int));
/* /*
* Search the bad sector table looking for * Search the bad sector table looking for
* the specified sector. Return index if found. * the specified sector. Return index if found.
@ -48,9 +46,7 @@ int isbad __P((struct dkbad *, int, int, int));
*/ */
int int
isbad(bt, cyl, trk, sec) isbad(struct dkbad *bt, int cyl, int trk, int sec)
struct dkbad *bt;
int cyl, trk, sec;
{ {
int i; int i;
long blk, bblk; long blk, bblk;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_machdep.c,v 1.40 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: hpux_machdep.c,v 1.41 2004/08/28 19:11:19 thorpej Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -107,7 +107,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpux_machdep.c,v 1.40 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: hpux_machdep.c,v 1.41 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -175,7 +175,7 @@ static const char context_fpu[] =
static const char context_nofpu[] = static const char context_nofpu[] =
"standalone HP-MC68020 HP-MC68010 localroot default"; "standalone HP-MC68020 HP-MC68010 localroot default";
static struct valtostr context_table[] = { static const struct valtostr context_table[] = {
{ FPU_68060, &context_040[0] }, { FPU_68060, &context_040[0] },
{ FPU_68040, &context_040[0] }, { FPU_68040, &context_040[0] },
{ FPU_68882, &context_fpu[0] }, { FPU_68882, &context_fpu[0] },
@ -197,9 +197,7 @@ struct bsdfp {
* m68k-specific setup for HP-UX executables. * m68k-specific setup for HP-UX executables.
*/ */
int int
hpux_cpu_makecmds(p, epp) hpux_cpu_makecmds(struct proc *p, struct exec_package *epp)
struct proc *p;
struct exec_package *epp;
{ {
/* struct hpux_exec *hpux_ep = epp->ep_hdr; */ /* struct hpux_exec *hpux_ep = epp->ep_hdr; */
@ -218,9 +216,7 @@ hpux_cpu_makecmds(p, epp)
* in ev->ev_len. * in ev->ev_len.
*/ */
int int
hpux_cpu_vmcmd(p, ev) hpux_cpu_vmcmd(struct proc *p, struct exec_vmcmd *ev)
struct proc *p;
struct exec_vmcmd *ev;
{ {
struct hpux_exec *execp = (struct hpux_exec *)ev->ev_addr; struct hpux_exec *execp = (struct hpux_exec *)ev->ev_addr;
@ -247,7 +243,7 @@ hpux_cpu_vmcmd(p, ev)
* Return arch-type for hpux_sys_sysconf() * Return arch-type for hpux_sys_sysconf()
*/ */
int int
hpux_cpu_sysconf_arch() hpux_cpu_sysconf_arch(void)
{ {
switch (cputype) { switch (cputype) {
@ -267,10 +263,7 @@ hpux_cpu_sysconf_arch()
* HP-UX advise(2) system call. * HP-UX advise(2) system call.
*/ */
int int
hpux_sys_advise(l, v, retval) hpux_sys_advise(struct lwp *l, void *v, register_t *retval)
struct lwp *l;
void *v;
register_t *retval;
{ {
struct hpux_sys_advise_args *uap = v; struct hpux_sys_advise_args *uap = v;
int error = 0; int error = 0;
@ -301,10 +294,7 @@ hpux_sys_advise(l, v, retval)
* Man page lies, behaviour here is based on observed behaviour. * Man page lies, behaviour here is based on observed behaviour.
*/ */
int int
hpux_sys_getcontext(lp, v, retval) hpux_sys_getcontext(struct lwp *lp, void *v, register_t *retval)
struct lwp *lp;
void *v;
register_t *retval;
{ {
struct hpux_sys_getcontext_args *uap = v; struct hpux_sys_getcontext_args *uap = v;
const char *str; const char *str;
@ -339,9 +329,7 @@ hpux_sys_getcontext(lp, v, retval)
* XXX This probably doesn't work anymore, BTW. --thorpej * XXX This probably doesn't work anymore, BTW. --thorpej
*/ */
int int
hpux_to_bsd_uoff(off, isps, l) hpux_to_bsd_uoff(int *off, int *isps, struct lwp *l)
int *off, *isps;
struct lwp *l;
{ {
int *ar0 = l->l_md.md_regs; int *ar0 = l->l_md.md_regs;
struct hpux_fp *hp; struct hpux_fp *hp;
@ -592,10 +580,7 @@ hpux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
*/ */
/* ARGSUSED */ /* ARGSUSED */
int int
hpux_sys_sigreturn(l, v, retval) hpux_sys_sigreturn(struct lwp *l, void *v, register_t *retval)
struct lwp *l;
void *v;
register_t *retval;
{ {
struct hpux_sys_sigreturn_args /* { struct hpux_sys_sigreturn_args /* {
syscallarg(struct hpuxsigcontext *) sigcntxp; syscallarg(struct hpuxsigcontext *) sigcntxp;
@ -736,10 +721,7 @@ hpux_sys_sigreturn(l, v, retval)
* Set registers on exec. * Set registers on exec.
*/ */
void void
hpux_setregs(l, pack, stack) hpux_setregs(struct lwp *l, struct exec_package *pack, u_long stack)
struct lwp *l;
struct exec_package *pack;
u_long stack;
{ {
struct frame *frame; struct frame *frame;

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.24 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: intr.c,v 1.25 2004/08/28 19:11:19 thorpej Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.24 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.25 2004/08/28 19:11:19 thorpej Exp $");
#define _HP300_INTR_H_PRIVATE #define _HP300_INTR_H_PRIVATE
@ -78,11 +78,11 @@ static const char *hp300_intr_names[NISR] = {
u_short hp300_ipls[HP300_NIPLS]; u_short hp300_ipls[HP300_NIPLS];
void intr_computeipl __P((void)); void intr_computeipl(void);
void netintr __P((void)); void netintr(void);
void void
intr_init() intr_init(void)
{ {
struct hp300_intr *hi; struct hp300_intr *hi;
int i; int i;
@ -110,7 +110,7 @@ intr_init()
* calls. This doesn't have to be fast. * calls. This doesn't have to be fast.
*/ */
void void
intr_computeipl() intr_computeipl(void)
{ {
struct hp300_intrhand *ih; struct hp300_intrhand *ih;
int ipl; int ipl;
@ -170,7 +170,7 @@ intr_computeipl()
} }
void void
intr_printlevels() intr_printlevels(void)
{ {
#ifdef DEBUG #ifdef DEBUG
@ -190,11 +190,7 @@ intr_printlevels()
* Called by driver attach functions. * Called by driver attach functions.
*/ */
void * void *
intr_establish(func, arg, ipl, priority) intr_establish(int (*func)(void *), void *arg, int ipl, int priority)
int (*func) __P((void *));
void *arg;
int ipl;
int priority;
{ {
struct hp300_intrhand *newih, *curih; struct hp300_intrhand *newih, *curih;
@ -263,8 +259,7 @@ intr_establish(func, arg, ipl, priority)
* Disestablish an interrupt handler. * Disestablish an interrupt handler.
*/ */
void void
intr_disestablish(arg) intr_disestablish(void *arg)
void *arg;
{ {
struct hp300_intrhand *ih = arg; struct hp300_intrhand *ih = arg;
@ -278,8 +273,7 @@ intr_disestablish(arg)
* assembly language interrupt routine. * assembly language interrupt routine.
*/ */
void void
intr_dispatch(evec) intr_dispatch(int evec /* format | vector offset */)
int evec; /* format | vector offset */
{ {
struct hp300_intrhand *ih; struct hp300_intrhand *ih;
struct hp300_intr *list; struct hp300_intr *list;
@ -317,7 +311,7 @@ intr_dispatch(evec)
} }
void void
netintr() netintr(void)
{ {
int s, isr; int s, isr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: leds.c,v 1.13 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: leds.c,v 1.14 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1990, 1993 * Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: leds.c,v 1.13 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: leds.c,v 1.14 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
@ -93,7 +93,7 @@ static volatile u_int8_t currentleds; /* current LED status */
* Map the LED page and setup the KVA to access it. * Map the LED page and setup the KVA to access it.
*/ */
void void
ledinit() ledinit(void)
{ {
pmap_enter(pmap_kernel(), (vaddr_t)ledbase, (paddr_t)LED_ADDR, pmap_enter(pmap_kernel(), (vaddr_t)ledbase, (paddr_t)LED_ADDR,
@ -112,8 +112,7 @@ ledinit()
* would like to be able to profile this routine. * would like to be able to profile this routine.
*/ */
void void
ledcontrol(ons, offs, togs) ledcontrol(int ons, int offs, int togs)
int ons, offs, togs;
{ {
__asm __volatile ( __asm __volatile (

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.179 2004/03/24 15:34:48 atatat Exp $ */ /* $NetBSD: machdep.c,v 1.180 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1990, 1993 * Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.179 2004/03/24 15:34:48 atatat Exp $"); __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.180 2004/08/28 19:11:19 thorpej Exp $");
#include "opt_ddb.h" #include "opt_ddb.h"
#include "opt_compat_hpux.h" #include "opt_compat_hpux.h"
@ -188,26 +188,26 @@ extern struct emul emul_hpux;
#endif #endif
/* prototypes for local functions */ /* prototypes for local functions */
void parityenable __P((void)); static void parityenable(void);
int parityerror __P((struct frame *)); static int parityerror(struct frame *);
int parityerrorfind __P((void)); static int parityerrorfind(void);
void identifycpu __P((void)); static void identifycpu(void);
void initcpu __P((void)); static void initcpu(void);
int cpu_dumpsize __P((void)); static int cpu_dumpsize(void);
int cpu_dump __P((int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *)); static int cpu_dump(int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *);
void cpu_init_kcore_hdr __P((void)); static void cpu_init_kcore_hdr(void);
/* functions called from locore.s */ /* functions called from locore.s */
void dumpsys __P((void)); void dumpsys(void);
void hp300_init __P((void)); void hp300_init(void);
void straytrap __P((int, u_short)); void straytrap(int, u_short);
void nmihand __P((struct frame)); void nmihand(struct frame);
/* /*
* Machine-dependent crash dump header info. * Machine-dependent crash dump header info.
*/ */
cpu_kcore_hdr_t cpu_kcore_hdr; static cpu_kcore_hdr_t cpu_kcore_hdr;
/* /*
* Note that the value of delay_divisor is roughly * Note that the value of delay_divisor is roughly
@ -222,7 +222,7 @@ int delay_divisor; /* delay constant */
* Early initialization, before main() is called. * Early initialization, before main() is called.
*/ */
void void
hp300_init() hp300_init(void)
{ {
struct btinfo_magic *bt_mag; struct btinfo_magic *bt_mag;
int i; int i;
@ -278,7 +278,7 @@ hp300_init()
* to choose and initialize a console. * to choose and initialize a console.
*/ */
void void
consinit() consinit(void)
{ {
/* /*
@ -318,7 +318,7 @@ consinit()
* initialize CPU * initialize CPU
*/ */
void void
cpu_startup() cpu_startup(void)
{ {
extern char *etext; extern char *etext;
vaddr_t minaddr, maxaddr; vaddr_t minaddr, maxaddr;
@ -406,10 +406,7 @@ cpu_startup()
* Set registers on exec. * Set registers on exec.
*/ */
void void
setregs(l, pack, stack) setregs(struct lwp *l, struct exec_package *pack, u_long stack)
struct lwp *l;
struct exec_package *pack;
u_long stack;
{ {
struct frame *frame = (struct frame *)l->l_md.md_regs; struct frame *frame = (struct frame *)l->l_md.md_regs;
@ -441,7 +438,7 @@ setregs(l, pack, stack)
/* /*
* Info for CTL_HW * Info for CTL_HW
*/ */
char cpu_model[120]; char cpu_model[120];
struct hp300_model { struct hp300_model {
int id; int id;
@ -450,7 +447,7 @@ struct hp300_model {
const char *speed; const char *speed;
}; };
const struct hp300_model hp300_models[] = { static const struct hp300_model hp300_models[] = {
{ HP_320, -1, "320", "16.67" }, { HP_320, -1, "320", "16.67" },
{ HP_330, -1, "318/319/330", "16.67" }, { HP_330, -1, "318/319/330", "16.67" },
{ HP_340, -1, "340", "16.67" }, { HP_340, -1, "340", "16.67" },
@ -472,8 +469,8 @@ const struct hp300_model hp300_models[] = {
{ 0, -1, NULL, NULL }, { 0, -1, NULL, NULL },
}; };
void static void
identifycpu() identifycpu(void)
{ {
const char *t, *mc, *s; const char *t, *mc, *s;
int i, len; int i, len;
@ -661,9 +658,7 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysctl machdep subtree setup")
int waittime = -1; int waittime = -1;
void void
cpu_reboot(howto, bootstr) cpu_reboot(int howto, char *bootstr)
int howto;
char *bootstr;
{ {
#if __GNUC__ /* XXX work around lame compiler problem (gcc 2.7.2) */ #if __GNUC__ /* XXX work around lame compiler problem (gcc 2.7.2) */
@ -724,8 +719,8 @@ cpu_reboot(howto, bootstr)
/* /*
* Initialize the kernel crash dump header. * Initialize the kernel crash dump header.
*/ */
void static void
cpu_init_kcore_hdr() cpu_init_kcore_hdr(void)
{ {
cpu_kcore_hdr_t *h = &cpu_kcore_hdr; cpu_kcore_hdr_t *h = &cpu_kcore_hdr;
struct m68k_kcore_hdr *m = &h->un._m68k; struct m68k_kcore_hdr *m = &h->un._m68k;
@ -786,8 +781,8 @@ cpu_init_kcore_hdr()
* Compute the size of the machine-dependent crash dump header. * Compute the size of the machine-dependent crash dump header.
* Returns size in disk blocks. * Returns size in disk blocks.
*/ */
int static int
cpu_dumpsize() cpu_dumpsize(void)
{ {
int size; int size;
@ -798,10 +793,8 @@ cpu_dumpsize()
/* /*
* Called by dumpsys() to dump the machine-dependent header. * Called by dumpsys() to dump the machine-dependent header.
*/ */
int static int
cpu_dump(dump, blknop) cpu_dump(int (*dump)(dev_t, daddr_t, caddr_t, size_t), daddr_t *blknop)
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
daddr_t *blknop;
{ {
int buf[dbtob(1) / sizeof(int)]; int buf[dbtob(1) / sizeof(int)];
cpu_kcore_hdr_t *chdr; cpu_kcore_hdr_t *chdr;
@ -837,7 +830,7 @@ long dumplo = 0; /* blocks */
* reduce the chance that swapping trashes it. * reduce the chance that swapping trashes it.
*/ */
void void
cpu_dumpconf() cpu_dumpconf(void)
{ {
const struct bdevsw *bdev; const struct bdevsw *bdev;
int chdrsize; /* size of dump header */ int chdrsize; /* size of dump header */
@ -875,12 +868,12 @@ cpu_dumpconf()
* Dump physical memory onto the dump device. Called by cpu_reboot(). * Dump physical memory onto the dump device. Called by cpu_reboot().
*/ */
void void
dumpsys() dumpsys(void)
{ {
const struct bdevsw *bdev; const struct bdevsw *bdev;
daddr_t blkno; /* current block to write */ daddr_t blkno; /* current block to write */
/* dump routine */ /* dump routine */
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t)); int (*dump)(dev_t, daddr_t, caddr_t, size_t);
int pg; /* page being dumped */ int pg; /* page being dumped */
paddr_t maddr; /* PA being dumped */ paddr_t maddr; /* PA being dumped */
int error; /* error code from (*dump)() */ int error; /* error code from (*dump)() */
@ -964,8 +957,8 @@ dumpsys()
printf("succeeded\n"); printf("succeeded\n");
} }
void static void
initcpu() initcpu(void)
{ {
#ifdef MAPPEDCOPY #ifdef MAPPEDCOPY
@ -986,9 +979,7 @@ initcpu()
} }
void void
straytrap(pc, evec) straytrap(int pc, u_short evec)
int pc;
u_short evec;
{ {
printf("unexpected trap (vector offset %x) from %x\n", printf("unexpected trap (vector offset %x) from %x\n",
evec & 0xFFF, pc); evec & 0xFFF, pc);
@ -999,8 +990,7 @@ straytrap(pc, evec)
int *nofault; int *nofault;
int int
badaddr(addr) badaddr(caddr_t addr)
caddr_t addr;
{ {
int i; int i;
label_t faultbuf; label_t faultbuf;
@ -1016,8 +1006,7 @@ badaddr(addr)
} }
int int
badbaddr(addr) badbaddr(caddr_t addr)
caddr_t addr;
{ {
int i; int i;
label_t faultbuf; label_t faultbuf;
@ -1038,8 +1027,7 @@ badbaddr(addr)
* Look up information in bootinfo from boot loader. * Look up information in bootinfo from boot loader.
*/ */
void * void *
lookup_bootinfo(type) lookup_bootinfo(int type)
int type;
{ {
struct btinfo_common *bt; struct btinfo_common *bt;
char *help = (char *)bootinfo_va; char *help = (char *)bootinfo_va;
@ -1066,15 +1054,14 @@ lookup_bootinfo(type)
int panicbutton = 1; /* non-zero if panic buttons are enabled */ int panicbutton = 1; /* non-zero if panic buttons are enabled */
int candbdiv = 2; /* give em half a second (hz / candbdiv) */ int candbdiv = 2; /* give em half a second (hz / candbdiv) */
void candbtimer __P((void *)); static void candbtimer(void *);
int crashandburn; int crashandburn;
struct callout candbtimer_ch = CALLOUT_INITIALIZER; struct callout candbtimer_ch = CALLOUT_INITIALIZER;
void void
candbtimer(arg) candbtimer(void *arg)
void *arg;
{ {
crashandburn = 0; crashandburn = 0;
@ -1087,8 +1074,7 @@ static int innmihand; /* simple mutex */
* Level 7 interrupts can be caused by the keyboard or parity errors. * Level 7 interrupts can be caused by the keyboard or parity errors.
*/ */
void void
nmihand(frame) nmihand(struct frame frame)
struct frame frame;
{ {
/* Prevent unwanted recursion. */ /* Prevent unwanted recursion. */
@ -1159,8 +1145,8 @@ int ignorekperr = 0; /* ignore kernel parity errors */
/* /*
* Enable parity detection * Enable parity detection
*/ */
void static void
parityenable() parityenable(void)
{ {
label_t faultbuf; label_t faultbuf;
@ -1179,9 +1165,8 @@ parityenable()
* Determine if level 7 interrupt was caused by a parity error * Determine if level 7 interrupt was caused by a parity error
* and deal with it if it was. Returns 1 if it was a parity error. * and deal with it if it was. Returns 1 if it was a parity error.
*/ */
int static int
parityerror(fp) parityerror(struct frame *fp)
struct frame *fp;
{ {
if (!gotparmem) if (!gotparmem)
return(0); return(0);
@ -1214,8 +1199,8 @@ parityerror(fp)
* Yuk! There has got to be a better way to do this! * Yuk! There has got to be a better way to do this!
* Searching all of memory with interrupts blocked can lead to disaster. * Searching all of memory with interrupts blocked can lead to disaster.
*/ */
int static int
parityerrorfind() parityerrorfind(void)
{ {
static label_t parcatch; static label_t parcatch;
static int looking = 0; static int looking = 0;
@ -1288,9 +1273,7 @@ done:
* done on little-endian machines... -- cgd * done on little-endian machines... -- cgd
*/ */
int int
cpu_exec_aout_makecmds(p, epp) cpu_exec_aout_makecmds(struct proc *p, struct exec_package *epp)
struct proc *p;
struct exec_package *epp;
{ {
#if defined(COMPAT_NOMID) || defined(COMPAT_44) #if defined(COMPAT_NOMID) || defined(COMPAT_44)
u_long midmag, magic; u_long midmag, magic;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.40 2003/08/07 16:27:38 agc Exp $ */ /* $NetBSD: mem.c,v 1.41 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1990, 1993 * Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.40 2003/08/07 16:27:38 agc Exp $"); __KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.41 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -95,9 +95,9 @@ extern u_int lowram;
extern char *extiobase; extern char *extiobase;
static caddr_t devzeropage; static caddr_t devzeropage;
dev_type_read(mmrw); static dev_type_read(mmrw);
dev_type_ioctl(mmioctl); dev_type_ioctl(mmioctl);
dev_type_mmap(mmmmap); static dev_type_mmap(mmmmap);
const struct cdevsw mem_cdevsw = { const struct cdevsw mem_cdevsw = {
nullopen, nullclose, mmrw, mmrw, mmioctl, nullopen, nullclose, mmrw, mmrw, mmioctl,
@ -105,11 +105,8 @@ const struct cdevsw mem_cdevsw = {
}; };
/*ARGSUSED*/ /*ARGSUSED*/
int static int
mmrw(dev, uio, flags) mmrw(dev_t dev, struct uio *uio, int flags)
dev_t dev;
struct uio *uio;
int flags;
{ {
vaddr_t o, v; vaddr_t o, v;
int c; int c;
@ -226,11 +223,8 @@ unlock:
return (error); return (error);
} }
paddr_t static paddr_t
mmmmap(dev, off, prot) mmmmap(dev_t dev, off_t off, int prot)
dev_t dev;
off_t off;
int prot;
{ {
/* /*
* /dev/mem is the only one that makes sense through this * /dev/mem is the only one that makes sense through this

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.24 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: pmap_bootstrap.c,v 1.25 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.24 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.25 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/proc.h> #include <sys/proc.h>
@ -97,9 +97,7 @@ extern caddr_t msgbufaddr;
* XXX a PIC compiler would make this much easier. * XXX a PIC compiler would make this much easier.
*/ */
void void
pmap_bootstrap(nextpa, firstpa) pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
paddr_t nextpa;
paddr_t firstpa;
{ {
paddr_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa; paddr_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa;
u_int nptpages, kstsize; u_int nptpages, kstsize;

View File

@ -1,4 +1,4 @@
/* $NetBSD: softintr.c,v 1.4 2003/11/17 14:37:59 tsutsui Exp $ */ /* $NetBSD: softintr.c,v 1.5 2004/08/28 19:11:19 thorpej Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.4 2003/11/17 14:37:59 tsutsui Exp $"); __KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.5 2004/08/28 19:11:19 thorpej Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -69,7 +69,7 @@ static struct hp300_soft_intr hp300_soft_intrs[IPL_NSOFT];
* Initialise hp300 software interrupt subsystem. * Initialise hp300 software interrupt subsystem.
*/ */
void void
softintr_init() softintr_init(void)
{ {
static const char *softintr_names[] = IPL_SOFTNAMES; static const char *softintr_names[] = IPL_SOFTNAMES;
struct hp300_soft_intr *hsi; struct hp300_soft_intr *hsi;
@ -96,7 +96,7 @@ softintr_init()
* Internal function for running queued soft interrupts. * Internal function for running queued soft interrupts.
*/ */
void void
softintr_dispatch() softintr_dispatch(void)
{ {
struct hp300_soft_intr *hsi; struct hp300_soft_intr *hsi;
struct hp300_soft_intrhand *sih; struct hp300_soft_intrhand *sih;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.111 2004/08/28 17:53:01 jdolecek Exp $ */ /* $NetBSD: trap.c,v 1.112 2004/08/28 19:11:19 thorpej Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1990, 1993 * Copyright (c) 1982, 1986, 1990, 1993
@ -77,7 +77,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.111 2004/08/28 17:53:01 jdolecek Exp $"); __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.112 2004/08/28 19:11:19 thorpej Exp $");
#include "opt_ddb.h" #include "opt_ddb.h"
#include "opt_execfmt.h" #include "opt_execfmt.h"
@ -125,20 +125,17 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.111 2004/08/28 17:53:01 jdolecek Exp $");
extern struct emul emul_sunos; extern struct emul emul_sunos;
#endif #endif
int writeback __P((struct frame *fp, int docachepush)); int writeback(struct frame *fp, int docachepush);
void trap __P((int type, u_int code, u_int v, struct frame frame)); void trap(int type, u_int code, u_int v, struct frame frame);
#ifdef DEBUG #ifdef DEBUG
void dumpssw __P((u_short)); void dumpssw(u_short);
void dumpwb __P((int, u_short, u_int, u_int)); void dumpwb(int, u_short, u_int, u_int);
#endif #endif
static inline void userret __P((struct lwp *l, struct frame *fp,
u_quad_t oticks, u_int faultaddr, int fromtrap));
int astpending; int astpending;
char *trap_type[] = { const char *trap_type[] = {
"Bus error", "Bus error",
"Address error", "Address error",
"Illegal instruction", "Illegal instruction",
@ -154,7 +151,7 @@ char *trap_type[] = {
"Coprocessor violation", "Coprocessor violation",
"Async system trap" "Async system trap"
}; };
int trap_types = sizeof trap_type / sizeof trap_type[0]; const int trap_types = sizeof trap_type / sizeof trap_type[0];
/* /*
* Size of various exception stack frames (minus the standard 8 bytes) * Size of various exception stack frames (minus the standard 8 bytes)
@ -218,13 +215,9 @@ int mmupid = -1;
* trap and syscall both need the following work done before returning * trap and syscall both need the following work done before returning
* to user mode. * to user mode.
*/ */
static inline void static __inline void
userret(l, fp, oticks, faultaddr, fromtrap) userret(struct lwp *l, struct frame *fp, u_quad_t oticks,
struct lwp *l; u_int faultaddr, int fromtrap)
struct frame *fp;
u_quad_t oticks;
u_int faultaddr;
int fromtrap;
{ {
struct proc *p = l->l_proc; struct proc *p = l->l_proc;
#ifdef M68040 #ifdef M68040
@ -286,10 +279,7 @@ again:
void machine_userret(struct lwp *, struct frame *, u_quad_t); void machine_userret(struct lwp *, struct frame *, u_quad_t);
void void
machine_userret(l, f, t) machine_userret(struct lwp *l, struct frame *f, u_quad_t t)
struct lwp *l;
struct frame *f;
u_quad_t t;
{ {
userret(l, f, t, 0, 0); userret(l, f, t, 0, 0);
@ -302,11 +292,7 @@ machine_userret(l, f, t)
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
void void
trap(type, code, v, frame) trap(int type, u_int code, u_int v, struct frame frame)
int type;
unsigned code;
unsigned v;
struct frame frame;
{ {
extern char fubail[], subail[]; extern char fubail[], subail[];
struct lwp *l; struct lwp *l;
@ -660,7 +646,7 @@ trap(type, code, v, frame)
#ifdef COMPAT_HPUX #ifdef COMPAT_HPUX
if (ISHPMMADDR(va)) { if (ISHPMMADDR(va)) {
int pmap_mapmulti __P((pmap_t, vaddr_t)); int pmap_mapmulti(pmap_t, vaddr_t);
vaddr_t bva; vaddr_t bva;
rv = pmap_mapmulti(map->pmap, va); rv = pmap_mapmulti(map->pmap, va);
@ -744,18 +730,16 @@ struct writebackstats {
int wbsize[4]; int wbsize[4];
} wbstats; } wbstats;
char *f7sz[] = { "longword", "byte", "word", "line" }; static const char *f7sz[] = { "longword", "byte", "word", "line" };
char *f7tt[] = { "normal", "MOVE16", "AFC", "ACK" }; static const char *f7tt[] = { "normal", "MOVE16", "AFC", "ACK" };
char *f7tm[] = { "d-push", "u-data", "u-code", "M-data", static const char *f7tm[] = { "d-push", "u-data", "u-code", "M-data",
"M-code", "k-data", "k-code", "RES" }; "M-code", "k-data", "k-code", "RES" };
char wberrstr[] = static const char wberrstr[] =
"WARNING: pid %d(%s) writeback [%s] failed, pc=%x fa=%x wba=%x wbd=%x\n"; "WARNING: pid %d(%s) writeback [%s] failed, pc=%x fa=%x wba=%x wbd=%x\n";
#endif #endif
int int
writeback(fp, docachepush) writeback(struct frame *fp, int docachepush)
struct frame *fp;
int docachepush;
{ {
struct fmt7 *f = &fp->f_fmt7; struct fmt7 *f = &fp->f_fmt7;
struct lwp *l = curlwp; struct lwp *l = curlwp;
@ -993,8 +977,7 @@ writeback(fp, docachepush)
#ifdef DEBUG #ifdef DEBUG
void void
dumpssw(ssw) dumpssw(u_short ssw)
u_short ssw;
{ {
printf(" SSW: %x: ", ssw); printf(" SSW: %x: ", ssw);
if (ssw & SSW4_CP) if (ssw & SSW4_CP)
@ -1020,10 +1003,7 @@ dumpssw(ssw)
} }
void void
dumpwb(num, s, a, d) dumpwb(int num, u_short s, u_int a, u_int d)
int num;
u_short s;
u_int a, d;
{ {
struct lwp *l = curlwp; struct lwp *l = curlwp;
struct proc *p = l->l_proc; struct proc *p = l->l_proc;