Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm Make bus_dma understand supersections.
details: https://anonhg.NetBSD.org/src/rev/d5ae2bedffe9
branches: trunk
changeset: 781373:d5ae2bedffe9
user: matt <matt%NetBSD.org@localhost>
date: Sun Sep 02 14:43:21 2012 +0000
description:
Make bus_dma understand supersections.
diffstat:
sys/arch/arm/arm32/bus_dma.c | 20 +++++++++++++-------
sys/arch/arm/include/arm32/pmap.h | 3 ++-
2 files changed, 15 insertions(+), 8 deletions(-)
diffs (64 lines):
diff -r 316a2d6e7768 -r d5ae2bedffe9 sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c Sun Sep 02 13:57:18 2012 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c Sun Sep 02 14:43:21 2012 +0000
@@ -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 @@
/*
* 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;
diff -r 316a2d6e7768 -r d5ae2bedffe9 sys/arch/arm/include/arm32/pmap.h
--- a/sys/arch/arm/include/arm32/pmap.h Sun Sep 02 13:57:18 2012 +0000
+++ b/sys/arch/arm/include/arm32/pmap.h Sun Sep 02 14:43:21 2012 +0000
@@ -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 @@
/* 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))
Home |
Main Index |
Thread Index |
Old Index