Create the AHCI branch for Aman's work
[reactos.git] / sdk / 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/amd64/debug_asm.S
6 * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9 #include <asm.inc>
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 .PROC DbgBreakPointNoBugCheck
26 .endprolog
27 int 3
28 ret
29 .ENDP
30
31 DbgUserBreakPoint:
32 .PROC DbgBreakPoint
33 .endprolog
34 int 3
35 ret
36 .ENDP
37
38 .PROC DbgBreakPointWithStatus
39 .endprolog
40 mov eax, ecx
41 .ENDP
42
43 .PROC RtlpBreakWithStatusInstruction
44 .endprolog
45 int 3
46 ret
47 .ENDP
48
49 DebugService2:
50 ret
51 /* Call the interrupt */
52 // mov eax, [rbp+8]
53 // int 0x2D
54 // int 3
55
56
57 /******************************************************************************
58 * NTSTATUS NTAPI DebugService(
59 * IN ULONG Service, // <rcx> = [rsp + 8]
60 * IN PVOID Buffer, // <rdx> = [rsp + 16]
61 * IN ULONG Length, // <r8> = [rsp + 24]
62 * IN PVOID Argument1, // <r9> = [rsp + 32]
63 * IN PVOID Argument2); // [rsp + 40]
64 */
65 DebugService:
66
67 /* Prepare registers for interrupt */
68 mov eax, ecx // Service
69 mov rcx, rdx // Buffer
70 mov edx, r8d // Length
71 mov r8, r9 // Argument1
72 mov r9, [rsp + 40] // Argument2
73
74 /* Call the Interrupt */
75 int HEX(2D)
76 int 3
77
78 /* Return */
79 ret
80
81 END