git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Debug
[tpg/acess2.git]
/
Kernel
/
arch
/
x86
/
mm_phys.c
diff --git
a/Kernel/arch/x86/mm_phys.c
b/Kernel/arch/x86/mm_phys.c
index
e81c99e
..
2727c01
100644
(file)
--- a/
Kernel/arch/x86/mm_phys.c
+++ b/
Kernel/arch/x86/mm_phys.c
@@
-2,6
+2,7
@@
AcessOS Microkernel Version
mm_phys.c
*/
AcessOS Microkernel Version
mm_phys.c
*/
+#define DEBUG 1
#include <common.h>
#include <mboot.h>
#include <mm_virt.h>
#include <common.h>
#include <mboot.h>
#include <mm_virt.h>
@@
-32,7
+33,7
@@
void MM_Install(tMBoot_Info *MBoot)
// Initialise globals
giPageCount = (MBoot->HighMem >> 2) + 256; // HighMem is a kByte value
// Initialise globals
giPageCount = (MBoot->HighMem >> 2) + 256; // HighMem is a kByte value
- L
og
("giPageCount = %i", giPageCount);
+ L
OG
("giPageCount = %i", giPageCount);
// Get used page count
kernelPages = (Uint)&gKernelEnd - KERNEL_BASE;
// Get used page count
kernelPages = (Uint)&gKernelEnd - KERNEL_BASE;
@@
-65,7
+66,7
@@
void MM_Install(tMBoot_Info *MBoot)
}
// Allocate References
}
// Allocate References
- L
og
("Reference Pages %i", (giPageCount*4+0xFFF)>>12);
+ L
OG
("Reference Pages %i", (giPageCount*4+0xFFF)>>12);
for(num = 0; num < (giPageCount*4+0xFFF)>>12; num++)
{
MM_Allocate( REFERENCE_BASE + (num<<12) );
for(num = 0; num < (giPageCount*4+0xFFF)>>12; num++)
{
MM_Allocate( REFERENCE_BASE + (num<<12) );
@@
-76,11
+77,7
@@
void MM_Install(tMBoot_Info *MBoot)
memsetd(gaPageReferences, 1, kernelPages);
for( num = kernelPages; num < giPageCount; num++ )
{
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,6
+97,7
@@
tPAddr MM_AllocPhys()
for(a=0;gaSuperBitmap[a]==-1&&a<num;a++);
if(a == num) {
RELEASE( &giPhysAlloc );
for(a=0;gaSuperBitmap[a]==-1&&a<num;a++);
if(a == num) {
RELEASE( &giPhysAlloc );
+ Warning("MM_AllocPhys - OUT OF MEMORY (Called by %p)", __builtin_return_address(0));
return 0;
}
for(b=0;gaSuperBitmap[a]&(1<<b);b++);
return 0;
}
for(b=0;gaSuperBitmap[a]&(1<<b);b++);
@@
-119,6
+117,7
@@
tPAddr MM_AllocPhys()
// Release Spinlock
RELEASE( &giPhysAlloc );
// Release Spinlock
RELEASE( &giPhysAlloc );
+ LOG("Allocated 0x%x\n", ret);
//LOG("ret = %x", ret);
return ret;
}
//LOG("ret = %x", ret);
return ret;
}
@@
-177,6
+176,7
@@
void MM_DerefPhys(tPAddr Addr)
// Mark as free in bitmaps
if( gaPageReferences[ Addr ] == 0 )
{
// Mark as free in bitmaps
if( gaPageReferences[ Addr ] == 0 )
{
+ LOG("Freed 0x%x\n", Addr);
gaPageBitmap[ Addr / 32 ] &= ~(1 << (Addr&31));
if(gaPageReferences[ Addr ] == 0)
gaSuperBitmap[ Addr >> 10 ] &= ~(1 << ((Addr >> 5)&31));
gaPageBitmap[ Addr / 32 ] &= ~(1 << (Addr&31));
if(gaPageReferences[ Addr ] == 0)
gaSuperBitmap[ Addr >> 10 ] &= ~(1 << ((Addr >> 5)&31));
UCC
git Repository :: git.ucc.asn.au