ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID NTAPI KeContextToTrapFrame ( IN PCONTEXT  Context,
IN OUT PKEXCEPTION_FRAME  ExceptionFrame,
IN OUT PKTRAP_FRAME  TrapFrame,
IN ULONG  ContextFlags,
IN KPROCESSOR_MODE  PreviousMode 
)

Definition at line 20 of file exp.c.

{
    KIRQL OldIrql;
    
    //
    // Do this at APC_LEVEL
    //
    OldIrql = KeGetCurrentIrql();
    if (OldIrql < APC_LEVEL) KeRaiseIrql(APC_LEVEL, &OldIrql);
    
    //
    // Start with the Control flags
    //
    if ((Context->ContextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL)
    {
        //
        // So this basically means all the special stuff
        //
        if (PreviousMode == UserMode)
        {
            //
            // ARM has register banks
            //
            TrapFrame->UserSp = Context->Sp;
            TrapFrame->UserLr = Context->Lr;
        }
        else
        {
            //
            // ARM has register banks
            //
            TrapFrame->SvcSp = Context->Sp;
            TrapFrame->SvcLr = Context->Lr;
        }
        
        //
        // The rest is already in the right mode
        //
        TrapFrame->Pc = Context->Pc;
        TrapFrame->Spsr = Context->Psr;
    }
    
    //
    // Now do the integers
    //
    if ((Context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER)
    {
        //
        // Basically everything else but FPU
        //
        TrapFrame->R0 = Context->R0;
        TrapFrame->R1 = Context->R1;
        TrapFrame->R2 = Context->R2;
        TrapFrame->R3 = Context->R3;
        TrapFrame->R4 = Context->R4;
        TrapFrame->R5 = Context->R5;
        TrapFrame->R6 = Context->R6;
        TrapFrame->R7 = Context->R7;
        TrapFrame->R8 = Context->R8;
        TrapFrame->R0 = Context->R9;
        TrapFrame->R10 = Context->R10;
        TrapFrame->R11 = Context->R11;
        TrapFrame->R12 = Context->R12;
    }
    
    //
    // Restore IRQL
    //
    if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql);  
}

Generated on Fri May 25 2012 06:03:05 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.