de-__P, remove register, ansify, KNF

This commit is contained in:
chs 2002-11-28 05:38:41 +00:00
parent 56783dd727
commit 2c73702df2
16 changed files with 206 additions and 291 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: boot.c,v 1.1 2002/06/06 19:48:11 fredette Exp $ */
/* $NetBSD: boot.c,v 1.2 2002/11/28 05:38:41 chs Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -73,9 +73,6 @@
#include <sys/boot_flag.h>
#include <arch/hp700/stand/common/libsa.h>
#if 0
#include <lib/libsa/stand.h>
#endif
#include <lib/libsa/loadfile.h>
#include <machine/pdc.h>
@ -110,20 +107,20 @@ char *names[] = {
static int bdev, badapt, bctlr, bunit, bpart;
int main __P((void));
void getbootdev __P((int *));
void exec_hp700 __P((char *, u_long, int));
int main(void);
void getbootdev(int *);
void exec_hp700(char *, u_long, int);
int tgets __P((char *));
int tgets(char *);
void _rtt(void);
typedef void (*startfuncp) __P((int, int, int, int, int, int, caddr_t))
typedef void (*startfuncp)(int, int, int, int, int, int, caddr_t)
__attribute__ ((noreturn));
int howto;
void
boot(bootdev)
dev_t bootdev;
boot(dev_t bootdev)
{
machdep();
#ifdef DEBUGBUG
@ -134,7 +131,7 @@ boot(bootdev)
}
int
main()
main(void)
{
int currname = 0;
char *filename, filename_buffer[100];
@ -174,8 +171,7 @@ main()
}
void
getbootdev(howto)
int *howto;
getbootdev(int *howto)
{
char c, *ptr = line;
@ -184,7 +180,6 @@ getbootdev(howto)
if (tgets(line)) {
if (strcmp(line, "reset") == 0) {
void _rtt __P((void));
_rtt();
printf("panic: can't reboot\n");
return;
@ -212,14 +207,11 @@ getbootdev(howto)
(((x) + sizeof(u_long) - 1) & ~(sizeof(u_long) - 1))
void
exec_hp700(file, loadaddr, howto)
char *file;
u_long loadaddr;
int howto;
exec_hp700(char *file, u_long loadaddr, int howto)
{
#ifdef EXEC_DEBUG
extern int debug;
register int i;
int i;
#endif
size_t ac = BOOTARG_LEN;
caddr_t av = (caddr_t)BOOTARG_OFF;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tgets.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: tgets.c,v 1.2 2002/11/28 05:38:41 chs Exp $ */
/*-
* Copyright (c) 1993
@ -37,69 +37,69 @@
#include <sys/types.h>
time_t getsecs __P((void));
int tgetchar __P((void));
int getchar __P((void));
int putchar __P((int));
time_t getsecs(void);
int tgetchar(void);
int getchar(void);
int putchar(int);
int
tgets(buf)
char *buf;
tgets(char *buf)
{
register int c;
int i;
register char *lp = buf;
time_t seconds1, seconds2;
int c, i;
char *p, *lp = buf;
time_t seconds1, seconds2;
seconds1 = getsecs();
for (i = 10; i > 0; ) {
c = tgetchar() & 0177;
if (c) {
for (;;) {
switch (c) {
case '\n':
case '\r':
*lp = '\0';
putchar('\n');
return (1);
case '\b':
case '\177':
if (lp > buf) {
lp--;
putchar('\b');
putchar(' ');
putchar('\b');
}
break;
case '#':
if (lp > buf)
--lp;
break;
case 'r'&037: {
register char *p;
seconds1 = getsecs();
for (i = 10; i > 0; ) {
c = tgetchar() & 0177;
if (c) {
for (;;) {
switch (c) {
case '\n':
case '\r':
*lp = '\0';
putchar('\n');
return (1);
putchar('\n');
for (p = buf; p < lp; ++p)
putchar(*p);
break;
}
case '@':
case 'u'&037:
case 'w'&037:
lp = buf;
putchar('\n');
break;
default:
*lp++ = c;
putchar(c);
}
c = getchar() & 0177;
}
}
if ((seconds2 = getsecs()) != seconds1) {
seconds1 = seconds2;
i--;
case '\b':
case '\177':
if (lp > buf) {
lp--;
putchar('\b');
putchar(' ');
putchar('\b');
}
break;
case '#':
if (lp > buf)
--lp;
break;
case 'r'&037:
putchar('\n');
for (p = buf; p < lp; ++p)
putchar(*p);
break;
case '@':
case 'u'&037:
case 'w'&037:
lp = buf;
putchar('\n');
break;
default:
*lp++ = c;
putchar(c);
}
c = getchar() & 0177;
}
}
if ((seconds2 = getsecs()) != seconds1) {
seconds1 = seconds2;
i--;
}
}
}
return (0);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cons.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: cons.c,v 1.2 2002/11/28 05:38:41 chs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -49,9 +49,9 @@
int noconsole;
void
cninit()
cninit(void)
{
register struct consdev *cp;
struct consdev *cp;
cn_tab = NULL;
noconsole = 1;
@ -69,7 +69,7 @@ cninit()
}
int
cngetc()
cngetc(void)
{
if (cn_tab)
@ -78,7 +78,7 @@ cngetc()
}
int
tcngetc()
tcngetc(void)
{
if (cn_tab)
return((*cn_tab->cn_getc)(0x80));
@ -86,8 +86,7 @@ tcngetc()
}
void
cnputc(c)
int c;
cnputc(int c)
{
/* Note: the dev_t arguments are not used! */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ct.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: ct.c,v 1.2 2002/11/28 05:38:41 chs Exp $ */
/* $OpenBSD: ct.c,v 1.5 1999/04/20 20:01:01 mickey Exp $ */
@ -69,14 +69,9 @@ iodcio_t ctiodc; /* cartridge tape IODC entry point */
int ctcode[IODC_MAXSIZE/sizeof(int)];
int
#ifdef __STDC__
ctopen(struct open_file *f, ...)
#else
ctopen(f)
struct open_file *f;
#endif
{
register struct hppa_dev *dp = f->f_devdata;
struct hppa_dev *dp = f->f_devdata;
int ret;
if (ctiodc == 0) {
@ -102,10 +97,9 @@ ctopen(f)
/*ARGSUSED*/
int
ctclose(f)
struct open_file *f;
ctclose(struct open_file *f)
{
free (f->f_devdata, sizeof(struct hppa_dev));
free(f->f_devdata, sizeof(struct hppa_dev));
f->f_devdata = NULL;
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dev_hppa.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: dev_hppa.c,v 1.2 2002/11/28 05:38:41 chs Exp $ */
/* $OpenBSD: dev_hppa.c,v 1.5 1999/04/20 20:01:01 mickey Exp $ */
@ -67,14 +67,11 @@ const struct pdc_devs {
/* pass dev_t to the open routines */
int
devopen(f, fname, file)
struct open_file *f;
const char *fname;
char **file;
devopen(struct open_file *f, const char *fname, char **file)
{
register struct hppa_dev *hpd;
register const struct pdc_devs *dp = pdc_devs;
register int rc = 1;
struct hppa_dev *hpd;
const struct pdc_devs *dp = pdc_devs;
int rc = 1;
if (!(*file = strchr(fname, ':')))
return ENODEV;
@ -125,11 +122,9 @@ devopen(f, fname, file)
}
void
devboot(dev, p)
dev_t dev;
char *p;
devboot(dev_t dev, char *p)
{
register const char *q;
const char *q;
if (!dev) {
int type, unit;
@ -171,8 +166,7 @@ devboot(dev, p)
int pch_pos;
void
putchar(c)
int c;
putchar(int c)
{
switch(c) {
case '\177': /* DEL erases */
@ -208,9 +202,9 @@ putchar(c)
}
int
getchar()
getchar(void)
{
register int c = cngetc();
int c = cngetc();
if (c == '\r')
c = '\n';
@ -230,9 +224,9 @@ getchar()
}
int
tgetchar()
tgetchar(void)
{
register int c;
int c;
if ((c = tcngetc()) == 0)
return(0);
@ -241,8 +235,7 @@ tgetchar()
char ttyname_buf[8];
char *
ttyname(fd)
int fd;
ttyname(int fd)
{
sprintf(ttyname_buf, "%s%d", cdevs[major(cn_tab->cn_dev)],
minor(cn_tab->cn_dev));
@ -250,8 +243,7 @@ ttyname(fd)
}
dev_t
ttydev(name)
char *name;
ttydev(char *name)
{
int i, unit = -1;
char *no = name + strlen(name) - 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dev_hppa.h,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: dev_hppa.h,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: dev_hppa.h,v 1.3 1999/04/20 20:01:01 mickey Exp $ */
@ -41,5 +41,4 @@ extern pdcio_t pdc;
extern int pdcbuf[]; /* PDC returns, pdc.c */
extern struct pz_device ctdev; /* cartridge tape (boot) device path */
int iodc_rw __P((char *, u_int, u_int, int func, struct pz_device *));
int iodc_rw(char *, u_int, u_int, int func, struct pz_device *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dk.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: dk.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: dk.c,v 1.5 1999/04/20 20:01:01 mickey Exp $ */
@ -37,9 +37,7 @@
iodcio_t dkiodc; /* boot IODC entry point */
const char *
dk_disklabel(dp, label)
struct hppa_dev *dp;
struct disklabel *label;
dk_disklabel(struct hppa_dev *dp, struct disklabel *label)
{
char buf[DEV_BSIZE];
int ret;
@ -52,16 +50,12 @@ dk_disklabel(dp, label)
}
int
#ifdef __STDC__
dkopen(struct open_file *f, ...)
#else
dkopen(f, va_alist)
struct open_file *f;
#endif
{
register struct disklabel *lp;
register struct hppa_dev *dp = f->f_devdata;
register const char *st;
struct disklabel *lp;
struct hppa_dev *dp = f->f_devdata;
const char *st;
u_int i;
#ifdef DEBUG
if (debug)
@ -85,8 +79,6 @@ dkopen(f, va_alist)
#endif
return ERDLAB;
} else {
register u_int i;
i = B_PARTITION(dp->bootdev);
if (i >= lp->d_npartitions || !lp->d_partitions[i].p_size) {
return (EPART);
@ -101,10 +93,9 @@ dkopen(f, va_alist)
}
int
dkclose(f)
struct open_file *f;
dkclose(struct open_file *f)
{
free (f->f_devdata, sizeof(struct hppa_dev));
free(f->f_devdata, sizeof(struct hppa_dev));
f->f_devdata = NULL;
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_hppa.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: exec_hppa.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: exec_hppa.c,v 1.7 1999/05/06 02:13:15 mickey Exp $ */
@ -47,18 +47,15 @@
#include <machine/pdc.h>
#include "dev_hppa.h"
typedef void (*startfuncp) __P((int, int, int, int, int, int, caddr_t))
typedef void (*startfuncp)(int, int, int, int, int, int, caddr_t)
__attribute__ ((noreturn));
void
machdep_exec(xp, howto, loadaddr)
struct x_param *xp;
int howto;
void *loadaddr;
machdep_exec(struct x_param *xp, int howto, void *loadaddr)
{
#ifdef EXEC_DEBUG
extern int debug;
register int i;
int i;
#endif
size_t ac = BOOTARG_LEN;
caddr_t av = (caddr_t)BOOTARG_OFF;

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_som.c,v 1.1 2002/06/06 19:48:12 fredette Exp $ */
/* $NetBSD: exec_som.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: exec_som.c,v 1.1 1999/12/23 04:10:30 mickey Exp $ */
@ -40,20 +40,16 @@
#include <lib/libsa/exec.h>
int
som_probe(fd, hdr)
int fd;
union x_header *hdr;
som_probe(int fd, union x_header *hdr)
{
return !SOM_BADMAGIC(&hdr->x_som);
}
int
som_load(fd, xp)
int fd;
register struct x_param *xp;
som_load(int fd, struct x_param *xp)
{
register struct som_filehdr *xf = &xp->xp_hdr->x_som;
struct som_filehdr *xf = &xp->xp_hdr->x_som;
struct som_exec_aux x;
if (lseek(fd, xf->aux_loc, SEEK_SET) < 0 ||
@ -89,9 +85,7 @@ som_load(fd, xp)
}
int
som_ldsym(fd, xp)
int fd;
register struct x_param *xp;
som_ldsym(int fd, struct x_param *xp)
{
return -1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: itecons.c,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: itecons.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: itecons.c,v 1.6 1999/04/20 20:01:02 mickey Exp $ */
@ -75,16 +75,13 @@ char cnbuf[IODC_MINIOSIZ] __attribute__ ((aligned (IODC_MINIOSIZ)));
int kycode[IODC_MAXSIZE/sizeof(int)];
int
cnspeed(dev, sp)
dev_t dev;
int sp;
cnspeed(dev_t dev, int sp)
{
return 9600;
}
void
ite_probe(cn)
struct consdev *cn;
ite_probe(struct consdev *cn)
{
cniodc = (iodcio_t)PAGE0->mem_free;
cons_pzdev = &PAGE0->mem_cons;
@ -107,8 +104,7 @@ ite_probe(cn)
}
void
ite_init(cn)
struct consdev *cn;
ite_init(struct consdev *cn)
{
/*
* If the keyboard is separate from the console output device,
@ -148,9 +144,7 @@ ite_init(cn)
}
void
ite_putc(dev, c)
dev_t dev;
int c;
ite_putc(dev_t dev, int c)
{
if (cniodc == NULL)
return;
@ -166,11 +160,10 @@ ite_putc(dev, c)
* i store the key into the stash removing on read op later;
*/
int
ite_getc(dev)
dev_t dev;
ite_getc(dev_t dev)
{
static int stash = 0;
register int err, c, l, i;
int err, c, l, i;
if (kyiodc == NULL)
return(0x100);
@ -219,10 +212,6 @@ ite_getc(dev)
}
void
ite_pollc(dev, on)
dev_t dev;
int on;
ite_pollc(dev_t dev, int on)
{
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lf.c,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: lf.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: lf.c,v 1.3 1999/04/20 20:01:02 mickey Exp $ */
@ -40,14 +40,9 @@
#include "dev_hppa.h"
int
#ifdef __STDC__
lfopen(struct open_file *f, ...)
#else
lfopen(f, va_alist)
struct open_file *f;
#endif
{
register struct hppa_dev *dp = f->f_devdata;;
struct hppa_dev *dp = f->f_devdata;;
if (!(dp->pz_dev = pdc_findev(-1, PCL_NET_MASK|PCL_SEQU)))
return ENXIO;
@ -56,8 +51,7 @@ lfopen(f, va_alist)
}
int
lfclose(f)
struct open_file *f;
lfclose(struct open_file *f)
{
free(f->f_devdata, sizeof(struct hppa_dev));
f->f_devdata = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: libsa.h,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: libsa.h,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: libsa.h,v 1.7 1999/12/23 04:07:47 mickey Exp $ */
@ -46,51 +46,49 @@ extern dev_t bootdev;
extern struct consdev constab[];
extern struct consdev *cn_tab;
int cngetc __P((void));
void cnputc __P((int));
void cninit __P((void));
int cngetc(void);
void cnputc(int);
void cninit(void);
void pdc_init __P((void));
void pdc_init(void);
struct pz_device;
struct pz_device *pdc_findev __P((int, int));
struct pz_device *pdc_findev(int, int);
int iodcstrategy __P((void *, int, daddr_t, size_t, void *, size_t *));
int iodcstrategy(void *, int, daddr_t, size_t, void *, size_t *);
int ctopen __P((struct open_file *, ...));
int ctclose __P((struct open_file *));
int ctopen(struct open_file *, ...);
int ctclose(struct open_file *);
int dkopen __P((struct open_file *, ...));
int dkclose __P((struct open_file *));
int dkopen(struct open_file *, ...);
int dkclose(struct open_file *);
int lfopen __P((struct open_file *, ...));
int lfstrategy __P((void *, int, daddr_t, size_t, void *, size_t *));
int lfclose __P((struct open_file *));
int lfopen(struct open_file *, ...);
int lfstrategy(void *, int, daddr_t, size_t, void *, size_t *);
int lfclose(struct open_file *);
void ite_probe __P((struct consdev *));
void ite_init __P((struct consdev *));
int ite_getc __P((dev_t));
void ite_putc __P((dev_t, int));
void ite_pollc __P((dev_t, int));
void ite_probe(struct consdev *);
void ite_init(struct consdev *);
int ite_getc(dev_t);
void ite_putc(dev_t, int);
void ite_pollc(dev_t, int);
void machdep __P((void));
void devboot __P((dev_t, char *));
void fcacheall __P((void));
void machdep(void);
void devboot(dev_t, char *);
void fcacheall(void);
int lif_open __P((char *path, struct open_file *f));
int lif_close __P((struct open_file *f));
int lif_read __P((struct open_file *f, void *buf,
size_t size, size_t *resid));
int lif_write __P((struct open_file *f, void *buf,
size_t size, size_t *resid));
off_t lif_seek __P((struct open_file *f, off_t offset, int where));
int lif_stat __P((struct open_file *f, struct stat *sb));
int lif_readdir __P((struct open_file *f, char *name));
int lif_open(char *, struct open_file *);
int lif_close(struct open_file *);
int lif_read(struct open_file *, void *, size_t, size_t *);
int lif_write(struct open_file *, void *, size_t, size_t *);
off_t lif_seek(struct open_file *, off_t, int);
int lif_stat(struct open_file *, struct stat *);
int lif_readdir(struct open_file *, char *);
union x_header;
struct x_param;
int som_probe __P((int, union x_header *));
int som_load __P((int, struct x_param *));
int som_ldsym __P((int, struct x_param *));
int som_probe(int, union x_header *);
int som_load(int, struct x_param *);
int som_ldsym(int, struct x_param *);
extern int debug;
extern char bootprog_name[], bootprog_rev[], bootprog_date[],

View File

@ -1,4 +1,4 @@
/* $NetBSD: lif.c,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: lif.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: lif.c,v 1.7 2001/06/09 03:54:41 mickey Exp $ */
@ -53,13 +53,11 @@ struct file {
};
int
lif_open (path, f)
char *path;
struct open_file *f;
lif_open(char *path, struct open_file *f)
{
register struct file *fp;
register struct lifdir *dp;
register char *p, *q;
struct file *fp;
struct lifdir *dp;
char *p, *q;
struct lif_load load;
int err, buf_size, l;
@ -70,14 +68,16 @@ lif_open (path, f)
fp = alloc(sizeof(*fp));
/* XXX we're assuming here that sizeof(fp->f_buf) >= LIF_FILESTART */
if ((err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0,
sizeof(fp->f_buf), &fp->f_buf, &buf_size)) ||
buf_size != sizeof(fp->f_buf)) {
err = (*f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0,
sizeof(fp->f_buf), &fp->f_buf, &buf_size);
if (err || buf_size != sizeof(fp->f_buf)) {
#ifdef LIFDEBUG
if (debug)
printf("lif_open: unable to read LIF header (%d)\n", err);
#endif
} else if ((fp->f_lp = (struct lifvol *)fp->f_buf)->vol_id == LIF_VOL_ID) {
} else if ((fp->f_lp = (struct lifvol *)fp->f_buf)->vol_id ==
LIF_VOL_ID) {
f->f_fsdata = fp;
fp->f_ld = (struct lifdir *)(fp->f_buf + LIF_DIRSTART);
fp->f_seek = 0;
@ -151,23 +151,18 @@ lif_open (path, f)
}
int
lif_close(f)
struct open_file *f;
lif_close(struct open_file *f)
{
free (f->f_fsdata, sizeof(struct file));
free(f->f_fsdata, sizeof(struct file));
f->f_fsdata = NULL;
return 0;
}
int
lif_read(f, buf, size, resid)
struct open_file *f;
void *buf;
size_t size;
size_t *resid;
lif_read(struct open_file *f, void *buf, size_t size, size_t *resid)
{
register struct file *fp = (struct file *)f->f_fsdata;
register char *p;
struct file *fp = (struct file *)f->f_fsdata;
char *p;
char bbuf[DEV_BSIZE];
size_t bsize, count = sizeof(bbuf);
int err = 0;
@ -200,22 +195,15 @@ lif_read(f, buf, size, resid)
}
int
lif_write(f, buf, size, resid)
struct open_file *f;
void *buf;
size_t size;
size_t *resid;
lif_write(struct open_file *f, void *buf, size_t size, size_t *resid)
{
return EOPNOTSUPP;
}
off_t
lif_seek(f, offset, where)
struct open_file *f;
off_t offset;
int where;
lif_seek(struct open_file *f, off_t offset, int where)
{
register struct file *fp = (struct file *)f->f_fsdata;
struct file *fp = (struct file *)f->f_fsdata;
switch (where) {
case SEEK_SET:
@ -234,11 +222,9 @@ lif_seek(f, offset, where)
}
int
lif_stat(f, sb)
struct open_file *f;
struct stat *sb;
lif_stat(struct open_file *f, struct stat *sb)
{
register struct file *fp = (struct file *)f->f_fsdata;
struct file *fp = (struct file *)f->f_fsdata;
sb->st_mode = 0755 | (fp->f_isdir? S_IFDIR: 0); /* XXX */
sb->st_uid = 0;
@ -248,12 +234,10 @@ lif_stat(f, sb)
}
int
lif_readdir(f, name)
struct open_file *f;
char *name;
lif_readdir(struct open_file *f, char *name)
{
register struct file *fp = (struct file *)f->f_fsdata;
register char *p;
struct file *fp = (struct file *)f->f_fsdata;
char *p;
if (name) {
while ((fp->f_rd->dir_name[0] == ' ' ||

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: machdep.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: machdep.c,v 1.6 2001/06/04 22:25:52 mickey Exp $ */
@ -46,7 +46,7 @@ int howto;
dev_t bootdev;
void
machdep()
machdep(void)
{
pdc_init();
#ifdef notyet
@ -56,7 +56,7 @@ machdep()
#ifdef PDCDEBUG
if (debug) {
register int i;
int i;
printf("SSTOR:\n");
printf("pri_boot="); DEVPATH_PRINT(&sstor.ss_pri_boot);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pdc.c,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: pdc.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: pdc.c,v 1.10 1999/05/06 02:27:44 mickey Exp $ */
@ -94,7 +94,7 @@ int bdsize = sizeof(struct bootdata);
* Initialize PDC and related variables.
*/
void
pdc_init()
pdc_init(void)
{
int err;
@ -131,17 +131,12 @@ pdc_init()
* the (negative) error condition, or zero if at "EOF".
*/
int
iodcstrategy(devdata, rw, blk, size, buf, rsize)
void *devdata;
int rw;
daddr_t blk;
size_t size;
void *buf;
size_t *rsize;
iodcstrategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf,
size_t *rsize)
{
struct hppa_dev *dp = devdata;
struct pz_device *pzdev = dp->pz_dev;
register int offset, xfer, ret;
int offset, xfer, ret;
#ifdef PDCDEBUG
if (debug)
@ -273,14 +268,13 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize)
* (any if unit == -1), and of specified class (PCL_*).
*/
struct pz_device *
pdc_findev(unit, class)
int unit, class;
pdc_findev(int unit, int class)
{
static struct pz_device pz;
int layers[sizeof(pz.pz_layers)/sizeof(pz.pz_layers[0])];
register iodcio_t iodc;
register struct iomod *io;
register int err = 0;
iodcio_t iodc;
struct iomod *io;
int err = 0;
#ifdef PDCDEBUG
if (debug)
@ -306,7 +300,7 @@ pdc_findev(unit, class)
} else {
struct pdc_memmap memmap;
struct iodc_data mptr;
register int i, stp;
int i, stp;
for (i = 0; i < 0xf; i++) {
pz.pz_bc[0] = pz.pz_bc[1] =
@ -409,10 +403,9 @@ pdc_findev(unit, class)
}
static __inline void
fall(c_base, c_count, c_loop, c_stride, data)
int c_base, c_count, c_loop, c_stride, data;
fall(int c_base, int c_count, int c_loop, int c_stride, int data)
{
register int loop; /* Internal vars */
int loop;
for (; c_count--; c_base += c_stride)
for (loop = c_loop; loop--; )
@ -431,9 +424,9 @@ fall(c_base, c_count, c_loop, c_stride, data)
struct pdc_cache pdc_cacheinfo PDC_ALIGNMENT;
void
fcacheall()
fcacheall(void)
{
register int err;
int err;
if ((err = (*pdc)(PDC_CACHE, PDC_CACHE_DFLT, &pdc_cacheinfo)) < 0) {
#ifdef DEBUG
@ -456,11 +449,11 @@ fcacheall()
/*
* Flush the instruction, then data cache.
*/
fall (pdc_cacheinfo.ic_base, pdc_cacheinfo.ic_count,
pdc_cacheinfo.ic_loop, pdc_cacheinfo.ic_stride, 0);
fall(pdc_cacheinfo.ic_base, pdc_cacheinfo.ic_count,
pdc_cacheinfo.ic_loop, pdc_cacheinfo.ic_stride, 0);
sync_caches();
fall (pdc_cacheinfo.dc_base, pdc_cacheinfo.dc_count,
pdc_cacheinfo.dc_loop, pdc_cacheinfo.dc_stride, 1);
fall(pdc_cacheinfo.dc_base, pdc_cacheinfo.dc_count,
pdc_cacheinfo.dc_loop, pdc_cacheinfo.dc_stride, 1);
sync_caches();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: time.c,v 1.1 2002/06/06 19:48:13 fredette Exp $ */
/* $NetBSD: time.c,v 1.2 2002/11/28 05:38:42 chs Exp $ */
/* $OpenBSD: time.c,v 1.3 1999/02/13 04:43:18 mickey Exp $ */
@ -39,10 +39,10 @@
#include "dev_hppa.h"
time_t
getsecs()
getsecs(void)
{
int err;
register time_t tt;
time_t tt;
if ((err = (*pdc)(PDC_TOD, PDC_TOD_READ, &pdcbuf)) < 0) {
tt = 0;
@ -60,4 +60,3 @@ getsecs()
return tt;
}