Author: tkreuzer
Date: Wed Nov 12 17:38:33 2008
New Revision: 37324
URL:
http://svn.reactos.org/svn/reactos?rev=37324&view=rev
Log:
- Implement RtlCaptureContext
- Reenable KeRosDumpStackFrames
Added:
branches/ros-amd64-bringup/reactos/lib/rtl/amd64/except_asm.S (with props)
Modified:
branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild
branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c
Added: branches/ros-amd64-bringup/reactos/lib/rtl/amd64/except_asm.S
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/amd64/except_asm.S (added)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/amd64/except_asm.S [iso-8859-1] Wed Nov 12
17:38:33 2008
@@ -1,0 +1,82 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Runtime Library (RTL)
+ * FILE: lib/rtl/amd64/except_asm.S
+ * PURPOSE: Exception support for AMD64
+ * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <ndk/asm.h>
+.intel_syntax noprefix
+
+/* FUNCTIONS *****************************************************************/
+
+/*
+ * VOID NTAPI
+ * RtlCaptureContext(
+ * PCONTEXT ContextRecord); <rcx>
+ */
+.func RtlCaptureContext
+.global _RtlCaptureContext
+_RtlCaptureContext:
+ .cfi_startproc
+
+ /* Safe segment selectors */
+ mov [rcx + CONTEXT_SegCs], cs
+ mov [rcx + CONTEXT_SegDs], ds
+ mov [rcx + CONTEXT_SegEs], es
+ mov [rcx + CONTEXT_SegFs], fs
+ mov [rcx + CONTEXT_SegGs], gs
+ mov [rcx + CONTEXT_SegSs], ss
+
+ /* Save the basic register context */
+ mov [rcx + CONTEXT_Rax], rax
+ mov [rcx + CONTEXT_Rcx], rcx
+ mov [rcx + CONTEXT_Rdx], rdx
+ mov [rcx + CONTEXT_Rbx], rbx
+ mov [rcx + CONTEXT_Rsp], rsp
+ mov [rcx + CONTEXT_Rbp], rbp
+ mov [rcx + CONTEXT_Rsi], rsi
+ mov [rcx + CONTEXT_Rdi], rdi
+ mov [rcx + CONTEXT_R8], r8
+ mov [rcx + CONTEXT_R9], r9
+ mov [rcx + CONTEXT_R10], r10
+ mov [rcx + CONTEXT_R11], r11
+ mov [rcx + CONTEXT_R12], r12
+ mov [rcx + CONTEXT_R13], r13
+ mov [rcx + CONTEXT_R14], r14
+ mov [rcx + CONTEXT_R15], r15
+
+ /* Capture eflags */
+ pushfq
+ pop rax
+ mov [rcx + CONTEXT_EFlags], rax
+
+ /* Put return address in rip member */
+ mov rax, [rsp]
+ mov [rcx + CONTEXT_Rip], rax
+
+ /* Safe mmx registers */
+/* movdqa [rcx + CONTEXT_Xmm0], xmm0
+ movdqa [rcx + CONTEXT_Xmm1], xmm1
+ movdqa [rcx + CONTEXT_Xmm2], xmm2
+ movdqa [rcx + CONTEXT_Xmm3], xmm3
+ movdqa [rcx + CONTEXT_Xmm4], xmm4
+ movdqa [rcx + CONTEXT_Xmm5], xmm5
+ movdqa [rcx + CONTEXT_Xmm6], xmm6
+ movdqa [rcx + CONTEXT_Xmm7], xmm7
+ movdqa [rcx + CONTEXT_Xmm8], xmm8
+ movdqa [rcx + CONTEXT_Xmm9], xmm9
+ movdqa [rcx + CONTEXT_Xmm10], xmm10
+ movdqa [rcx + CONTEXT_Xmm11], xmm11
+ movdqa [rcx + CONTEXT_Xmm12], xmm12
+ movdqa [rcx + CONTEXT_Xmm13], xmm13
+ movdqa [rcx + CONTEXT_Xmm14], xmm14
+ movdqa [rcx + CONTEXT_Xmm15], xmm15
+*/
+ ret
+ .cfi_endproc
+.endfunc
+
Propchange: branches/ros-amd64-bringup/reactos/lib/rtl/amd64/except_asm.S
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/ros-amd64-bringup/reactos/lib/rtl/rtl.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
==============================================================================
--- 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 Nov 12 17:38:33
2008
@@ -39,6 +39,7 @@
<if property="ARCH" value="amd64">
<directory name="amd64">
<file>debug_asm.S</file>
+ <file>except_asm.S</file>
<file>unwind.c</file>
<file>stubs.c</file>
</directory>
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] Wed Nov 12
17:38:33 2008
@@ -56,8 +56,6 @@
STUB(MmHighestPhysicalPage)
STUB(MiFreeDescriptorOrg)
STUB(ExEventObjectType)
-STUB(KeRosDumpStackFrames)
-STUB(RtlWalkFrameChain)
STUB(ExSystemLookasideListHead)
STUB(PspGetOrSetContextKernelRoutine)
STUB(KeConnectInterrupt)
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/bug.c [iso-8859-1] Wed Nov 12 17:38:33
2008
@@ -227,13 +227,13 @@
return (USHORT)i;
}
-#ifndef _M_AMD64
VOID
FASTCALL
KeRosDumpStackFrameArray(IN PULONG Frames,
IN ULONG FrameCount)
{
- ULONG i, Addr;
+ ULONG i;
+ ULONG_PTR Addr;
BOOLEAN InSystem;
PVOID p;
PLDR_DATA_TABLE_ENTRY LdrEntry;
@@ -316,7 +316,7 @@
}
}
}
-#endif
+
VOID
NTAPI