From: John Hodge (sonata) Date: Sun, 25 Nov 2012 11:08:38 +0000 (+0800) Subject: Kernel/x86_64 - Fixed MM_AllocDMA off by `n` pages in PAddr ret X-Git-Tag: rel0.15~652 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=8e6c492206780952bfc81a6223e05dab33699566;p=tpg%2Facess2.git Kernel/x86_64 - Fixed MM_AllocDMA off by `n` pages in PAddr ret --- diff --git a/KernelLand/Kernel/arch/x86_64/mm_virt.c b/KernelLand/Kernel/arch/x86_64/mm_virt.c index 0953cbf8..e1e59c08 100644 --- a/KernelLand/Kernel/arch/x86_64/mm_virt.c +++ b/KernelLand/Kernel/arch/x86_64/mm_virt.c @@ -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; }