use BUS_SPACE_MAP_PREFETCHABLE instead BUS_SPACE_MAP_CACHEABLE where the

PCI BAR bit is referred to
This commit is contained in:
drochner 2000-01-25 22:30:04 +00:00
parent c0d973b9ae
commit 4f1e715248
4 changed files with 17 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_map.c,v 1.5 1998/08/15 10:10:54 mycroft Exp $ */
/* $NetBSD: pci_map.c,v 1.6 2000/01/25 22:30:04 drochner Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -171,8 +171,8 @@ pci_mem_find(pc, tag, reg, type, basep, sizep, flagsp)
if (sizep != 0)
*sizep = PCI_MAPREG_MEM_SIZE(mask);
if (flagsp != 0)
*flagsp = PCI_MAPREG_MEM_CACHEABLE(address) ?
BUS_SPACE_MAP_CACHEABLE : 0;
*flagsp = PCI_MAPREG_MEM_PREFETCHABLE(address) ?
BUS_SPACE_MAP_PREFETCHABLE : 0;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_subr.c,v 1.33 1999/12/15 12:27:26 kleink Exp $ */
/* $NetBSD: pci_subr.c,v 1.34 2000/01/25 22:30:04 drochner Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@ -578,7 +578,7 @@ pci_conf_print_bar(pc, tag, regs, reg, name)
}
printf("type: ");
if (PCI_MAPREG_TYPE(rval) == PCI_MAPREG_TYPE_MEM) {
const char *type, *cache;
const char *type, *prefetch;
switch (PCI_MAPREG_MEM_TYPE(rval)) {
case PCI_MAPREG_MEM_TYPE_32BIT:
@ -594,11 +594,11 @@ pci_conf_print_bar(pc, tag, regs, reg, name)
type = "unknown (XXX)";
break;
}
if (PCI_MAPREG_MEM_CACHEABLE(rval))
cache = "";
if (PCI_MAPREG_MEM_PREFETCHABLE(rval))
prefetch = "";
else
cache = "non";
printf("%s %scacheable memory\n", type, cache);
prefetch = "non";
printf("%s %sprefetchable memory\n", type, prefetch);
printf(" base: 0x%08x, size: 0x%08x\n",
PCI_MAPREG_MEM_ADDR(rval),
PCI_MAPREG_MEM_SIZE(mask));

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcireg.h,v 1.22 1999/11/16 02:13:02 enami Exp $ */
/* $NetBSD: pcireg.h,v 1.23 2000/01/25 22:30:05 drochner Exp $ */
/*
* Copyright (c) 1995, 1996, 1999
@ -314,9 +314,9 @@ typedef u_int8_t pci_revision_t;
#define PCI_MAPREG_MEM_TYPE_32BIT_1M 0x00000002
#define PCI_MAPREG_MEM_TYPE_64BIT 0x00000004
#define PCI_MAPREG_MEM_CACHEABLE(mr) \
(((mr) & PCI_MAPREG_MEM_CACHEABLE_MASK) != 0)
#define PCI_MAPREG_MEM_CACHEABLE_MASK 0x00000008
#define PCI_MAPREG_MEM_PREFETCHABLE(mr) \
(((mr) & PCI_MAPREG_MEM_PREFETCHABLE_MASK) != 0)
#define PCI_MAPREG_MEM_PREFETCHABLE_MASK 0x00000008
#define PCI_MAPREG_MEM_ADDR(mr) \
((mr) & PCI_MAPREG_MEM_ADDR_MASK)

View File

@ -1,4 +1,4 @@
/* $NetBSD: tga.c,v 1.15 1999/12/06 19:25:59 drochner Exp $ */
/* $NetBSD: tga.c,v 1.16 2000/01/25 22:30:05 drochner Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -168,11 +168,11 @@ tga_getdevconfig(memt, pc, tag, dc)
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
&dc->dc_pcipaddr, &pcisize, &flags))
return;
if ((flags & BUS_SPACE_MAP_CACHEABLE) == 0) /* XXX */
panic("tga memory not cacheable");
if ((flags & BUS_SPACE_MAP_PREFETCHABLE) == 0) /* XXX */
panic("tga memory not prefetchable");
if (bus_space_map(memt, dc->dc_pcipaddr, pcisize,
BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_LINEAR, &dc->dc_vaddr))
BUS_SPACE_MAP_PREFETCHABLE | BUS_SPACE_MAP_LINEAR, &dc->dc_vaddr))
return;
#ifdef __alpha__
dc->dc_paddr = ALPHA_K0SEG_TO_PHYS(dc->dc_vaddr); /* XXX */