From 4a40b0145384f27d740cb2a91b2470f0cc824128 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 30 Jun 2011 00:52:55 +0000 Subject: [PATCH] Modify mapiodev to take a third argument indicating whether the space should be prefetchable (true) or not (false). --- sys/arch/bebox/bebox/machdep.c | 6 +++--- sys/arch/bebox/include/autoconf.h | 3 +-- sys/arch/bebox/pci/pci_machdep.c | 8 ++++---- sys/arch/evbppc/evbppc/evbppc_machdep.c | 10 ++++++---- sys/arch/evbppc/mpc85xx/machdep.c | 8 +++++--- sys/arch/evbppc/pmppc/pci/pci_machdep.c | 8 ++++---- sys/arch/ibmnws/ibmnws/machdep.c | 6 +++--- sys/arch/ibmnws/include/autoconf.h | 7 +++---- sys/arch/ibmnws/pci/pci_machdep.c | 6 +++--- sys/arch/macppc/dev/adb.c | 6 +++--- sys/arch/macppc/dev/esp.c | 8 ++++---- sys/arch/macppc/dev/gpio.c | 7 ++++--- sys/arch/macppc/dev/if_bm.c | 8 ++++---- sys/arch/macppc/dev/if_mc.c | 8 ++++---- sys/arch/macppc/dev/mediabay.c | 6 +++--- sys/arch/macppc/dev/mesh.c | 8 ++++---- sys/arch/macppc/dev/nvram.c | 10 +++++----- sys/arch/macppc/dev/zs.c | 8 ++++---- sys/arch/macppc/include/autoconf.h | 3 +-- sys/arch/macppc/macppc/cpu.c | 6 +++--- sys/arch/macppc/pci/bandit.c | 8 ++++---- sys/arch/macppc/pci/grackle.c | 8 ++++---- sys/arch/macppc/pci/u3.c | 4 ++-- sys/arch/macppc/pci/uninorth.c | 8 ++++---- sys/arch/mvmeppc/include/autoconf.h | 3 +-- sys/arch/mvmeppc/mvmeppc/machdep.c | 6 +++--- sys/arch/mvmeppc/pci/pci_machdep.c | 8 ++++---- sys/arch/ofppc/ofppc/mainbus.c | 14 +++++++------- sys/arch/powerpc/booke/booke_machdep.c | 10 +++++----- sys/arch/powerpc/booke/booke_stubs.c | 10 +++++----- sys/arch/powerpc/booke/e500_tlb.c | 10 +++++----- sys/arch/powerpc/ibm4xx/pmap.c | 16 ++++++++-------- sys/arch/powerpc/include/booke/cpuvar.h | 6 +++--- sys/arch/powerpc/include/booke/pmap.h | 3 +-- sys/arch/powerpc/include/booke/pte.h | 12 +++--------- sys/arch/powerpc/include/cpu.h | 4 ++-- sys/arch/powerpc/include/ibm4xx/pmap.h | 3 +-- sys/arch/powerpc/include/oea/pmap.h | 3 +-- sys/arch/powerpc/oea/oea_machdep.c | 9 +++++---- sys/arch/powerpc/oea/pmap.c | 8 ++++---- sys/arch/powerpc/oea/pmap_kernel.c | 8 ++++---- sys/arch/powerpc/pci/pchb.c | 6 +++--- sys/arch/powerpc/powerpc/bus_dma.c | 6 +++--- sys/arch/powerpc/powerpc/bus_space.c | 9 +++++---- sys/arch/prep/include/autoconf.h | 3 +-- sys/arch/prep/pci/pci_machdep.c | 8 ++++---- sys/arch/prep/prep/machdep.c | 12 ++++++------ sys/arch/rs6000/include/autoconf.h | 5 ++--- 48 files changed, 171 insertions(+), 179 deletions(-) diff --git a/sys/arch/bebox/bebox/machdep.c b/sys/arch/bebox/bebox/machdep.c index 63dafa32c53a..fda550d4475b 100644 --- a/sys/arch/bebox/bebox/machdep.c +++ b/sys/arch/bebox/bebox/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.100 2011/06/20 07:18:05 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.101 2011/06/30 00:52:55 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.100 2011/06/20 07:18:05 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.101 2011/06/30 00:52:55 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -170,7 +170,7 @@ cpu_startup(void) /* * BeBox Mother Board's Register Mapping */ - bebox_mb_reg = (vaddr_t) mapiodev(BEBOX_INTR_REG, PAGE_SIZE); + bebox_mb_reg = (vaddr_t) mapiodev(BEBOX_INTR_REG, PAGE_SIZE, false); if (!bebox_mb_reg) panic("cpu_startup: no room for interrupt register"); diff --git a/sys/arch/bebox/include/autoconf.h b/sys/arch/bebox/include/autoconf.h index cd835b3891ad..b20d1d9306e8 100644 --- a/sys/arch/bebox/include/autoconf.h +++ b/sys/arch/bebox/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.3 2007/10/17 19:53:59 garbled Exp $ */ +/* $NetBSD: autoconf.h,v 1.4 2011/06/30 00:52:56 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -44,5 +44,4 @@ struct confargs { /* bus_space_tag_t ca_tag; */ }; -extern void *mapiodev(paddr_t, psize_t); extern paddr_t kvtop(void *); diff --git a/sys/arch/bebox/pci/pci_machdep.c b/sys/arch/bebox/pci/pci_machdep.c index 682c4fb5cf43..0adc8a2e0784 100644 --- a/sys/arch/bebox/pci/pci_machdep.c +++ b/sys/arch/bebox/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.19 2011/06/22 18:06:32 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.20 2011/06/30 00:52:56 matt Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.19 2011/06/22 18:06:32 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.20 2011/06/30 00:52:56 matt Exp $"); #include #include @@ -92,8 +92,8 @@ bebox_pci_get_chipset_tag(pci_chipset_tag_t pc) pc->pc_decompose_tag = genppc_pci_indirect_decompose_tag; pc->pc_conf_hook = genppc_pci_conf_hook; - pc->pc_addr = mapiodev(PCI_MODE1_ADDRESS_REG, 4); - pc->pc_data = mapiodev(PCI_MODE1_DATA_REG, 4); + pc->pc_addr = mapiodev(PCI_MODE1_ADDRESS_REG, 4, false); + pc->pc_data = mapiodev(PCI_MODE1_DATA_REG, 4, false); pc->pc_bus = 0; pc->pc_node = 0; pc->pc_memt = 0; diff --git a/sys/arch/evbppc/evbppc/evbppc_machdep.c b/sys/arch/evbppc/evbppc/evbppc_machdep.c index 44cc7b014183..22891e9f749b 100644 --- a/sys/arch/evbppc/evbppc/evbppc_machdep.c +++ b/sys/arch/evbppc/evbppc/evbppc_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: evbppc_machdep.c,v 1.11 2011/06/12 04:20:18 mrg Exp $ */ +/* $NetBSD: evbppc_machdep.c,v 1.12 2011/06/30 00:52:56 matt Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.11 2011/06/12 04:20:18 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.12 2011/06/30 00:52:56 matt Exp $"); #include #include @@ -94,13 +94,15 @@ int fake_mapiodev = 1; * mapping if one is found. */ void * -mapiodev(paddr_t pa, psize_t len) +mapiodev(paddr_t pa, psize_t len, bool prefetchable) { void *p; paddr_t faddr; vaddr_t taddr, va; int off; + KASSERT(!prefetchable); + /* * See if we have reserved TLB entry for the pa. This needs to be * true for console as we can't use uvm during early bootstrap. @@ -123,7 +125,7 @@ mapiodev(paddr_t pa, psize_t len) for (; len > 0; len -= PAGE_SIZE) { pmap_kenter_pa(taddr, faddr, - VM_PROT_READ|VM_PROT_WRITE|PME_NOCACHE, 0); + VM_PROT_READ|VM_PROT_WRITE, PMAP_NOCACHE); faddr += PAGE_SIZE; taddr += PAGE_SIZE; } diff --git a/sys/arch/evbppc/mpc85xx/machdep.c b/sys/arch/evbppc/mpc85xx/machdep.c index 237bd2554fef..928b35ee9091 100644 --- a/sys/arch/evbppc/mpc85xx/machdep.c +++ b/sys/arch/evbppc/mpc85xx/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.14 2011/06/29 05:53:05 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.15 2011/06/30 00:52:56 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -398,8 +398,10 @@ e500_cnputc(dev_t dv, int c) } static void * -gur_tlb_mapiodev(paddr_t pa, psize_t len) +gur_tlb_mapiodev(paddr_t pa, psize_t len, bool prefetchable) { + if (prefetchable) + return NULL; if (pa < gur_bst.pbs_offset) return NULL; if (pa + len > gur_bst.pbs_offset + gur_bst.pbs_limit) @@ -407,7 +409,7 @@ gur_tlb_mapiodev(paddr_t pa, psize_t len) return (void *)pa; } -static void *(* const early_tlb_mapiodev)(paddr_t, psize_t) = gur_tlb_mapiodev; +static void *(* const early_tlb_mapiodev)(paddr_t, psize_t, bool) = gur_tlb_mapiodev; static void e500_cpu_reset(void) diff --git a/sys/arch/evbppc/pmppc/pci/pci_machdep.c b/sys/arch/evbppc/pmppc/pci/pci_machdep.c index 7431807e2583..c3d3875fdcb3 100644 --- a/sys/arch/evbppc/pmppc/pci/pci_machdep.c +++ b/sys/arch/evbppc/pmppc/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.4 2011/06/22 18:06:32 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.5 2011/06/30 00:52:56 matt Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.4 2011/06/22 18:06:32 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.5 2011/06/30 00:52:56 matt Exp $"); #include #include @@ -109,8 +109,8 @@ pmppc_pci_get_chipset_tag(pci_chipset_tag_t pc) pc->pc_decompose_tag = genppc_pci_indirect_decompose_tag; pc->pc_conf_hook = genppc_pci_conf_hook; - pc->pc_addr = mapiodev(CPC_PCICFGADR, 4); - pc->pc_data = mapiodev(CPC_PCICFGDATA, 4); + pc->pc_addr = mapiodev(CPC_PCICFGADR, 4, false); + pc->pc_data = mapiodev(CPC_PCICFGDATA, 4, false); pc->pc_bus = 0; pc->pc_node = 0; pc->pc_memt = 0; diff --git a/sys/arch/ibmnws/ibmnws/machdep.c b/sys/arch/ibmnws/ibmnws/machdep.c index e58561b2258d..b68322f466b6 100644 --- a/sys/arch/ibmnws/ibmnws/machdep.c +++ b/sys/arch/ibmnws/ibmnws/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.15 2011/06/20 07:18:06 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.16 2011/06/30 00:52:56 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.15 2011/06/20 07:18:06 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2011/06/30 00:52:56 matt Exp $"); #include "opt_compat_netbsd.h" @@ -160,7 +160,7 @@ cpu_startup(void) /* * Mapping PReP interrput vector register. */ - prep_intr_reg = (vaddr_t) mapiodev(PREP_INTR_REG, PAGE_SIZE); + prep_intr_reg = (vaddr_t) mapiodev(PREP_INTR_REG, PAGE_SIZE, false); if (!prep_intr_reg) panic("startup: no room for interrupt register"); prep_intr_reg_off = INTR_VECTOR_REG; diff --git a/sys/arch/ibmnws/include/autoconf.h b/sys/arch/ibmnws/include/autoconf.h index 534d0f47bfcd..fd41c17b7ea7 100644 --- a/sys/arch/ibmnws/include/autoconf.h +++ b/sys/arch/ibmnws/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.5 2007/03/04 06:00:03 christos Exp $ */ +/* $NetBSD: autoconf.h,v 1.6 2011/06/30 00:52:56 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -43,6 +43,5 @@ struct confargs { /* bus_space_tag_t ca_tag; */ }; -extern void *mapiodev(paddr_t, psize_t); -extern paddr_t kvtop(void *); -extern void *intr_establish(int, int, int, int (*)(void *), void *); +paddr_t kvtop(void *); +void *intr_establish(int, int, int, int (*)(void *), void *); diff --git a/sys/arch/ibmnws/pci/pci_machdep.c b/sys/arch/ibmnws/pci/pci_machdep.c index fd475b651100..2118b79eb8dc 100644 --- a/sys/arch/ibmnws/pci/pci_machdep.c +++ b/sys/arch/ibmnws/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.7 2011/06/22 18:06:33 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.8 2011/06/30 00:52:57 matt Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -84,8 +84,8 @@ ibmnws_pci_get_chipset_tag_indirect(pci_chipset_tag_t pc) pc->pc_decompose_tag = genppc_pci_indirect_decompose_tag; pc->pc_conf_hook = ibmnws_pci_conf_hook; - pc->pc_addr = mapiodev(PCI_MODE1_ADDRESS_REG, 4); - pc->pc_data = mapiodev(PCI_MODE1_DATA_REG, 4); + pc->pc_addr = mapiodev(PCI_MODE1_ADDRESS_REG, 4, false); + pc->pc_data = mapiodev(PCI_MODE1_DATA_REG, 4, false); pc->pc_bus = 0; pc->pc_node = 0; pc->pc_memt = 0; diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c index 88b71d53de9a..006503dcbf52 100644 --- a/sys/arch/macppc/dev/adb.c +++ b/sys/arch/macppc/dev/adb.c @@ -1,4 +1,4 @@ -/* $NetBSD: adb.c,v 1.30 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: adb.c,v 1.31 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (C) 1994 Bradley A. Grantham @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.30 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.31 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -111,7 +111,7 @@ adbattach(device_t parent, device_t self, void *aux) ca->ca_reg[0] += ca->ca_baseaddr; - sc->sc_regbase = mapiodev(ca->ca_reg[0], ca->ca_reg[1]); + sc->sc_regbase = mapiodev(ca->ca_reg[0], ca->ca_reg[1], false); Via1Base = sc->sc_regbase; if (strcmp(ca->ca_name, "via-cuda") == 0) diff --git a/sys/arch/macppc/dev/esp.c b/sys/arch/macppc/dev/esp.c index 84b63007254b..2cbe11f4fdb0 100644 --- a/sys/arch/macppc/dev/esp.c +++ b/sys/arch/macppc/dev/esp.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp.c,v 1.30 2010/12/20 00:25:37 matt Exp $ */ +/* $NetBSD: esp.c,v 1.31 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.30 2010/12/20 00:25:37 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.31 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -180,8 +180,8 @@ espattach(device_t parent, device_t self, void *aux) * Map my registers in. */ reg = ca->ca_reg; - esc->sc_reg = mapiodev(ca->ca_baseaddr + reg[0], reg[1]); - esc->sc_dmareg = mapiodev(ca->ca_baseaddr + reg[2], reg[3]); + esc->sc_reg = mapiodev(ca->ca_baseaddr + reg[0], reg[1], false); + esc->sc_dmareg = mapiodev(ca->ca_baseaddr + reg[2], reg[3], false); /* Allocate 16-byte aligned DMA command space */ esc->sc_dmacmd = dbdma_alloc(sizeof(dbdma_command_t) * 20); diff --git a/sys/arch/macppc/dev/gpio.c b/sys/arch/macppc/dev/gpio.c index c75e08b57840..b72f2eb21958 100644 --- a/sys/arch/macppc/dev/gpio.c +++ b/sys/arch/macppc/dev/gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpio.c,v 1.10 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: gpio.c,v 1.11 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.10 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.11 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -95,7 +95,8 @@ gpio_obio_attach(device_t parent, device_t self, void *aux) printf("\n"); - sc->sc_port = mapiodev(ca->ca_baseaddr + ca->ca_reg[0], ca->ca_reg[1]); + sc->sc_port = mapiodev(ca->ca_baseaddr + ca->ca_reg[0], ca->ca_reg[1], + false); ca2.ca_baseaddr = ca->ca_baseaddr; for (child = OF_child(ca->ca_node); child; child = OF_peer(child)) { diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index 588de561c856..4d4fd0dccc60 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bm.c,v 1.44 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: if_bm.c,v 1.45 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (C) 1998, 1999, 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.44 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.45 2011/06/30 00:52:57 matt Exp $"); #include "opt_inet.h" @@ -212,8 +212,8 @@ bmac_attach(device_t parent, device_t self, void *aux) } memcpy(sc->sc_enaddr, laddr, 6); - sc->sc_txdma = mapiodev(ca->ca_reg[2], PAGE_SIZE); - sc->sc_rxdma = mapiodev(ca->ca_reg[4], PAGE_SIZE); + sc->sc_txdma = mapiodev(ca->ca_reg[2], PAGE_SIZE, false); + sc->sc_rxdma = mapiodev(ca->ca_reg[4], PAGE_SIZE, false); sc->sc_txcmd = dbdma_alloc(BMAC_TXBUFS * sizeof(dbdma_command_t)); sc->sc_rxcmd = dbdma_alloc((BMAC_RXBUFS + 1) * sizeof(dbdma_command_t)); sc->sc_txbuf = malloc(BMAC_BUFLEN * BMAC_TXBUFS, M_DEVBUF, M_NOWAIT); diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c index e28edaf1ffbe..5a0663e03aa8 100644 --- a/sys/arch/macppc/dev/if_mc.c +++ b/sys/arch/macppc/dev/if_mc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_mc.c,v 1.19 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: if_mc.c,v 1.20 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (c) 1997 David Huang @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.19 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.20 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -117,8 +117,8 @@ mc_attach(device_t parent, device_t self, void *aux) reg[2] += ca->ca_baseaddr; reg[4] += ca->ca_baseaddr; - sc->sc_txdma = mapiodev(reg[2], reg[3]); - sc->sc_rxdma = mapiodev(reg[4], reg[5]); + sc->sc_txdma = mapiodev(reg[2], reg[3], false); + sc->sc_rxdma = mapiodev(reg[4], reg[5], false); bus_space_map(sc->sc_regt, reg[0], reg[1], 0, &sc->sc_regh); sc->sc_tail = 0; diff --git a/sys/arch/macppc/dev/mediabay.c b/sys/arch/macppc/dev/mediabay.c index 5ea5c65ee95f..05cf4eb879b2 100644 --- a/sys/arch/macppc/dev/mediabay.c +++ b/sys/arch/macppc/dev/mediabay.c @@ -1,4 +1,4 @@ -/* $NetBSD: mediabay.c,v 1.20 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: mediabay.c,v 1.21 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mediabay.c,v 1.20 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mediabay.c,v 1.21 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -124,7 +124,7 @@ mediabay_attach(device_t parent, device_t self, void *aux) ca->ca_reg[0] += ca->ca_baseaddr; - sc->sc_addr = mapiodev(ca->ca_reg[0], PAGE_SIZE); + sc->sc_addr = mapiodev(ca->ca_reg[0], PAGE_SIZE, false); sc->sc_node = ca->ca_node; sc->sc_baseaddr = ca->ca_baseaddr; sc->sc_tag = ca->ca_tag; diff --git a/sys/arch/macppc/dev/mesh.c b/sys/arch/macppc/dev/mesh.c index 3694a07679e0..21d2364cd965 100644 --- a/sys/arch/macppc/dev/mesh.c +++ b/sys/arch/macppc/dev/mesh.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesh.c,v 1.34 2009/09/26 15:49:45 tsutsui Exp $ */ +/* $NetBSD: mesh.c,v 1.35 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesh.c,v 1.34 2009/09/26 15:49:45 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesh.c,v 1.35 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -211,9 +211,9 @@ mesh_attach(device_t parent, device_t self, void *aux) reg = ca->ca_reg; reg[0] += ca->ca_baseaddr; reg[2] += ca->ca_baseaddr; - sc->sc_reg = mapiodev(reg[0], reg[1]); + sc->sc_reg = mapiodev(reg[0], reg[1], false); sc->sc_irq = ca->ca_intr[0]; - sc->sc_dmareg = mapiodev(reg[2], reg[3]); + sc->sc_dmareg = mapiodev(reg[2], reg[3], false); sc->sc_cfflags = device_cfdata(self)->cf_flags; sc->sc_meshid = mesh_read_reg(sc, MESH_MESH_ID) & 0x1f; diff --git a/sys/arch/macppc/dev/nvram.c b/sys/arch/macppc/dev/nvram.c index b28744208874..b967bd61d6be 100644 --- a/sys/arch/macppc/dev/nvram.c +++ b/sys/arch/macppc/dev/nvram.c @@ -1,4 +1,4 @@ -/* $NetBSD: nvram.c,v 1.16 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: nvram.c,v 1.17 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvram.c,v 1.16 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvram.c,v 1.17 2011/06/30 00:52:57 matt Exp $"); #include #include @@ -103,13 +103,13 @@ nvram_attach(device_t parent, device_t self, void *aux) case 8: /* untested */ sc->nv_type = NVRAM_IOMEM; - sc->nv_data = mapiodev(ca->ca_baseaddr + reg[0], reg[1]); + sc->nv_data = mapiodev(ca->ca_baseaddr + reg[0], reg[1], false); break; case 16: sc->nv_type = NVRAM_PORT; - sc->nv_port = mapiodev(ca->ca_baseaddr + reg[0], reg[1]); - sc->nv_data = mapiodev(ca->ca_baseaddr + reg[2], reg[3]); + sc->nv_port = mapiodev(ca->ca_baseaddr + reg[0], reg[1], false); + sc->nv_data = mapiodev(ca->ca_baseaddr + reg[2], reg[3], false); break; case 0: diff --git a/sys/arch/macppc/dev/zs.c b/sys/arch/macppc/dev/zs.c index 2ee32494815e..c31f1b26c6a3 100644 --- a/sys/arch/macppc/dev/zs.c +++ b/sys/arch/macppc/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.49 2009/10/27 03:45:32 snj Exp $ */ +/* $NetBSD: zs.c,v 1.50 2011/06/30 00:52:57 matt Exp $ */ /* * Copyright (c) 1996, 1998 Bill Studenmund @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.49 2009/10/27 03:45:32 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.50 2011/06/30 00:52:57 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -218,7 +218,7 @@ zsc_attach(device_t parent, device_t self, void *aux) chip = 0; ca->ca_reg[0] += ca->ca_baseaddr; - zsd = mapiodev(ca->ca_reg[0], ca->ca_reg[1]); + zsd = mapiodev(ca->ca_reg[0], ca->ca_reg[1], false); node = OF_child(ca->ca_node); /* ch-a */ @@ -238,7 +238,7 @@ zsc_attach(device_t parent, device_t self, void *aux) regs[2] += ca->ca_baseaddr; regs[4] += ca->ca_baseaddr; #ifdef ZS_TXDMA - zsc->zsc_txdmareg[channel] = mapiodev(regs[2], regs[3]); + zsc->zsc_txdmareg[channel] = mapiodev(regs[2], regs[3], false); zsc->zsc_txdmacmd[channel] = dbdma_alloc(sizeof(dbdma_command_t) * 3); memset(zsc->zsc_txdmacmd[channel], 0, diff --git a/sys/arch/macppc/include/autoconf.h b/sys/arch/macppc/include/autoconf.h index a31437e6480a..6679fc2ac7a1 100644 --- a/sys/arch/macppc/include/autoconf.h +++ b/sys/arch/macppc/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.16 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: autoconf.h,v 1.17 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -62,7 +62,6 @@ void identifycpu(char *); /* these are in machdep.c */ void initppc(u_int, u_int, char *); void model_init(void); -void *mapiodev(paddr_t, psize_t); paddr_t kvtop(void *); void dumpsys(void); void copy_disp_props(device_t, int, prop_dictionary_t); diff --git a/sys/arch/macppc/macppc/cpu.c b/sys/arch/macppc/macppc/cpu.c index 221f304769fe..7ac3f425fffa 100644 --- a/sys/arch/macppc/macppc/cpu.c +++ b/sys/arch/macppc/macppc/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.57 2011/06/29 06:13:08 matt Exp $ */ +/* $NetBSD: cpu.c,v 1.58 2011/06/30 00:52:57 matt Exp $ */ /*- * Copyright (c) 2001 Tsubai Masanari. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.57 2011/06/29 06:13:08 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.58 2011/06/30 00:52:57 matt Exp $"); #include "opt_ppcparam.h" #include "opt_multiprocessor.h" @@ -189,7 +189,7 @@ ohare_init(void) volatile uint32_t *cache_reg, x; /* enable L2 cache */ - cache_reg = mapiodev(CACHE_REG, PAGE_SIZE); + cache_reg = mapiodev(CACHE_REG, PAGE_SIZE, false); if (((cache_reg[2] >> 24) & 0x0f) >= 3) { x = cache_reg[4]; if ((x & 0x10) == 0) diff --git a/sys/arch/macppc/pci/bandit.c b/sys/arch/macppc/pci/bandit.c index e13fe4755940..8770dbb4e5e9 100644 --- a/sys/arch/macppc/pci/bandit.c +++ b/sys/arch/macppc/pci/bandit.c @@ -1,4 +1,4 @@ -/* $NetBSD: bandit.c,v 1.28 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: bandit.c,v 1.29 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bandit.c,v 1.28 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bandit.c,v 1.29 2011/06/30 00:52:58 matt Exp $"); #include #include @@ -126,8 +126,8 @@ bandit_attach(device_t parent, device_t self, void *aux) pc->pc_node = node; pc->pc_iot = &sc->sc_iot; pc->pc_memt = &sc->sc_memt; - pc->pc_addr = mapiodev(reg[0] + 0x800000, 4); - pc->pc_data = mapiodev(reg[0] + 0xc00000, 8); + pc->pc_addr = mapiodev(reg[0] + 0x800000, 4, false); + pc->pc_data = mapiodev(reg[0] + 0xc00000, 8, false); pc->pc_bus = busrange[0]; pc->pc_conf_read = bandit_conf_read; pc->pc_conf_write = bandit_conf_write; diff --git a/sys/arch/macppc/pci/grackle.c b/sys/arch/macppc/pci/grackle.c index 3ef1801ba673..6075bdcf9973 100644 --- a/sys/arch/macppc/pci/grackle.c +++ b/sys/arch/macppc/pci/grackle.c @@ -1,4 +1,4 @@ -/* $NetBSD: grackle.c,v 1.13 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: grackle.c,v 1.14 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: grackle.c,v 1.13 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: grackle.c,v 1.14 2011/06/30 00:52:58 matt Exp $"); #include #include @@ -126,8 +126,8 @@ grackle_attach(device_t parent, device_t self, void *aux) macppc_pci_get_chipset_tag(pc); pc->pc_node = node; - pc->pc_addr = mapiodev(GRACKLE_ADDR, 4); - pc->pc_data = mapiodev(GRACKLE_DATA, 4); + pc->pc_addr = mapiodev(GRACKLE_ADDR, 4, false); + pc->pc_data = mapiodev(GRACKLE_DATA, 4, false); pc->pc_bus = busrange[0]; pc->pc_conf_read = grackle_conf_read; pc->pc_conf_write = grackle_conf_write; diff --git a/sys/arch/macppc/pci/u3.c b/sys/arch/macppc/pci/u3.c index aa4d56c38601..437bbe81c0da 100644 --- a/sys/arch/macppc/pci/u3.c +++ b/sys/arch/macppc/pci/u3.c @@ -1,4 +1,4 @@ -/* $NetBSD: u3.c,v 1.4 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: u3.c,v 1.5 2011/06/30 00:52:58 matt Exp $ */ /* * Copyright 2006 Kyma Systems LLC. @@ -104,7 +104,7 @@ ibmcpc_attach(device_t parent, device_t self, void *aux) } aprint_normal("Mapping in config space @ pa 0x%08x, size: 0x%08x\n", reg[1], reg[2]); - pc_data = mapiodev(reg[1], reg[2]); + pc_data = mapiodev(reg[1], reg[2], false); for (child = OF_child(OF_finddevice("/ht")), i = 1; child; child = OF_peer(child), i++) { diff --git a/sys/arch/macppc/pci/uninorth.c b/sys/arch/macppc/pci/uninorth.c index 7951f819d5cb..06e4bb258080 100644 --- a/sys/arch/macppc/pci/uninorth.c +++ b/sys/arch/macppc/pci/uninorth.c @@ -1,4 +1,4 @@ -/* $NetBSD: uninorth.c,v 1.14 2011/06/18 08:08:28 matt Exp $ */ +/* $NetBSD: uninorth.c,v 1.15 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uninorth.c,v 1.14 2011/06/18 08:08:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uninorth.c,v 1.15 2011/06/30 00:52:58 matt Exp $"); #include #include @@ -138,8 +138,8 @@ uninorth_attach(device_t parent, device_t self, void *aux) macppc_pci_get_chipset_tag(pc); pc->pc_node = node; - pc->pc_addr = mapiodev(reg[0] + 0x800000, 4); - pc->pc_data = mapiodev(reg[0] + 0xc00000, 8); + pc->pc_addr = mapiodev(reg[0] + 0x800000, 4, false); + pc->pc_data = mapiodev(reg[0] + 0xc00000, 8, false); pc->pc_bus = busrange[0]; pc->pc_conf_read = uninorth_conf_read; pc->pc_conf_write = uninorth_conf_write; diff --git a/sys/arch/mvmeppc/include/autoconf.h b/sys/arch/mvmeppc/include/autoconf.h index ba8fdf06b60e..9df6eb32892d 100644 --- a/sys/arch/mvmeppc/include/autoconf.h +++ b/sys/arch/mvmeppc/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.4 2009/03/14 14:46:03 dsl Exp $ */ +/* $NetBSD: autoconf.h,v 1.5 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -43,6 +43,5 @@ struct confargs { /* bus_space_tag_t ca_tag; */ }; -void *mapiodev(paddr_t, psize_t); paddr_t kvtop(void *); void *intr_establish(int, int, int, int (*)(void *), void *); diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c index 2ee4f480ecc3..01535938eac1 100644 --- a/sys/arch/mvmeppc/mvmeppc/machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.28 2011/06/20 07:18:07 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.29 2011/06/30 00:52:58 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2011/06/20 07:18:07 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.29 2011/06/30 00:52:58 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_mvmetype.h" @@ -164,7 +164,7 @@ cpu_startup(void) /* * Mapping PReP-compatible interrput vector register. */ - prep_intr_reg = (vaddr_t) mapiodev(MVMEPPC_INTR_REG, PAGE_SIZE); + prep_intr_reg = (vaddr_t) mapiodev(MVMEPPC_INTR_REG, PAGE_SIZE, false); if (!prep_intr_reg) panic("startup: no room for interrupt register"); diff --git a/sys/arch/mvmeppc/pci/pci_machdep.c b/sys/arch/mvmeppc/pci/pci_machdep.c index c24b9505fb63..62bccf54e701 100644 --- a/sys/arch/mvmeppc/pci/pci_machdep.c +++ b/sys/arch/mvmeppc/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.8 2011/06/22 18:06:33 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.9 2011/06/30 00:52:58 matt Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.8 2011/06/22 18:06:33 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.9 2011/06/30 00:52:58 matt Exp $"); #include #include @@ -93,8 +93,8 @@ mvmeppc_pci_get_chipset_tag(pci_chipset_tag_t pc) pc->pc_decompose_tag = genppc_pci_indirect_decompose_tag; pc->pc_conf_hook = genppc_pci_conf_hook; - pc->pc_addr = mapiodev(PCI_MODE1_ADDRESS_REG, 4); - pc->pc_data = mapiodev(PCI_MODE1_DATA_REG, 4); + pc->pc_addr = mapiodev(PCI_MODE1_ADDRESS_REG, 4, false); + pc->pc_data = mapiodev(PCI_MODE1_DATA_REG, 4, false); pc->pc_bus = 0; pc->pc_node = 0; pc->pc_memt = 0; diff --git a/sys/arch/ofppc/ofppc/mainbus.c b/sys/arch/ofppc/ofppc/mainbus.c index f3299e9358d8..0859f99e84c1 100644 --- a/sys/arch/ofppc/ofppc/mainbus.c +++ b/sys/arch/ofppc/ofppc/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.27 2011/06/05 17:03:16 matt Exp $ */ +/* $NetBSD: mainbus.c,v 1.28 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.27 2011/06/05 17:03:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.28 2011/06/30 00:52:58 matt Exp $"); #include "opt_interrupt.h" #include "opt_multiprocessor.h" @@ -83,7 +83,7 @@ init_prepivr(int node) aprint_error("Incorrectly identified i8259 as prepivr\n"); return setup_i8259(); } - prep_intr_reg = (vaddr_t)mapiodev(ivr, sizeof(uint32_t)); + prep_intr_reg = (vaddr_t)mapiodev(ivr, sizeof(uint32_t), false); prep_intr_reg_off = 0; /* hack */ if (!prep_intr_reg) panic("startup: no room for interrupt register"); @@ -125,7 +125,7 @@ init_openpic(int node) (aadr.phys_hi & OFW_PCI_PHYS_HI_SPACEMASK) && (aadr.size_lo + aadr.phys_lo <= (rp->size_lo+rp->host))) { baseaddr = (unsigned char *)mapiodev( - rp->host | aadr.phys_lo, aadr.size_lo); + rp->host | aadr.phys_lo, aadr.size_lo, false); aprint_normal("Found openpic at %08x\n", rp->host | aadr.phys_lo); setup_openpic(baseaddr, 0); @@ -153,7 +153,7 @@ init_openpic(int node) return FALSE; if (len == sizeof(int)*2) { - baseaddr = (unsigned char *)mapiodev(reg[0], reg[1]); + baseaddr = (unsigned char *)mapiodev(reg[0], reg[1], false); aprint_verbose("Found openpic at %08x\n", reg[0]); #ifdef PIC_OPENPIC (void)setup_openpic(baseaddr, 0); @@ -180,12 +180,12 @@ init_openpic(int node) if (i > OPENPIC_MAX_ISUS) aprint_error("Increase OPENPIC_MAX_ISUS to %d\n", i); - baseaddr = (unsigned char *)mapiodev(reg[0], 0x40000); + baseaddr = (unsigned char *)mapiodev(reg[0], 0x40000, false); aprint_verbose("Found openpic at %08x\n", reg[0]); for (j=0; j < i; j++) { isu[j] = (unsigned char *)mapiodev(reg[(j+1)*2], - reg[(j+1)*2+1]); + reg[(j+1)*2+1], false); isumap[j] = reg[(j+1)*2+1]; } (void)setup_distributed_openpic(baseaddr, i, (void **)isu, isumap); diff --git a/sys/arch/powerpc/booke/booke_machdep.c b/sys/arch/powerpc/booke/booke_machdep.c index 7fca2ea78fc0..1c92db9c374a 100644 --- a/sys/arch/powerpc/booke/booke_machdep.c +++ b/sys/arch/powerpc/booke/booke_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: booke_machdep.c,v 1.13 2011/06/29 21:53:10 dholland Exp $ */ +/* $NetBSD: booke_machdep.c,v 1.14 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -38,7 +38,7 @@ #define _POWERPC_BUS_DMA_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.13 2011/06/29 21:53:10 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.14 2011/06/30 00:52:58 matt Exp $"); #include "opt_modular.h" @@ -313,7 +313,7 @@ cpu_reboot(int howto, char *what) * mapping if one is found. */ void * -mapiodev(paddr_t pa, psize_t len) +mapiodev(paddr_t pa, psize_t len, bool prefetchable) { const vsize_t off = pa & PAGE_MASK; @@ -321,7 +321,7 @@ mapiodev(paddr_t pa, psize_t len) * See if we have reserved TLB entry for the pa. This needs to be * true for console as we can't use uvm during early bootstrap. */ - void * const p = tlb_mapiodev(pa, len); + void * const p = tlb_mapiodev(pa, len, prefetchable); if (p != NULL) return p; @@ -340,7 +340,7 @@ mapiodev(paddr_t pa, psize_t len) va -= PAGE_SIZE; pa -= PAGE_SIZE; pmap_kenter_pa(va, pa, VM_PROT_READ|VM_PROT_WRITE, - PMAP_NOCACHE); + prefetchable ? 0 : PMAP_NOCACHE); } pmap_update(pmap_kernel()); return (void *)(va + off); diff --git a/sys/arch/powerpc/booke/booke_stubs.c b/sys/arch/powerpc/booke/booke_stubs.c index e3a0f9f80282..0fef2935287c 100644 --- a/sys/arch/powerpc/booke/booke_stubs.c +++ b/sys/arch/powerpc/booke/booke_stubs.c @@ -1,4 +1,4 @@ -/* $NetBSD: booke_stubs.c,v 1.8 2011/06/29 21:53:11 dholland Exp $ */ +/* $NetBSD: booke_stubs.c,v 1.9 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: booke_stubs.c,v 1.8 2011/06/29 21:53:11 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: booke_stubs.c,v 1.9 2011/06/30 00:52:58 matt Exp $"); #include #include @@ -143,12 +143,12 @@ tlb_walk(void *ctx, bool (*func)(void *, vaddr_t, uint32_t, uint32_t)) (*cpu_md_ops.md_tlb_ops->md_tlb_walk)(ctx, func); } -void *tlb_mapiodev(paddr_t, psize_t) __stub; +void *tlb_mapiodev(paddr_t, psize_t, bool) __stub; void * -tlb_mapiodev(paddr_t pa, psize_t len) +tlb_mapiodev(paddr_t pa, psize_t len, bool prefetchable) { - return (*cpu_md_ops.md_tlb_io_ops->md_tlb_mapiodev)(pa, len); + return (*cpu_md_ops.md_tlb_io_ops->md_tlb_mapiodev)(pa, len, prefetchable); } void tlb_unmapiodev(vaddr_t, vsize_t) __stub; diff --git a/sys/arch/powerpc/booke/e500_tlb.c b/sys/arch/powerpc/booke/e500_tlb.c index 911144f2a8ef..a0e6a9e6a554 100644 --- a/sys/arch/powerpc/booke/e500_tlb.c +++ b/sys/arch/powerpc/booke/e500_tlb.c @@ -1,4 +1,4 @@ -/* $NetBSD: e500_tlb.c,v 1.6 2011/06/29 23:15:55 matt Exp $ */ +/* $NetBSD: e500_tlb.c,v 1.7 2011/06/30 00:52:58 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.6 2011/06/29 23:15:55 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.7 2011/06/30 00:52:58 matt Exp $"); #include @@ -683,7 +683,7 @@ e500_tlb_lookup_xtlb2(vaddr_t va, vsize_t len) } static void * -e500_tlb_mapiodev(paddr_t pa, psize_t len) +e500_tlb_mapiodev(paddr_t pa, psize_t len, bool prefetchable) { struct e500_xtlb * const xtlb = e500_tlb_lookup_xtlb(pa, NULL); @@ -694,8 +694,8 @@ e500_tlb_mapiodev(paddr_t pa, psize_t len) */ if (xtlb && pa + len <= xtlb->e_tlb.tlb_va + xtlb->e_tlb.tlb_size - && ((xtlb->e_tlb.tlb_pte & PTE_W) == 0 - || (xtlb->e_tlb.tlb_pte & PTE_I) == PTE_I)) { + && (prefetchable + || (xtlb->e_tlb.tlb_pte & PTE_WIG) == (PTE_I|PTE_G))) { xtlb->e_refcnt++; return (void *) pa; } diff --git a/sys/arch/powerpc/ibm4xx/pmap.c b/sys/arch/powerpc/ibm4xx/pmap.c index 723101129de2..488bae92fe00 100644 --- a/sys/arch/powerpc/ibm4xx/pmap.c +++ b/sys/arch/powerpc/ibm4xx/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.69 2011/06/21 04:21:44 matt Exp $ */ +/* $NetBSD: pmap.c,v 1.70 2011/06/30 00:52:58 matt Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.69 2011/06/21 04:21:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.70 2011/06/30 00:52:58 matt Exp $"); #include #include @@ -820,11 +820,11 @@ pmap_enter(struct pmap *pm, vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags) /* XXXX -- need to support multiple page sizes. */ tte |= TTE_SZ_16K; #ifdef DIAGNOSTIC - if ((flags & (PME_NOCACHE | PME_WRITETHROUG)) == - (PME_NOCACHE | PME_WRITETHROUG)) + if ((flags & (PMAP_NOCACHE | PME_WRITETHROUG)) == + (PMAP_NOCACHE | PME_WRITETHROUG)) panic("pmap_enter: uncached & writethrough"); #endif - if (flags & PME_NOCACHE) + if (flags & PMAP_NOCACHE) /* Must be I/O mapping */ tte |= TTE_I | TTE_G; #ifdef PPC_4XX_NOCACHE @@ -941,11 +941,11 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags) /* XXXX -- need to support multiple page sizes. */ tte |= TTE_SZ_16K; #ifdef DIAGNOSTIC - if ((prot & (PME_NOCACHE | PME_WRITETHROUG)) == - (PME_NOCACHE | PME_WRITETHROUG)) + if ((flags & (PMAP_NOCACHE | PME_WRITETHROUG)) == + (PMAP_NOCACHE | PME_WRITETHROUG)) panic("pmap_kenter_pa: uncached & writethrough"); #endif - if (prot & PME_NOCACHE) + if (flags & PMAP_NOCACHE) /* Must be I/O mapping */ tte |= TTE_I | TTE_G; #ifdef PPC_4XX_NOCACHE diff --git a/sys/arch/powerpc/include/booke/cpuvar.h b/sys/arch/powerpc/include/booke/cpuvar.h index b27a5711e4be..8ec9d4126ea5 100644 --- a/sys/arch/powerpc/include/booke/cpuvar.h +++ b/sys/arch/powerpc/include/booke/cpuvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.11 2011/06/29 06:00:56 matt Exp $ */ +/* $NetBSD: cpuvar.h,v 1.12 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -115,7 +115,7 @@ struct tlb_md_io_ops { * early boot by doing cpu_md_ops.tlb_md_ops = (const struct * tlb_md_ops *) &. */ - void *(*md_tlb_mapiodev)(paddr_t, psize_t); + void *(*md_tlb_mapiodev)(paddr_t, psize_t, bool); void (*md_tlb_unmapiodev)(vaddr_t, vsize_t); int (*md_tlb_ioreserve)(vaddr_t, vsize_t, uint32_t); int (*md_tlb_iorelease)(vaddr_t); @@ -175,7 +175,7 @@ void calc_delayconst(void); struct intrsw; void exception_init(const struct intrsw *); -void *tlb_mapiodev(paddr_t, psize_t); +void *tlb_mapiodev(paddr_t, psize_t, bool); void tlb_unmapiodev(vaddr_t, vsize_t); int tlb_ioreserve(vaddr_t, vsize_t, pt_entry_t); int tlb_iorelease(vaddr_t); diff --git a/sys/arch/powerpc/include/booke/pmap.h b/sys/arch/powerpc/include/booke/pmap.h index 797da5e3e711..9fbaac92c359 100644 --- a/sys/arch/powerpc/include/booke/pmap.h +++ b/sys/arch/powerpc/include/booke/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.7 2011/06/23 02:33:44 matt Exp $ */ +/* $NetBSD: pmap.h,v 1.8 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -52,7 +52,6 @@ #include #endif -#define PMAP_MD_NOCACHE 0x01000000 #define PMAP_NEED_PROCWR #include diff --git a/sys/arch/powerpc/include/booke/pte.h b/sys/arch/powerpc/include/booke/pte.h index d12f668d12fe..35f038dcccb0 100644 --- a/sys/arch/powerpc/include/booke/pte.h +++ b/sys/arch/powerpc/include/booke/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.5 2011/06/23 20:46:15 matt Exp $ */ +/* $NetBSD: pte.h,v 1.6 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -125,16 +125,10 @@ pte_to_paddr(pt_entry_t pt_entry) return (paddr_t)(pt_entry & PTE_RPN_MASK); } -static inline pt_entry_t -pte_iouncached_bits(void) -{ - return PTE_W|PTE_I|PTE_G; -} - static inline pt_entry_t pte_ionocached_bits(void) { - return PTE_WIG; + return PTE_I|PTE_G; } static inline pt_entry_t @@ -218,7 +212,7 @@ pte_prot_bits(struct vm_page_md *mdpg, vm_prot_t prot) static inline pt_entry_t pte_flag_bits(struct vm_page_md *mdpg, int flags) { - if (__predict_false(flags & PMAP_MD_NOCACHE)) { + if (__predict_false(flags & PMAP_NOCACHE)) { if (__predict_true(mdpg != NULL)) { return pte_nocached_bits(); } else { diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h index 7f817c8ca97b..310f13bda845 100644 --- a/sys/arch/powerpc/include/cpu.h +++ b/sys/arch/powerpc/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.87 2011/06/29 06:00:17 matt Exp $ */ +/* $NetBSD: cpu.h,v 1.88 2011/06/30 00:52:59 matt Exp $ */ /* * Copyright (C) 1999 Wolfgang Solfrank. @@ -352,7 +352,7 @@ void dcache_wbinv(vaddr_t, vsize_t); void dcache_inv(vaddr_t, vsize_t); void icache_inv(vaddr_t, vsize_t); -void * mapiodev(paddr_t, psize_t); +void * mapiodev(paddr_t, psize_t, bool); void unmapiodev(vaddr_t, vsize_t); #ifdef MULTIPROCESSOR diff --git a/sys/arch/powerpc/include/ibm4xx/pmap.h b/sys/arch/powerpc/include/ibm4xx/pmap.h index 68869f38c1bb..c71c6a34ea84 100644 --- a/sys/arch/powerpc/include/ibm4xx/pmap.h +++ b/sys/arch/powerpc/include/ibm4xx/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.16 2011/06/20 20:24:28 matt Exp $ */ +/* $NetBSD: pmap.h,v 1.17 2011/06/30 00:52:59 matt Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -138,7 +138,6 @@ */ #define PME_NOCACHE 0x1000000 #define PME_WRITETHROUG 0x2000000 -#define PMAP_MD_NOCACHE PME_NOCACHE /* XXX: OEA pmap compat. for bus_dma */ /* * Pmap stuff diff --git a/sys/arch/powerpc/include/oea/pmap.h b/sys/arch/powerpc/include/oea/pmap.h index e2977cee7ddb..953507f8edf4 100644 --- a/sys/arch/powerpc/include/oea/pmap.h +++ b/sys/arch/powerpc/include/oea/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.24 2011/06/20 20:24:29 matt Exp $ */ +/* $NetBSD: pmap.h,v 1.25 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -218,7 +218,6 @@ vaddr_t pmap_unsetusr (void); int pmap_setup_segment0_map(int use_large_pages, ...); #endif -#define PMAP_MD_NOCACHE 0x1000000 #define PMAP_MD_PREFETCHABLE 0x2000000 #define PMAP_STEAL_MEMORY #define PMAP_NEED_PROCWR diff --git a/sys/arch/powerpc/oea/oea_machdep.c b/sys/arch/powerpc/oea/oea_machdep.c index 00dc16a0e5d6..2bfb10bbe215 100644 --- a/sys/arch/powerpc/oea/oea_machdep.c +++ b/sys/arch/powerpc/oea/oea_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: oea_machdep.c,v 1.58 2011/06/20 07:18:07 matt Exp $ */ +/* $NetBSD: oea_machdep.c,v 1.59 2011/06/30 00:52:59 matt Exp $ */ /* * Copyright (C) 2002 Matt Thomas @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.58 2011/06/20 07:18:07 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.59 2011/06/30 00:52:59 matt Exp $"); #include "opt_ppcarch.h" #include "opt_compat_netbsd.h" @@ -835,7 +835,7 @@ kvtop(void *addr) * Allocate vm space and mapin the I/O address */ void * -mapiodev(paddr_t pa, psize_t len) +mapiodev(paddr_t pa, psize_t len, bool prefetchable) { paddr_t faddr; vaddr_t taddr, va; @@ -850,7 +850,8 @@ mapiodev(paddr_t pa, psize_t len) return NULL; for (; len > 0; len -= PAGE_SIZE) { - pmap_kenter_pa(taddr, faddr, VM_PROT_READ | VM_PROT_WRITE, 0); + pmap_kenter_pa(taddr, faddr, VM_PROT_READ | VM_PROT_WRITE, + (prefetchable ? PMAP_MD_PREFETCHABLE : PMAP_NOCACHE)); faddr += PAGE_SIZE; taddr += PAGE_SIZE; } diff --git a/sys/arch/powerpc/oea/pmap.c b/sys/arch/powerpc/oea/pmap.c index 6a43a1dc6fe4..d2891a4f2472 100644 --- a/sys/arch/powerpc/oea/pmap.c +++ b/sys/arch/powerpc/oea/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.80 2011/06/19 07:59:47 matt Exp $ */ +/* $NetBSD: pmap.c,v 1.81 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.80 2011/06/19 07:59:47 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.81 2011/06/30 00:52:59 matt Exp $"); #define PMAP_NOOPNAMES @@ -1931,7 +1931,7 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags) } else pte_lo = PTE_G; - if ((flags & PMAP_MD_NOCACHE) == 0) { + if ((flags & PMAP_NOCACHE) == 0) { for (mp = mem; mp->size; mp++) { if (pa >= mp->start && pa < mp->start + mp->size) { pte_lo = PTE_M; @@ -2024,7 +2024,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags) * asssume it's in memory coherent memory. */ pte_lo = PTE_IG; - if ((flags & PMAP_MD_NOCACHE) == 0) { + if ((flags & PMAP_NOCACHE) == 0) { for (mp = mem; mp->size; mp++) { if (pa >= mp->start && pa < mp->start + mp->size) { pte_lo = PTE_M; diff --git a/sys/arch/powerpc/oea/pmap_kernel.c b/sys/arch/powerpc/oea/pmap_kernel.c index 0fbd59ba28d8..64ac8ce542b3 100644 --- a/sys/arch/powerpc/oea/pmap_kernel.c +++ b/sys/arch/powerpc/oea/pmap_kernel.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_kernel.c,v 1.8 2011/06/20 08:07:03 matt Exp $ */ +/* $NetBSD: pmap_kernel.c,v 1.9 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -30,7 +30,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: pmap_kernel.c,v 1.8 2011/06/20 08:07:03 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: pmap_kernel.c,v 1.9 2011/06/30 00:52:59 matt Exp $"); #include "opt_ddb.h" #include "opt_pmap.h" @@ -44,12 +44,12 @@ struct pmap *const kernel_pmap_ptr = &kernel_pmap_; u_int powerpc_mmap_flags(paddr_t pa) { - u_int flags = PMAP_MD_NOCACHE; + u_int flags = PMAP_NOCACHE; if (pa & POWERPC_MMAP_FLAG_PREFETCHABLE) flags |= PMAP_MD_PREFETCHABLE; if (pa & POWERPC_MMAP_FLAG_CACHEABLE) - flags &= ~PMAP_MD_NOCACHE; + flags &= ~PMAP_NOCACHE; return flags; } diff --git a/sys/arch/powerpc/pci/pchb.c b/sys/arch/powerpc/pci/pchb.c index 7a9e2ad1d758..e6fc1e9c288f 100644 --- a/sys/arch/powerpc/pci/pchb.c +++ b/sys/arch/powerpc/pci/pchb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pchb.c,v 1.6 2011/06/17 19:03:00 matt Exp $ */ +/* $NetBSD: pchb.c,v 1.7 2011/06/30 00:52:59 matt Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.6 2011/06/17 19:03:00 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.7 2011/06/30 00:52:59 matt Exp $"); #include #include @@ -260,7 +260,7 @@ pchbattach(device_t parent, device_t self, void *aux) ibm82660_print(pa, self); break; case PCI_PRODUCT_IBM_PYTHON: - python = mapiodev(0xfeff6000, 0x60); + python = mapiodev(0xfeff6000, 0x60, false); v = 0x88b78e01; /* taken from linux */ out32rb(python+0x30, v); v = in32rb(python+0x30); diff --git a/sys/arch/powerpc/powerpc/bus_dma.c b/sys/arch/powerpc/powerpc/bus_dma.c index 1417b138fcff..f703969d8e68 100644 --- a/sys/arch/powerpc/powerpc/bus_dma.c +++ b/sys/arch/powerpc/powerpc/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.41 2011/06/18 06:41:44 matt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.42 2011/06/30 00:53:00 matt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #define _POWERPC_BUS_DMA_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.41 2011/06/18 06:41:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.42 2011/06/30 00:53:00 matt Exp $"); #include #include @@ -637,7 +637,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size_t size pmap_kenter_pa(va, addr, VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED | - ((flags & BUS_DMA_NOCACHE) ? PMAP_MD_NOCACHE : 0)); + ((flags & BUS_DMA_NOCACHE) ? PMAP_NOCACHE : 0)); } } diff --git a/sys/arch/powerpc/powerpc/bus_space.c b/sys/arch/powerpc/powerpc/bus_space.c index 42b00ed8419f..3d377cdb27ea 100644 --- a/sys/arch/powerpc/powerpc/bus_space.c +++ b/sys/arch/powerpc/powerpc/bus_space.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.27 2011/06/20 05:39:43 matt Exp $ */ +/* $NetBSD: bus_space.c,v 1.28 2011/06/30 00:53:00 matt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.27 2011/06/20 05:39:43 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.28 2011/06/30 00:53:00 matt Exp $"); #define _POWERPC_BUS_SPACE_PRIVATE @@ -614,7 +614,8 @@ memio_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, /* * Map this into the kernel pmap. */ - *bshp = (bus_space_handle_t) mapiodev(pa, size); + *bshp = (bus_space_handle_t) mapiodev(pa, size, + (flags & BUS_SPACE_MAP_PREFETCHABLE) != 0); if (*bshp == 0) { extent_free(t->pbs_extent, bpa, size, EX_NOWAIT | extent_flags); #ifdef DEBUG @@ -747,7 +748,7 @@ memio_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend, } } #endif /* defined (PPC_OEA) || defined(PPC_OEA601) */ - *bshp = (bus_space_handle_t) mapiodev(pa, size); + *bshp = (bus_space_handle_t) mapiodev(pa, size, false); if (*bshp == 0) { extent_free(t->pbs_extent, bpa, size, EX_NOWAIT | extent_flags); return (ENOMEM); diff --git a/sys/arch/prep/include/autoconf.h b/sys/arch/prep/include/autoconf.h index f6c91db537a7..62d325cac13f 100644 --- a/sys/arch/prep/include/autoconf.h +++ b/sys/arch/prep/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.8 2007/10/17 19:56:49 garbled Exp $ */ +/* $NetBSD: autoconf.h,v 1.9 2011/06/30 00:53:00 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -43,5 +43,4 @@ struct confargs { /* bus_space_tag_t ca_tag; */ }; -extern void *mapiodev(paddr_t, psize_t); extern paddr_t kvtop(void *); diff --git a/sys/arch/prep/pci/pci_machdep.c b/sys/arch/prep/pci/pci_machdep.c index 6320ca9b3de7..008bda38ab3d 100644 --- a/sys/arch/prep/pci/pci_machdep.c +++ b/sys/arch/prep/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.35 2011/06/22 18:06:35 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.36 2011/06/30 00:53:00 matt Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.35 2011/06/22 18:06:35 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.36 2011/06/30 00:53:00 matt Exp $"); #include #include @@ -96,8 +96,8 @@ prep_pci_get_chipset_tag_indirect(pci_chipset_tag_t pc) pc->pc_decompose_tag = genppc_pci_indirect_decompose_tag; pc->pc_conf_hook = prep_pci_conf_hook; - pc->pc_addr = mapiodev(prep_pci_baseaddr, 4); - pc->pc_data = mapiodev(prep_pci_basedata, 4); + pc->pc_addr = mapiodev(prep_pci_baseaddr, 4, false); + pc->pc_data = mapiodev(prep_pci_basedata, 4, false); pc->pc_bus = 0; pc->pc_node = 0; pc->pc_memt = 0; diff --git a/sys/arch/prep/prep/machdep.c b/sys/arch/prep/prep/machdep.c index 7847867a741b..345f66da00cb 100644 --- a/sys/arch/prep/prep/machdep.c +++ b/sys/arch/prep/prep/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.72 2011/06/20 07:18:07 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.73 2011/06/30 00:53:00 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.72 2011/06/20 07:18:07 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.73 2011/06/30 00:53:00 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_openpic.h" @@ -342,11 +342,11 @@ prep_setup_openpic(PPC_DEVICE *dev) if (pa->PPCData[0] == 1) baseaddr = (unsigned char *)mapiodev( le64dec(&pa->PPCData[4]) | PREP_BUS_SPACE_IO, - le64dec(&pa->PPCData[12])); + le64dec(&pa->PPCData[12]), false); else if (pa->PPCData[0] == 2) baseaddr = (unsigned char *)mapiodev( le64dec(&pa->PPCData[4]) | PREP_BUS_SPACE_MEM, - le64dec(&pa->PPCData[12])); + le64dec(&pa->PPCData[12]), false); if (baseaddr == NULL) return 0; pic_init(); @@ -407,7 +407,7 @@ setup_ivr(PPC_DEVICE *dev) /* otherwise we have a memory packet */ addr = le64dec(&pa->PPCData[4]) & ~(PAGE_SIZE-1); prep_intr_reg_off = le64dec(&pa->PPCData[4]) & (PAGE_SIZE-1); - prep_intr_reg = (vaddr_t)mapiodev(addr, PAGE_SIZE); + prep_intr_reg = (vaddr_t)mapiodev(addr, PAGE_SIZE, false); if (!prep_intr_reg) panic("startup: no room for interrupt register"); return; @@ -450,7 +450,7 @@ prep_init(void) * occur on certain motorola VME boards. Instead we need * to just hardcode it. */ - prep_intr_reg = (vaddr_t) mapiodev(PREP_INTR_REG, PAGE_SIZE); + prep_intr_reg = (vaddr_t) mapiodev(PREP_INTR_REG, PAGE_SIZE, false); if (!prep_intr_reg) panic("startup: no room for interrupt register"); prep_intr_reg_off = INTR_VECTOR_REG; diff --git a/sys/arch/rs6000/include/autoconf.h b/sys/arch/rs6000/include/autoconf.h index 83cb74af81d4..1c07c191afeb 100644 --- a/sys/arch/rs6000/include/autoconf.h +++ b/sys/arch/rs6000/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.1 2007/12/17 19:09:08 garbled Exp $ */ +/* $NetBSD: autoconf.h,v 1.2 2011/06/30 00:53:00 matt Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -44,8 +44,7 @@ struct confargs { }; #ifdef _KERNEL -extern void *mapiodev(paddr_t, psize_t); -extern paddr_t kvtop(void *); +paddr_t kvtop(void *); void inittodr(time_t); void resettodr(void);