- Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception...
[reactos.git] / reactos / lib / rtl / i386 / debug_asm.S
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Run-Time Library
4 * PURPOSE: Debug Routines
5 * FILE: lib/rtl/i386/debug.S
6 * PROGRAMER: Alex Ionescu (alex@relsoft.net)
7 */
8
9 .intel_syntax noprefix
10
11 /* GLOBALS ****************************************************************/
12
13 .globl _DbgBreakPoint@0
14 .globl _DbgBreakPointWithStatus@4
15 .globl _DbgUserBreakPoint@0
16 .globl _DebugService@20
17 .globl _DebugService2@12
18 .globl _DbgBreakPointNoBugCheck@0
19 .globl _RtlpBreakWithStatusInstruction@0
20
21 /* FUNCTIONS ***************************************************************/
22
23 .func DbgBreakPointNoBugCheck@0
24 _DbgBreakPointNoBugCheck@0:
25 int 3
26 ret
27 .endfunc
28
29 .func DbgBreakPoint@0
30 _DbgBreakPoint@0:
31 _DbgUserBreakPoint@0:
32 int 3
33 ret
34 .endfunc
35
36 .func DbgBreakPointWithStatus@4
37 _DbgBreakPointWithStatus@4:
38 mov eax, [esp+4]
39
40 _RtlpBreakWithStatusInstruction@0:
41 int 3
42 ret 4
43 .endfunc
44
45 .func DebugService2@12
46 _DebugService2@12:
47
48 /* Setup the stack */
49 push ebp
50 mov ebp, esp
51
52 /* Call the interrupt */
53 mov eax, [ebp+16]
54 mov ecx, [ebp+8]
55 mov edx, [ebp+12]
56 int 0x2D
57 //int 3
58
59 /* Restore stack */
60 pop ebp
61 ret 12
62 .endfunc
63
64 .func DebugService@20
65 _DebugService@20:
66
67 /* Setup the stack */
68 push ebp
69 mov ebp, esp
70
71 /* Save the registers */
72 push ecx
73 push ebx
74 push edi
75 push edi
76 push ebx
77
78 /* Call the Interrupt */
79 mov eax, [ebp+8]
80 mov ecx, [ebp+12]
81 mov edx, [ebp+16]
82 mov ebx, [ebp+20]
83 mov edi, [ebp+24]
84 int 0x2D
85 //int 3
86
87 /* Restore registers */
88 pop ebx
89 pop edi
90 pop edi
91 pop ebx
92
93 /* Return */
94 leave
95 ret 20
96 .endfunc