page_fault.S
globl _vmm_pageFault text code32 esp globl _vmm_pageFault text code32 esp movl (%esp) movl % esp
globl _vmm_pageFault text code32 globl _vmm_pageFault text code32 _vmm_pageFault _vmm_pageFault idt_init vmm_pagingInit
globl _vmm_pageFault text code32 esp eax pushl ebx ebx pushl ecx pushl edx push ebx push eax movl globl _vmm_pageFault text code32 esp eax pushl ebx ebx pushl ecx pushl edx push ebx push eax movl cr2 cr2
globl _vmm_pageFault text code32 esp eax pushl ebx ebx pushl ecx pushl edx push ebx push eax movl eax pushl eax sti call vmm_pageFault addl globl _vmm_pageFault text code32 esp eax pushl ebx ebx pushl ecx pushl edx push ebx push eax movl eax pushl eax sti call vmm_pageFault addl xC xC

    /*****************************************************************************************
    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: page__fault_8S.xml 88 2016-01-12 00:11:29Z reddawg $

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

    /*
    Pagefaultwrapperthiswillaquiresomevaluesweneedforlateruse
    */

    .globl_vmm_pageFault
    .text
    .code32
    _vmm_pageFault:
    xchgl%eax,(%esp)/*SaveEAX*/
    movl4(%esp),%eax/*MoveEIPintoEAXtouselater*/
    pushl%ebx/*SaveEBX*/
    movl20(%esp),%ebx/*SaveESPforring3touselater*/
    pushl%ecx/*SaveECX,EDX*/
    pushl%edx
    push%ebx/*PushESP*/
    push%eax/*PushEIP*/
    movl%cr2,%eax/*Pushthefaultedaddress*/
    pushl%eax
    sti/*Turninterruptsbackonwearenowentrantsafe*/
    callvmm_pageFault/*Callourpagefaulthandler*/
    addl$0xC,%esp/*Adjustthestacktocompensateforpushedvalues*/
    popl%edx/*RestoreEAX,EBX,ECX,EDX*/
    popl%ecx
    popl%ebx
    popl%eax
    iret/*Returnfromtheinterrupt*/

    /***
    END
    ***/