From 8e6c492206780952bfc81a6223e05dab33699566 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Sun, 25 Nov 2012 19:08:38 +0800 Subject: [PATCH] Kernel/x86_64 - Fixed MM_AllocDMA off by `n` pages in PAddr ret --- KernelLand/Kernel/arch/x86_64/mm_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.20.1