summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-11 15:13:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-11 15:13:36 +0000
commit022ee57bcd79d4e1569e2c65e00ec1b71ea97f8c (patch)
treef82f8982f192a56963faea395c4badaa9e629464
parent2af8b41b710a344db823cade5939fb3b5eaf4972 (diff)
various ansi and spacing issues; pefo ok
-rw-r--r--sys/arch/sgi/localbus/com_lbus.c16
-rw-r--r--sys/arch/sgi/localbus/macebus.c93
-rw-r--r--sys/arch/sgi/pci/macepcibridge.c4
-rw-r--r--sys/arch/sgi/pci/macepcimap.c4
-rw-r--r--sys/arch/sgi/sgi/clock_md.c4
-rw-r--r--sys/arch/sgi/sgi/conf.c5
6 files changed, 49 insertions, 77 deletions
diff --git a/sys/arch/sgi/localbus/com_lbus.c b/sys/arch/sgi/localbus/com_lbus.c
index 2e063741c81..18c1e0468d2 100644
--- a/sys/arch/sgi/localbus/com_lbus.c
+++ b/sys/arch/sgi/localbus/com_lbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_lbus.c,v 1.2 2004/08/10 19:16:18 deraadt Exp $ */
+/* $OpenBSD: com_lbus.c,v 1.3 2004/08/11 15:13:35 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -58,26 +58,22 @@ com_localbus_probe(parent, match, aux)
{
bus_space_tag_t iot;
bus_space_handle_t ioh;
- int iobase;
- int rv;
struct cfdata *cf = match;
- struct confargs *ca = aux;
+ struct confargs *ca = aux;
+ int iobase, rv = 0;
/*
* Check if this is our com. If low nibble is 0 match
* against system CLASS. Else a perfect match is checked.
*/
- if ((ca->ca_sys & 0x000f) == 0) {
+ if ((ca->ca_sys & 0x000f) == 0) {
if (ca->ca_sys != (sys_config.system_type & 0xfff0))
return 0;
- } else if (ca->ca_sys != sys_config.system_type) {
+ } else if (ca->ca_sys != sys_config.system_type)
return 0;
- }
iobase = (bus_addr_t)sys_config.cons_ioaddr[cf->cf_unit];
- if (iobase == 0) {
- rv = 0; /* Not present */
- } else {
+ if (iobase) {
iot = sys_config.cons_iot;
/* if it's in use as console, it's there. */
if (!(iobase == comconsaddr && !comconsattached)) {
diff --git a/sys/arch/sgi/localbus/macebus.c b/sys/arch/sgi/localbus/macebus.c
index 033217c9f35..07529a93fa7 100644
--- a/sys/arch/sgi/localbus/macebus.c
+++ b/sys/arch/sgi/localbus/macebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macebus.c,v 1.4 2004/08/10 19:16:18 deraadt Exp $ */
+/* $OpenBSD: macebus.c,v 1.5 2004/08/11 15:13:35 deraadt Exp $ */
/*
* Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se)
@@ -130,21 +130,15 @@ struct machine_bus_dma_tag mace_bus_dma_tag = {
* Match bus only to targets which have this bus.
*/
int
-macebusmatch(parent, match, aux)
- struct device *parent;
- void *match;
- void *aux;
+macebusmatch(struct device *parent, void *match, void *aux)
{
- if (sys_config.system_type == SGI_O2) {
+ if (sys_config.system_type == SGI_O2)
return (1);
- }
- return(0);
+ return (0);
}
int
-macebusprint(aux, macebus)
- void *aux;
- const char *macebus;
+macebusprint(void *aux, const char *macebus)
{
/* XXXX print flags */
return (QUIET);
@@ -174,7 +168,7 @@ macebusscan(struct device *parent, void *child, void *args)
lba.ca_intr = 0;
lba.ca_nintr = 0;
} else {
- lba.ca_intr= cf->cf_loc[2];
+ lba.ca_intr = cf->cf_loc[2];
lba.ca_nintr = 1;
}
@@ -193,10 +187,7 @@ macebusscan(struct device *parent, void *child, void *args)
}
void
-macebusattach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
+macebusattach(struct device *parent, struct device *self, void *aux)
{
struct device *dev;
struct confargs lba;
@@ -208,26 +199,26 @@ macebusattach(parent, self, aux)
* Create an extent for the localbus control registers.
*/
macebus_tag.bus_extent = extent_create("mace_space",
- macebus_tag.bus_base, macebus_tag.bus_base + 0x00400000,
- M_DEVBUF, (caddr_t)mace_ext_storage,
- sizeof(mace_ext_storage), EX_NOCOALESCE|EX_NOWAIT);
+ macebus_tag.bus_base, macebus_tag.bus_base + 0x00400000,
+ M_DEVBUF, (caddr_t)mace_ext_storage,
+ sizeof(mace_ext_storage), EX_NOCOALESCE|EX_NOWAIT);
crimebus_tag.bus_extent = extent_create("crime_space",
- crimebus_tag.bus_base, crimebus_tag.bus_base + 0x00400000,
- M_DEVBUF, (caddr_t)crime_ext_storage,
- sizeof(crime_ext_storage), EX_NOCOALESCE|EX_NOWAIT);
+ crimebus_tag.bus_base, crimebus_tag.bus_base + 0x00400000,
+ M_DEVBUF, (caddr_t)crime_ext_storage,
+ sizeof(crime_ext_storage), EX_NOCOALESCE|EX_NOWAIT);
/*
* Map and set up CRIME control registers.
*/
if (bus_space_map(&crimebus_tag, 0x00000000, 0x400, 0, &crime_h)) {
- printf("UH-OH! Can't map CRIME control registers!\n");
+ printf(": cannot map CRIME control registers\n");
return;
}
hwmask_addr = (void *)(PHYS_TO_KSEG1(CRIMEBUS_BASE)+CRIME_INT_MASK);
creg = bus_space_read_8(&crimebus_tag, crime_h, CRIME_REVISION);
- printf(" Crime revision %d.%d\n", (creg & 0xf0) >> 4, creg & 0xf);
+ printf(": crime rev %d.%d\n", (creg & 0xf0) >> 4, creg & 0xf);
bus_space_write_8(&crimebus_tag, crime_h, CRIME_CPU_ERROR_STAT, 0);
bus_space_write_8(&crimebus_tag, crime_h, CRIME_MEM_ERROR_STAT, 0);
@@ -266,15 +257,13 @@ macebusattach(parent, self, aux)
* On O2 systems all interrupts are handled by the
* macebus interrupt handler. Register all except clock.
*/
- switch(sys_config.system_type) {
-
+ switch (sys_config.system_type) {
case SGI_O2:
set_intr(INTPRI_MACEIO, CR_INT_0, macebus_iointr);
lba.ca_bus->ab_intr_establish = macebus_intr_establish;
lba.ca_bus->ab_intr_disestablish = macebus_intr_disestablish;
register_pending_int_handler(macebus_do_pending_int);
break;
-
default:
panic("macebusscan: unknown macebus type!");
}
@@ -288,11 +277,11 @@ macebusattach(parent, self, aux)
cf = dev->dv_cfdata;
lba.ca_sys = cf->cf_loc[0];
- if (cf->cf_loc[1] == -1) {
+ if (cf->cf_loc[1] == -1)
lba.ca_baseaddr = 0;
- } else {
+ else
lba.ca_baseaddr = cf->cf_loc[1];
- }
+
if (cf->cf_loc[2] == -1) {
lba.ca_intr = 0;
lba.ca_nintr = 0;
@@ -362,7 +351,7 @@ mace_write_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int64_t v)
int
mace_space_map(bus_space_tag_t t, bus_addr_t offs, bus_size_t size,
- int cacheable, bus_space_handle_t *bshp)
+ int cacheable, bus_space_handle_t *bshp)
{
bus_addr_t bpa;
int error;
@@ -393,9 +382,8 @@ mace_space_map(bus_space_tag_t t, bus_addr_t offs, bus_size_t size,
void
mace_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
{
- bus_addr_t sva;
- bus_size_t off, len;
- bus_addr_t paddr;
+ bus_addr_t sva, paddr;
+ bus_size_t off, len;
/* should this verify that the proper size is freed? */
sva = trunc_page(bsh);
@@ -426,17 +414,16 @@ mace_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size)
int
mace_space_region(bus_space_tag_t t, bus_space_handle_t bsh,
- bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp)
+ bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp)
{
- *nbshp = bsh + offset;
- return (0);
+ *nbshp = bsh + offset;
+ return (0);
}
/*
* Macebus interrupt handler driver.
*/
-
intrmask_t mace_intem = 0x0;
static intrmask_t intrtype[INTMASKSIZE];
static intrmask_t intrmask[INTMASKSIZE];
@@ -454,21 +441,14 @@ static int fakeintr(void *a) {return 0;}
* Interrupts are numbered from 1 and up where 1 maps to HW int 0.
*/
void *
-macebus_intr_establish(icp, irq, type, level, ih_fun, ih_arg, ih_what)
- void *icp;
- u_long irq; /* XXX pci_intr_handle_t compatible XXX */
- int type;
- int level;
- int (*ih_fun) __P((void *));
- void *ih_arg;
- char *ih_what;
+macebus_intr_establish(void *icp, u_long irq, int type, int level,
+ int (*ih_fun)(void *), void *ih_arg, char *ih_what)
{
struct intrhand **p, *q, *ih;
static struct intrhand fakehand = {NULL, fakeintr};
int edge;
-extern int cold;
-
-static int initialized = 0;
+ extern int cold;
+ static int initialized = 0;
if (!initialized) {
/*INIT CODE HERE*/
@@ -546,7 +526,7 @@ macebus_intr_disestablish(void *p1, void *p2)
* Regenerate interrupt masks to reflect reality.
*/
void
-macebus_intr_makemasks()
+macebus_intr_makemasks(void)
{
int irq, level;
struct intrhand *q;
@@ -607,21 +587,21 @@ macebus_intr_makemasks()
}
void
-macebus_do_pending_int()
+macebus_do_pending_int(void)
{
struct intrhand *ih;
int vector;
intrmask_t pcpl;
intrmask_t hwpend;
struct trap_frame cf;
-static volatile int processing;
+ static volatile int processing;
/* Don't recurse... */
if (processing)
return;
processing = 1;
-/* XXX interrupt vulnerable when changing ipending */
+ /* XXX interrupt vulnerable when changing ipending */
pcpl = splhigh(); /* Turn off all */
/* XXX Fake a trapframe for clock pendings... */
@@ -727,16 +707,15 @@ macebus_iointr(intrmask_t hwpend, struct trap_frame *cf)
intrmask_t
macebus_aux(intrmask_t hwpend, struct trap_frame *cf)
{
+ extern char idle[], e_idle[];
u_int64_t mask;
-extern char idle[];
-extern char e_idle[];
mask = bus_space_read_8(&macebus_tag, mace_h, MACE_ISA_MISC_REG);
mask |= MACE_ISA_MISC_RLED_OFF | MACE_ISA_MISC_GLED_OFF;
- /* GREEN - User mode */
+ /* GREEN - User mode */
/* AMBER - System mode */
- /* RED - IDLE */
+ /* RED - IDLE */
if (cf->sr & SR_KSU_USER) {
mask &= ~MACE_ISA_MISC_GLED_OFF;
} else if (cf->pc >= (long)idle && cf->pc < (long)e_idle) {
diff --git a/sys/arch/sgi/pci/macepcibridge.c b/sys/arch/sgi/pci/macepcibridge.c
index fafe5b81817..24e114952ea 100644
--- a/sys/arch/sgi/pci/macepcibridge.c
+++ b/sys/arch/sgi/pci/macepcibridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macepcibridge.c,v 1.2 2004/08/10 19:16:18 deraadt Exp $ */
+/* $OpenBSD: macepcibridge.c,v 1.3 2004/08/11 15:13:35 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se)
@@ -211,7 +211,7 @@ pcibrattach(struct device *parent, struct device *self, void *aux)
}
pcireg = bus_space_read_4(sc->sc_memt, sc->sc_memh, MACE_PCI_REVISION);
- printf(" Mace revision %d, host system O2.\n", pcireg);
+ printf(": mace rev %d, host system O2\n", pcireg);
/* Register the PCI ERROR interrupt handler */
BUS_INTR_ESTABLISH(ca, NULL, 8, IST_LEVEL, IPL_HIGH,
diff --git a/sys/arch/sgi/pci/macepcimap.c b/sys/arch/sgi/pci/macepcimap.c
index 7ae54e31629..623ba93cb7e 100644
--- a/sys/arch/sgi/pci/macepcimap.c
+++ b/sys/arch/sgi/pci/macepcimap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macepcimap.c,v 1.1 2004/08/06 21:12:19 pefo Exp $ */
+/* $OpenBSD: macepcimap.c,v 1.2 2004/08/11 15:13:35 deraadt Exp $ */
/* $NetBSD: pci_mace.c,v 1.2 2004/01/19 10:28:28 sekiya Exp $ */
/*
@@ -90,7 +90,7 @@ pciaddr_remap(pci_chipset_tag_t pc)
if (PCI_HDRTYPE_MULTIFN(bhlcr) ||
(qd != NULL &&
- (qd->quirks & PCI_QUIRK_MULTIFUNCTION) != 0))
+ (qd->quirks & PCI_QUIRK_MULTIFUNCTION) != 0))
nfuncs = 8;
else
nfuncs = 1;
diff --git a/sys/arch/sgi/sgi/clock_md.c b/sys/arch/sgi/sgi/clock_md.c
index 60a3f60709f..48082b3e288 100644
--- a/sys/arch/sgi/sgi/clock_md.c
+++ b/sys/arch/sgi/sgi/clock_md.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock_md.c,v 1.4 2004/08/10 18:47:22 deraadt Exp $ */
+/* $OpenBSD: clock_md.c,v 1.5 2004/08/11 15:13:35 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -73,7 +73,7 @@ md_clk_attach(parent, self, aux)
if (bus_space_map(sc->sc_clk_t, MACE_ISA_RTC_OFFS, 128*256, 0,
&sc->sc_clk_h))
printf("UH!? Can't map clock device!\n");
- printf(" TOD with DS1687,");
+ printf(": TOD with DS1687,");
break;
default:
diff --git a/sys/arch/sgi/sgi/conf.c b/sys/arch/sgi/sgi/conf.c
index 1d323994518..b1bd4797c0c 100644
--- a/sys/arch/sgi/sgi/conf.c
+++ b/sys/arch/sgi/sgi/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.2 2004/08/10 18:47:22 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.3 2004/08/11 15:13:35 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -34,9 +34,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * from: @(#)conf.c 8.2 (Berkeley) 11/14/93
- * $Id: conf.c,v 1.2 2004/08/10 18:47:22 deraadt Exp $
*/
#include <sys/param.h>