Module Name: src Committed By: bouyer Date: Sun Oct 18 14:40:40 UTC 2009
Modified Files: src/sys/arch/sparc/include [netbsd-5]: bus.h src/sys/arch/sparc/sparc [netbsd-5]: machdep.c Log Message: Back out ticket 969 To generate a diff of this commit: cvs rdiff -u -r1.54.10.1 -r1.54.10.2 src/sys/arch/sparc/include/bus.h cvs rdiff -u -r1.282.4.2 -r1.282.4.3 src/sys/arch/sparc/sparc/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/sparc/include/bus.h diff -u src/sys/arch/sparc/include/bus.h:1.54.10.1 src/sys/arch/sparc/include/bus.h:1.54.10.2 --- src/sys/arch/sparc/include/bus.h:1.54.10.1 Sun Oct 18 13:43:45 2009 +++ src/sys/arch/sparc/include/bus.h Sun Oct 18 14:40:40 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.54.10.1 2009/10/18 13:43:45 bouyer Exp $ */ +/* $NetBSD: bus.h,v 1.54.10.2 2009/10/18 14:40:40 bouyer Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -245,7 +245,6 @@ void (*)(void)); /*optional fast vector*/ - static __inline int bus_space_map(t, a, s, f, hp) bus_space_tag_t t; @@ -353,7 +352,7 @@ #define BUS_SPACE_MAP_BUS1 0x0100 /* placeholders for bus functions... */ #define BUS_SPACE_MAP_BUS2 0x0200 #define BUS_SPACE_MAP_BUS3 0x0400 -#define BUS_SPACE_MAP_LARGE 0x0800 /* map outside IODEV range */ +#define BUS_SPACE_MAP_BUS4 0x0800 /* flags for bus_space_barrier() */ Index: src/sys/arch/sparc/sparc/machdep.c diff -u src/sys/arch/sparc/sparc/machdep.c:1.282.4.2 src/sys/arch/sparc/sparc/machdep.c:1.282.4.3 --- src/sys/arch/sparc/sparc/machdep.c:1.282.4.2 Sun Oct 18 13:43:45 2009 +++ src/sys/arch/sparc/sparc/machdep.c Sun Oct 18 14:40:40 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.282.4.2 2009/10/18 13:43:45 bouyer Exp $ */ +/* $NetBSD: machdep.c,v 1.282.4.3 2009/10/18 14:40:40 bouyer Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282.4.2 2009/10/18 13:43:45 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282.4.3 2009/10/18 14:40:40 bouyer Exp $"); #include "opt_compat_netbsd.h" #include "opt_compat_sunos.h" @@ -2127,8 +2127,8 @@ return (EINVAL); } -static int -sparc_bus_map_iodev(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags, +int +sparc_bus_map(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags, vaddr_t va, bus_space_handle_t *hp) { vaddr_t v; @@ -2194,44 +2194,11 @@ return (0); } -static int -sparc_bus_map_large(bus_space_tag_t t, bus_addr_t ba, - bus_size_t size, int flags, bus_space_handle_t *hp) -{ - vaddr_t v = 0; - - if (uvm_map(kernel_map, &v, size, NULL, 0, PAGE_SIZE, - UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_SHARE, UVM_ADV_NORMAL, - 0)) == 0) { - return sparc_bus_map_iodev(t, ba, size, flags, v, hp); - } - return -1; -} - -int -sparc_bus_map(bus_space_tag_t t, bus_addr_t ba, - bus_size_t size, int flags, vaddr_t va, - bus_space_handle_t *hp) -{ - - if (flags & BUS_SPACE_MAP_LARGE) { - return sparc_bus_map_large(t, ba, size, flags, hp); - } else - return sparc_bus_map_iodev(t, ba, size, flags, va, hp); - -} - int sparc_bus_unmap(bus_space_tag_t t, bus_space_handle_t bh, bus_size_t size) { vaddr_t va = trunc_page((vaddr_t)bh); - /* - * XXX - * mappings with BUS_SPACE_MAP_LARGE need additional care here - * we can just check if the VA is in the IODEV range - */ - pmap_kremove(va, round_page(size)); pmap_update(pmap_kernel()); return (0);