Module Name:    src
Committed By:   matt
Date:           Tue Dec  6 17:37:55 UTC 2011

Modified Files:
        src/sys/arch/mips/mips [matt-nb5-mips64]: bus_dma.c

Log Message:
Add missing KSEGX support.


To generate a diff of this commit:
cvs rdiff -u -r1.22.16.20 -r1.22.16.21 src/sys/arch/mips/mips/bus_dma.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/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.22.16.20 src/sys/arch/mips/mips/bus_dma.c:1.22.16.21
--- src/sys/arch/mips/mips/bus_dma.c:1.22.16.20	Thu May 26 19:21:56 2011
+++ src/sys/arch/mips/mips/bus_dma.c	Tue Dec  6 17:37:55 2011
@@ -1013,6 +1013,11 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 		if (((mips_options.mips_cpu_flags & CPU_MIPS_D_CACHE_COHERENT) == 0)
 		&&  (flags & BUS_DMA_COHERENT))
 			*kvap = (void *)MIPS_PHYS_TO_KSEG1(segs[0].ds_addr);
+#ifdef ENABLE_MIPS_KSEGX
+		else if (mips_ksegx_start < segs[0].ds_addr
+		    && segs[0].ds_addr < mips_ksegx_start + VM_KSEGX_SIZE)
+			*kvap = (void *)(vaddr_t)(VM_KSEGX_ADDRESS + segs[0].ds_addr);
+#endif
 		else
 			*kvap = (void *)MIPS_PHYS_TO_KSEG0(segs[0].ds_addr);
 		return (0);
@@ -1065,6 +1070,11 @@ _bus_dmamem_unmap(bus_dma_tag_t t, void 
 	 */
 	if (MIPS_KSEG0_P(kva) || MIPS_KSEG1_P(kva))
 		return;
+#ifdef ENABLE_MIPS_KSEGX
+	if (VM_KSEGX_ADDRESS <= (vaddr_t)kva
+	    && (vaddr_t)kva < VM_KSEGX_ADDRESS + VM_KSEGX_SIZE)
+		return;
+#endif
 #ifdef _LP64
 	if (MIPS_XKPHYS_P((vaddr_t)kva))
 		return;

Reply via email to