Kernel/x86_64 - Fixed MM_AllocDMA off by `n` pages in PAddr ret
authorJohn Hodge (sonata) <[email protected]>
Sun, 25 Nov 2012 11:08:38 +0000 (19:08 +0800)
committerJohn Hodge (sonata) <[email protected]>
Sun, 25 Nov 2012 11:08:38 +0000 (19:08 +0800)
KernelLand/Kernel/arch/x86_64/mm_virt.c

index 0953cbf..e1e59c0 100644 (file)
@@ -849,6 +849,7 @@ tVAddr MM_AllocDMA(int Pages, int MaxBits, tPAddr *PhysAddr)
        
        // Allocated successfully, now map
        ret = MM_MapHWPages(phys, Pages);
+       *PhysAddr = phys;
        // MapHWPages references the pages, so deref them back down to 1
        for(;Pages--;phys+=0x1000)
                MM_DerefPhys(phys);
@@ -857,7 +858,6 @@ tVAddr MM_AllocDMA(int Pages, int MaxBits, tPAddr *PhysAddr)
                return 0;
        }
        
-       *PhysAddr = phys;
        return ret;
 }
 

UCC git Repository :: git.ucc.asn.au