getphysicaladdr.c
vmm/vmm.h
sys/thread.h
ubixos/types.h
sys/_types.h
vmm/paging.h
vmm/vmm.h
src/sys/vmm/getphysicaladdr.c
sys/sysproto.h
sys/signal.h
u_int32_t u_int32_t vmm_getPhysicalAddr (uInt32 pageAddr) vmm_getPhysicalAddr uInt32 pageAddr

Function: void *vmmGetPhysicalAddr(); Description: Returns The Physical Address Of The Virtual Page Notes:

tablesBaseAddress
x1000
vmm_pageFault
vmmCopyVirtualSpace
vmmCreateVirtualSpace

    /*****************************************************************************************
    Copyright(c)2002-2004TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,are
    permittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistof
    conditions,thefollowingdisclaimerandthelistofauthors.Redistributionsinbinary
    formmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowing
    disclaimerandthelistofauthorsinthedocumentationand/orothermaterialsprovided
    withthedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftware
    withoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANY
    EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOF
    MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALL
    THECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,
    SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENT
    OFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,OR
    TORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHIS
    SOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: getphysicaladdr_8c.xml 88 2016-01-12 00:11:29Z reddawg $

    *****************************************************************************************/

    #include<vmm/vmm.h>

    u_int32_tvmm_getPhysicalAddr(uInt32pageAddr){
    intpageDirectoryIndex=0x0,pageTableIndex=0x0;
    uInt32*pageTable=0x0;

    //CalculateThePageDirectoryIndex
    pageDirectoryIndex=(pageAddr>>22);

    //CalculateThePageTableIndex
    pageTableIndex=((pageAddr>>12)&0x3FF);

    /*SetpageTableToTheVirtualAddressOfTable*/
    pageTable=(uInt32*)(tablesBaseAddress+(0x1000*pageDirectoryIndex));
    /*ReturnThePhysicalAddressOfThePage*/
    return((uInt32)(pageTable[pageTableIndex]&0xFFFFF000));
    }

    /***
    END
    ***/