ANSIfy.
This commit is contained in:
parent
61f5f2c87d
commit
d8a85de05c
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pchb.c,v 1.7 2005/12/11 12:17:06 christos Exp $ */
|
/* $NetBSD: pchb.c,v 1.8 2006/04/05 15:46:58 tsutsui Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.7 2005/12/11 12:17:06 christos Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.8 2006/04/05 15:46:58 tsutsui Exp $");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -47,10 +47,7 @@ CFATTACH_DECL(pchb, sizeof(struct device),
|
||||||
pchb_match, pchb_attach, NULL, NULL);
|
pchb_match, pchb_attach, NULL, NULL);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pchb_match(parent, match, aux)
|
pchb_match(struct device *parent, struct cfdata *match, void *aux)
|
||||||
struct device *parent;
|
|
||||||
struct cfdata *match;
|
|
||||||
void *aux;
|
|
||||||
{
|
{
|
||||||
struct pci_attach_args *pa = aux;
|
struct pci_attach_args *pa = aux;
|
||||||
|
|
||||||
|
@ -62,9 +59,7 @@ pchb_match(parent, match, aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pchb_attach(parent, self, aux)
|
pchb_attach(struct device *parent, struct device *self, void *aux)
|
||||||
struct device *parent, *self;
|
|
||||||
void *aux;
|
|
||||||
{
|
{
|
||||||
struct pci_attach_args *pa = aux;
|
struct pci_attach_args *pa = aux;
|
||||||
int major, minor;
|
int major, minor;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pci_machdep.c,v 1.19 2006/02/10 20:52:56 gdamore Exp $ */
|
/* $NetBSD: pci_machdep.c,v 1.20 2006/04/05 15:46:58 tsutsui Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.19 2006/02/10 20:52:56 gdamore Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.20 2006/04/05 15:46:58 tsutsui Exp $");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -68,9 +68,8 @@ struct cobalt_bus_dma_tag pci_bus_dma_tag = {
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
pci_attach_hook(parent, self, pba)
|
pci_attach_hook(struct device *parent, struct device *self,
|
||||||
struct device *parent, *self;
|
struct pcibus_attach_args *pba)
|
||||||
struct pcibus_attach_args *pba;
|
|
||||||
{
|
{
|
||||||
/* XXX */
|
/* XXX */
|
||||||
|
|
||||||
|
@ -78,27 +77,23 @@ pci_attach_hook(parent, self, pba)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pci_bus_maxdevs(pc, busno)
|
pci_bus_maxdevs(pci_chipset_tag_t pc, int busno)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
int busno;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcitag_t
|
pcitag_t
|
||||||
pci_make_tag(pc, bus, device, function)
|
pci_make_tag(pci_chipset_tag_t pc, int bus, int device, int function)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
int bus, device, function;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
return (bus << 16) | (device << 11) | (function << 8);
|
return (bus << 16) | (device << 11) | (function << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pci_decompose_tag(pc, tag, bp, dp, fp)
|
pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, int *bp, int *dp, int *fp)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
pcitag_t tag;
|
|
||||||
int *bp, *dp, *fp;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (bp != NULL)
|
if (bp != NULL)
|
||||||
*bp = (tag >> 16) & 0xff;
|
*bp = (tag >> 16) & 0xff;
|
||||||
if (dp != NULL)
|
if (dp != NULL)
|
||||||
|
@ -108,10 +103,7 @@ pci_decompose_tag(pc, tag, bp, dp, fp)
|
||||||
}
|
}
|
||||||
|
|
||||||
pcireg_t
|
pcireg_t
|
||||||
pci_conf_read(pc, tag, reg)
|
pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
pcitag_t tag;
|
|
||||||
int reg;
|
|
||||||
{
|
{
|
||||||
pcireg_t data;
|
pcireg_t data;
|
||||||
int bus, dev, func;
|
int bus, dev, func;
|
||||||
|
@ -138,11 +130,7 @@ pci_conf_read(pc, tag, reg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pci_conf_write(pc, tag, reg, data)
|
pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t data)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
pcitag_t tag;
|
|
||||||
int reg;
|
|
||||||
pcireg_t data;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
bus_space_write_4(pc->pc_bst, pc->pc_bsh, GT_PCICFG_ADDR,
|
bus_space_write_4(pc->pc_bst, pc->pc_bsh, GT_PCICFG_ADDR,
|
||||||
|
@ -152,9 +140,7 @@ pci_conf_write(pc, tag, reg, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pci_intr_map(pa, ihp)
|
pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
|
||||||
struct pci_attach_args *pa;
|
|
||||||
pci_intr_handle_t *ihp;
|
|
||||||
{
|
{
|
||||||
pci_chipset_tag_t pc = pa->pa_pc;
|
pci_chipset_tag_t pc = pa->pa_pc;
|
||||||
pcitag_t intrtag = pa->pa_intrtag;
|
pcitag_t intrtag = pa->pa_intrtag;
|
||||||
|
@ -180,9 +166,7 @@ pci_intr_map(pa, ihp)
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
pci_intr_string(pc, ih)
|
pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
pci_intr_handle_t ih;
|
|
||||||
{
|
{
|
||||||
static char irqstr[8];
|
static char irqstr[8];
|
||||||
|
|
||||||
|
@ -195,9 +179,7 @@ pci_intr_string(pc, ih)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct evcnt *
|
const struct evcnt *
|
||||||
pci_intr_evcnt(pc, ih)
|
pci_intr_evcnt(pci_chipset_tag_t pc, pci_intr_handle_t ih)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
pci_intr_handle_t ih;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* XXX for now, no evcnt parent reported */
|
/* XXX for now, no evcnt parent reported */
|
||||||
|
@ -205,12 +187,10 @@ pci_intr_evcnt(pc, ih)
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
pci_intr_establish(pc, ih, level, func, arg)
|
pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
|
||||||
pci_chipset_tag_t pc;
|
int (*func)(void *), void *arg)
|
||||||
pci_intr_handle_t ih;
|
|
||||||
int level, (*func)(void *);
|
|
||||||
void *arg;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ih >= 16)
|
if (ih >= 16)
|
||||||
return cpu_intr_establish(ih - 16, level, func, arg);
|
return cpu_intr_establish(ih - 16, level, func, arg);
|
||||||
else
|
else
|
||||||
|
@ -218,10 +198,9 @@ pci_intr_establish(pc, ih, level, func, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pci_intr_disestablish(pc, cookie)
|
pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie)
|
||||||
pci_chipset_tag_t pc;
|
|
||||||
void *cookie;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Try both, only the valid one will disestablish. */
|
/* Try both, only the valid one will disestablish. */
|
||||||
cpu_intr_disestablish(cookie);
|
cpu_intr_disestablish(cookie);
|
||||||
icu_intr_disestablish(cookie);
|
icu_intr_disestablish(cookie);
|
||||||
|
|
Loading…
Reference in New Issue