From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 23:07:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8790DEA2; Fri, 13 Dec 2013 23:07:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 732A017A6; Fri, 13 Dec 2013 23:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDN7NqY066957; Fri, 13 Dec 2013 23:07:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDN7NIA066954; Fri, 13 Dec 2013 23:07:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132307.rBDN7NIA066954@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 23:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259363 - stable/10/sys/arm/s3c2xx0 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 23:07:23 -0000 Author: ian Date: Fri Dec 13 23:07:22 2013 New Revision: 259363 URL: http://svnweb.freebsd.org/changeset/base/259363 Log: MFC r257639: Remove the duplicated implementations of some bus_space functions and use the essentially identical generic implementations instead. The generic implementations differ only in the spelling of a couple variable names and some formatting differences. Modified: stable/10/sys/arm/s3c2xx0/files.s3c2xx0 stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/s3c2xx0/files.s3c2xx0 ============================================================================== --- stable/10/sys/arm/s3c2xx0/files.s3c2xx0 Fri Dec 13 22:58:57 2013 (r259362) +++ stable/10/sys/arm/s3c2xx0/files.s3c2xx0 Fri Dec 13 23:07:22 2013 (r259363) @@ -1,4 +1,6 @@ # $FreeBSD$ +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard arm/arm/irq_dispatch.S standard arm/s3c2xx0/board_ln2410sbc.c optional board_ln2410sbc Modified: stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c Fri Dec 13 22:58:57 2013 (r259362) +++ stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c Fri Dec 13 23:07:22 2013 (r259363) @@ -89,7 +89,6 @@ __FBSDID("$FreeBSD$"); #include /* Prototypes for all the bus_space structure functions */ -bs_protos(s3c2xx0); bs_protos(generic); bs_protos(generic_armv4); @@ -98,16 +97,16 @@ struct bus_space s3c2xx0_bs_tag = { (void *) 0, /* mapping/unmapping */ - s3c2xx0_bs_map, - s3c2xx0_bs_unmap, - s3c2xx0_bs_subregion, + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, /* allocation/deallocation */ - s3c2xx0_bs_alloc, /* not implemented */ - s3c2xx0_bs_free, /* not implemented */ + generic_bs_alloc, /* not implemented */ + generic_bs_free, /* not implemented */ /* barrier */ - s3c2xx0_bs_barrier, + generic_bs_barrier, /* read (single) */ generic_bs_r_1, @@ -164,87 +163,3 @@ struct bus_space s3c2xx0_bs_tag = { NULL, }; -int -s3c2xx0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, - int flag, bus_space_handle_t * bshp) -{ - u_long startpa, endpa, pa; - vm_offset_t va; - pt_entry_t *pte; - const struct pmap_devmap *pd; - - if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { - /* Device was statically mapped. */ - *bshp = pd->pd_va + (bpa - pd->pd_pa); - return 0; - } - - startpa = trunc_page(bpa); - endpa = round_page(bpa + size); - - va = kva_alloc(endpa - startpa); - if (!va) - return (ENOMEM); - - *bshp = (bus_space_handle_t) (va + (bpa - startpa)); - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - if ((flag & BUS_SPACE_MAP_CACHEABLE) == 0) - *pte &= ~L2_S_CACHE_MASK; - } - return (0); -} - -void -s3c2xx0_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) -{ - vm_offset_t va, endva, origva; - - if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page((vm_offset_t)h + size); - origva = va = trunc_page((vm_offset_t)h); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kva_free(origva, endva - origva); -} - -int -s3c2xx0_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t size, bus_space_handle_t * nbshp) -{ - - *nbshp = bsh + offset; - return (0); -} - -void -s3c2xx0_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - - /* Nothing to do. */ -} - -int -s3c2xx0_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, - bus_size_t size, bus_size_t alignment, bus_size_t boundary, - int flags, bus_addr_t * bpap, bus_space_handle_t * bshp) -{ - - panic("s3c2xx0_io_bs_alloc(): not implemented\n"); -} - -void -s3c2xx0_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - panic("s3c2xx0_io_bs_free(): not implemented\n"); -}