summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-11 15:13:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-11 15:13:59 +0000
commita5e7078e96193df0b9f41c74d5b2f9a017cb3236 (patch)
treeae910f59397e6dd129ebadd3587c56b30e79c843 /sys
parent022ee57bcd79d4e1569e2c65e00ec1b71ea97f8c (diff)
ansi
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/cpu.c51
-rw-r--r--sys/arch/mips64/mips64/mem.c37
2 files changed, 29 insertions, 59 deletions
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index e64ec15b7ca..6434d3990e1 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.5 2004/08/10 20:28:13 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.6 2004/08/11 15:13:58 deraadt Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
@@ -65,17 +65,13 @@ cpumatch(struct device *parent, void *match, void *aux)
}
void
-cpuattach(parent, dev, aux)
- struct device *parent;
- struct device *dev;
- void *aux;
+cpuattach(struct device *parent, struct device *dev, void *aux)
{
int cpuno = dev->dv_unit;
printf(": ");
- switch(sys_config.cpu[cpuno].type) {
-
+ switch (sys_config.cpu[cpuno].type) {
case MIPS_R4000:
if (CpuPrimaryInstCacheSize == 16384)
printf("MIPS R4400 CPU");
@@ -107,11 +103,10 @@ cpuattach(parent, dev, aux)
printf("PMC-Sierra RM52X0 CPU");
break;
case MIPS_RM7000:
- if (sys_config.cpu[cpuno].vers_maj < 2) {
+ if (sys_config.cpu[cpuno].vers_maj < 2)
printf("PMC-Sierra RM7000 CPU");
- } else {
+ else
printf("PMC-Sierra RM7000A CPU");
- }
cpu_is_rm7k++;
break;
case MIPS_RM9000:
@@ -122,12 +117,10 @@ cpuattach(parent, dev, aux)
break;
}
printf(" rev %d.%d %d MHz with ", sys_config.cpu[cpuno].vers_maj,
- sys_config.cpu[cpuno].vers_min,
- sys_config.cpu[cpuno].clock / 1000000);
-
-
- switch(sys_config.cpu[cpuno].fptype) {
+ sys_config.cpu[cpuno].vers_min,
+ sys_config.cpu[cpuno].clock / 1000000);
+ switch (sys_config.cpu[cpuno].fptype) {
case MIPS_SOFT:
printf("Software emulation float");
break;
@@ -163,15 +156,13 @@ cpuattach(parent, dev, aux)
printf("Unknown FPU type (0x%x)", sys_config.cpu[cpuno].fptype);
break;
}
- printf(" rev %d.%d", sys_config.cpu[cpuno].fpvers_maj,
- sys_config.cpu[cpuno].fpvers_min);
- printf("\n");
+ printf(" rev %d.%d\n", sys_config.cpu[cpuno].fpvers_maj,
+ sys_config.cpu[cpuno].fpvers_min);
- printf("cpu%d: cache L1-I %dKB", cpuno,
- CpuPrimaryInstCacheSize / 1024);
- printf(" D %dKB ",
- CpuPrimaryDataCacheSize / 1024);
- switch(CpuNWayCache) {
+ printf("cpu%d: cache L1-I %dKB", cpuno, CpuPrimaryInstCacheSize / 1024);
+ printf(" D %dKB ", CpuPrimaryDataCacheSize / 1024);
+
+ switch (CpuNWayCache) {
case 2:
printf("2 way");
break;
@@ -182,33 +173,31 @@ cpuattach(parent, dev, aux)
printf("1 way");
break;
}
+
if (CpuSecondaryCacheSize != 0) {
- switch(sys_config.cpu[cpuno].type) {
+ switch (sys_config.cpu[cpuno].type) {
case MIPS_RM7000:
case MIPS_RM9000:
printf(", L2 %dKB 4 way", CpuSecondaryCacheSize / 1024);
break;
-
default:
printf(", L2 %dKB direct", CpuSecondaryCacheSize / 1024);
break;
}
-
}
- if (CpuTertiaryCacheSize != 0) {
+ if (CpuTertiaryCacheSize != 0)
printf(", L3 %dKB direct", CpuTertiaryCacheSize / 1024);
- }
printf("\n");
#ifdef DEBUG
printf("cpu%d: Setsize %d:%d\n", cpuno,
- CpuPrimaryInstSetSize, CpuPrimaryDataSetSize);
+ CpuPrimaryInstSetSize, CpuPrimaryDataSetSize);
printf("cpu%d: Alias mask 0x%x\n", cpuno, CpuCacheAliasMask);
printf("cpu%d: Config Register %x\n", cpuno, CpuConfigRegister);
printf("cpu%d: Cache type %x\n", cpuno, CpuCacheType);
if (fpu_id.cpu[cpuno].cp_imp == MIPS_RM7000) {
- u_int tmp;
- tmp = CpuConfigRegister;
+ u_int tmp = CpuConfigRegister;
+
printf("cpu%d: ", cpuno);
printf("K0 = %1d ",0x7 & tmp);
printf("SE = %1d ",0x1 & (tmp>>3));
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c
index 9486dab1e62..0fd86f4ad91 100644
--- a/sys/arch/mips64/mips64/mem.c
+++ b/sys/arch/mips64/mips64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.3 2004/08/10 17:06:06 pefo Exp $ */
+/* $OpenBSD: mem.c,v 1.4 2004/08/11 15:13:58 deraadt Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -73,10 +73,7 @@ cdev_decl(mm);
/*ARGSUSED*/
int
-mmopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
+mmopen(dev_t dev, int flag, int mode, struct proc *p)
{
switch (minor(dev)) {
@@ -103,10 +100,7 @@ mmopen(dev, flag, mode, p)
/*ARGSUSED*/
int
-mmclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
+mmclose(dev_t dev, int flag, int mode, struct proc *p)
{
#ifdef APERTURE
if (minor(dev) == 4)
@@ -117,15 +111,11 @@ mmclose(dev, flag, mode, p)
/*ARGSUSED*/
int
-mmrw(dev, uio, flags)
- dev_t dev;
- struct uio *uio;
- int flags;
+mmrw(dev_t dev, struct uio *uio, int flags)
{
- vaddr_t v;
- int c;
struct iovec *iov;
- int error = 0;
+ int error = 0, c;
+ vaddr_t v;
while (uio->uio_resid > 0 && error == 0) {
iov = uio->uio_iov;
@@ -155,7 +145,6 @@ mmrw(dev, uio, flags)
if ((v > KSEG0_BASE && v + c <= KSEG0_BASE + ctob(physmem)) ||
uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) {
-
error = uiomove((caddr_t)v, c, uio);
continue;
} else {
@@ -198,14 +187,11 @@ mmrw(dev, uio, flags)
/*ARGSUSED*/
paddr_t
-mmmmap(dev, off, prot)
- dev_t dev;
- off_t off;
- int prot;
+mmmmap(dev_t dev, off_t off, int prot)
{
#ifdef APERTURE
if (minor(dev) == 4) {
- if (off >= 0x0000 && off < 0x10000) {
+ if (off >= 0x0000 && off < 0x10000) {
off += sys_config.pci_io[0].bus_base;
return mips_btop(off);
} else if (off >= 0xa0000 && off < 0x10000000) {
@@ -220,12 +206,7 @@ mmmmap(dev, off, prot)
}
int
-mmioctl(dev, cmd, data, flags, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flags;
- struct proc *p;
+mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
return (EOPNOTSUPP);
}