Add prototypes, and make this compile with -Wall. Remove register

modifier from all declarations.
This commit is contained in:
scottr 1997-04-01 03:12:06 +00:00
parent 66c9485803
commit 698c8410a2
17 changed files with 364 additions and 286 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.34 1997/03/26 22:38:58 gwr Exp $ */
/* $NetBSD: autoconf.c,v 1.35 1997/04/01 03:12:06 scottr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@ -65,17 +65,18 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/map.h>
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/disklabel.h>
#include <sys/device.h>
#include <sys/conf.h>
#include <sys/dmap.h>
#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/device.h>
#include <sys/disklabel.h>
#include <sys/dmap.h>
#include <sys/malloc.h>
#include <sys/map.h>
#include <sys/mount.h>
#include <sys/queue.h>
#include <sys/reboot.h>
#include <sys/tty.h>
#include <dev/cons.h>
@ -90,8 +91,11 @@
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/dmavar.h>
#include <hp300/dev/grfreg.h>
#include <hp300/dev/hilreg.h>
#include <hp300/dev/hilioctl.h>
#include <hp300/dev/hilvar.h>
#include <hp300/dev/hpibvar.h>
#include <hp300/dev/scsivar.h>
@ -168,14 +172,6 @@ void setbootdev __P((void));
static struct dev_data *dev_data_lookup __P((struct device *));
static void dev_data_insert __P((struct dev_data *, ddlist_t *));
static struct device *parsedisk __P((char *str, int len, int defpart,
dev_t *devp));
static struct device *getdisk __P((char *str, int len, int defpart,
dev_t *devp));
static int findblkmajor __P((struct device *dv));
static char *findblkname __P((int));
static int getstr __P((char *cp, int size));
int mainbusmatch __P((struct device *, struct cfdata *, void *));
void mainbusattach __P((struct device *, struct device *, void *));
int mainbussearch __P((struct device *, struct cfdata *, void *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.18 1996/10/13 03:14:27 christos Exp $ */
/* $NetBSD: clock.c,v 1.19 1997/04/01 03:12:09 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -51,12 +51,16 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/tty.h>
#include <machine/psl.h>
#include <machine/cpu.h>
#include <hp300/dev/hilreg.h>
#include <hp300/dev/hilioctl.h>
#include <hp300/dev/hilvar.h>
#include <hp300/hp300/clockreg.h>
#ifdef GPROF
@ -83,12 +87,17 @@ static int statprev; /* previous value in stat timer */
static int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
struct bbc_tm *gmt_to_bbc();
u_char bbc_registers[13];
u_char write_bbc_reg(), read_bbc_reg();
struct hil_dev *bbcaddr = NULL;
void statintr __P((struct clockframe *));
void hp300_calibrate_delay __P((void));
struct bbc_tm *gmt_to_bbc __P((long));
int bbc_to_gmt __P((u_long *));
void read_bbc __P((void));
u_char read_bbc_reg __P((int));
u_char write_bbc_reg __P((int, u_int));
/*
* Machine-dependent clock routines.
@ -187,10 +196,11 @@ hp300_calibrate_delay()
* Set up the real-time and statistics clocks. Leave stathz 0 only if
* no alternative timer is available.
*/
void
cpu_initclocks()
{
register volatile struct clkreg *clk;
register int intvl, statint, profint, minint;
volatile struct clkreg *clk;
int intvl, statint, profint, minint;
clkstd[0] = IIOV(0x5F8000); /* XXX grot */
clk = (volatile struct clkreg *)clkstd[0];
@ -276,8 +286,8 @@ void
statintr(fp)
struct clockframe *fp;
{
register volatile struct clkreg *clk;
register int newint, r, var;
volatile struct clkreg *clk;
int newint, r, var;
clk = (volatile struct clkreg *)clkstd[0];
var = statvar;
@ -306,10 +316,10 @@ statintr(fp)
*/
void
microtime(tvp)
register struct timeval *tvp;
struct timeval *tvp;
{
register volatile struct clkreg *clk;
register int s, u, t, u2, s2;
volatile struct clkreg *clk;
int s, u, t, u2, s2;
/*
* Read registers from slowest-changing to fastest-changing,
@ -344,6 +354,7 @@ microtime(tvp)
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
void
inittodr(base)
time_t base;
{
@ -382,10 +393,11 @@ inittodr(base)
/*
* Restore the time of day hardware after a time change.
*/
void
resettodr()
{
register int i;
register struct bbc_tm *tmptr;
int i;
struct bbc_tm *tmptr;
tmptr = gmt_to_bbc(time.tv_sec);
@ -412,8 +424,8 @@ struct bbc_tm *
gmt_to_bbc(tim)
long tim;
{
register int i;
register long hms, day;
int i;
long hms, day;
static struct bbc_tm rt;
day = tim / SECDAY;
@ -443,11 +455,12 @@ gmt_to_bbc(tim)
return(&rt);
}
int
bbc_to_gmt(timbuf)
u_long *timbuf;
{
register int i;
register u_long tmp;
int i;
u_long tmp;
int year, month, day, hour, min, sec;
read_bbc();
@ -485,9 +498,10 @@ bbc_to_gmt(timbuf)
return(1);
}
void
read_bbc()
{
register int i, read_okay;
int i, read_okay;
read_okay = 0;
while (!read_okay) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.37 1997/01/30 09:00:21 thorpej Exp $ */
/* $NetBSD: conf.c,v 1.38 1997/04/01 03:12:10 scottr Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -191,6 +191,7 @@ dev_t swapdev = makedev(3, 0);
/*
* Returns true if dev is /dev/mem or /dev/kmem.
*/
int
iskmemdev(dev)
dev_t dev;
{
@ -201,6 +202,7 @@ iskmemdev(dev)
/*
* Returns true if dev is /dev/zero.
*/
int
iszerodev(dev)
dev_t dev;
{
@ -247,6 +249,7 @@ static int chrtoblktbl[] = {
/*
* Convert a character device number to a block device number.
*/
dev_t
chrtoblk(dev)
dev_t dev;
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_memrw.c,v 1.2 1996/12/09 17:38:27 thorpej Exp $ */
/* $NetBSD: db_memrw.c,v 1.3 1997/04/01 03:12:12 scottr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -77,10 +77,10 @@ static void db_write_text __P((vm_offset_t, size_t, char *));
void
db_read_bytes(addr, size, data)
vm_offset_t addr;
register size_t size;
register char *data;
size_t size;
char *data;
{
register char *src = (char*)addr;
char *src = (char*)addr;
if (size == 4) {
*((int*)data) = *((int*)src);
@ -106,10 +106,10 @@ db_read_bytes(addr, size, data)
static void
db_write_text(addr, size, data)
vm_offset_t addr;
register size_t size;
register char *data;
size_t size;
char *data;
{
register char *dst, *odst;
char *dst, *odst;
pt_entry_t *pte, oldpte, tmppte;
vm_offset_t pgva;
int limit;
@ -196,10 +196,10 @@ extern char kernel_text[], etext[];
void
db_write_bytes(addr, size, data)
vm_offset_t addr;
register size_t size;
register char *data;
size_t size;
char *data;
{
register char *dst = (char *)addr;
char *dst = (char *)addr;
/* If any part is in kernel text, use db_write_text() */
if ((dst < etext) && ((dst + size) > kernel_text)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.8 1996/02/02 19:50:26 scottr Exp $ */
/* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@ -58,11 +58,11 @@
char *
readdisklabel(dev, strat, lp, osdep)
dev_t dev;
void (*strat)();
register struct disklabel *lp;
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
{
register struct buf *bp;
struct buf *bp;
struct disklabel *dlp;
char *msg = NULL;
@ -108,12 +108,12 @@ readdisklabel(dev, strat, lp, osdep)
*/
int
setdisklabel(olp, nlp, openmask, osdep)
register struct disklabel *olp, *nlp;
struct disklabel *olp, *nlp;
u_long openmask;
struct cpu_disklabel *osdep;
{
register i;
register struct partition *opp, *npp;
int i;
struct partition *opp, *npp;
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
@ -150,8 +150,8 @@ setdisklabel(olp, nlp, openmask, osdep)
int
writedisklabel(dev, strat, lp, osdep)
dev_t dev;
void (*strat)();
register struct disklabel *lp;
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
{
struct buf *bp;
@ -171,7 +171,7 @@ writedisklabel(dev, strat, lp, osdep)
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_READ;
(*strat)(bp);
if (error = biowait(bp))
if ((error = biowait(bp)))
goto done;
for (dlp = (struct disklabel *)bp->b_data;
dlp <= (struct disklabel *)

View File

@ -1,4 +1,4 @@
/* $NetBSD: dkbad.c,v 1.4 1994/10/26 07:25:33 cgd Exp $ */
/* $NetBSD: dkbad.c,v 1.5 1997/04/01 03:12:15 scottr Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -40,18 +40,21 @@
#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.
* Return -1 if not found.
*/
int
isbad(bt, cyl, trk, sec)
register struct dkbad *bt;
struct dkbad *bt;
int cyl, trk, sec;
{
register int i;
register long blk, bblk;
int i;
long blk, bblk;
blk = ((long)cyl << 16) + (trk << 8) + sec;
for (i = 0; i < 126; i++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_machdep.c,v 1.9 1997/03/16 10:00:45 thorpej Exp $ */
/* $NetBSD: hpux_machdep.c,v 1.10 1997/04/01 03:12:16 scottr Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Jason R. Thorpe. All rights reserved.
@ -312,7 +312,7 @@ hpux_sys_getcontext(p, v, retval)
{
struct hpux_sys_getcontext_args *uap = v;
int l, i, error = 0;
register int len;
int len;
for (i = 0; context_table[i].str != NULL; i++)
if (context_table[i].val == fputype)
@ -344,10 +344,10 @@ hpux_to_bsd_uoff(off, isps, p)
int *off, *isps;
struct proc *p;
{
register int *ar0 = p->p_md.md_regs;
int *ar0 = p->p_md.md_regs;
struct hpux_fp *hp;
struct bsdfp *bp;
register u_int raddr;
u_int raddr;
*isps = 0;
@ -457,11 +457,11 @@ hpux_sendsig(catcher, sig, mask, code)
int sig, mask;
u_long code;
{
register struct proc *p = curproc;
register struct hpuxsigframe *kfp, *fp;
register struct frame *frame;
register struct sigacts *psp = p->p_sigacts;
register short ft;
struct proc *p = curproc;
struct hpuxsigframe *kfp, *fp;
struct frame *frame;
struct sigacts *psp = p->p_sigacts;
short ft;
int oonstack, fsize;
extern char sigcode[], esigcode[];
@ -631,9 +631,9 @@ hpux_sys_sigreturn(p, v, retval)
struct hpux_sys_sigreturn_args /* {
syscallarg(struct hpuxsigcontext *) sigcntxp;
} */ *uap = v;
register struct hpuxsigcontext *scp;
register struct frame *frame;
register int rf;
struct hpuxsigcontext *scp;
struct frame *frame;
int rf;
struct hpuxsigcontext tsigc;
struct hpuxsigstate tstate;
int flags;
@ -716,7 +716,7 @@ hpux_sys_sigreturn(p, v, retval)
* the sigcontext structure.
*/
if (flags & HSS_RTEFRAME) {
register int sz;
int sz;
/* grab frame type and validate */
sz = tstate.hss_frame.f_format;
@ -759,7 +759,7 @@ hpux_sys_sigreturn(p, v, retval)
*/
void
hpux_setregs(p, pack, stack, retval)
register struct proc *p;
struct proc *p;
struct exec_package *pack;
u_long stack;
register_t *retval;

View File

@ -1,4 +1,4 @@
/* $NetBSD: isr.c,v 1.5 1996/12/09 17:38:25 thorpej Exp $ */
/* $NetBSD: isr.c,v 1.6 1997/04/01 03:12:18 scottr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -42,8 +42,10 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/vmmeter.h>
#include <net/netisr.h>
#include <machine/cpu.h>
@ -257,7 +259,7 @@ isrdispatch(evec)
vec = (evec & 0xfff) >> 2;
if ((vec < ISRLOC) || (vec >= (ISRLOC + NISR)))
panic("isrdispatch: bad vec 0x%x\n");
panic("isrdispatch: bad vec 0x%x\n", vec);
ipl = vec - ISRLOC;
intrcnt[ipl]++;
@ -271,6 +273,7 @@ isrdispatch(evec)
return;
}
handled = 0;
/* Give all the handlers a chance. */
for (isr = list->lh_first ; isr != NULL; isr = isr->isr_link.le_next)
handled |= (*isr->isr_func)(isr->isr_arg);
@ -286,6 +289,14 @@ isrdispatch(evec)
/*
* XXX Why on earth isn't this in a common file?!
*/
void netintr __P((void));
void arpintr __P((void));
void ipintr __P((void));
void nsintr __P((void));
void clnintr __P((void));
void ccittintr __P((void));
void pppintr __P((void));
void
netintr()
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: kgdb_glue.c,v 1.2 1994/10/26 07:25:39 cgd Exp $ */
/* $NetBSD: kgdb_glue.c,v 1.3 1997/04/01 03:12:19 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
@ -56,7 +56,7 @@
#include <machine/reg.h>
#ifndef lint
static char rcsid[] = "$NetBSD: kgdb_glue.c,v 1.2 1994/10/26 07:25:39 cgd Exp $";
static char rcsid[] = "$NetBSD: kgdb_glue.c,v 1.3 1997/04/01 03:12:19 scottr Exp $";
#endif
#define KGDB_STACKSIZE 0x800
@ -69,8 +69,8 @@ u_long kgdb_stack[KGDB_STACKWORDS];
static inline void
copywords(src, dst, nbytes)
register u_long *src, *dst;
register u_int nbytes;
u_long *src, *dst;
u_int nbytes;
{
u_long *limit = src + (nbytes / sizeof(u_long));

View File

@ -1,4 +1,4 @@
/* $NetBSD: kgdb_stub.c,v 1.6 1996/10/13 03:14:30 christos Exp $ */
/* $NetBSD: kgdb_stub.c,v 1.7 1997/04/01 03:12:20 scottr Exp $ */
/*
* Copyright (c) 1990, 1993
@ -49,7 +49,7 @@
*/
#ifdef KGDB
#ifndef lint
static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.6 1996/10/13 03:14:30 christos Exp $";
static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.7 1997/04/01 03:12:20 scottr Exp $";
#endif
#include <sys/param.h>
@ -107,12 +107,12 @@ static int (*kgdb_putc)();
*/
static void
kgdb_send(type, bp, len)
register u_char type;
register u_char *bp;
register int len;
u_char type;
u_char *bp;
int len;
{
register u_char csum;
register u_char *ep = bp + len;
u_char csum;
u_char *ep = bp + len;
PUTC(FRAME_START);
PUTESC(type);
@ -133,9 +133,9 @@ kgdb_recv(bp, lenp)
u_char *bp;
int *lenp;
{
register u_char c, csum;
register int escape, len;
register int type;
u_char c, csum;
int escape, len;
int type;
restart:
csum = len = escape = 0;
@ -285,10 +285,10 @@ kgdb_panic()
static inline void
kgdb_copy(src, dst, nbytes)
register u_char *src, *dst;
register u_int nbytes;
u_char *src, *dst;
u_int nbytes;
{
register u_char *ep = src + nbytes;
u_char *ep = src + nbytes;
while (src < ep)
*dst++ = *src++;
@ -331,11 +331,11 @@ kgdb_trap(type, frame)
int type;
struct frame *frame;
{
register u_long len;
u_long len;
u_char *addr;
register u_char *cp;
register u_char out, in;
register int outlen;
u_char *cp;
u_char out, in;
int outlen;
int inlen;
u_long gdb_regs[NUM_REGS];
@ -459,7 +459,7 @@ kgdb_trap(type, frame)
case KGDB_REG_W | KGDB_DELTA:
cp = inbuffer;
for (len = 0; len < inlen; len += 5) {
register int j = cp[len];
int j = cp[len];
kgdb_copy(&cp[len + 1],
(u_char *)&gdb_regs[j], 4);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.85 1997/03/27 21:01:29 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.86 1997/04/01 03:12:22 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -44,27 +44,27 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/signalvar.h>
#include <sys/kernel.h>
#include <sys/map.h>
#include <sys/proc.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/clist.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/mount.h>
#include <sys/user.h>
#include <sys/clist.h>
#include <sys/conf.h>
#include <sys/exec.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/map.h>
#include <sys/mbuf.h>
#include <sys/mount.h>
#include <sys/msgbuf.h>
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/signalvar.h>
#include <sys/syscallargs.h>
#include <sys/tty.h>
#include <sys/user.h>
#include <sys/vnode.h>
#include <sys/sysctl.h>
#include <sys/syscallargs.h>
#ifdef SYSVMSG
#include <sys/msg.h>
#endif
@ -75,18 +75,28 @@
#include <sys/shm.h>
#endif
#include <machine/db_machdep.h>
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
#include <machine/autoconf.h>
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/psl.h>
#include <machine/pte.h>
#include <dev/cons.h>
#define MAXMEM 64*1024*CLSIZE /* XXX - from cmap.h */
#include <vm/vm_kern.h>
#include <vm/vm_param.h>
#include <dev/cons.h>
#include <arch/hp300/dev/hilreg.h>
#include <arch/hp300/dev/hilioctl.h>
#include <arch/hp300/dev/hilvar.h>
#ifdef USELEDS
#include <arch/hp300/hp300/led.h>
#endif /* USELEDS */
/* the following is used externally (sysctl_hw) */
char machine[] = "hp300"; /* cpu "architecture" */
@ -203,9 +213,9 @@ void
cpu_startup()
{
extern char *etext;
register unsigned i;
register caddr_t v;
int base, residual, sz;
unsigned i;
caddr_t v;
int base, residual;
vm_offset_t minaddr, maxaddr;
vm_size_t size;
#ifdef DEBUG
@ -298,7 +308,7 @@ cpu_startup()
#ifdef DEBUG
pmapdebug = opmapdebug;
#endif
printf("avail mem = %d\n", ptoa(cnt.v_free_count));
printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
@ -350,7 +360,7 @@ cpu_startup()
*/
caddr_t
allocsys(v)
register caddr_t v;
caddr_t v;
{
#define valloc(name, type, num) \
@ -411,7 +421,7 @@ allocsys(v)
*/
void
setregs(p, pack, stack, retval)
register struct proc *p;
struct proc *p;
struct exec_package *pack;
u_long stack;
register_t *retval;
@ -577,8 +587,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
}
#ifdef USELEDS
#include <hp300/hp300/led.h>
int inledcontrol = 0; /* 1 if we are in ledcontrol already, cheap mutex */
char *ledaddr;
@ -606,10 +614,10 @@ ledinit()
*/
void
ledcontrol(ons, offs, togs)
register int ons, offs, togs;
int ons, offs, togs;
{
static char currentleds;
register char leds;
char leds;
inledcontrol = 1;
leds = currentleds;
@ -665,11 +673,11 @@ sendsig(catcher, sig, mask, code)
int sig, mask;
u_long code;
{
register struct proc *p = curproc;
register struct sigframe *fp, *kfp;
register struct frame *frame;
register struct sigacts *psp = p->p_sigacts;
register short ft;
struct proc *p = curproc;
struct sigframe *fp, *kfp;
struct frame *frame;
struct sigacts *psp = p->p_sigacts;
short ft;
int oonstack, fsize;
extern char sigcode[], esigcode[];
@ -821,9 +829,9 @@ sys_sigreturn(p, v, retval)
struct sys_sigreturn_args /* {
syscallarg(struct sigcontext *) sigcntxp;
} */ *uap = v;
register struct sigcontext *scp;
register struct frame *frame;
register int rf;
struct sigcontext *scp;
struct frame *frame;
int rf;
struct sigcontext tsigc;
struct sigstate tstate;
int flags;
@ -901,7 +909,7 @@ sys_sigreturn(p, v, retval)
* the sigcontext structure.
*/
if (flags & SS_RTEFRAME) {
register int sz;
int sz;
/* grab frame type and validate */
sz = tstate.ss_frame.f_format;
@ -941,14 +949,17 @@ int waittime = -1;
void
cpu_reboot(howto, bootstr)
register int howto;
int howto;
char *bootstr;
{
extern int cold;
#if __GNUC__ /* XXX work around lame compiler problem (gcc 2.7.2) */
(void)&howto;
#endif
/* take a snap shot before clobbering any registers */
if (curproc && curproc->p_addr)
savectx(curproc->p_addr);
savectx(&curproc->p_addr->u_pcb);
/* If system is cold, just halt. */
if (cold) {
@ -1075,7 +1086,7 @@ dumpsys()
dump = bdevsw[major(dumpdev)].d_dump;
blkno = dumplo;
printf("\ndumping to dev 0x%x, offset %d\n", dumpdev, dumplo);
printf("\ndumping to dev 0x%x, offset %ld\n", dumpdev, dumplo);
printf("dump ");
maddr = lowram;
@ -1159,9 +1170,9 @@ int *nofault;
int
badaddr(addr)
register caddr_t addr;
caddr_t addr;
{
register int i;
int i;
label_t faultbuf;
nofault = (int *) &faultbuf;
@ -1176,9 +1187,9 @@ badaddr(addr)
int
badbaddr(addr)
register caddr_t addr;
caddr_t addr;
{
register int i;
int i;
label_t faultbuf;
nofault = (int *) &faultbuf;
@ -1346,8 +1357,8 @@ parityerrorfind()
static label_t parcatch;
static int looking = 0;
volatile int pg, o, s;
register volatile int *ip;
register int i;
volatile int *ip;
int i;
int found;
#ifdef lint
@ -1401,11 +1412,11 @@ done:
void
regdump(fp, sbytes)
struct frame *fp; /* must not be register */
struct frame *fp; /* must not be */
int sbytes;
{
static int doingdump = 0;
register int i;
int i;
int s;
if (doingdump)
@ -1444,10 +1455,10 @@ regdump(fp, sbytes)
void
dumpmem(ptr, sz, ustack)
register int *ptr;
int *ptr;
int sz, ustack;
{
register int i, val;
int i, val;
for (i = 0; i < sz; i++) {
if ((i & 7) == 0)
@ -1470,11 +1481,11 @@ dumpmem(ptr, sz, ustack)
char *
hexstr(val, len)
register int val;
int val;
int len;
{
static char nbuf[9];
register int x, i;
int x, i;
if (len > 8)
return("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.15 1997/03/15 23:30:12 thorpej Exp $ */
/* $NetBSD: mem.c,v 1.16 1997/04/01 03:12:25 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -45,11 +45,12 @@
*/
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/uio.h>
#include <machine/cpu.h>
@ -59,6 +60,11 @@ extern u_int lowram;
extern char *extiobase;
static caddr_t devzeropage;
int mmopen __P((dev_t, int, int));
int mmclose __P((dev_t, int, int));
int mmrw __P((dev_t, struct uio *, int));
int mmmmap __P((dev_t, int, int));
/*ARGSUSED*/
int
mmopen(dev, flag, mode)
@ -86,9 +92,9 @@ mmrw(dev, uio, flags)
struct uio *uio;
int flags;
{
register vm_offset_t o, v;
register int c;
register struct iovec *iov;
vm_offset_t o, v;
int c;
struct iovec *iov;
int error = 0;
static int physlock;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.30 1997/03/18 14:13:55 mycroft Exp $ */
/* $NetBSD: pmap.c,v 1.31 1997/04/01 03:12:27 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
@ -288,13 +288,23 @@ int pmap_aliasmask; /* seperation at which VA aliasing ok */
int protostfree; /* prototype (default) free ST map */
#endif
struct pv_entry *pmap_alloc_pv __P((void));
void pmap_free_pv __P((struct pv_entry *));
void pmap_collect_pv __P((void));
void pmap_activate __P((pmap_t, struct pcb *));
void pmap_deactivate __P((pmap_t, struct pcb *));
#ifdef COMPAT_HPUX
int pmap_mapmulti __P((pmap_t, vm_offset_t));
#endif /* COMPAT_HPUX */
/*
* Internal routines
*/
void pmap_remove_mapping __P((pmap_t, vm_offset_t, pt_entry_t *, int));
void pmap_remove_mapping __P((pmap_t, vm_offset_t, pt_entry_t *, int));
boolean_t pmap_testbit __P((vm_offset_t, int));
void pmap_changebit __P((vm_offset_t, int, boolean_t));
void pmap_enter_ptpage __P((pmap_t, vm_offset_t));
void pmap_changebit __P((vm_offset_t, int, boolean_t));
void pmap_enter_ptpage __P((pmap_t, vm_offset_t));
#ifdef DEBUG
void pmap_pvdump __P((vm_offset_t));
void pmap_check_wiring __P((char *, vm_offset_t));
@ -538,8 +548,7 @@ void
pmap_free_pv(pv)
struct pv_entry *pv;
{
register struct pv_page *pvp;
register int i;
struct pv_page *pvp;
pvp = (struct pv_page *) trunc_page(pv);
switch (++pvp->pvp_pgi.pgi_nfree) {
@ -657,7 +666,7 @@ pmap_t
pmap_create(size)
vm_size_t size;
{
register pmap_t pmap;
pmap_t pmap;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
@ -687,7 +696,7 @@ pmap_create(size)
*/
void
pmap_pinit(pmap)
register struct pmap *pmap;
struct pmap *pmap;
{
#ifdef DEBUG
@ -719,7 +728,7 @@ pmap_pinit(pmap)
*/
void
pmap_destroy(pmap)
register pmap_t pmap;
pmap_t pmap;
{
int count;
@ -747,7 +756,7 @@ pmap_destroy(pmap)
*/
void
pmap_release(pmap)
register struct pmap *pmap;
struct pmap *pmap;
{
#ifdef DEBUG
@ -793,7 +802,7 @@ pmap_reference(pmap)
void
pmap_activate(pmap, pcb)
register pmap_t pmap;
pmap_t pmap;
struct pcb *pcb;
{
@ -810,7 +819,7 @@ pmap_activate(pmap, pcb)
void
pmap_deactivate(pmap, pcb)
register pmap_t pmap;
pmap_t pmap;
struct pcb *pcb;
{
}
@ -823,11 +832,11 @@ pmap_deactivate(pmap, pcb)
*/
void
pmap_remove(pmap, sva, eva)
register pmap_t pmap;
register vm_offset_t sva, eva;
pmap_t pmap;
vm_offset_t sva, eva;
{
register vm_offset_t nssva;
register pt_entry_t *pte;
vm_offset_t nssva;
pt_entry_t *pte;
boolean_t firstpage, needcflush;
int flags;
@ -945,7 +954,7 @@ pmap_page_protect(pa, prot)
vm_offset_t pa;
vm_prot_t prot;
{
register struct pv_entry *pv;
struct pv_entry *pv;
int s;
#ifdef DEBUG
@ -972,7 +981,7 @@ pmap_page_protect(pa, prot)
pv = pa_to_pvh(pa);
s = splimp();
while (pv->pv_pmap != NULL) {
register pt_entry_t *pte;
pt_entry_t *pte;
pte = pmap_pte(pv->pv_pmap, pv->pv_va);
#ifdef DEBUG
@ -1001,12 +1010,12 @@ pmap_page_protect(pa, prot)
*/
void
pmap_protect(pmap, sva, eva, prot)
register pmap_t pmap;
register vm_offset_t sva, eva;
pmap_t pmap;
vm_offset_t sva, eva;
vm_prot_t prot;
{
register vm_offset_t nssva;
register pt_entry_t *pte;
vm_offset_t nssva;
pt_entry_t *pte;
boolean_t firstpage, needtflush;
int isro;
@ -1120,14 +1129,14 @@ pmap_protect(pmap, sva, eva, prot)
*/
void
pmap_enter(pmap, va, pa, prot, wired)
register pmap_t pmap;
pmap_t pmap;
vm_offset_t va;
register vm_offset_t pa;
vm_offset_t pa;
vm_prot_t prot;
boolean_t wired;
{
register pt_entry_t *pte;
register int npte;
pt_entry_t *pte;
int npte;
vm_offset_t opa;
boolean_t cacheable = TRUE;
boolean_t checkpv = TRUE;
@ -1239,7 +1248,7 @@ pmap_enter(pmap, va, pa, prot, wired)
* since pmap_enter can be called at interrupt time.
*/
if (pa >= vm_first_phys && pa < vm_last_phys) {
register struct pv_entry *pv, *npv;
struct pv_entry *pv, *npv;
int s;
#ifdef PMAPSTATS
@ -1447,11 +1456,11 @@ validate:
*/
void
pmap_change_wiring(pmap, va, wired)
register pmap_t pmap;
pmap_t pmap;
vm_offset_t va;
boolean_t wired;
{
register pt_entry_t *pte;
pt_entry_t *pte;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
@ -1504,10 +1513,10 @@ pmap_change_wiring(pmap, va, wired)
vm_offset_t
pmap_extract(pmap, va)
register pmap_t pmap;
pmap_t pmap;
vm_offset_t va;
{
register vm_offset_t pa;
vm_offset_t pa;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
@ -1578,9 +1587,9 @@ void
pmap_collect(pmap)
pmap_t pmap;
{
register vm_offset_t pa;
register struct pv_entry *pv;
register pt_entry_t *pte;
vm_offset_t pa;
struct pv_entry *pv;
pt_entry_t *pte;
vm_offset_t kpa;
int s;
@ -1600,7 +1609,7 @@ pmap_collect(pmap)
#endif
s = splimp();
for (pa = vm_first_phys; pa < vm_last_phys; pa += NBPG) {
register struct kpt_page *kpt, **pkpt;
struct kpt_page *kpt, **pkpt;
/*
* Locate physical pages which are being used as kernel
@ -1612,7 +1621,7 @@ pmap_collect(pmap)
do {
if (pv->pv_ptste && pv->pv_ptpmap == pmap_kernel())
break;
} while (pv = pv->pv_next);
} while ((pv = pv->pv_next));
if (pv == NULL)
continue;
#ifdef DEBUG
@ -1705,7 +1714,7 @@ void
pmap_zero_page(phys)
vm_offset_t phys;
{
register vm_offset_t kva;
vm_offset_t kva;
extern caddr_t CADDR1;
#ifdef DEBUG
@ -1736,7 +1745,7 @@ void
pmap_copy_page(src, dst)
vm_offset_t src, dst;
{
register vm_offset_t skva, dkva;
vm_offset_t skva, dkva;
extern caddr_t CADDR1, CADDR2;
#ifdef DEBUG
@ -1786,8 +1795,8 @@ pmap_pageable(pmap, sva, eva, pageable)
* - PT pages have only one pv_table entry
*/
if (pmap == pmap_kernel() && pageable && sva + NBPG == eva) {
register struct pv_entry *pv;
register vm_offset_t pa;
struct pv_entry *pv;
vm_offset_t pa;
#ifdef DEBUG
if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
@ -1917,6 +1926,7 @@ pmap_phys_address(ppn)
* We implement this at the segment table level, the machine independent
* VM knows nothing about it.
*/
int
pmap_mapmulti(pmap, va)
pmap_t pmap;
vm_offset_t va;
@ -1956,13 +1966,13 @@ pmap_mapmulti(pmap, va)
/* static */
void
pmap_remove_mapping(pmap, va, pte, flags)
register pmap_t pmap;
register vm_offset_t va;
register pt_entry_t *pte;
pmap_t pmap;
vm_offset_t va;
pt_entry_t *pte;
int flags;
{
register vm_offset_t pa;
register struct pv_entry *pv, *npv;
vm_offset_t pa;
struct pv_entry *pv, *npv;
pmap_t ptpmap;
st_entry_t *ste;
int s, bits;
@ -2206,11 +2216,11 @@ pmap_remove_mapping(pmap, va, pte, flags)
/* static */
boolean_t
pmap_testbit(pa, bit)
register vm_offset_t pa;
vm_offset_t pa;
int bit;
{
register struct pv_entry *pv;
register pt_entry_t *pte;
struct pv_entry *pv;
pt_entry_t *pte;
int s;
if (pa < vm_first_phys || pa >= vm_last_phys)
@ -2252,12 +2262,12 @@ pmap_testbit(pa, bit)
/* static */
void
pmap_changebit(pa, bit, setem)
register vm_offset_t pa;
vm_offset_t pa;
int bit;
boolean_t setem;
{
register struct pv_entry *pv;
register pt_entry_t *pte, npte;
struct pv_entry *pv;
pt_entry_t *pte, npte;
vm_offset_t va;
int s;
boolean_t firstpage = TRUE;
@ -2334,8 +2344,8 @@ pmap_changebit(pa, bit, setem)
* flushed (but only once).
*/
if (firstpage && mmutype == MMU_68040 &&
(bit == PG_RO && setem ||
(bit & PG_CMASK))) {
((bit == PG_RO && setem) ||
(bit & PG_CMASK))) {
firstpage = FALSE;
DCFP(pa);
ICPP(pa);
@ -2377,11 +2387,11 @@ pmap_changebit(pa, bit, setem)
/* static */
void
pmap_enter_ptpage(pmap, va)
register pmap_t pmap;
register vm_offset_t va;
pmap_t pmap;
vm_offset_t va;
{
register vm_offset_t ptpa;
register struct pv_entry *pv;
vm_offset_t ptpa;
struct pv_entry *pv;
st_entry_t *ste;
int s;
@ -2475,7 +2485,7 @@ pmap_enter_ptpage(pmap, va)
* pmap_enter).
*/
if (pmap == pmap_kernel()) {
register struct kpt_page *kpt;
struct kpt_page *kpt;
s = splimp();
if ((kpt = kpt_free_list) == (struct kpt_page *)0) {
@ -2527,7 +2537,7 @@ pmap_enter_ptpage(pmap, va)
#endif
s = vm_fault(pt_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE);
if (s != KERN_SUCCESS) {
printf("vm_fault(pt_map, %x, RW, 0) -> %d\n", va, s);
printf("vm_fault(pt_map, %lx, RW, 0) -> %d\n", va, s);
panic("pmap_enter: vm_fault failed");
}
ptpa = pmap_extract(pmap_kernel(), va);
@ -2550,8 +2560,8 @@ pmap_enter_ptpage(pmap, va)
if (dowriteback && dokwriteback)
#endif
if (mmutype == MMU_68040) {
pt_entry_t *pte = pmap_pte(pmap_kernel(), va);
#ifdef DEBUG
pt_entry_t *pte = pmap_pte(pmap_kernel(), va);
if ((pmapdebug & PDB_PARANOIA) && (*pte & PG_CCB) == 0)
printf("%s PT no CCB: kva=%x ptpa=%x pte@%x=%x\n",
pmap == pmap_kernel() ? "Kernel" : "User",
@ -2572,7 +2582,7 @@ pmap_enter_ptpage(pmap, va)
do {
if (pv->pv_pmap == pmap_kernel() && pv->pv_va == va)
break;
} while (pv = pv->pv_next);
} while ((pv = pv->pv_next));
}
#ifdef DEBUG
if (pv == NULL)
@ -2630,7 +2640,7 @@ void
pmap_pvdump(pa)
vm_offset_t pa;
{
register struct pv_entry *pv;
struct pv_entry *pv;
printf("pa %x", pa);
for (pv = pa_to_pvh(pa); pv; pv = pv->pv_next)
@ -2647,8 +2657,8 @@ pmap_check_wiring(str, va)
vm_offset_t va;
{
vm_map_entry_t entry;
register int count;
register pt_entry_t *pte;
int count;
pt_entry_t *pte;
va = trunc_page(va);
if (!pmap_ste_v(pmap_kernel(), va) ||

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.10 1996/10/14 08:05:37 thorpej Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.11 1997/04/01 03:12:29 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
@ -41,12 +41,17 @@
#include <sys/param.h>
#include <sys/msgbuf.h>
#include <machine/pte.h>
#include <hp300/hp300/clockreg.h>
#include <machine/vmparam.h>
#include <sys/proc.h>
#include <machine/frame.h>
#include <machine/cpu.h>
#include <machine/vmparam.h>
#include <machine/pte.h>
#include <hp300/hp300/clockreg.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#define RELOC(v, t) *((t*)((u_int)&(v) + firstpa))
@ -66,6 +71,8 @@ extern int protection_codes[];
extern int pmap_aliasmask;
#endif
void pmap_bootstrap __P((vm_offset_t, vm_offset_t));
/*
* Special purpose kernel virtual addresses, used for mapping
* physical pages for a variety of temporary or permanent purposes:
@ -92,12 +99,12 @@ struct msgbuf *msgbufp;
void
pmap_bootstrap(nextpa, firstpa)
vm_offset_t nextpa;
register vm_offset_t firstpa;
vm_offset_t firstpa;
{
vm_offset_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa;
u_int nptpages, kstsize;
register st_entry_t protoste, *ste;
register pt_entry_t protopte, *pte, *epte;
st_entry_t protoste, *ste;
pt_entry_t protopte, *pte, *epte;
/*
* Calculate important physical addresses:
@ -175,7 +182,7 @@ pmap_bootstrap(nextpa, firstpa)
* likely be insufficient in the future (at least for the kernel).
*/
if (RELOC(mmutype, int) == MMU_68040) {
register int num;
int num;
/*
* First invalidate the entire "segment table" pages
@ -452,7 +459,7 @@ pmap_bootstrap(nextpa, firstpa)
* absolute "jmp" table.
*/
{
register int *kp;
int *kp;
kp = &RELOC(protection_codes, int);
kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
@ -485,7 +492,7 @@ pmap_bootstrap(nextpa, firstpa)
* MAXKL2SIZE-1: maps last-page page table
*/
if (RELOC(mmutype, int) == MMU_68040) {
register int num;
int num;
kpm->pm_stfree = ~l2tobm(0);
num = roundup((nptpages + 1) * (NPTEPG / SG4_LEV3SIZE),

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.13 1995/12/11 17:09:17 thorpej Exp $ */
/* $NetBSD: sys_machdep.c,v 1.14 1997/04/01 03:12:30 scottr Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -60,7 +60,7 @@ sys_vtrace(p, v, retval)
void *v;
register_t *retval;
{
register struct sys_vtrace_args /* {
struct sys_vtrace_args /* {
syscallarg(int) request;
syscallarg(int) value;
} */ *uap = v;
@ -100,8 +100,8 @@ sys_vtrace(p, v, retval)
vdoualarm(arg)
void *arg;
{
register int pid = (int)arg;
register struct proc *p;
int pid = (int)arg;
struct proc *p;
p = pfind(pid);
if (p)
@ -130,6 +130,7 @@ vdoualarm(arg)
* do pages, above that we do the entire cache.
*/
/*ARGSUSED1*/
int
cachectl(req, addr, len)
int req;
caddr_t addr;
@ -139,9 +140,9 @@ cachectl(req, addr, len)
#if defined(M68040)
if (mmutype == MMU_68040) {
register int inc = 0;
int inc = 0;
int pa = 0, doall = 0;
caddr_t end;
caddr_t end = 0;
#ifdef COMPAT_HPUX
extern struct emul emul_hpux;
@ -151,7 +152,7 @@ cachectl(req, addr, len)
#endif
if (addr == 0 ||
(req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG)
((req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG))
doall = 1;
if (!doall) {
@ -260,10 +261,12 @@ sys_sysarch(p, v, retval)
void *v;
register_t *retval;
{
#if 0 /* unused */
struct sys_sysarch_args /* {
syscallarg(int) op;
syscallarg(char *) parms;
} */ *uap = v;
#endif
return ENOSYS;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.48 1997/03/15 23:34:32 thorpej Exp $ */
/* $NetBSD: trap.c,v 1.49 1997/04/01 03:12:31 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -56,6 +56,8 @@
#include <sys/ktrace.h>
#endif
#include <arch/m68k/include/frame.h>
#include <machine/db_machdep.h>
#include <machine/psl.h>
#include <machine/trap.h>
#include <machine/cpu.h>
@ -78,6 +80,7 @@ extern struct emul emul_sunos;
int writeback __P((struct frame *fp, int docachepush));
void trap __P((int type, u_int code, u_int v, struct frame frame));
void syscall __P((register_t code, struct frame frame));
void child_return __P((struct proc *, struct frame));
#ifdef DEBUG
void dumpssw __P((u_short));
@ -169,8 +172,8 @@ int mmupid = -1;
*/
static inline void
userret(p, fp, oticks, faultaddr, fromtrap)
register struct proc *p;
register struct frame *fp;
struct proc *p;
struct frame *fp;
u_quad_t oticks;
u_int faultaddr;
int fromtrap;
@ -230,7 +233,7 @@ again:
"pid %d(%s): writeback aborted in sigreturn, pc=%x\n",
p->p_pid, p->p_comm, fp->f_pc, faultaddr);
#endif
} else if (sig = writeback(fp, fromtrap)) {
} else if ((sig = writeback(fp, fromtrap))) {
beenhere = 1;
oticks = p->p_sticks;
trapsignal(p, sig, faultaddr);
@ -251,14 +254,14 @@ void
trap(type, code, v, frame)
int type;
unsigned code;
register unsigned v;
unsigned v;
struct frame frame;
{
extern char fubail[], subail[];
register struct proc *p;
register int i, s;
struct proc *p;
int i, s;
u_int ucode;
u_quad_t sticks;
u_quad_t sticks = 0 /* XXX initializer works around compiler bug */;
cnt.v_trap++;
p = curproc;
@ -296,9 +299,11 @@ trap(type, code, v, frame)
goto kgdb_cont;
#endif
#ifdef DDB
(void) kdb_trap(type, &frame);
(void)kdb_trap(type, (db_regs_t *)&frame);
#endif
#ifdef KGDB
kgdb_cont:
#endif
splx(s);
if (panicstr) {
printf("trap during panic!\n");
@ -363,12 +368,12 @@ trap(type, code, v, frame)
case T_FPERR|T_USER: /* 68881 exceptions */
/*
* We pass along the 68881 status register which locore stashed
* We pass along the 68881 status which locore stashed
* in code for us. Note that there is a possibility that the
* bit pattern of this register will conflict with one of the
* bit pattern of this will conflict with one of the
* FPE_* codes defined in signal.h. Fortunately for us, the
* only such codes we use are all in the range 1-7 and the low
* 3 bits of the status register are defined as 0 so there is
* 3 bits of the status are defined as 0 so there is
* no clash.
*/
ucode = code;
@ -503,6 +508,7 @@ trap(type, code, v, frame)
case T_SSIR: /* software interrupt */
case T_SSIR|T_USER:
if (ssir & SIR_NET) {
void netintr __P((void));
siroff(SIR_NET);
cnt.v_soft++;
netintr();
@ -538,9 +544,9 @@ trap(type, code, v, frame)
case T_MMUFLT|T_USER: /* page fault */
{
register vm_offset_t va;
register struct vmspace *vm = p->p_vmspace;
register vm_map_t map;
vm_offset_t va;
struct vmspace *vm = p->p_vmspace;
vm_map_t map;
int rv;
vm_prot_t ftype;
extern vm_map_t kernel_map;
@ -580,6 +586,7 @@ trap(type, code, v, frame)
#ifdef COMPAT_HPUX
if (ISHPMMADDR(va)) {
int pmap_mapmulti __P((pmap_t, vm_offset_t));
vm_offset_t bva;
rv = pmap_mapmulti(map->pmap, va);
@ -628,7 +635,7 @@ trap(type, code, v, frame)
if (type == T_MMUFLT) {
if (p->p_addr->u_pcb.pcb_onfault)
goto copyfault;
printf("vm_fault(%x, %x, %x, 0) -> %x\n",
printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
map, va, ftype, rv);
printf(" type %x, code [mmu,,ssw]: %x\n",
type, code);
@ -669,8 +676,8 @@ writeback(fp, docachepush)
struct frame *fp;
int docachepush;
{
register struct fmt7 *f = &fp->f_fmt7;
register struct proc *p = curproc;
struct fmt7 *f = &fp->f_fmt7;
struct proc *p = curproc;
int err = 0;
u_int fa;
caddr_t oonfault = p->p_addr->u_pcb.pcb_onfault;
@ -753,8 +760,8 @@ writeback(fp, docachepush)
* Writeback #1.
* Position the "memory-aligned" data and write it out.
*/
register u_int wb1d = f->f_wb1d;
register int off;
u_int wb1d = f->f_wb1d;
int off;
#ifdef DEBUG
if ((mmudebug & MDB_WBFOLLOW) || MDB_ISPID(p->p_pid))
@ -898,7 +905,7 @@ writeback(fp, docachepush)
#ifdef DEBUG
void
dumpssw(ssw)
register u_short ssw;
u_short ssw;
{
printf(" SSW: %x: ", ssw);
if (ssw & SSW4_CP)
@ -929,7 +936,7 @@ dumpwb(num, s, a, d)
u_short s;
u_int a, d;
{
register struct proc *p = curproc;
struct proc *p = curproc;
vm_offset_t pa;
printf(" writeback #%d: VA %x, data %x, SZ=%s, TT=%s, TM=%s\n",
@ -954,9 +961,9 @@ syscall(code, frame)
register_t code;
struct frame frame;
{
register caddr_t params;
register struct sysent *callp;
register struct proc *p;
caddr_t params;
struct sysent *callp;
struct proc *p;
int error, opc, nsys;
size_t argsize;
register_t args[8], rval[2];

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.34 1997/03/16 09:59:40 thorpej Exp $ */
/* $NetBSD: vm_machdep.c,v 1.35 1997/04/01 03:12:33 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -52,13 +52,16 @@
#include <sys/core.h>
#include <sys/exec.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <machine/frame.h>
#include <machine/cpu.h>
#include <machine/pte.h>
#include <machine/reg.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
void setredzone __P((pt_entry_t *, caddr_t));
/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the kernel stack and pcb, making the child
@ -70,13 +73,13 @@
*/
void
cpu_fork(p1, p2)
register struct proc *p1, *p2;
struct proc *p1, *p2;
{
register struct pcb *pcb = &p2->p_addr->u_pcb;
register struct trapframe *tf;
register struct switchframe *sf;
void child_return __P((struct proc *, struct frame));
struct pcb *pcb = &p2->p_addr->u_pcb;
struct trapframe *tf;
struct switchframe *sf;
extern struct pcb *curpcb;
extern void proc_trampoline(), child_return();
p2->p_md.md_flags = p1->p_md.md_flags;
@ -195,10 +198,10 @@ cpu_coredump(p, vp, cred, chdr)
*/
void
pagemove(from, to, size)
register caddr_t from, to;
caddr_t from, to;
size_t size;
{
register vm_offset_t pa;
vm_offset_t pa;
#ifdef DEBUG
if (size & CLOFSET)
@ -227,12 +230,13 @@ pagemove(from, to, size)
* kernel VA space at `vaddr'. Read/write and cache-inhibit status
* are specified by `prot'.
*/
void
physaccess(vaddr, paddr, size, prot)
caddr_t vaddr, paddr;
register int size, prot;
int size, prot;
{
register pt_entry_t *pte;
register u_int page;
pt_entry_t *pte;
u_int page;
pte = kvtopte(vaddr);
page = (u_int)paddr & PG_FRAME;
@ -243,11 +247,12 @@ physaccess(vaddr, paddr, size, prot)
TBIAS();
}
void
physunaccess(vaddr, size)
caddr_t vaddr;
register int size;
int size;
{
register pt_entry_t *pte;
pt_entry_t *pte;
pte = kvtopte(vaddr);
for (size = btoc(size); size; size--)
@ -267,6 +272,7 @@ physunaccess(vaddr, size)
* Look at _lev6intr in locore.s for more details.
*/
/*ARGSUSED*/
void
setredzone(pte, vaddr)
pt_entry_t *pte;
caddr_t vaddr;
@ -276,8 +282,9 @@ setredzone(pte, vaddr)
/*
* Convert kernel VA to physical address
*/
int
kvtop(addr)
register caddr_t addr;
caddr_t addr;
{
vm_offset_t va;
@ -300,16 +307,16 @@ extern vm_map_t phys_map;
/*ARGSUSED*/
void
vmapbuf(bp, sz)
register struct buf *bp;
struct buf *bp;
vm_size_t sz;
{
register int npf;
register caddr_t addr;
register long flags = bp->b_flags;
int npf;
caddr_t addr;
long flags = bp->b_flags;
struct proc *p;
int off;
vm_offset_t kva;
register vm_offset_t pa;
vm_offset_t pa;
if ((flags & B_PHYS) == 0)
panic("vmapbuf");
@ -337,11 +344,11 @@ vmapbuf(bp, sz)
/*ARGSUSED*/
void
vunmapbuf(bp, sz)
register struct buf *bp;
struct buf *bp;
vm_size_t sz;
{
register caddr_t addr;
register int npf;
caddr_t addr;
int npf;
vm_offset_t kva;
if ((bp->b_flags & B_PHYS) == 0)