summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-01-10 03:55:40 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-01-10 03:55:40 +0000
commit28100039e1f0137c4d7c12f19db829f2abda51b0 (patch)
treeecaad7ad7ac61dba89a213274739d3f49e8b7dae
parentc4d7e35492666ec7f56d61b18509cda8859943e2 (diff)
Fix some -Wall complaints
pmap_enter() now takes an extra arg trapsignal() now takes a union sigval as the last arg A kbus kernel now links but is untested--much more remains to be done.
-rw-r--r--sys/arch/kbus/dev/sbic.c5
-rw-r--r--sys/arch/kbus/dev/xd.c2
-rw-r--r--sys/arch/kbus/fpu/fpu.c12
-rw-r--r--sys/arch/kbus/include/pmap.h1
-rw-r--r--sys/arch/kbus/kbus/autoconf.c22
-rw-r--r--sys/arch/kbus/kbus/disksubr.c4
-rw-r--r--sys/arch/kbus/kbus/machdep.c13
-rw-r--r--sys/arch/kbus/kbus/mem.c2
-rw-r--r--sys/arch/kbus/kbus/pmap.c5
-rw-r--r--sys/arch/kbus/kbus/trap.c27
-rw-r--r--sys/arch/kbus/kbus/vm_machdep.c10
11 files changed, 58 insertions, 45 deletions
diff --git a/sys/arch/kbus/dev/sbic.c b/sys/arch/kbus/dev/sbic.c
index 124afc70b4b..35caf51c4e6 100644
--- a/sys/arch/kbus/dev/sbic.c
+++ b/sys/arch/kbus/dev/sbic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbic.c,v 1.2 1999/01/11 05:11:27 millert Exp $ */
+/* $OpenBSD: sbic.c,v 1.3 2000/01/10 03:55:36 millert Exp $ */
/* $NetBSD: sbic.c,v 1.28 1996/10/13 03:07:29 christos Exp $ */
/*
@@ -2352,7 +2352,7 @@ sbicnextstate(dev, csr, asr)
wait = sbic_data_wait;
if( sbicxfstart(regs,
acb->sc_kv.dc_count,
- SBIC_PHASE(csr), wait))
+ SBIC_PHASE(csr), wait)) {
if( SBIC_PHASE(csr) == DATA_IN_PHASE )
/* data in? */
i=sbicxfin(regs,
@@ -2363,6 +2363,7 @@ sbicnextstate(dev, csr, asr)
acb->sc_kv.dc_count,
acb->sc_kv.dc_addr,
SBIC_PHASE(csr));
+ }
acb->sc_kv.dc_addr +=
(acb->sc_kv.dc_count - i);
acb->sc_kv.dc_count = i;
diff --git a/sys/arch/kbus/dev/xd.c b/sys/arch/kbus/dev/xd.c
index 69b73428fd7..c4c8a9793c9 100644
--- a/sys/arch/kbus/dev/xd.c
+++ b/sys/arch/kbus/dev/xd.c
@@ -1537,7 +1537,7 @@ xdc_submit_iorq(xdcsc, iorqno, type)
int
xdc_piodriver(xdcsc, iorqno, freeone)
struct xdc_softc *xdcsc;
- char iorqno;
+ int iorqno;
int freeone;
{
diff --git a/sys/arch/kbus/fpu/fpu.c b/sys/arch/kbus/fpu/fpu.c
index 2eaef3290b1..e72048bc90a 100644
--- a/sys/arch/kbus/fpu/fpu.c
+++ b/sys/arch/kbus/fpu/fpu.c
@@ -110,9 +110,11 @@ fpu_cleanup(p, fs)
{
register int i, fsr = fs->fs_fsr, error;
union instr instr;
- caddr_t pc = (caddr_t)p->p_md.md_tf->tf_pc; /* XXX only approximate */
+ union sigval sv;
struct fpemu fe;
+ sv.sival_int = p->p_md.md_tf->tf_pc; /* XXX only approximate */
+
switch ((fsr >> FSR_FTT_SHIFT) & FSR_FTT_MASK) {
case FSR_TT_NONE:
@@ -122,7 +124,7 @@ fpu_cleanup(p, fs)
case FSR_TT_IEEE:
if ((i = fsr & FSR_CX) == 0)
panic("fpu ieee trap, but no exception");
- trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - i], pc);
+ trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - i], sv);
break; /* XXX should return, but queue remains */
case FSR_TT_UNFIN:
@@ -139,7 +141,7 @@ fpu_cleanup(p, fs)
log(LOG_ERR, "fpu hardware error (%s[%d])\n",
p->p_comm, p->p_pid);
uprintf("%s[%d]: fpu hardware error\n", p->p_comm, p->p_pid);
- trapsignal(p, SIGFPE, -1, FPE_FLTINV, pc); /* ??? */
+ trapsignal(p, SIGFPE, -1, FPE_FLTINV, sv); /* ??? */
goto out;
default:
@@ -164,11 +166,11 @@ fpu_cleanup(p, fs)
case FPE:
trapsignal(p, SIGFPE,
fpu_codes[(fs->fs_fsr & FSR_CX) - 1],
- fpu_types[(fs->fs_fsr & FSR_CX) - 1], pc);
+ fpu_types[(fs->fs_fsr & FSR_CX) - 1], sv);
break;
case NOTFPU:
- trapsignal(p, SIGILL, 0, ILL_COPROC, pc);
+ trapsignal(p, SIGILL, 0, ILL_COPROC, sv);
break;
default:
diff --git a/sys/arch/kbus/include/pmap.h b/sys/arch/kbus/include/pmap.h
index 96627806e42..228516d859a 100644
--- a/sys/arch/kbus/include/pmap.h
+++ b/sys/arch/kbus/include/pmap.h
@@ -292,6 +292,7 @@ struct pmap kernel_pmap_store;
struct pmap kernel_pmap_store;
void pmap_bootstrap __P((vm_offset_t firstaddr));
void pmap_disp_va __P((pmap_t pmap, vm_offset_t va));
+vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int));
struct user;
void switchexit __P((vm_map_t, struct user *, int));
diff --git a/sys/arch/kbus/kbus/autoconf.c b/sys/arch/kbus/kbus/autoconf.c
index 6bba4bb6d39..328aa08c327 100644
--- a/sys/arch/kbus/kbus/autoconf.c
+++ b/sys/arch/kbus/kbus/autoconf.c
@@ -67,7 +67,9 @@
#include <machine/vmparam.h>
#include <machine/kbus.h>
-void swapconf __P((void));
+void setroot __P((void));
+void swapconf __P((void));
+
/*
* The following several variables are related to
* the configuration process, and are used in initializing
@@ -89,19 +91,19 @@ configure()
if (config_rootfound("mainbus", NULL) == NULL)
panic ("No mainbus found!");
- spl0();
+ (void)spl0();
- setconf ();
- swapconf ();
-#if 0
/*
* Configure swap area and related system
* parameter based on device(s) used.
*/
- dumpconf();
+#if 0 /* XXX */
+ setroot();
#endif
+ swapconf();
cold = 0;
- printf ("******* COLD = 0 ********\n");
+
+ printf ("******* COLD = 0 ********\n"); /* XXX */
}
/*
@@ -357,7 +359,8 @@ bus_mapin(bustype, paddr, size)
do {
pmap_enter(pmap_kernel(), v, pa | PG_IO,
- VM_PROT_READ | VM_PROT_WRITE, 1);
+ VM_PROT_READ | VM_PROT_WRITE, 1,
+ VM_PROT_READ | VM_PROT_WRITE);
v += PAGE_SIZE;
pa += PAGE_SIZE;
} while ((size -= PAGE_SIZE) > 0);
@@ -397,7 +400,8 @@ int bus_peek(bustype, paddr, sz)
off = paddr & PGOFSET;
pmap_enter (pmap_kernel(), peek_addr, (paddr & PG_FRAME) | PG_IO,
- VM_PROT_READ | VM_PROT_WRITE, 1);
+ VM_PROT_READ | VM_PROT_WRITE, 1,
+ VM_PROT_READ | VM_PROT_WRITE);
return probeget ((caddr_t)peek_addr + off, sz);
}
diff --git a/sys/arch/kbus/kbus/disksubr.c b/sys/arch/kbus/kbus/disksubr.c
index 52be09fc670..21a1042967c 100644
--- a/sys/arch/kbus/kbus/disksubr.c
+++ b/sys/arch/kbus/kbus/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.4 1999/01/08 04:29:06 millert Exp $ */
+/* $OpenBSD: disksubr.c,v 1.5 2000/01/10 03:55:38 millert Exp $ */
/* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */
/*
@@ -175,7 +175,7 @@ setdisklabel(olp, nlp, openmask, clp)
u_long openmask;
struct cpu_disklabel *clp;
{
- register i;
+ register int i;
register struct partition *opp, *npp;
/* sanity clause */
diff --git a/sys/arch/kbus/kbus/machdep.c b/sys/arch/kbus/kbus/machdep.c
index f7876bb310d..03bb797b874 100644
--- a/sys/arch/kbus/kbus/machdep.c
+++ b/sys/arch/kbus/kbus/machdep.c
@@ -136,6 +136,7 @@ static int _mapped; /* TG: FIXME. */
extern char end[], _edata[];
extern vm_offset_t avail_start;
extern vm_offset_t avail_end;
+extern vm_size_t mem_size;
/*
* dvmamap is used to manage DVMA memory. Note: this coincides with
@@ -328,11 +329,7 @@ long dumplo;
int physmem;
extern int bootdev;
-extern cyloffset;
-
-/* pmap_enter prototype */
-void pmap_enter __P((register pmap_t, vm_offset_t, register vm_offset_t,
- vm_prot_t, boolean_t));
+extern int cyloffset;
void
cpu_startup(void)
@@ -517,11 +514,12 @@ allocsys(v)
* memory. Insure a minimum of 16 buffers.
* We allocate 1/2 as many swap buffer headers as file i/o buffers.
*/
- if (bufpages == 0)
+ if (bufpages == 0) {
if (physmem < (2 * 1024 * 1024))
bufpages = physmem / 10 / CLSIZE;
else
bufpages = ((2 * 1024 * 1024 + physmem) / 40) / CLSIZE;
+ }
bufpages = min(NKMEMCLUSTERS*2/5, bufpages); /* XXX ? - cgd */
@@ -1231,7 +1229,8 @@ cpu_exec_aout_makecmds(p, epp)
int error = ENOEXEC;
#ifdef COMPAT_SUNOS
- extern sunos_exec_aout_makecmds __P((struct proc *, struct exec_package *));
+ extern int sunos_exec_aout_makecmds __P((struct proc *,
+ struct exec_package *));
if ((error = sunos_exec_aout_makecmds(p, epp)) == 0)
return 0;
#endif
diff --git a/sys/arch/kbus/kbus/mem.c b/sys/arch/kbus/kbus/mem.c
index fc176e9b88f..8e57ec7f82a 100644
--- a/sys/arch/kbus/kbus/mem.c
+++ b/sys/arch/kbus/kbus/mem.c
@@ -138,7 +138,7 @@ mmrw(dev, uio, flags)
#endif
pmap_enter(pmap_kernel(), (vm_offset_t)vmmap,
trunc_page(v), uio->uio_rw == UIO_READ ?
- VM_PROT_READ : VM_PROT_WRITE, TRUE);
+ VM_PROT_READ : VM_PROT_WRITE, TRUE, 0);
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
error = uiomove((caddr_t)vmmap + o, c, uio);
diff --git a/sys/arch/kbus/kbus/pmap.c b/sys/arch/kbus/kbus/pmap.c
index 88198761585..44ca9e4e975 100644
--- a/sys/arch/kbus/kbus/pmap.c
+++ b/sys/arch/kbus/kbus/pmap.c
@@ -296,7 +296,7 @@ pmap_map(virt, start, end, prot)
printf("pmap_map(%x, %x, %x, %x)\n", virt, start, end, prot);
#endif
while (start < end) {
- pmap_enter(pmap_kernel(), virt, start, prot, FALSE);
+ pmap_enter(pmap_kernel(), virt, start, prot, FALSE, 0);
virt += PAGE_SIZE;
start += PAGE_SIZE;
}
@@ -724,12 +724,13 @@ pmap_is_page_ro(pmap, va, entry)
* insert this page into the given map NOW.
*/
void
-pmap_enter(pmap, va, pa, prot, wired)
+pmap_enter(pmap, va, pa, prot, wired, access_type)
register pmap_t pmap;
vm_offset_t va;
register vm_offset_t pa;
vm_prot_t prot;
boolean_t wired;
+ vm_prot_t access_type;
{
register pt_entry_t *pte;
register u_int npte;
diff --git a/sys/arch/kbus/kbus/trap.c b/sys/arch/kbus/kbus/trap.c
index a4640d1b636..f54f3cf36cc 100644
--- a/sys/arch/kbus/kbus/trap.c
+++ b/sys/arch/kbus/kbus/trap.c
@@ -269,6 +269,9 @@ trap(type, psr, pc, tf)
register struct pcb *pcb;
register int n;
u_quad_t sticks;
+ union sigval sv;
+
+ sv.sival_int = pc; /* XXX fix for parm five of trapsignal() */
/* This steps the PC over the trap. */
#define ADVANCE (n = tf->tf_npc, tf->tf_pc = n, tf->tf_npc = n + 4)
@@ -335,7 +338,7 @@ badtrap:
/* ... but leave it in until we find anything */
printf("%s[%d]: unimplemented software trap 0x%x\n",
p->p_comm, p->p_pid, type);
- trapsignal(p, SIGILL, type, ILL_ILLOPC, (caddr_t)pc);
+ trapsignal(p, SIGILL, type, ILL_ILLOPC, sv);
break;
#ifdef COMPAT_SVR4
@@ -355,11 +358,11 @@ badtrap:
break; /* the work is all in userret() */
case T_ILLINST:
- trapsignal(p, SIGILL, 0, ILL_ILLOPC, (caddr_t)pc);
+ trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv);
break;
case T_PRIVINST:
- trapsignal(p, SIGILL, 0, ILL_PRVOPC, (caddr_t)pc);
+ trapsignal(p, SIGILL, 0, ILL_PRVOPC, sv);
break;
case T_FPDISABLED: {
@@ -451,7 +454,7 @@ badtrap:
break;
case T_ALIGN:
- trapsignal(p, SIGBUS, 0, BUS_ADRALN, (caddr_t)pc);
+ trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv);
break;
case T_FPE:
@@ -476,21 +479,21 @@ badtrap:
break;
case T_TAGOF:
- trapsignal(p, SIGEMT, 0, EMT_TAGOVF, (caddr_t)pc);
+ trapsignal(p, SIGEMT, 0, EMT_TAGOVF, sv);
break;
case T_CPDISABLED:
uprintf("coprocessor instruction\n"); /* XXX */
- trapsignal(p, SIGILL, 0, FPE_FLTINV, (caddr_t)pc);
+ trapsignal(p, SIGILL, 0, FPE_FLTINV, sv);
break;
case T_BREAKPOINT:
- trapsignal(p, SIGTRAP, 0, TRAP_BRKPT, (caddr_t)pc);
+ trapsignal(p, SIGTRAP, 0, TRAP_BRKPT, sv);
break;
case T_DIV0:
ADVANCE;
- trapsignal(p, SIGFPE, 0, FPE_INTDIV, (caddr_t)pc);
+ trapsignal(p, SIGFPE, 0, FPE_INTDIV, sv);
break;
case T_FLUSHWIN:
@@ -510,7 +513,7 @@ badtrap:
case T_RANGECHECK:
uprintf("T_RANGECHECK\n"); /* XXX */
ADVANCE;
- trapsignal(p, SIGILL, 0, ILL_ILLOPN, (caddr_t)pc);
+ trapsignal(p, SIGILL, 0, ILL_ILLOPN, sv);
break;
case T_FIXALIGN:
@@ -521,7 +524,7 @@ badtrap:
case T_INTOF:
uprintf("T_INTOF\n"); /* XXX */
ADVANCE;
- trapsignal(p, SIGFPE, FPE_INTOVF_TRAP, FPE_INTOVF, (caddr_t)pc);
+ trapsignal(p, SIGFPE, FPE_INTOVF_TRAP, FPE_INTOVF, sv);
break;
case 0xff: /* Temporary hack... */
zs_hack ();
@@ -621,6 +624,7 @@ mem_access_fault(type, fcr, fvar, pc, psr, tf)
vm_prot_t ftype;
int onfault;
u_quad_t sticks;
+ union sigval sv;
int otype;
/* During autoconfig. */
@@ -828,7 +832,8 @@ kfault:
tf->tf_npc = onfault + 4;
return;
}
- trapsignal(p, SIGSEGV, ftype, SEGV_MAPERR, (caddr_t)fvar);
+ sv.sival_int = fvar;
+ trapsignal(p, SIGSEGV, ftype, SEGV_MAPERR, sv);
}
/* out: */
if ((psr & PSR_PS) == 0) {
diff --git a/sys/arch/kbus/kbus/vm_machdep.c b/sys/arch/kbus/kbus/vm_machdep.c
index 445f159f2e5..7c054c2029f 100644
--- a/sys/arch/kbus/kbus/vm_machdep.c
+++ b/sys/arch/kbus/kbus/vm_machdep.c
@@ -94,7 +94,7 @@ cpu_fork(p1, p2, stack, stacksize)
for (i=0; i < UPAGES; i++)
pmap_enter(&p2->p_vmspace->vm_pmap, USRSTACK+i*NBPG,
pmap_extract(pmap_kernel(), ((int)p2->p_addr)+i*NBPG),
- VM_PROT_READ, TRUE);
+ VM_PROT_READ, TRUE, 0);
pmap_activate(&p2->p_vmspace->vm_pmap, &up->u_pcb);
@@ -169,7 +169,8 @@ pagemove(from, to, size)
pmap_remove(pmap_kernel(),
(vm_offset_t)from, (vm_offset_t)from + PAGE_SIZE);
pmap_enter(pmap_kernel(),
- (vm_offset_t)to, pa, VM_PROT_READ|VM_PROT_WRITE, 1);
+ (vm_offset_t)to, pa, VM_PROT_READ | VM_PROT_WRITE, 1,
+ VM_PROT_READ | VM_PROT_WRITE);
from += PAGE_SIZE;
to += PAGE_SIZE;
size -= PAGE_SIZE;
@@ -212,9 +213,8 @@ vmapbuf(bp, sz)
* pmap_enter distributes this mapping to all
* contexts... maybe we should avoid this extra work
*/
- pmap_enter(pmap_kernel(), kva,
- pa,
- VM_PROT_READ|VM_PROT_WRITE, 1);
+ pmap_enter(pmap_kernel(), kva, pa,
+ VM_PROT_READ | VM_PROT_WRITE, 1, 0);
addr += PAGE_SIZE;
kva += PAGE_SIZE;