diff --git a/src/sys/lib/kmalloc.c b/src/sys/lib/kmalloc.c index d80f42e..6272413 100644 --- a/src/sys/lib/kmalloc.c +++ b/src/sys/lib/kmalloc.c @@ -352,8 +352,6 @@ if (tmpDesc->baseAddr == baseAddr) { memset(tmpDesc->baseAddr,0xBB,tmpDesc->limit); - spinUnlock(&mallocSpinLock); - return; if (usedKernDesc == tmpDesc) usedKernDesc = tmpDesc->next; @@ -384,6 +382,9 @@ /*** $Log$ + Revision 1.28 2004/09/11 23:21:26 reddawg + run now do you get fegfaults with BB? + Revision 1.27 2004/09/11 22:49:28 reddawg pat look at lines 276-285 does the math seem right? diff --git a/src/sys/vmm/memory.c b/src/sys/vmm/memory.c index d091b9e..b70c68a 100644 --- a/src/sys/vmm/memory.c +++ b/src/sys/vmm/memory.c @@ -34,6 +34,7 @@ #include #include #include +#include static uInt32 freePages = 0; static spinLock_t vmmSpinLock = SPIN_LOCK_INITIALIZER; @@ -226,7 +227,7 @@ ************************************************************************/ int freePage(uInt32 pageAddr) { int pageIndex = 0x0; - + assert((pageAddr & 0xFFF) == 0x0); spinLock(&vmmSpinLock); /* Find The Page Index To The Memory Map */ @@ -239,6 +240,7 @@ vmmMemoryMap[pageIndex].cowCounter = 0x0; vmmMemoryMap[pageIndex].pid = -2; freePages++; + systemVitals->freePages = freePages; } else { /* Adjust The COW Counter */ @@ -263,6 +265,7 @@ ************************************************************************/ int adjustCowCounter(uInt32 baseAddr, int adjustment) { int vmmMemoryMapIndex = (baseAddr / 4096); + assert((baseAddr & 0xFFF) == 0x0); spinLock(&vmmCowSpinLock); /* Adjust COW Counter */ vmmMemoryMap[vmmMemoryMapIndex].cowCounter += adjustment; @@ -272,6 +275,7 @@ vmmMemoryMap[vmmMemoryMapIndex].pid = vmmID; vmmMemoryMap[vmmMemoryMapIndex].status = memAvail; freePages++; + systemVitals->freePages = freePages; } spinUnlock(&vmmCowSpinLock); /* Return */ @@ -329,6 +333,9 @@ /*** $Log$ + Revision 1.14 2004/09/11 16:39:19 apwillia + Fix order in adjustCowCounter to prevent potential race condition + Revision 1.13 2004/08/14 11:23:03 reddawg Changes