--- /dev/null
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Run-Time Library
+ * PURPOSE: Debug Routines
+ * FILE: lib/rtl/i386/debug.S
+ * PROGRAMER: Alex Ionescu (alex@relsoft.net)
+ */
+
+.intel_syntax noprefix
+
+/* GLOBALS ****************************************************************/
+
+.globl _DbgBreakPoint
+.globl _DbgBreakPointWithStatus
+.globl _DbgUserBreakPoint
+.globl _DebugService
+.globl _DebugService2
+.globl _DbgBreakPointNoBugCheck
+.globl _RtlpBreakWithStatusInstruction
+
+/* FUNCTIONS ***************************************************************/
+
+.func DbgBreakPointNoBugCheck
+_DbgBreakPointNoBugCheck:
+ int 3
+ ret
+.endfunc
+
+.func DbgBreakPoint
+_DbgBreakPoint:
+_DbgUserBreakPoint:
+ int 3
+ ret
+.endfunc
+
+.func DbgBreakPointWithStatus
+_DbgBreakPointWithStatus:
+ mov eax, ecx
+
+_RtlpBreakWithStatusInstruction:
+ int 3
+ ret
+.endfunc
+
+.func DebugService2
+_DebugService2:
+ /* Call the interrupt */
+// mov eax, [rbp+8]
+// int 0x2D
+ int 3
+
+.endfunc
+
+.func DebugService
+_DebugService:
+
+ /* Save the registers */
+ push rcx
+ push rbx
+ push rdi
+ push rdi
+ push rbx
+
+ /* Call the Interrupt */
+ // FIXME: setup registers
+ int 0x2D
+ int 3
+
+ /* Restore registers */
+ pop rbx
+ pop rdi
+ pop rdi
+ pop rbx
+
+ /* Return */
+ ret 20
+.endfunc
DPRINT("RtlpCheckIntegerAtom(AtomName '%S' AtomValue %p)\n",
AtomName, AtomValue);
- if (!((ULONG)AtomName & 0xFFFF0000))
+ if (!((ULONG_PTR)AtomName & 0xFFFF0000))
{
- LoValue = (USHORT)((ULONG)AtomName & 0xFFFF);
+ LoValue = (USHORT)((ULONG_PTR)AtomName & 0xFFFF);
if (LoValue == 0)
LoValue = 0xC000;
IN OUT PRTL_DEBUG_INFORMATION Buf)
{
NTSTATUS Status = STATUS_SUCCESS;
- ULONG Pid = (ULONG) NtCurrentTeb()->Cid.UniqueProcess;
+ ULONG Pid = (ULONG_PTR) NtCurrentTeb()->Cid.UniqueProcess;
Buf->Flags = DebugInfoMask;
Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION);
Buf->TargetProcessHandle = NtCurrentProcess();
ClientId.UniqueThread = 0;
- ClientId.UniqueProcess = (HANDLE)ProcessId;
+ ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)ProcessId;
InitializeObjectAttributes(&ObjectAttributes,
NULL,
0,
<directory name="arm">
<file>debug_asm.S</file>
</directory>
- <file>mem.c</file>
- <file>memgen.c</file>
+ <file>mem.c</file>
+ <file>memgen.c</file>
+ </if>
+ <if property="ARCH" value="amd64">
+ <directory name="amd64">
+ <file>debug_asm.S</file>
+ </directory>
</if>
<directory name="austin">
<file>avl.c</file>
flags |= ZEROPAD;
}
str = number(str, end,
- (unsigned long) va_arg(args, void *), 16,
+ (ULONG_PTR) va_arg(args, void *), 16,
field_width, precision, flags);
continue;
/* FIXME *********************************************************************/
/* FIXME: Interlocked functions that need to be made into a public header */
+#if 0
FORCEINLINE
LONG
InterlockedAnd(IN OUT volatile LONG *Target,
return j;
}
+#endif
/* FUNCTIONS *****************************************************************/
RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENTION_LOCK)
#define RTL_SRWLOCK_BITS 4
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(_M_AMD64)
/* This macro will cause the code to assert if compiled with a buggy
version of GCC that doesn't align the wait blocks properly on the stack! */
#define ASSERT_SRW_WAITBLOCK(ptr) \
flags |= ZEROPAD;
}
str = number(str, end,
- (unsigned long) va_arg(args, void *), 16,
+ (ULONG_PTR) va_arg(args, void *), 16,
field_width, precision, flags);
continue;