[ros-diffs] [tkreuzer] 34716: rtl: - amd64/add debug_asm.S (FIXME) - cast AtomName to ULONG_PTR instead of ULONG - RtlQueryProcessdebugInformation(): cast teb->Cid.UniqueProcess to ULONG_PTR for assignment to Pid. (should ProcessId parameter be ULONG_PTR, too?) - vs(w)nprintf: cast argument to ULONG_PTR instead of unsigned long for a %p - comment out some inlined Interlocked functions that shouldn't be there anyway Now rtl can be compiled

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Thu Jul 24 01:56:37 CEST 2008


Author: tkreuzer
Date: Wed Jul 23 18:56:37 2008
New Revision: 34716

URL: http://svn.reactos.org/svn/reactos?rev=34716&view=rev
Log:
rtl:
- amd64/add debug_asm.S (FIXME)
- cast AtomName to ULONG_PTR instead of ULONG
- RtlQueryProcessdebugInformation(): cast teb->Cid.UniqueProcess to ULONG_PTR for assignment to Pid. (should ProcessId parameter be ULONG_PTR, too?)
- vs(w)nprintf: cast argument to ULONG_PTR instead of unsigned long for a %p
- comment out some inlined Interlocked functions that shouldn't be there anyway
Now rtl can be compiled

Added:
    branches/ros-amd64-bringup/reactos/lib/rtl/amd64/
    branches/ros-amd64-bringup/reactos/lib/rtl/amd64/debug_asm.S   (with props)
Modified:
    branches/ros-amd64-bringup/reactos/lib/rtl/atom.c
    branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c
    branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild
    branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c
    branches/ros-amd64-bringup/reactos/lib/rtl/srw.c
    branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c

Added: branches/ros-amd64-bringup/reactos/lib/rtl/amd64/debug_asm.S
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/amd64/debug_asm.S?rev=34716&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/amd64/debug_asm.S (added)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/amd64/debug_asm.S [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -1,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 at 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

Propchange: branches/ros-amd64-bringup/reactos/lib/rtl/amd64/debug_asm.S
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/atom.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/atom.c?rev=34716&r1=34715&r2=34716&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/atom.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/atom.c [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -90,9 +90,9 @@
    DPRINT("RtlpCheckIntegerAtom(AtomName '%S' AtomValue %p)\n",
           AtomName, AtomValue);
 
-   if (!((ULONG)AtomName & 0xFFFF0000))
-     {
-        LoValue = (USHORT)((ULONG)AtomName & 0xFFFF);
+   if (!((ULONG_PTR)AtomName & 0xFFFF0000))
+     {
+        LoValue = (USHORT)((ULONG_PTR)AtomName & 0xFFFF);
 
         if (LoValue == 0)
           LoValue = 0xC000;

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c?rev=34716&r1=34715&r2=34716&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/dbgbuffer.c [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -234,7 +234,7 @@
                                 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 @@
        Buf->TargetProcessHandle = NtCurrentProcess();
 
        ClientId.UniqueThread = 0;
-       ClientId.UniqueProcess = (HANDLE)ProcessId;
+       ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)ProcessId;
        InitializeObjectAttributes(&ObjectAttributes,
                                   NULL,
                                   0,

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild?rev=34716&r1=34715&r2=34716&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -33,8 +33,13 @@
 		<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>

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c?rev=34716&r1=34715&r2=34716&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -577,7 +577,7 @@
 				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;
 

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/srw.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/srw.c?rev=34716&r1=34715&r2=34716&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/srw.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/srw.c [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -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 @@
 
     return j;
 }
+#endif
 
 /* FUNCTIONS *****************************************************************/
 
@@ -87,7 +89,7 @@
                              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) \

Modified: branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c?rev=34716&r1=34715&r2=34716&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c [iso-8859-1] Wed Jul 23 18:56:37 2008
@@ -575,7 +575,7 @@
 				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;
 



More information about the Ros-diffs mailing list