diff --git a/reactos/lib/rtl/amd64/debug_asm.S b/reactos/lib/rtl/amd64/debug_asm.S
new file mode 100644
index 00000000000..af2248f7026
--- /dev/null
+++ b/reactos/lib/rtl/amd64/debug_asm.S
@@ -0,0 +1,77 @@
+/*
+ * 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
diff --git a/reactos/lib/rtl/atom.c b/reactos/lib/rtl/atom.c
index 74e7879185d..dde6658346f 100644
--- a/reactos/lib/rtl/atom.c
+++ b/reactos/lib/rtl/atom.c
@@ -90,9 +90,9 @@ RtlpCheckIntegerAtom(PWSTR AtomName,
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;
diff --git a/reactos/lib/rtl/dbgbuffer.c b/reactos/lib/rtl/dbgbuffer.c
index f723fe12839..e2390a82d28 100644
--- a/reactos/lib/rtl/dbgbuffer.c
+++ b/reactos/lib/rtl/dbgbuffer.c
@@ -234,7 +234,7 @@ RtlQueryProcessDebugInformation(IN ULONG ProcessId,
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);
@@ -319,7 +319,7 @@ else
Buf->TargetProcessHandle = NtCurrentProcess();
ClientId.UniqueThread = 0;
- ClientId.UniqueProcess = (HANDLE)ProcessId;
+ ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)ProcessId;
InitializeObjectAttributes(&ObjectAttributes,
NULL,
0,
diff --git a/reactos/lib/rtl/rtl.rbuild b/reactos/lib/rtl/rtl.rbuild
index fdd2ddbebec..61b126f41a5 100644
--- a/reactos/lib/rtl/rtl.rbuild
+++ b/reactos/lib/rtl/rtl.rbuild
@@ -33,8 +33,13 @@
debug_asm.S
- mem.c
- memgen.c
+ mem.c
+ memgen.c
+
+
+
+ debug_asm.S
+
avl.c
diff --git a/reactos/lib/rtl/sprintf.c b/reactos/lib/rtl/sprintf.c
index a00ff412cf0..c213adaeb2f 100644
--- a/reactos/lib/rtl/sprintf.c
+++ b/reactos/lib/rtl/sprintf.c
@@ -577,7 +577,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
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;
diff --git a/reactos/lib/rtl/srw.c b/reactos/lib/rtl/srw.c
index b9283bd3307..a7a4eee636b 100644
--- a/reactos/lib/rtl/srw.c
+++ b/reactos/lib/rtl/srw.c
@@ -21,6 +21,7 @@
/* FIXME *********************************************************************/
/* FIXME: Interlocked functions that need to be made into a public header */
+#if 0
FORCEINLINE
LONG
InterlockedAnd(IN OUT volatile LONG *Target,
@@ -60,6 +61,7 @@ InterlockedOr(IN OUT volatile LONG *Target,
return j;
}
+#endif
/* FUNCTIONS *****************************************************************/
@@ -87,7 +89,7 @@ InterlockedOr(IN OUT volatile LONG *Target,
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) \
diff --git a/reactos/lib/rtl/swprintf.c b/reactos/lib/rtl/swprintf.c
index f4851e05b4d..c4b7fa95b71 100644
--- a/reactos/lib/rtl/swprintf.c
+++ b/reactos/lib/rtl/swprintf.c
@@ -575,7 +575,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar
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;