[OpenBIOS] [PATCH 02/15] SPARC32: rename dvma_alloc()'s ba variable to iova

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon May 21 23:33:09 CEST 2018


This makes it clearer that we are handling a virtual IO address.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 drivers/iommu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu.c b/drivers/iommu.c
index cd9a64b..be486c0 100644
--- a/drivers/iommu.c
+++ b/drivers/iommu.c
@@ -45,7 +45,7 @@ void *
 dvma_alloc(int size, unsigned int *pphys)
 {
     void *va;
-    unsigned int pa, ba;
+    unsigned int pa, iova;
     unsigned int npages;
     unsigned int mva, mpa;
     unsigned int i;
@@ -58,8 +58,8 @@ dvma_alloc(int size, unsigned int *pphys)
     if (ret != 0)
         return NULL;
 
-    ba = (unsigned int)mem_alloc(&cdvmem, npages * PAGE_SIZE, PAGE_SIZE);
-    if (ba == 0)
+    iova = (unsigned int)mem_alloc(&cdvmem, npages * PAGE_SIZE, PAGE_SIZE);
+    if (iova == 0)
         return NULL;
 
     pa = (unsigned int)va2pa((unsigned long)va);
@@ -75,13 +75,13 @@ dvma_alloc(int size, unsigned int *pphys)
      * Map into IOMMU page table.
      */
     mpa = (unsigned int) pa;
-    iopte = &t->page_table[(ba - t->plow) / PAGE_SIZE];
+    iopte = &t->page_table[(iova - t->plow) / PAGE_SIZE];
     for (i = 0; i < npages; i++) {
         *iopte++ = MKIOPTE(mpa);
         mpa += PAGE_SIZE;
     }
 
-    *pphys = ba;
+    *pphys = iova;
 
     return va;
 }
-- 
2.11.0




More information about the OpenBIOS mailing list