LogF("Backtrace: %p", IP);
//else
// LogF("Backtrace: %s+0x%x", str, delta);
- if( !MM_GetPhysAddr(BP) )
+ if( !MM_GetPhysAddr( (void*)BP ) )
{
LogF("\nBacktrace: Invalid BP, stopping\n");
return;
}
- while( MM_GetPhysAddr(BP) && MM_GetPhysAddr(BP+8+7) && i < MAX_BACKTRACE )
+ while( MM_GetPhysAddr( (void*)BP) && MM_GetPhysAddr((void*)(BP+8+7)) && i < MAX_BACKTRACE )
{
//str = Debug_GetSymbol(*(Uint*)(ebp+4), &delta);
//if(str == NULL)
extern void Desctab_Init(void);
extern void MM_InitVirt(void);
extern void Heap_Install(void);
-extern void Threads_Init(void);
extern int Time_Setup(void);
-extern void System_Init(char *Commandline);
extern void MM_InitPhys_Multiboot(tMBoot_Info *MBoot);
for( i = 0; i < Pages; i++, addr++ )
{
gaMainBitmap[addr >> 6] |= 1LL << (addr & 63);
- if( MM_GetPhysAddr( (tVAddr)&gaiPageReferences[addr] ) )
+ if( MM_GetPhysAddr( &gaiPageReferences[addr] ) )
gaiPageReferences[addr] = 1;
// Log("page %P refcount = %i", MM_GetRefCount(addr<<12));
rangeID = MM_int_GetRangeID(addr << 12);
{
tVAddr ref_base = ((tVAddr)&gaiPageReferences[ page ]) & ~0xFFF;
// Allocate reference page
- if( !MM_GetPhysAddr(ref_base) )
+ if( !MM_GetPhysAddr(&gaiPageReferences[page]) )
{
const int pages_per_refpage = PAGE_SIZE/sizeof(gaiPageReferences[0]);
int i;
PAGE_ALLOC_SET(page);
if( gaMainBitmap[page >> 6] + 1 == 0 )
gaSuperBitmap[page>> 12] |= 1LL << ((page >> 6) & 63);
- if( MM_GetPhysAddr( (tVAddr)&gaiPageReferences[page] ) )
+ if( MM_GetPhysAddr( &gaiPageReferences[page] ) )
gaiPageReferences[page] = 1;
}
if( PAddr >> 12 > giMaxPhysPage ) return ;
- if( MM_GetPhysAddr( (tVAddr) &gaiPageReferences[page] ) )
+ if( MM_GetPhysAddr( &gaiPageReferences[page] ) )
{
gaiPageReferences[ page ] --;
if( gaiPageReferences[ page ] == 0 )
if( PAddr > giMaxPhysPage ) return 0;
- if( MM_GetPhysAddr( (tVAddr)&gaiPageReferences[PAddr] ) ) {
+ if( MM_GetPhysAddr( &gaiPageReferences[PAddr] ) ) {
return gaiPageReferences[PAddr];
}
// if( !MM_GetRefCount(PAddr) ) return 1;
- if( !MM_GetPhysAddr(node_page) ) {
+ if( !MM_GetPhysAddr((void*)node_page) ) {
if( !MM_Allocate(node_page) )
return -1;
memset( (void*)node_page, 0, PAGE_SIZE );
// if( !MM_GetRefCount(PAddr) ) return 1;
PAddr >>= 12;
- if( !MM_GetPhysAddr( (tVAddr)&gapPageNodes[PAddr] ) ) {
+ if( !MM_GetPhysAddr( &gapPageNodes[PAddr] ) ) {
*Node = NULL;
return 0;
}
#define CANOICAL(addr) ((addr)&0x800000000000?(addr)|0xFFFF000000000000:(addr))
LogF("%016llx => ", CANOICAL(RangeStart));
// LogF("%6llx %6llx %6llx %016llx => ",
-// MM_GetPhysAddr( (tVAddr)&PAGEDIRPTR(RangeStart>>30) ),
-// MM_GetPhysAddr( (tVAddr)&PAGEDIR(RangeStart>>21) ),
-// MM_GetPhysAddr( (tVAddr)&PAGETABLE(RangeStart>>12) ),
+// MM_GetPhysAddr( &PAGEDIRPTR(RangeStart>>30) ),
+// MM_GetPhysAddr( &PAGEDIR(RangeStart>>21) ),
+// MM_GetPhysAddr( &PAGETABLE(RangeStart>>12) ),
// CANOICAL(RangeStart)
// );
if( gMM_ZeroPage && (PAGETABLE(RangeStart>>12) & PADDR_MASK) == gMM_ZeroPage )
{
tPAddr phys;
- phys = MM_GetPhysAddr(VAddr);
+ phys = MM_GetPhysAddr( (void*)VAddr );
if(!phys) return ;
MM_Unmap(VAddr);
/**
* \brief Get the physical address of a virtual location
*/
-tPAddr MM_GetPhysAddr(tVAddr Addr)
+tPAddr MM_GetPhysAddr(const void *Ptr)
{
+ tVAddr Addr = (tVAddr)Ptr;
tPAddr *ptr;
int ret;
{
for( num = Number; num -- && ret < MM_HWMAP_TOP; ret += 0x1000 )
{
- if( MM_GetPhysAddr(ret) != 0 ) break;
+ if( MM_GetPhysAddr( (void*)ret ) != 0 )
+ break;
}
if( num >= 0 ) continue;
// Log_KernelPanic("MM", "TODO: Implement MM_UnmapHWPages");
while( Number -- )
{
- MM_DerefPhys( MM_GetPhysAddr(VAddr) );
+ MM_DerefPhys( MM_GetPhysAddr((void*)VAddr) );
MM_Unmap(VAddr);
VAddr += 0x1000;
}
MM_MapEx(kstackbase+i*0x1000, phys, 1, 0);
tmpmapping = MM_MapTemp(phys);
- if( MM_GetPhysAddr( kstackbase+i*0x1000 ) )
+ if( MM_GetPhysAddr( (void*)(kstackbase+i*0x1000) ) )
memcpy(tmpmapping, (void*)(kstackbase+i*0x1000), 0x1000);
else
memset(tmpmapping, 0, 0x1000);
Uint i;
for( ; base < MM_KSTACK_TOP; base += KERNEL_STACK_SIZE )
{
- if(MM_GetPhysAddr(base+KERNEL_STACK_SIZE-0x1000) != 0)
+ if(MM_GetPhysAddr( (void*)(base+KERNEL_STACK_SIZE-0x1000) ) != 0)
continue;
//Log("MM_NewKStack: Found one at %p", base + KERNEL_STACK_SIZE);
// Check Prospective Space
for( i = USER_STACK_SZ >> 12; i--; )
{
- if( MM_GetPhysAddr( base + (i<<12) ) != 0 )
+ if( MM_GetPhysAddr( (void*)(base + (i<<12)) ) != 0 )
break;
}