Module Name:    src
Committed By:   matt
Date:           Sun Sep  2 14:43:21 UTC 2012

Modified Files:
        src/sys/arch/arm/arm32: bus_dma.c
        src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Make bus_dma understand supersections.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/arm/include/arm32/pmap.h

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/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.54 src/sys/arch/arm/arm32/bus_dma.c:1.55
--- src/sys/arch/arm/arm32/bus_dma.c:1.54	Fri Jul  1 20:57:45 2011
+++ src/sys/arch/arm/arm32/bus_dma.c	Sun Sep  2 14:43:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.54 2011/07/01 20:57:45 dyoung Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.55 2012/09/02 14:43:21 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54 2011/07/01 20:57:45 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.55 2012/09/02 14:43:21 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -962,17 +962,23 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		/*
 		 * Get the physical address for this segment.
 		 *
-		 * XXX Don't support checking for coherent mappings
+		 * XXX Doesn't support checking for coherent mappings
 		 * XXX in user address space.
 		 */
 		if (__predict_true(pmap == pmap_kernel())) {
 			(void) pmap_get_pde_pte(pmap, vaddr, &pde, &ptep);
 			if (__predict_false(pmap_pde_section(pde))) {
-				curaddr = (*pde & L1_S_FRAME) |
-				    (vaddr & L1_S_OFFSET);
+				paddr_t s_frame = L1_S_FRAME;
+				paddr_t s_offset = L1_S_OFFSET;
+#if ARM_MMU_V7 > 0
+				if (__predict_false(pmap_pde_supersection(pde))) {
+					s_frame = L1_SS_FRAME;
+					s_frame = L1_SS_OFFSET;
+}
+#endif
+				curaddr = (*pde & s_frame) | (vaddr & s_offset);
 				if (*pde & L1_S_CACHE_MASK) {
-					map->_dm_flags &=
-					    ~ARM32_DMAMAP_COHERENT;
+					map->_dm_flags &= ~ARM32_DMAMAP_COHERENT;
 				}
 			} else {
 				pte = *ptep;

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.106 src/sys/arch/arm/include/arm32/pmap.h:1.107
--- src/sys/arch/arm/include/arm32/pmap.h:1.106	Sat Sep  1 12:19:32 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Sep  2 14:43:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.106 2012/09/01 12:19:32 martin Exp $	*/
+/*	$NetBSD: pmap.h,v 1.107 2012/09/02 14:43:21 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -453,6 +453,7 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 /* L1 and L2 page table macros */
 #define pmap_pde_v(pde)		l1pte_valid(*(pde))
 #define pmap_pde_section(pde)	l1pte_section_p(*(pde))
+#define pmap_pde_supersection(pde)	l1pte_supersection_p(*(pde))
 #define pmap_pde_page(pde)	l1pte_page_p(*(pde))
 #define pmap_pde_fpage(pde)	l1pte_fpage_p(*(pde))
 

Reply via email to