reactos/lib/rtl/amd64/debug_asm.S
Hermès Bélusca-Maïto e1ef078741 Create this branch to work on loading of different Kernel-Debugger DLL providers, and see whether it is possible to move KDBG from ntoskrnl to a new DLL called, say, KDROSDBG.DLL.
The idea then would be to have the following behaviour (when specifying the following options in the kernel command line):

/DEBUGPORT=COMi --> load KDCOM.DLL and use COMi port (i == 1,2,3,4) if possible.
/DEBUGPORT=FOO  --> load KDFOO.DLL (useful for KDUSB.DLL, KD1394.DLL, KDBAZIS.DLL for VirtualKD, etc...)
/DEBUGPORT=ROSDBG:[COMi|SCREEN|FILE|GDB|...] --> load KDROSDBG.DLL which contains the ROS kernel debugger, and use COMi or SCREEN or... as output port.

svn path=/branches/kd++/; revision=58883
2013-04-28 13:26:45 +00:00

82 lines
1.7 KiB
ArmAsm

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Run-Time Library
* PURPOSE: Debug Routines
* FILE: lib/rtl/i386/debug.S
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
*/
#include <asm.inc>
/* GLOBALS ****************************************************************/
PUBLIC DbgBreakPoint
PUBLIC DbgBreakPointWithStatus
PUBLIC DbgUserBreakPoint
PUBLIC DebugService
PUBLIC DebugService2
PUBLIC DbgBreakPointNoBugCheck
PUBLIC RtlpBreakWithStatusInstruction
/* FUNCTIONS ***************************************************************/
.code64
.PROC DbgBreakPointNoBugCheck
.endprolog
int 3
ret
.ENDP
DbgUserBreakPoint:
.PROC DbgBreakPoint
.endprolog
int 3
ret
.ENDP
.PROC DbgBreakPointWithStatus
.endprolog
mov eax, ecx
.ENDP
.PROC RtlpBreakWithStatusInstruction
.endprolog
int 3
ret
.ENDP
DebugService2:
ret
/* Call the interrupt */
// mov eax, [rbp+8]
// int 0x2D
// int 3
/******************************************************************************
* NTSTATUS NTAPI DebugService(
* IN ULONG Service, // <rcx> = [rsp + 8]
* IN PVOID Buffer, // <rdx> = [rsp + 16]
* IN ULONG Length, // <r8> = [rsp + 24]
* IN PVOID Argument1, // <r9> = [rsp + 32]
* IN PVOID Argument2); // [rsp + 40]
*/
DebugService:
/* Prepare registers for interrupt */
mov eax, ecx // Service
mov rcx, rdx // Buffer
mov edx, r8d // Length
mov r8, r9 // Argument1
mov r9, [rsp + 40] // Argument2
/* Call the Interrupt */
int HEX(2D)
int 3
/* Return */
ret
END