git: 9front

Download patch

ref: d5bb56ef3b419ee59cce045de49f9af7861fda30
parent: 834a4a1040b80e89b2a2b06fe5de199635824f0c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Apr 11 09:49:41 EDT 2019

bcm: dont assume PHYSDRAM 0 in dmaaddr(), fix dmaioaddr()

--- a/sys/src/9/bcm/dma.c
+++ b/sys/src/9/bcm/dma.c
@@ -100,13 +100,13 @@
 uintptr
 dmaaddr(void *va)
 {
-	return soc.busdram | (PTR2UINT(va) & ~KSEGM);
+	return soc.busdram | (PADDR(va) - PHYSDRAM);
 }
 
 static uintptr
 dmaioaddr(void *va)
 {
-	return soc.busio | (PTR2UINT(va) & ~VIRTIO);
+	return soc.busio | ((uintptr)va - VIRTIO);
 }
 
 static void
--