mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
- Implement KeTrapFrameToContext.
- We now get to the point where we call KiDebugRoutine, which is registered as KdpEnterDebuggerException. - KdpEnterDebuggerException reads our exception record and understands this is a BREAKPOINT_PRINT. - It then calls the KdpServiceDispatcher. - This, in turn, calls KdpPrintString. - Which in turn loops the "debug providers" and calls KdpSerialPrintString. - Which calls into KDCOM. - And we see this on the debug log: (ntoskrnl/kd/kdio.c:191) . - Epic Win. Need to implement KeContextToTrapFrame now. svn path=/trunk/; revision=34482
This commit is contained in:
parent
673e2fd5fd
commit
ed3125b4e0
|
@ -14,6 +14,10 @@
|
||||||
|
|
||||||
/* GLOBALS ********************************************************************/
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
|
#include <internal/arm/ksarm.h>
|
||||||
|
#define KiGetPreviousMode(tf) \
|
||||||
|
((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS ******************************************************************/
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
@ -35,8 +39,73 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame,
|
||||||
IN PKEXCEPTION_FRAME ExceptionFrame,
|
IN PKEXCEPTION_FRAME ExceptionFrame,
|
||||||
IN OUT PCONTEXT Context)
|
IN OUT PCONTEXT Context)
|
||||||
{
|
{
|
||||||
while (TRUE);
|
KIRQL OldIrql;
|
||||||
return;
|
|
||||||
|
//
|
||||||
|
// 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 (KiGetPreviousMode(TrapFrame))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// ARM has register banks
|
||||||
|
//
|
||||||
|
Context->Sp = TrapFrame->UserSp;
|
||||||
|
Context->Lr = TrapFrame->UserLr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// ARM has register banks
|
||||||
|
//
|
||||||
|
Context->Sp = TrapFrame->SvcSp;
|
||||||
|
Context->Lr = TrapFrame->SvcLr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// The rest is already in the right mode
|
||||||
|
//
|
||||||
|
Context->Pc = TrapFrame->Pc;
|
||||||
|
Context->Psr = TrapFrame->Spsr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Now do the integers
|
||||||
|
//
|
||||||
|
if ((Context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Basically everything else but FPU
|
||||||
|
//
|
||||||
|
Context->R0 = TrapFrame->R0;
|
||||||
|
Context->R1 = TrapFrame->R1;
|
||||||
|
Context->R2 = TrapFrame->R2;
|
||||||
|
Context->R3 = TrapFrame->R3;
|
||||||
|
Context->R4 = TrapFrame->R4;
|
||||||
|
Context->R5 = TrapFrame->R5;
|
||||||
|
Context->R6 = TrapFrame->R6;
|
||||||
|
Context->R7 = TrapFrame->R7;
|
||||||
|
Context->R8 = TrapFrame->R8;
|
||||||
|
Context->R0 = TrapFrame->R9;
|
||||||
|
Context->R10 = TrapFrame->R10;
|
||||||
|
Context->R11 = TrapFrame->R11;
|
||||||
|
Context->R12 = TrapFrame->R12;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Restore IRQL
|
||||||
|
//
|
||||||
|
if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Reference in a new issue