KNF, ANSIfy, remove register decls

This commit is contained in:
tsutsui 2006-07-22 06:36:06 +00:00
parent 4d891ed888
commit 2895c250c2
4 changed files with 74 additions and 72 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cacheops.c,v 1.10 2005/12/11 12:17:59 christos Exp $ */
/* $NetBSD: cacheops.c,v 1.11 2006/07/22 06:36:06 tsutsui Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cacheops.c,v 1.10 2005/12/11 12:17:59 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cacheops.c,v 1.11 2006/07/22 06:36:06 tsutsui Exp $");
#include <sys/types.h>
#include <machine/cpu.h>
@ -47,8 +47,9 @@ __KERNEL_RCSID(0, "$NetBSD: cacheops.c,v 1.10 2005/12/11 12:17:59 christos Exp $
#endif
void
_TBIA()
_TBIA(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_TBIA
if (TBIA_md())
return;
@ -80,8 +81,9 @@ _TBIA()
}
void
_TBIAS()
_TBIAS(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_TBIAS
if (TBIAS_md())
return;
@ -113,8 +115,9 @@ _TBIAS()
}
void
_TBIAU()
_TBIAU(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_TBIAU
if (TBIAU_md())
return;
@ -146,8 +149,9 @@ _TBIAU()
}
void
_ICIA()
_ICIA(void)
{
switch (cputype) {
default:
#ifdef M68020
@ -174,8 +178,9 @@ _ICIA()
}
void
_ICPA()
_ICPA(void)
{
switch (cputype) {
default:
#ifdef M68020
@ -202,8 +207,9 @@ _ICPA()
}
void
_DCIA()
_DCIA(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_DCIA
if (DCIA_md())
return;
@ -235,8 +241,9 @@ _DCIA()
}
void
_DCIS()
_DCIS(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_DCIS
if (DCIS_md())
return;
@ -268,8 +275,9 @@ _DCIS()
}
void
_DCIU()
_DCIU(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_DCIU
if (DCIU_md())
return;
@ -301,8 +309,9 @@ _DCIU()
}
void
_PCIA()
_PCIA(void)
{
#ifdef M68K_CACHEOPS_MACHDEP_PCIA
if (PCIA_md())
return;
@ -334,9 +343,9 @@ _PCIA()
}
void
_TBIS(va)
vaddr_t va;
_TBIS(vaddr_t va)
{
#ifdef M68K_CACHEOPS_MACHDEP_TBIS
if (TBIS_md(va))
return;
@ -368,9 +377,9 @@ _TBIS(va)
}
void
_DCIAS(pa)
paddr_t pa;
_DCIAS(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68020
@ -398,8 +407,9 @@ _DCIAS(pa)
#if defined(M68040) || defined(M68060)
void
_DCFA()
_DCFA(void)
{
switch (cputype) {
#ifdef M68040
case CPU_68040:
@ -415,8 +425,9 @@ _DCFA()
}
void
_DCPA()
_DCPA(void)
{
switch (cputype) {
default:
#ifdef M68040
@ -433,9 +444,9 @@ _DCPA()
}
void
_ICPL(pa)
paddr_t pa;
_ICPL(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68040
@ -452,9 +463,9 @@ _ICPL(pa)
}
void
_ICPP(pa)
paddr_t pa;
_ICPP(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68040
@ -471,9 +482,9 @@ _ICPP(pa)
}
void
_DCPL(pa)
paddr_t pa;
_DCPL(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68040
@ -490,9 +501,9 @@ _DCPL(pa)
}
void
_DCPP(pa)
paddr_t pa;
_DCPP(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68040
@ -509,9 +520,9 @@ _DCPP(pa)
}
void
_DCFL(pa)
paddr_t pa;
_DCFL(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68040
@ -528,9 +539,9 @@ _DCFL(pa)
}
void
_DCFP(pa)
paddr_t pa;
_DCFP(paddr_t pa)
{
switch (cputype) {
default:
#ifdef M68040

View File

@ -1,4 +1,4 @@
/* $NetBSD: kgdb_m68k.c,v 1.5 2005/12/11 12:17:59 christos Exp $ */
/* $NetBSD: kgdb_m68k.c,v 1.6 2006/07/22 06:36:06 tsutsui Exp $ */
/*
* Copyright (c) 1990, 1993
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kgdb_m68k.c,v 1.5 2005/12/11 12:17:59 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: kgdb_m68k.c,v 1.6 2006/07/22 06:36:06 tsutsui Exp $");
#include <sys/param.h>
#include <sys/kgdb.h>
@ -58,8 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: kgdb_m68k.c,v 1.5 2005/12/11 12:17:59 christos Exp $
* (gdb only understands unix signal numbers).
*/
int
kgdb_signal(type)
int type;
kgdb_signal(int type)
{
int sigval;
@ -102,7 +101,7 @@ kgdb_signal(type)
sigval = SIGEMT;
break;
}
return (sigval);
return sigval;
}
/*
@ -125,9 +124,7 @@ kgdb_signal(type)
*/
void
kgdb_getregs(regs, gdb_regs)
db_regs_t *regs;
kgdb_reg_t *gdb_regs;
kgdb_getregs(db_regs_t *regs, kgdb_reg_t *gdb_regs)
{
int i;
@ -138,15 +135,12 @@ kgdb_getregs(regs, gdb_regs)
}
void
kgdb_setregs(regs, gdb_regs)
db_regs_t *regs;
kgdb_reg_t *gdb_regs;
kgdb_setregs(db_regs_t *regs, kgdb_reg_t *gdb_regs)
{
int i;
for (i = 0; i < 16; i++)
regs->tf_regs[i] = gdb_regs[i];
regs->tf_sr = gdb_regs[GDB_SR] |
(regs->tf_sr & PSL_T);
regs->tf_sr = gdb_regs[GDB_SR] | (regs->tf_sr & PSL_T);
regs->tf_pc = gdb_regs[GDB_PC];
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mappedcopy.c,v 1.21 2005/12/11 12:17:59 christos Exp $ */
/* $NetBSD: mappedcopy.c,v 1.22 2006/07/22 06:36:06 tsutsui Exp $ */
/*
* XXX This doesn't work yet. Soon. --thorpej@NetBSD.org
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mappedcopy.c,v 1.21 2005/12/11 12:17:59 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mappedcopy.c,v 1.22 2006/07/22 06:36:06 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -109,12 +109,10 @@ u_int mappedcopysize = -1;
static caddr_t caddr1 = 0;
int
mappedcopyin(f, t, count)
void *f, *t;
register size_t count;
mappedcopyin(void *f, void *t, size_t count)
{
register caddr_t fromp = f, top = t;
register vaddr_t kva;
caddr_t fromp = f, top = t;
vaddr_t kva;
paddr_t upa;
register size_t len;
int off, alignable;
@ -142,7 +140,7 @@ mappedcopyin(f, t, count)
* page is faulted in and read access allowed.
*/
if (fubyte(fromp) == -1)
return (EFAULT);
return EFAULT;
/*
* Map in the page and memcpy data in from it
*/
@ -164,19 +162,17 @@ mappedcopyin(f, t, count)
}
pmap_remove(pmap_kernel(), kva, kva + PAGE_SIZE);
pmap_update(pmap_kernel());
return (0);
return 0;
#undef CADDR1
}
int
mappedcopyout(f, t, count)
void *f, *t;
register size_t count;
mappedcopyout(void *f, void *t, size_t count)
{
register caddr_t fromp = f, top = t;
register vaddr_t kva;
caddr_t fromp = f, top = t;
vaddr_t kva;
paddr_t upa;
register size_t len;
size_t len;
int off, alignable;
pmap_t upmap;
#define CADDR2 caddr1
@ -202,7 +198,7 @@ mappedcopyout(f, t, count)
* page is faulted in and write access allowed.
*/
if (subyte(top, *((char *)fromp)) == -1)
return (EFAULT);
return EFAULT;
/*
* Map in the page and memcpy data out to it
*/
@ -225,6 +221,6 @@ mappedcopyout(f, t, count)
}
pmap_remove(pmap_kernel(), kva, kva + PAGE_SIZE);
pmap_update(pmap_kernel());
return (0);
return 0;
#undef CADDR2
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: regdump.c,v 1.11 2005/12/11 12:17:59 christos Exp $ */
/* $NetBSD: regdump.c,v 1.12 2006/07/22 06:36:06 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: regdump.c,v 1.11 2005/12/11 12:17:59 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: regdump.c,v 1.12 2006/07/22 06:36:06 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -99,7 +99,7 @@ void
regdump(struct trapframe *tf, int sbytes)
{
static int doingdump = 0;
register int i;
int i;
int s;
if (doingdump)
@ -127,7 +127,8 @@ regdump(struct trapframe *tf, int sbytes)
hexstr((int)(((int *)(void *)&tf)-1), 8));
dumpmem(((int *)(void *)&tf)-1, sbytes, 0);
} else {
printf("\n\nUser stack (%s):", hexstr(tf->tf_regs[SP], 8));
printf("\n\nUser stack (%s):",
hexstr(tf->tf_regs[SP], 8));
dumpmem((int *)tf->tf_regs[SP], sbytes, 1);
}
}
@ -138,11 +139,11 @@ regdump(struct trapframe *tf, int sbytes)
static void
dumpmem(int *ptr, int sz, int ustack)
{
register int i, val;
register int limit;
int i, val;
int limit;
/* Stay in the same page */
limit = ((int)ptr) | (PAGE_SIZE-3);
limit = ((int)ptr) | (PAGE_SIZE - 3);
for (i = 0; i < sz; i++) {
if ((i & 7) == 0)
@ -166,7 +167,7 @@ static char *
hexstr(int val, int len)
{
static char nbuf[9];
register int x, i;
int x, i;
if (len > 8) {
nbuf[0] = '\0';
@ -179,5 +180,5 @@ hexstr(int val, int len)
nbuf[i] = HEXDIGITS[x];
val >>= 4;
}
return(nbuf);
return nbuf;
}