From: John Hodge Date: Tue, 22 Sep 2009 12:29:36 +0000 (+0800) Subject: Added debug to malloc, added caller to out of memory message X-Git-Tag: rel0.06~537 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1772867b77bef2030de97f82c1f0daa8c93003d9;p=tpg%2Facess2.git Added debug to malloc, added caller to out of memory message --- diff --git a/Kernel/arch/x86/mm_phys.c b/Kernel/arch/x86/mm_phys.c index de30a931..72f5dc9a 100644 --- a/Kernel/arch/x86/mm_phys.c +++ b/Kernel/arch/x86/mm_phys.c @@ -76,11 +76,7 @@ void MM_Install(tMBoot_Info *MBoot) memsetd(gaPageReferences, 1, kernelPages); for( num = kernelPages; num < giPageCount; num++ ) { - //if(gaPageBitmap[ num2 / 32 ] == 0) { - // memsetd(&gaPageReferences[num2], 0, 31-(num2&31)); - // num2 = (num2 + 32) & ~31; - //} else - gaPageReferences[num] = (gaPageBitmap[ num / 32 ] >> (num&31)) & 1; + gaPageReferences[num] = (gaPageBitmap[ num / 32 ] >> (num&31)) & 1; } } @@ -100,7 +96,7 @@ tPAddr MM_AllocPhys() for(a=0;gaSuperBitmap[a]==-1&&aSize == Bytes) { head->Magic = MAGIC_USED; RELEASE(&giHeapSpinlock); // Release spinlock + LOG("RETURN %p", best->Data); return best->Data; } @@ -204,6 +205,7 @@ void *malloc(size_t Bytes) // Check size if(best->Size == Bytes) { RELEASE(&giHeapSpinlock); // Release spinlock + LOG("RETURN %p", best->Data); return best->Data; } } @@ -222,6 +224,7 @@ void *malloc(size_t Bytes) best->Magic = MAGIC_USED; // Mark block as used RELEASE(&giHeapSpinlock); // Release spinlock + LOG("RETURN %p", best->Data); return best->Data; }