Reactos
at master 68 lines 1.5 kB view raw
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/* FUNCTIONS ***************************************************************/ 12 13.code64 14 15PUBLIC DbgUserBreakPoint 16DbgUserBreakPoint: 17PUBLIC DbgBreakPoint 18.PROC DbgBreakPoint 19 .endprolog 20 int 3 21 ret 22.ENDP 23 24PUBLIC RtlpBreakWithStatusInstruction 25RtlpBreakWithStatusInstruction: 26PUBLIC DbgBreakPointWithStatus 27.PROC DbgBreakPointWithStatus 28 .endprolog 29 int 3 30 ret 31.ENDP 32 33PUBLIC DebugService2 34DebugService2: 35 36 /* Pass the service number in eax */ 37 mov rax, r8 38 int HEX(2D) 39 int 3 40 ret 41 42 43/****************************************************************************** 44 * NTSTATUS NTAPI DebugService( 45 * IN ULONG Service, // <rcx> = [rsp + 8] 46 * IN PVOID Buffer, // <rdx> = [rsp + 16] 47 * IN ULONG Length, // <r8> = [rsp + 24] 48 * IN PVOID Argument1, // <r9> = [rsp + 32] 49 * IN PVOID Argument2); // [rsp + 40] 50 */ 51PUBLIC DebugService 52DebugService: 53 54 /* Prepare registers for interrupt */ 55 mov eax, ecx // Service 56 mov rcx, rdx // Buffer 57 mov edx, r8d // Length 58 mov r8, r9 // Argument1 59 mov r9, [rsp + 40] // Argument2 60 61 /* Call the Interrupt */ 62 int HEX(2D) 63 int 3 64 65 /* Return */ 66 ret 67 68END