- 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

svn path=/branches/ros-amd64-bringup/; revision=34716
This commit is contained in:
Timo Kreuzer
2008-07-23 23:56:37 +00:00
parent cc5298d837
commit 31e3f10a45
7 changed files with 93 additions and 9 deletions
+77
View File
@@ -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
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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,
+7 -2
View File
@@ -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>
+1 -1
View File
@@ -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;
+3 -1
View File
@@ -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) \
+1 -1
View File
@@ -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;