1 #include <internal/ke.h>
2 #include <internal/i386/segment.h>
11 /* Ss - space already reserved by return EIP */
15 pushl 12(%esp) /* Eip */
16 movl %ss, 16(%esp) /* Save Ss */
17 pushl $0 /* ErrorCode */
23 pushl $0 /* ExceptionList */
24 pushl $0 /* PreviousMode */
33 /* Clear all breakpoint enables in dr7. */
34 andl $0xFFFF0000, %eax
46 pushl $0 /* TempEip */
48 pushl $0 /* DebugPointer */
49 pushl $3 /* DebugArgMark (Exception number) */
50 pushl 0x60(%esp) /* DebugEip */
51 pushl %ebp /* DebugEbp */
57 pushl $1 /* FirstChance */
58 pushl %eax /* Push a pointer to the trap frame */
59 pushl $0 /* Context */
60 pushl $0 /* PreviousMode (KernelMode) */
61 pushl $0 /* ExceptionRecord */
62 call _KdbEnterDebuggerException
65 * Pop the arguments and unused portions of the trap frame:
76 * Restore/update debugging registers.
92 * Restore registers including any that might have been changed
93 * inside the debugger.
101 addl $4, %esp /* PreviousMode */
102 addl $4, %esp /* ExceptionList */
108 /* Remove SS:ESP from the stack */
117 addl $12, %esp /* ErrorCode and SS:ESP */
120 * Return to the caller.
125 .globl _KdbpStackSwitchAndCall@8
126 _KdbpStackSwitchAndCall@8:
130 movl 0x8(%esp), %eax /* New stack */
131 movl 0xC(%esp), %ecx /* Function to call */
132 movl %esp, %edx /* Old stack */
141 /* Switch back to old stack */