Build with -Wall -Wetc.

This commit is contained in:
briggs 2001-02-04 17:38:10 +00:00
parent e560b86e0b
commit 522ec180e9
10 changed files with 71 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpu.h,v 1.2 1999/12/07 15:14:56 danw Exp $ */
/* $NetBSD: fpu.h,v 1.3 2001/02/04 17:38:10 briggs Exp $ */
/*-
* Copyright (C) 1996 Wolfgang Solfrank.
@ -66,4 +66,9 @@
#define FPSCR_NI 0x00000004
#define FPSCR_RN 0x00000003
#ifdef _KERNEL
void enable_fpu __P((struct proc *p));
void save_fpu __P((struct proc *p));
#endif
#endif /* _MACHINE_FPU_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: openpic.h,v 1.1 2001/02/02 06:11:52 briggs Exp $ */
/* $NetBSD: openpic.h,v 1.2 2001/02/04 17:38:10 briggs Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@ -30,6 +30,7 @@
#include <machine/openpicreg.h>
void openpic_init __P((unsigned char *, int));
void openpic_enable_irq __P((int, int));
void openpic_disable_irq __P((int));
void openpic_set_priority __P((int, int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.17 2000/03/30 16:18:24 jdolecek Exp $ */
/* $NetBSD: pmap.h,v 1.18 2001/02/04 17:38:10 briggs Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -77,6 +77,7 @@ void pmap_bootstrap __P((u_int kernelstart, u_int kernelend));
boolean_t pmap_extract __P((struct pmap *, vaddr_t, paddr_t *));
boolean_t ptemodify __P((struct vm_page *, u_int, u_int));
int ptebits __P((struct vm_page *, int));
void pmap_real_memory __P((paddr_t *, psize_t *));
#define PMAP_NEED_PROCWR
void pmap_procwr __P((struct proc *, vaddr_t, size_t));

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_interface.c,v 1.8 2000/11/24 21:49:06 tsubai Exp $ */
/* $NetBSD: db_interface.c,v 1.9 2001/02/04 17:38:11 briggs Exp $ */
/* $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */
#include "opt_ddb.h"
@ -19,6 +19,9 @@
extern label_t *db_recover;
void ddb_trap __P((void)); /* Call into trap_subr.S */
int ddb_trap_glue __P((struct trapframe *)); /* Called from trap_subr.S */
void
cpu_Debugger()
{
@ -29,8 +32,6 @@ int
ddb_trap_glue(frame)
struct trapframe *frame;
{
int msr;
if (!(frame->srr1 & PSL_PR)
&& (frame->exc == EXC_TRC
|| (frame->exc == EXC_PGM

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_trace.c,v 1.6 2001/01/18 10:54:28 jdolecek Exp $ */
/* $NetBSD: db_trace.c,v 1.7 2001/02/04 17:38:11 briggs Exp $ */
/* $OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $ */
/*
@ -36,6 +36,7 @@
#include <machine/pmap.h>
#include <ddb/db_access.h>
#include <ddb/db_interface.h>
#include <ddb/db_sym.h>
#include <ddb/db_variables.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.8 2000/06/29 07:48:18 mrg Exp $ */
/* $NetBSD: mem.c,v 1.9 2001/02/04 17:38:11 briggs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -53,6 +53,12 @@
#include <uvm/uvm_extern.h>
/* These should be defined in a header somewhere */
int mmopen __P((dev_t, int, int));
int mmclose __P((dev_t, int, int));
int mmrw __P((dev_t, struct uio *, int));
paddr_t mmmmap __P((dev_t, off_t, int));
/*ARGSUSED*/
int
mmopen(dev, flag, mode)
@ -79,7 +85,7 @@ mmrw(dev, uio, flags)
struct uio *uio;
int flags;
{
vaddr_t o, v;
vaddr_t v;
u_int c;
struct iovec *iov;
int error = 0;
@ -101,7 +107,7 @@ mmrw(dev, uio, flags)
v = uio->uio_offset;
c = uio->uio_resid;
/* This doesn't allow device mapping! XXX */
pmap_real_memory(&v, &c);
pmap_real_memory(&v, (psize_t *) &c);
error = uiomove((caddr_t)v, c, uio);
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.33 2001/01/14 03:26:11 thorpej Exp $ */
/* $NetBSD: pmap.c,v 1.34 2001/02/04 17:38:11 briggs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -122,13 +122,27 @@ static u_int usedsr[NPMAPS / sizeof(u_int) / 8];
static int pmap_initialized;
static inline void tlbie __P((vaddr_t));
static inline void tlbsync __P((void));
static inline void tlbia __P((void));
static inline int ptesr __P((sr_t *, vaddr_t));
static inline int pteidx __P((sr_t, vaddr_t));
static inline int ptematch __P((pte_t *, sr_t, vaddr_t, int));
static __inline struct pv_entry *pa_to_pv __P((paddr_t));
static __inline char *pa_to_attr __P((paddr_t));
static int pte_insert __P((int, pte_t *));
int pte_spill __P((vaddr_t)); /* Called from trap_subr.S */
static inline int pmap_enter_pv __P((int, vaddr_t, paddr_t));
static void pmap_remove_pv __P((int, vaddr_t, paddr_t, struct pte *));
static pte_t *pte_find __P((struct pmap *, vaddr_t));
/*
* These small routines may have to be replaced,
* if/when we support processors other that the 604.
*/
static inline void
tlbie(ea)
caddr_t ea;
vaddr_t ea;
{
asm volatile ("tlbie %0" :: "r"(ea));
}
@ -142,10 +156,10 @@ tlbsync()
static void
tlbia()
{
caddr_t i;
vaddr_t i;
asm volatile ("sync");
for (i = 0; i < (caddr_t)0x00040000; i += 0x00001000)
for (i = 0; i < (vaddr_t)0x00040000; i += 0x00001000)
tlbie(i);
tlbsync();
}
@ -883,7 +897,7 @@ pmap_enter_pv(pteidx, va, pa)
s = splvm();
pv = pa_to_pv(pa);
if (first = pv->pv_idx == -1) {
if ((first = pv->pv_idx) == -1) {
/*
* No entries yet, use header as the first entry.
*/
@ -942,7 +956,7 @@ pmap_remove_pv(pteidx, va, pa, pte)
} else
pv->pv_idx = -1;
} else {
for (; npv = pv->pv_next; pv = npv)
for (; (npv = pv->pv_next) != NULL; pv = npv)
if (pteidx == npv->pv_idx && va == npv->pv_va)
break;
if (npv) {
@ -968,12 +982,11 @@ pmap_enter(pm, va, pa, prot, flags)
int flags;
{
sr_t sr;
int idx, i, s;
int idx, s;
pte_t pte;
struct pte_ovfl *po;
int managed;
struct mem_region *mp;
boolean_t wired = (flags & PMAP_WIRED) != 0;
/*
* Have to remove any existing mapping first.
@ -1185,7 +1198,7 @@ pmap_protect(pm, sva, eva, prot)
if (prot & VM_PROT_READ) {
s = splvm();
while (sva < eva) {
if (ptp = pte_find(pm, sva)) {
if ((ptp = pte_find(pm, sva)) != NULL) {
valid = ptp->pte_hi & PTE_VALID;
ptp->pte_hi &= ~PTE_VALID;
asm volatile ("sync");

View File

@ -1,4 +1,4 @@
/* $NetBSD: process_machdep.c,v 1.4 2000/06/09 14:05:04 kleink Exp $ */
/* $NetBSD: process_machdep.c,v 1.5 2001/02/04 17:38:11 briggs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -37,6 +37,7 @@
#include <sys/systm.h>
#include <sys/ptrace.h>
#include <machine/fpu.h>
#include <machine/pcb.h>
#include <machine/reg.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.35 2001/01/01 04:33:39 tsubai Exp $ */
/* $NetBSD: trap.c,v 1.36 2001/02/04 17:38:11 briggs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -45,7 +45,11 @@
#include <uvm/uvm_extern.h>
#include <dev/cons.h>
#include <machine/cpu.h>
#include <machine/db_machdep.h>
#include <machine/fpu.h>
#include <machine/frame.h>
#include <machine/pcb.h>
#include <machine/pmap.h>
@ -65,6 +69,13 @@ volatile int want_resched;
void *syscall = NULL; /* XXX dummy symbol for emul_netbsd */
static int fix_unaligned __P((struct proc *p, struct trapframe *frame));
static inline void setusr __P((int));
void trap __P((struct trapframe *)); /* Called from locore / trap_subr */
int setfault __P((faultbuf)); /* defined in locore.S */
/* Why are these not defined in a header? */
int badaddr __P((void *, size_t));
int badaddr_read __P((void *, size_t, int *));
void
trap(frame)
@ -110,7 +121,7 @@ trap(frame)
KERNEL_UNLOCK();
if (rv == KERN_SUCCESS)
return;
if (fb = p->p_addr->u_pcb.pcb_onfault) {
if ((fb = p->p_addr->u_pcb.pcb_onfault) != NULL) {
frame->srr0 = (*fb)[0];
frame->fixreg[1] = (*fb)[1];
frame->fixreg[2] = (*fb)[2];
@ -302,7 +313,7 @@ syscall_bad:
{
faultbuf *fb;
if (fb = p->p_addr->u_pcb.pcb_onfault) {
if ((fb = p->p_addr->u_pcb.pcb_onfault) != NULL) {
frame->srr0 = (*fb)[0];
frame->fixreg[1] = (*fb)[1];
frame->fixreg[2] = (*fb)[2];
@ -332,7 +343,7 @@ brain_damage:
{
int sig;
while (sig = CURSIG(p))
while ((sig = CURSIG(p)) != 0)
postsig(sig);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.22 2000/11/25 02:59:34 matt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.23 2001/02/04 17:38:11 briggs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -42,6 +42,7 @@
#include <uvm/uvm_extern.h>
#include <machine/fpu.h>
#include <machine/pcb.h>
/*
@ -186,6 +187,7 @@ void
cpu_exit(p)
struct proc *p;
{
void switchexit __P((struct proc *)); /* Defined in locore.S */
#ifdef ALTIVEC
struct pcb *pcb = &p->p_addr->u_pcb;
#endif
@ -245,13 +247,13 @@ cpu_coredump(p, vp, cred, chdr)
cseg.c_addr = 0;
cseg.c_size = chdr->c_cpusize;
if (error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
if ((error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
(off_t)chdr->c_hdrsize, UIO_SYSSPACE,
IO_NODELOCKED|IO_UNIT, cred, NULL, p))
IO_NODELOCKED|IO_UNIT, cred, NULL, p)) != 0)
return error;
if (error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof md_core,
if ((error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof md_core,
(off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
IO_NODELOCKED|IO_UNIT, cred, NULL, p))
IO_NODELOCKED|IO_UNIT, cred, NULL, p)) != 0)
return error;
chdr->c_nseg++;