X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fmm_phys.c;h=1b79650bd6e75ac47b1a0ed55a37524669e483de;hb=1e7db40300bc594cf708bb6082a6e05a268da946;hp=2727c018ab277fe71ebb0aea060659569f5ab6c0;hpb=3d261aba7f8108798d731d6cd85c445f46a41024;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/mm_phys.c b/Kernel/arch/x86/mm_phys.c index 2727c018..1b79650b 100644 --- a/Kernel/arch/x86/mm_phys.c +++ b/Kernel/arch/x86/mm_phys.c @@ -1,7 +1,7 @@ /* - AcessOS Microkernel Version - mm_phys.c -*/ + * Acess2 + * - Physical memory manager + */ #define DEBUG 1 #include #include @@ -102,7 +102,6 @@ tPAddr MM_AllocPhys() } for(b=0;gaSuperBitmap[a]&(1<0;c++); // Mark page used if(gaPageReferences) @@ -117,8 +116,47 @@ tPAddr MM_AllocPhys() // Release Spinlock RELEASE( &giPhysAlloc ); - LOG("Allocated 0x%x\n", ret); - //LOG("ret = %x", ret); + + return ret; +} + +/** + * \fn tPAddr MM_AllocPhysRange(int Pages) + * \brief Allocate a range of physical pages + * \param Pages Number of pages to allocate + */ +tPAddr MM_AllocPhysRange(int Pages) +{ + int num = giPageCount / 32 / 32; + int a, b, c; + Uint32 ret; + + LOCK( &giPhysAlloc ); + + // Find free page + for(a=0;gaSuperBitmap[a]==-1&&a> 10 ] &= ~(1 << ((Addr >> 5)&31));