svn commit: r259363 - stable/10/sys/arm/s3c2xx0

Ian Lepore ian at FreeBSD.org
Fri Dec 13 23:07:23 UTC 2013


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 <machine/bus.h>
 
 /* 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");
-}


More information about the svn-src-stable-10 mailing list