[AMD64]
[reactos.git] / reactos / lib / rtl / amd64 / 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: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9 #include <reactos/asm.h>
10
11 /* GLOBALS ****************************************************************/
12
13 PUBLIC DbgBreakPoint
14 PUBLIC DbgBreakPointWithStatus
15 PUBLIC DbgUserBreakPoint
16 PUBLIC DebugService
17 PUBLIC DebugService2
18 PUBLIC DbgBreakPointNoBugCheck
19 PUBLIC RtlpBreakWithStatusInstruction
20
21 /* FUNCTIONS ***************************************************************/
22
23 .code64
24
25 DbgBreakPointNoBugCheck:
26 int 3
27 ret
28
29 DbgBreakPoint:
30 DbgUserBreakPoint:
31 int 3
32 ret
33
34 DbgBreakPointWithStatus:
35 mov eax, ecx
36 RtlpBreakWithStatusInstruction:
37 int 3
38 ret
39
40 DebugService2:
41 ret
42 /* Call the interrupt */
43 // mov eax, [rbp+8]
44 // int 0x2D
45 // int 3
46
47
48 /******************************************************************************
49 * NTSTATUS NTAPI DebugService(
50 * IN ULONG Service, // <rcx> = [rsp + 8]
51 * IN PVOID Buffer, // <rdx> = [rsp + 16]
52 * IN ULONG Length, // <r8> = [rsp + 24]
53 * IN PVOID Argument1, // <r9> = [rsp + 32]
54 * IN PVOID Argument2); // [rsp + 40]
55 */
56 DebugService:
57
58 /* Prepare registers for interrupt */
59 mov eax, ecx // Service
60 mov rcx, rdx // Buffer
61 mov edx, r8d // Length
62 mov r8, r9 // Argument1
63 mov r9, [rsp + 40] // Argument2
64
65 /* Call the Interrupt */
66 int HEX(2D)
67 int 3
68
69 /* Return */
70 ret
71
72 END