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.
@ -143,7 +143,7 @@
*/
#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 "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 dnkbdcnattach(bus_space_tag_t, bus_addr_t);
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_scan(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 char *extiobase;
@ -278,29 +279,26 @@ struct dev_data {
int dd_punit; /* and punit... */
};
typedef LIST_HEAD(, dev_data) ddlist_t;
ddlist_t dev_data_list; /* all dev_datas */
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; /* all dev_datas */
static ddlist_t dev_data_list_hpib; /* hpib controller dev_datas */
static ddlist_t dev_data_list_scsi; /* scsi controller dev_datas */
void findbootdev __P((void));
void findbootdev_slave __P((ddlist_t *, int, int, int));
void setbootdev __P((void));
static void findbootdev(void);
static void findbootdev_slave(ddlist_t *, int, int, int);
static void setbootdev(void);
static struct dev_data *dev_data_lookup __P((struct device *));
static void dev_data_insert __P((struct dev_data *, ddlist_t *));
static struct dev_data *dev_data_lookup(struct device *);
static void dev_data_insert(struct dev_data *, ddlist_t *);
int mainbusmatch __P((struct device *, struct cfdata *, void *));
void mainbusattach __P((struct device *, struct device *, void *));
int mainbussearch __P((struct device *, struct cfdata *, void *));
static int mainbusmatch(struct device *, struct cfdata *, void *);
static void mainbusattach(struct device *, struct device *, void *);
static int mainbussearch(struct device *, struct cfdata *, void *);
CFATTACH_DECL(mainbus, sizeof(struct device),
mainbusmatch, mainbusattach, NULL, NULL);
int
mainbusmatch(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
static int
mainbusmatch(struct device *parent, struct cfdata *match, void *aux)
{
static int mainbus_matched = 0;
@ -312,10 +310,8 @@ mainbusmatch(parent, match, aux)
return (1);
}
void
mainbusattach(parent, self, aux)
struct device *parent, *self;
void *aux;
static void
mainbusattach(struct device *parent, struct device *self, void *aux)
{
printf("\n");
@ -324,11 +320,8 @@ mainbusattach(parent, self, aux)
config_search(mainbussearch, self, NULL);
}
int
mainbussearch(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
static int
mainbussearch(struct device *parent, struct cfdata *cf, void *aux)
{
if (config_match(parent, cf, NULL) > 0)
@ -340,7 +333,7 @@ mainbussearch(parent, cf, aux)
* Determine the device configuration for the running system.
*/
void
cpu_configure()
cpu_configure(void)
{
/*
@ -369,7 +362,7 @@ cpu_configure()
**********************************************************************/
void
cpu_rootconf()
cpu_rootconf(void)
{
struct dev_data *dd;
struct device *dv;
@ -447,9 +440,7 @@ cpu_rootconf()
* used to attach it. This is used to find the boot device.
*/
void
device_register(dev, aux)
struct device *dev;
void *aux;
device_register(struct device *dev, void *aux)
{
struct dev_data *dd;
static int seen_netdevice = 0;
@ -529,8 +520,8 @@ device_register(dev, aux)
}
}
void
findbootdev()
static void
findbootdev(void)
{
int type, ctlr, slave, punit, part;
int scsiboot, hpibboot, netboot;
@ -626,10 +617,8 @@ findbootdev()
booted_partition = part;
}
void
findbootdev_slave(ddlist, ctlr, slave, punit)
ddlist_t *ddlist;
int ctlr, slave, punit;
static void
findbootdev_slave(ddlist_t *ddlist, int ctlr, int slave, int punit)
{
struct dev_data *cdd, *dd;
@ -670,8 +659,8 @@ findbootdev_slave(ddlist, ctlr, slave, punit)
}
}
void
setbootdev()
static void
setbootdev(void)
{
struct dev_data *cdd, *dd;
int type, ctlr;
@ -758,8 +747,7 @@ setbootdev()
* Return the dev_data corresponding to the given device.
*/
static struct dev_data *
dev_data_lookup(dev)
struct device *dev;
dev_data_lookup(struct device *dev)
{
struct dev_data *dd;
@ -774,9 +762,7 @@ dev_data_lookup(dev)
* Insert a dev_data into the provided list, sorted by select code.
*/
static void
dev_data_insert(dd, ddlist)
struct dev_data *dd;
ddlist_t *ddlist;
dev_data_insert(struct dev_data *dd, ddlist_t *ddlist)
{
struct dev_data *de;
@ -821,7 +807,7 @@ dev_data_insert(dd, ddlist)
**********************************************************************/
void
hp300_cninit()
hp300_cninit(void)
{
struct bus_space_tag tag;
bus_space_tag_t bst;
@ -905,9 +891,8 @@ find_kbd:
#endif /* NITE */
}
int
dio_scan(func)
int (*func)(bus_space_tag_t, bus_addr_t, int);
static int
dio_scan(int (*func)(bus_space_tag_t, bus_addr_t, int))
{
#ifndef CONSCODE
int scode, sctop;
@ -927,10 +912,9 @@ dio_scan(func)
return (1);
}
int
dio_scode_probe(scode, func)
int scode;
int (*func)(bus_space_tag_t, bus_addr_t, int);
static int
dio_scode_probe(int scode,
int (*func)(bus_space_tag_t, bus_addr_t, int))
{
struct bus_space_tag tag;
bus_space_tag_t bst;
@ -976,9 +960,7 @@ iomap_init(void)
* space mapping the indicated physical address range [pa - pa+size)
*/
caddr_t
iomap(pa, size)
caddr_t pa;
int size;
iomap(caddr_t pa, int size)
{
u_long kva;
int error;
@ -1002,9 +984,7 @@ iomap(pa, size)
* Unmap a previously mapped device.
*/
void
iounmap(kva, size)
caddr_t kva;
int size;
iounmap(caddr_t kva, int size)
{
#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.
@ -41,7 +41,7 @@
*/
#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/systm.h>
@ -57,12 +57,8 @@ extern int *nofault;
/* ARGSUSED */
int
bus_space_map(t, bpa, size, flags, bshp)
bus_space_tag_t t;
bus_addr_t bpa;
bus_size_t size;
int flags;
bus_space_handle_t *bshp;
bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags,
bus_space_handle_t *bshp)
{
vaddr_t kva;
vsize_t offset;
@ -105,14 +101,9 @@ bus_space_map(t, bpa, size, flags, bshp)
/* ARGSUSED */
int
bus_space_alloc(t, rstart, rend, size, alignment, boundary, flags,
bpap, bshp)
bus_space_tag_t t;
bus_addr_t rstart, rend;
bus_size_t size, alignment, boundary;
int flags;
bus_addr_t *bpap;
bus_space_handle_t *bshp;
bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend,
bus_size_t size, bus_size_t alignment, bus_size_t 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 */
void
bus_space_free(t, bsh, size)
bus_space_tag_t t;
bus_space_handle_t bsh;
bus_size_t size;
bus_space_free(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
bus_space_unmap(t, bsh, size)
bus_space_tag_t t;
bus_space_handle_t bsh;
bus_size_t size;
bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
{
vaddr_t kva;
vsize_t offset;
@ -181,11 +166,8 @@ bus_space_unmap(t, bsh, size)
/* ARGSUSED */
int
bus_space_subregion(t, bsh, offset, size, nbshp)
bus_space_tag_t t;
bus_space_handle_t bsh;
bus_size_t offset, size;
bus_space_handle_t *nbshp;
bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp)
{
*nbshp = bsh + offset;
@ -194,11 +176,8 @@ bus_space_subregion(t, bsh, offset, size, nbshp)
/* ARGSUSED */
int
hp300_bus_space_probe(t, bsh, offset, sz)
bus_space_tag_t t;
bus_space_handle_t bsh;
bus_size_t offset;
int sz;
hp300_bus_space_probe(bus_space_tag_t t, bus_space_handle_t bsh,
bus_size_t offset, int sz)
{
label_t faultbuf;
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
@ -85,7 +85,7 @@
*/
#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/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>
#endif
void statintr __P((struct clockframe *));
void statintr(struct clockframe *);
static todr_chip_handle_t todr_handle;
int clkstd[1];
static int clkstd[1];
static int clkint; /* clock interval, as loaded */
/*
* 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;
}
/*
* Machine-dependent clock routines.
*
@ -151,7 +150,7 @@ todr_attach(todr_chip_handle_t handle)
* mvme68k delay calibration algorithm.
*/
void
hp300_calibrate_delay()
hp300_calibrate_delay(void)
{
extern int delay_divisor;
volatile struct clkreg *clk;
@ -231,7 +230,7 @@ hp300_calibrate_delay()
* no alternative timer is available.
*/
void
cpu_initclocks()
cpu_initclocks(void)
{
volatile struct clkreg *clk;
int intvl, statint, profint, minint;
@ -303,8 +302,7 @@ cpu_initclocks()
* but that would be a drag.
*/
void
setstatclockrate(newhz)
int newhz;
setstatclockrate(int newhz)
{
if (newhz == stathz)
@ -320,8 +318,7 @@ setstatclockrate(newhz)
* DO THIS INLINE IN locore.s?
*/
void
statintr(fp)
struct clockframe *fp;
statintr(struct clockframe *fp)
{
volatile struct clkreg *clk;
int newint, r, var;
@ -352,8 +349,7 @@ statintr(fp)
* Return the best possible estimate of the current time.
*/
void
microtime(tvp)
struct timeval *tvp;
microtime(struct timeval *tvp)
{
volatile struct clkreg *clk;
int s, u, t, u2, s2;
@ -392,8 +388,7 @@ microtime(tvp)
* from a filesystem.
*/
void
inittodr(base)
time_t base;
inittodr(time_t base)
{
int badbase = 0, waszero = (base == 0);
@ -440,7 +435,7 @@ inittodr(base)
* when crashing during autoconfig.
*/
void
resettodr()
resettodr(void)
{
if (time.tv_sec == 0)
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
@ -37,7 +37,7 @@
*/
#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/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.
*/
const char *
readdisklabel(dev, strat, lp, osdep)
dev_t dev;
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
struct cpu_disklabel *osdep)
{
struct buf *bp;
struct disklabel *dlp;
@ -106,10 +103,8 @@ readdisklabel(dev, strat, lp, osdep)
* Check new disk label for sensibility before setting it.
*/
int
setdisklabel(olp, nlp, openmask, osdep)
struct disklabel *olp, *nlp;
u_long openmask;
struct cpu_disklabel *osdep;
setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
struct cpu_disklabel *osdep)
{
int i;
struct partition *opp, *npp;
@ -147,11 +142,8 @@ setdisklabel(olp, nlp, openmask, osdep)
* Write disk label back to device after modification.
*/
int
writedisklabel(dev, strat, lp, osdep)
dev_t dev;
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
struct cpu_disklabel *osdep)
{
struct buf *bp;
struct disklabel *dlp;
@ -198,10 +190,7 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
int wlabel;
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
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
@ -32,15 +32,13 @@
*/
#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
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/dkbad.h>
int isbad __P((struct dkbad *, int, int, int));
/*
* Search the bad sector table looking for
* the specified sector. Return index if found.
@ -48,9 +46,7 @@ int isbad __P((struct dkbad *, int, int, int));
*/
int
isbad(bt, cyl, trk, sec)
struct dkbad *bt;
int cyl, trk, sec;
isbad(struct dkbad *bt, int cyl, int trk, int sec)
{
int i;
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.
@ -107,7 +107,7 @@
*/
#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/systm.h>
@ -175,7 +175,7 @@ static const char context_fpu[] =
static const char context_nofpu[] =
"standalone HP-MC68020 HP-MC68010 localroot default";
static struct valtostr context_table[] = {
static const struct valtostr context_table[] = {
{ FPU_68060, &context_040[0] },
{ FPU_68040, &context_040[0] },
{ FPU_68882, &context_fpu[0] },
@ -197,9 +197,7 @@ struct bsdfp {
* m68k-specific setup for HP-UX executables.
*/
int
hpux_cpu_makecmds(p, epp)
struct proc *p;
struct exec_package *epp;
hpux_cpu_makecmds(struct proc *p, struct exec_package *epp)
{
/* struct hpux_exec *hpux_ep = epp->ep_hdr; */
@ -218,9 +216,7 @@ hpux_cpu_makecmds(p, epp)
* in ev->ev_len.
*/
int
hpux_cpu_vmcmd(p, ev)
struct proc *p;
struct exec_vmcmd *ev;
hpux_cpu_vmcmd(struct proc *p, struct exec_vmcmd *ev)
{
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()
*/
int
hpux_cpu_sysconf_arch()
hpux_cpu_sysconf_arch(void)
{
switch (cputype) {
@ -267,10 +263,7 @@ hpux_cpu_sysconf_arch()
* HP-UX advise(2) system call.
*/
int
hpux_sys_advise(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_advise(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_advise_args *uap = v;
int error = 0;
@ -301,10 +294,7 @@ hpux_sys_advise(l, v, retval)
* Man page lies, behaviour here is based on observed behaviour.
*/
int
hpux_sys_getcontext(lp, v, retval)
struct lwp *lp;
void *v;
register_t *retval;
hpux_sys_getcontext(struct lwp *lp, void *v, register_t *retval)
{
struct hpux_sys_getcontext_args *uap = v;
const char *str;
@ -339,9 +329,7 @@ hpux_sys_getcontext(lp, v, retval)
* XXX This probably doesn't work anymore, BTW. --thorpej
*/
int
hpux_to_bsd_uoff(off, isps, l)
int *off, *isps;
struct lwp *l;
hpux_to_bsd_uoff(int *off, int *isps, struct lwp *l)
{
int *ar0 = l->l_md.md_regs;
struct hpux_fp *hp;
@ -592,10 +580,7 @@ hpux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
*/
/* ARGSUSED */
int
hpux_sys_sigreturn(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_sigreturn(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_sigreturn_args /* {
syscallarg(struct hpuxsigcontext *) sigcntxp;
@ -736,10 +721,7 @@ hpux_sys_sigreturn(l, v, retval)
* Set registers on exec.
*/
void
hpux_setregs(l, pack, stack)
struct lwp *l;
struct exec_package *pack;
u_long stack;
hpux_setregs(struct lwp *l, struct exec_package *pack, u_long stack)
{
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.
@ -41,7 +41,7 @@
*/
#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
@ -78,11 +78,11 @@ static const char *hp300_intr_names[NISR] = {
u_short hp300_ipls[HP300_NIPLS];
void intr_computeipl __P((void));
void netintr __P((void));
void intr_computeipl(void);
void netintr(void);
void
intr_init()
intr_init(void)
{
struct hp300_intr *hi;
int i;
@ -110,7 +110,7 @@ intr_init()
* calls. This doesn't have to be fast.
*/
void
intr_computeipl()
intr_computeipl(void)
{
struct hp300_intrhand *ih;
int ipl;
@ -170,7 +170,7 @@ intr_computeipl()
}
void
intr_printlevels()
intr_printlevels(void)
{
#ifdef DEBUG
@ -190,11 +190,7 @@ intr_printlevels()
* Called by driver attach functions.
*/
void *
intr_establish(func, arg, ipl, priority)
int (*func) __P((void *));
void *arg;
int ipl;
int priority;
intr_establish(int (*func)(void *), void *arg, int ipl, int priority)
{
struct hp300_intrhand *newih, *curih;
@ -263,8 +259,7 @@ intr_establish(func, arg, ipl, priority)
* Disestablish an interrupt handler.
*/
void
intr_disestablish(arg)
void *arg;
intr_disestablish(void *arg)
{
struct hp300_intrhand *ih = arg;
@ -278,8 +273,7 @@ intr_disestablish(arg)
* assembly language interrupt routine.
*/
void
intr_dispatch(evec)
int evec; /* format | vector offset */
intr_dispatch(int evec /* format | vector offset */)
{
struct hp300_intrhand *ih;
struct hp300_intr *list;
@ -317,7 +311,7 @@ intr_dispatch(evec)
}
void
netintr()
netintr(void)
{
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
@ -77,7 +77,7 @@
*/
#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>
@ -93,7 +93,7 @@ static volatile u_int8_t currentleds; /* current LED status */
* Map the LED page and setup the KVA to access it.
*/
void
ledinit()
ledinit(void)
{
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.
*/
void
ledcontrol(ons, offs, togs)
int ons, offs, togs;
ledcontrol(int ons, int offs, int togs)
{
__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
@ -77,7 +77,7 @@
*/
#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_compat_hpux.h"
@ -188,26 +188,26 @@ extern struct emul emul_hpux;
#endif
/* prototypes for local functions */
void parityenable __P((void));
int parityerror __P((struct frame *));
int parityerrorfind __P((void));
void identifycpu __P((void));
void initcpu __P((void));
static void parityenable(void);
static int parityerror(struct frame *);
static int parityerrorfind(void);
static void identifycpu(void);
static void initcpu(void);
int cpu_dumpsize __P((void));
int cpu_dump __P((int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *));
void cpu_init_kcore_hdr __P((void));
static int cpu_dumpsize(void);
static int cpu_dump(int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *);
static void cpu_init_kcore_hdr(void);
/* functions called from locore.s */
void dumpsys __P((void));
void hp300_init __P((void));
void straytrap __P((int, u_short));
void nmihand __P((struct frame));
void dumpsys(void);
void hp300_init(void);
void straytrap(int, u_short);
void nmihand(struct frame);
/*
* 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
@ -222,7 +222,7 @@ int delay_divisor; /* delay constant */
* Early initialization, before main() is called.
*/
void
hp300_init()
hp300_init(void)
{
struct btinfo_magic *bt_mag;
int i;
@ -278,7 +278,7 @@ hp300_init()
* to choose and initialize a console.
*/
void
consinit()
consinit(void)
{
/*
@ -318,7 +318,7 @@ consinit()
* initialize CPU
*/
void
cpu_startup()
cpu_startup(void)
{
extern char *etext;
vaddr_t minaddr, maxaddr;
@ -406,10 +406,7 @@ cpu_startup()
* Set registers on exec.
*/
void
setregs(l, pack, stack)
struct lwp *l;
struct exec_package *pack;
u_long stack;
setregs(struct lwp *l, struct exec_package *pack, u_long stack)
{
struct frame *frame = (struct frame *)l->l_md.md_regs;
@ -441,7 +438,7 @@ setregs(l, pack, stack)
/*
* Info for CTL_HW
*/
char cpu_model[120];
char cpu_model[120];
struct hp300_model {
int id;
@ -450,7 +447,7 @@ struct hp300_model {
const char *speed;
};
const struct hp300_model hp300_models[] = {
static const struct hp300_model hp300_models[] = {
{ HP_320, -1, "320", "16.67" },
{ HP_330, -1, "318/319/330", "16.67" },
{ HP_340, -1, "340", "16.67" },
@ -472,8 +469,8 @@ const struct hp300_model hp300_models[] = {
{ 0, -1, NULL, NULL },
};
void
identifycpu()
static void
identifycpu(void)
{
const char *t, *mc, *s;
int i, len;
@ -661,9 +658,7 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysctl machdep subtree setup")
int waittime = -1;
void
cpu_reboot(howto, bootstr)
int howto;
char *bootstr;
cpu_reboot(int howto, char *bootstr)
{
#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.
*/
void
cpu_init_kcore_hdr()
static void
cpu_init_kcore_hdr(void)
{
cpu_kcore_hdr_t *h = &cpu_kcore_hdr;
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.
* Returns size in disk blocks.
*/
int
cpu_dumpsize()
static int
cpu_dumpsize(void)
{
int size;
@ -798,10 +793,8 @@ cpu_dumpsize()
/*
* Called by dumpsys() to dump the machine-dependent header.
*/
int
cpu_dump(dump, blknop)
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
daddr_t *blknop;
static int
cpu_dump(int (*dump)(dev_t, daddr_t, caddr_t, size_t), daddr_t *blknop)
{
int buf[dbtob(1) / sizeof(int)];
cpu_kcore_hdr_t *chdr;
@ -837,7 +830,7 @@ long dumplo = 0; /* blocks */
* reduce the chance that swapping trashes it.
*/
void
cpu_dumpconf()
cpu_dumpconf(void)
{
const struct bdevsw *bdev;
int chdrsize; /* size of dump header */
@ -875,12 +868,12 @@ cpu_dumpconf()
* Dump physical memory onto the dump device. Called by cpu_reboot().
*/
void
dumpsys()
dumpsys(void)
{
const struct bdevsw *bdev;
daddr_t blkno; /* current block to write */
/* 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 */
paddr_t maddr; /* PA being dumped */
int error; /* error code from (*dump)() */
@ -964,8 +957,8 @@ dumpsys()
printf("succeeded\n");
}
void
initcpu()
static void
initcpu(void)
{
#ifdef MAPPEDCOPY
@ -986,9 +979,7 @@ initcpu()
}
void
straytrap(pc, evec)
int pc;
u_short evec;
straytrap(int pc, u_short evec)
{
printf("unexpected trap (vector offset %x) from %x\n",
evec & 0xFFF, pc);
@ -999,8 +990,7 @@ straytrap(pc, evec)
int *nofault;
int
badaddr(addr)
caddr_t addr;
badaddr(caddr_t addr)
{
int i;
label_t faultbuf;
@ -1016,8 +1006,7 @@ badaddr(addr)
}
int
badbaddr(addr)
caddr_t addr;
badbaddr(caddr_t addr)
{
int i;
label_t faultbuf;
@ -1038,8 +1027,7 @@ badbaddr(addr)
* Look up information in bootinfo from boot loader.
*/
void *
lookup_bootinfo(type)
int type;
lookup_bootinfo(int type)
{
struct btinfo_common *bt;
char *help = (char *)bootinfo_va;
@ -1066,15 +1054,14 @@ lookup_bootinfo(type)
int panicbutton = 1; /* non-zero if panic buttons are enabled */
int candbdiv = 2; /* give em half a second (hz / candbdiv) */
void candbtimer __P((void *));
static void candbtimer(void *);
int crashandburn;
struct callout candbtimer_ch = CALLOUT_INITIALIZER;
void
candbtimer(arg)
void *arg;
candbtimer(void *arg)
{
crashandburn = 0;
@ -1087,8 +1074,7 @@ static int innmihand; /* simple mutex */
* Level 7 interrupts can be caused by the keyboard or parity errors.
*/
void
nmihand(frame)
struct frame frame;
nmihand(struct frame frame)
{
/* Prevent unwanted recursion. */
@ -1159,8 +1145,8 @@ int ignorekperr = 0; /* ignore kernel parity errors */
/*
* Enable parity detection
*/
void
parityenable()
static void
parityenable(void)
{
label_t faultbuf;
@ -1179,9 +1165,8 @@ parityenable()
* 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.
*/
int
parityerror(fp)
struct frame *fp;
static int
parityerror(struct frame *fp)
{
if (!gotparmem)
return(0);
@ -1214,8 +1199,8 @@ parityerror(fp)
* Yuk! There has got to be a better way to do this!
* Searching all of memory with interrupts blocked can lead to disaster.
*/
int
parityerrorfind()
static int
parityerrorfind(void)
{
static label_t parcatch;
static int looking = 0;
@ -1288,9 +1273,7 @@ done:
* done on little-endian machines... -- cgd
*/
int
cpu_exec_aout_makecmds(p, epp)
struct proc *p;
struct exec_package *epp;
cpu_exec_aout_makecmds(struct proc *p, struct exec_package *epp)
{
#if defined(COMPAT_NOMID) || defined(COMPAT_44)
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
@ -77,7 +77,7 @@
*/
#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/systm.h>
@ -95,9 +95,9 @@ extern u_int lowram;
extern char *extiobase;
static caddr_t devzeropage;
dev_type_read(mmrw);
static dev_type_read(mmrw);
dev_type_ioctl(mmioctl);
dev_type_mmap(mmmmap);
static dev_type_mmap(mmmmap);
const struct cdevsw mem_cdevsw = {
nullopen, nullclose, mmrw, mmrw, mmioctl,
@ -105,11 +105,8 @@ const struct cdevsw mem_cdevsw = {
};
/*ARGSUSED*/
int
mmrw(dev, uio, flags)
dev_t dev;
struct uio *uio;
int flags;
static int
mmrw(dev_t dev, struct uio *uio, int flags)
{
vaddr_t o, v;
int c;
@ -226,11 +223,8 @@ unlock:
return (error);
}
paddr_t
mmmmap(dev, off, prot)
dev_t dev;
off_t off;
int prot;
static paddr_t
mmmmap(dev_t dev, off_t off, int prot)
{
/*
* /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
@ -36,7 +36,7 @@
*/
#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/proc.h>
@ -97,9 +97,7 @@ extern caddr_t msgbufaddr;
* XXX a PIC compiler would make this much easier.
*/
void
pmap_bootstrap(nextpa, firstpa)
paddr_t nextpa;
paddr_t firstpa;
pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
{
paddr_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa;
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.
@ -42,7 +42,7 @@
*/
#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/systm.h>
@ -69,7 +69,7 @@ static struct hp300_soft_intr hp300_soft_intrs[IPL_NSOFT];
* Initialise hp300 software interrupt subsystem.
*/
void
softintr_init()
softintr_init(void)
{
static const char *softintr_names[] = IPL_SOFTNAMES;
struct hp300_soft_intr *hsi;
@ -96,7 +96,7 @@ softintr_init()
* Internal function for running queued soft interrupts.
*/
void
softintr_dispatch()
softintr_dispatch(void)
{
struct hp300_soft_intr *hsi;
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
@ -77,7 +77,7 @@
*/
#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_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;
#endif
int writeback __P((struct frame *fp, int docachepush));
void trap __P((int type, u_int code, u_int v, struct frame frame));
int writeback(struct frame *fp, int docachepush);
void trap(int type, u_int code, u_int v, struct frame frame);
#ifdef DEBUG
void dumpssw __P((u_short));
void dumpwb __P((int, u_short, u_int, u_int));
void dumpssw(u_short);
void dumpwb(int, u_short, u_int, u_int);
#endif
static inline void userret __P((struct lwp *l, struct frame *fp,
u_quad_t oticks, u_int faultaddr, int fromtrap));
int astpending;
char *trap_type[] = {
const char *trap_type[] = {
"Bus error",
"Address error",
"Illegal instruction",
@ -154,7 +151,7 @@ char *trap_type[] = {
"Coprocessor violation",
"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)
@ -218,13 +215,9 @@ int mmupid = -1;
* trap and syscall both need the following work done before returning
* to user mode.
*/
static inline void
userret(l, fp, oticks, faultaddr, fromtrap)
struct lwp *l;
struct frame *fp;
u_quad_t oticks;
u_int faultaddr;
int fromtrap;
static __inline void
userret(struct lwp *l, struct frame *fp, u_quad_t oticks,
u_int faultaddr, int fromtrap)
{
struct proc *p = l->l_proc;
#ifdef M68040
@ -286,10 +279,7 @@ again:
void machine_userret(struct lwp *, struct frame *, u_quad_t);
void
machine_userret(l, f, t)
struct lwp *l;
struct frame *f;
u_quad_t t;
machine_userret(struct lwp *l, struct frame *f, u_quad_t t)
{
userret(l, f, t, 0, 0);
@ -302,11 +292,7 @@ machine_userret(l, f, t)
*/
/*ARGSUSED*/
void
trap(type, code, v, frame)
int type;
unsigned code;
unsigned v;
struct frame frame;
trap(int type, u_int code, u_int v, struct frame frame)
{
extern char fubail[], subail[];
struct lwp *l;
@ -660,7 +646,7 @@ trap(type, code, v, frame)
#ifdef COMPAT_HPUX
if (ISHPMMADDR(va)) {
int pmap_mapmulti __P((pmap_t, vaddr_t));
int pmap_mapmulti(pmap_t, vaddr_t);
vaddr_t bva;
rv = pmap_mapmulti(map->pmap, va);
@ -744,18 +730,16 @@ struct writebackstats {
int wbsize[4];
} wbstats;
char *f7sz[] = { "longword", "byte", "word", "line" };
char *f7tt[] = { "normal", "MOVE16", "AFC", "ACK" };
char *f7tm[] = { "d-push", "u-data", "u-code", "M-data",
"M-code", "k-data", "k-code", "RES" };
char wberrstr[] =
static const char *f7sz[] = { "longword", "byte", "word", "line" };
static const char *f7tt[] = { "normal", "MOVE16", "AFC", "ACK" };
static const char *f7tm[] = { "d-push", "u-data", "u-code", "M-data",
"M-code", "k-data", "k-code", "RES" };
static const char wberrstr[] =
"WARNING: pid %d(%s) writeback [%s] failed, pc=%x fa=%x wba=%x wbd=%x\n";
#endif
int
writeback(fp, docachepush)
struct frame *fp;
int docachepush;
writeback(struct frame *fp, int docachepush)
{
struct fmt7 *f = &fp->f_fmt7;
struct lwp *l = curlwp;
@ -993,8 +977,7 @@ writeback(fp, docachepush)
#ifdef DEBUG
void
dumpssw(ssw)
u_short ssw;
dumpssw(u_short ssw)
{
printf(" SSW: %x: ", ssw);
if (ssw & SSW4_CP)
@ -1020,10 +1003,7 @@ dumpssw(ssw)
}
void
dumpwb(num, s, a, d)
int num;
u_short s;
u_int a, d;
dumpwb(int num, u_short s, u_int a, u_int d)
{
struct lwp *l = curlwp;
struct proc *p = l->l_proc;