fa443a883d568982c1a4cdfaa17696fb005a208a
[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 #include <asm.inc>
10
11 /* FUNCTIONS ***************************************************************/
12
13 .code
14
15 PUBLIC _DbgBreakPointNoBugCheck@0
16 FUNC _DbgBreakPointNoBugCheck@0
17 FPO 0, 0, 0, 0, 0, FRAME_FPO
18
19 /* Do breakpoint */
20 int 3
21 ret
22
23 ENDFUNC
24
25
26 PUBLIC _DbgUserBreakPoint@0
27 _DbgUserBreakPoint@0:
28 PUBLIC _DbgBreakPoint@0
29 FUNC _DbgBreakPoint@0
30 FPO 0, 0, 0, 0, 0, FRAME_FPO
31
32 /* Do breakpoint */
33 int 3
34 ret
35
36 ENDFUNC
37
38
39 PUBLIC _DbgBreakPointWithStatus@4
40 FUNC _DbgBreakPointWithStatus@4
41 FPO 0, 1, 0, 0, 0, FRAME_FPO
42
43 /* Put Status in EAX */
44 mov eax, [esp+4]
45
46 PUBLIC _RtlpBreakWithStatusInstruction@0
47 GLOBAL_LABEL _RtlpBreakWithStatusInstruction@0
48
49 /*
50 * Do a "labeled" breakpoint -- the KD data block has a "BreakpointWithStatus" field
51 * pointing to this label, letting a debugger easily check that a breakpoint has occured here
52 * and thereby know that there is a Status for it to retrieve from EAX
53 *
54 * In other words, Status is passed as an argument directly to the debugger
55 */
56 int 3
57 ret 4
58
59 ENDFUNC
60
61
62 PUBLIC _DebugService2@12
63 FUNC _DebugService2@12
64 FPO 0, 3, 3, 0, 1, FRAME_NONFPO
65
66 /* Set up the stack */
67 push ebp
68 mov ebp, esp
69
70 /* Call the interrupt */
71 mov eax, [ebp+16]
72 mov ecx, [ebp+8]
73 mov edx, [ebp+12]
74 int HEX(2D)
75 int 3
76
77 /* Return */
78 pop ebp
79 ret 12
80
81 ENDFUNC
82
83
84 PUBLIC _DebugService@20
85 FUNC _DebugService@20
86 FPO 0, 5, 3, 0, 1, FRAME_NONFPO
87
88 /* Set up the stack */
89 push ebp
90 mov ebp, esp
91
92 /* Save non-volatiles */
93 push ebx
94 push edi
95
96 /* Call the Interrupt */
97 mov eax, [ebp+8]
98 mov ecx, [ebp+12]
99 mov edx, [ebp+16]
100 mov ebx, [ebp+20]
101 mov edi, [ebp+24]
102 int HEX(2D)
103 int 3
104
105 /* Restore non-volatiles */
106 pop edi
107 pop ebx
108
109 /* Return */
110 pop ebp
111 ret 20
112
113 ENDFUNC
114
115 END