remove the unneccessary alpha_mbs and slight cleanup

This commit is contained in:
mjacob 1998-05-05 22:01:54 +00:00
parent 742983f1eb
commit 294015435b
1 changed files with 20 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcpcia_pci.c,v 1.2 1998/04/30 04:25:22 mjacob Exp $ */ /* $NetBSD: mcpcia_pci.c,v 1.3 1998/05/05 22:01:54 mjacob Exp $ */
/* /*
* Copyright (c) 1998 by Matthew Jacob * Copyright (c) 1998 by Matthew Jacob
@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.2 1998/04/30 04:25:22 mjacob Exp $"); __KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.3 1998/05/05 22:01:54 mjacob Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -42,20 +42,23 @@ __KERNEL_RCSID(0, "$NetBSD: mcpcia_pci.c,v 1.2 1998/04/30 04:25:22 mjacob Exp $"
#include <dev/pci/pcireg.h> #include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h> #include <dev/pci/pcivar.h>
#include <alpha/tlsb/tlsbreg.h>
#include <alpha/pci/mcpciareg.h> #include <alpha/pci/mcpciareg.h>
#include <alpha/pci/mcpciavar.h> #include <alpha/pci/mcpciavar.h>
#define KV(_addr) ((caddr_t)ALPHA_PHYS_TO_K0SEG((_addr))) #define KV(_addr) ((caddr_t)ALPHA_PHYS_TO_K0SEG((_addr)))
void mcpcia_attach_hook __P((struct device *, struct device *, static void mcpcia_attach_hook __P((struct device *, struct device *,
struct pcibus_attach_args *)); struct pcibus_attach_args *));
int mcpcia_bus_maxdevs __P((void *, int)); static int
pcitag_t mcpcia_make_tag __P((void *, int, int, int)); mcpcia_bus_maxdevs __P((void *, int));
void mcpcia_decompose_tag __P((void *, pcitag_t, int *, int *, static pcitag_t
int *)); mcpcia_make_tag __P((void *, int, int, int));
pcireg_t mcpcia_conf_read __P((void *, pcitag_t, int)); static void
void mcpcia_conf_write __P((void *, pcitag_t, int, pcireg_t)); mcpcia_decompose_tag __P((void *, pcitag_t, int *, int *, int *));
static pcireg_t
mcpcia_conf_read __P((void *, pcitag_t, int));
static void
mcpcia_conf_write __P((void *, pcitag_t, int, pcireg_t));
void void
mcpcia_pci_init(pc, v) mcpcia_pci_init(pc, v)
@ -71,18 +74,14 @@ mcpcia_pci_init(pc, v)
pc->pc_conf_write = mcpcia_conf_write; pc->pc_conf_write = mcpcia_conf_write;
} }
void static void
mcpcia_attach_hook(parent, self, pba) mcpcia_attach_hook(parent, self, pba)
struct device *parent, *self; struct device *parent, *self;
struct pcibus_attach_args *pba; struct pcibus_attach_args *pba;
{ {
#if 0
struct mcpcia_config *ccp = pba->pba_pc->pc_conf_v;
printf("mcpcia_attach_hook for %s\n", ccp->cc_sc->mcpcia_dev.dv_xname);
#endif
} }
int static int
mcpcia_bus_maxdevs(cpv, busno) mcpcia_bus_maxdevs(cpv, busno)
void *cpv; void *cpv;
int busno; int busno;
@ -90,7 +89,7 @@ mcpcia_bus_maxdevs(cpv, busno)
return (MCPCIA_MAXDEV); return (MCPCIA_MAXDEV);
} }
pcitag_t static pcitag_t
mcpcia_make_tag(cpv, b, d, f) mcpcia_make_tag(cpv, b, d, f)
void *cpv; void *cpv;
int b, d, f; int b, d, f;
@ -100,7 +99,7 @@ mcpcia_make_tag(cpv, b, d, f)
return (tag); return (tag);
} }
void static void
mcpcia_decompose_tag(cpv, tag, bp, dp, fp) mcpcia_decompose_tag(cpv, tag, bp, dp, fp)
void *cpv; void *cpv;
pcitag_t tag; pcitag_t tag;
@ -114,7 +113,7 @@ mcpcia_decompose_tag(cpv, tag, bp, dp, fp)
*fp = (tag >> 13) & 0x7; *fp = (tag >> 13) & 0x7;
} }
pcireg_t static pcireg_t
mcpcia_conf_read(cpv, tag, offset) mcpcia_conf_read(cpv, tag, offset)
void *cpv; void *cpv;
pcitag_t tag; pcitag_t tag;
@ -138,20 +137,14 @@ mcpcia_conf_read(cpv, tag, offset)
paddr |= ((unsigned long) ((offset >> 2) << 7)); paddr |= ((unsigned long) ((offset >> 2) << 7));
paddr |= MCPCIA_PCI_CONF; paddr |= MCPCIA_PCI_CONF;
paddr |= ccp->cc_sysbase; paddr |= ccp->cc_sysbase;
#if 0
printf("mcpcia_conf_read: read paddr %lx\n", paddr);
#endif
dp = (pcireg_t *)KV(paddr); dp = (pcireg_t *)KV(paddr);
alpha_mb();
if (badaddr(dp, sizeof (*dp)) == 0) { if (badaddr(dp, sizeof (*dp)) == 0) {
data = *dp; data = *dp;
} }
return (data); return (data);
} }
void static void
mcpcia_conf_write(cpv, tag, offset, data) mcpcia_conf_write(cpv, tag, offset, data)
void *cpv; void *cpv;
pcitag_t tag; pcitag_t tag;
@ -177,12 +170,6 @@ mcpcia_conf_write(cpv, tag, offset, data)
paddr |= MCPCIA_PCI_CONF; paddr |= MCPCIA_PCI_CONF;
paddr |= ccp->cc_sysbase; paddr |= ccp->cc_sysbase;
#if 0
printf("mcpcia_conf_write: write paddr %lx\n", paddr);
#endif
dp = (pcireg_t *)KV(paddr); dp = (pcireg_t *)KV(paddr);
alpha_mb();
*dp = data; *dp = data;
alpha_mb();
} }