Author: tkreuzer
Date: Fri Jul 23 23:30:00 2010
New Revision: 48219
URL:
http://svn.reactos.org/svn/reactos?rev=48219&view=rev
Log:
[NTOSKRNL]
- Add KiGetLinkedTrapFrame for amd64
- Add MiAddressToPti
- Fix MmCreateProcessAddressSpace, MmInitializeHandBuiltProcess prototype (ULONG ->
ULONG_PTR)
- #if out some C_ASSERTs for other architectures than x86
- #define InitializeSListHead to RtlInitializeSListHead on amd64
- Don't implement MiSyncARM3WithROS on amd64
- Implement RtlPcToFileHeader, RtlpGetStackLimits
Modified:
trunk/reactos/ntoskrnl/include/internal/amd64/ke.h
trunk/reactos/ntoskrnl/include/internal/amd64/mm.h
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
trunk/reactos/ntoskrnl/include/internal/rtl.h
trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
trunk/reactos/ntoskrnl/rtl/libsupp.c
Modified: trunk/reactos/ntoskrnl/include/internal/amd64/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/amd64/ke.h [iso-8859-1] Fri Jul 23 23:30:00
2010
@@ -95,6 +95,9 @@
#define KeGetTrapFramePc(TrapFrame) \
((TrapFrame)->Rip)
+
+#define KiGetLinkedTrapFrame(x) \
+ (PKTRAP_FRAME)((x)->Rdx)
#define KeGetContextReturnRegister(Context) \
((Context)->Rax)
Modified: trunk/reactos/ntoskrnl/include/internal/amd64/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] Fri Jul 23 23:30:00
2010
@@ -101,6 +101,17 @@
return (PMMPTE)(PTE_BASE + Offset);
}
#define MiAddressToPte(x) _MiAddressToPte((PVOID)(x))
+
+ULONG
+FORCEINLINE
+MiAddressToPti(PVOID Address)
+{
+ ULONG64 Pti = (ULONG64)Address >> PTI_SHIFT;
+ Pti &= PTI_MASK_AMD64;
+ return Pti;
+}
+
+#define MiAddressToPteOffset(x) MiAddressToPti(x)
/* Convert a PTE into a corresponding address */
PVOID
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Fri Jul 23 23:30:00 2010
@@ -1407,14 +1407,14 @@
MmCreateProcessAddressSpace(
IN ULONG MinWs,
IN PEPROCESS Dest,
- IN PULONG DirectoryTableBase
+ IN PULONG_PTR DirectoryTableBase
);
NTSTATUS
NTAPI
MmInitializeHandBuiltProcess(
IN PEPROCESS Process,
- IN PULONG DirectoryTableBase
+ IN PULONG_PTR DirectoryTableBase
);
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Fri Jul 23 23:30:00
2010
@@ -145,7 +145,7 @@
#endif
-#if defined (_M_IX86) || defined(_M_AMD64)
+#ifdef _M_IX86
C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemCall) == 0x300);
C_ASSERT(FIELD_OFFSET(KTHREAD, InitialStack) == KTHREAD_INITIAL_STACK);
C_ASSERT(FIELD_OFFSET(KTHREAD, Teb) == KTHREAD_TEB);
Modified: trunk/reactos/ntoskrnl/include/internal/rtl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/rtl.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/rtl.h [iso-8859-1] Fri Jul 23 23:30:00 2010
@@ -1,4 +1,8 @@
#pragma once
+
+#ifdef _WIN64
+#define InitializeSListHead RtlInitializeSListHead
+#endif
NTSTATUS
NTAPI
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Fri Jul 23 23:30:00 2010
@@ -350,6 +350,7 @@
/* PRIVATE FUNCTIONS **********************************************************/
+#ifndef _M_AMD64
//
// In Bavaria, this is probably a hate crime
//
@@ -372,6 +373,7 @@
Pde++;
}
}
+#endif
PFN_NUMBER
NTAPI
Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/libsupp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] Fri Jul 23 23:30:00 2010
@@ -27,6 +27,30 @@
SIZE_T RtlpAllocDeallocQueryBufferSize = 128;
/* FUNCTIONS *****************************************************************/
+
+PVOID
+NTAPI
+RtlPcToFileHeader(
+ IN PVOID PcValue,
+ OUT PVOID *BaseOfImage)
+{
+ PLDR_DATA_TABLE_ENTRY LdrEntry;
+ BOOLEAN InSystem;
+
+ /* Get the base for this file */
+ if ((ULONG_PTR)PcValue > (ULONG_PTR)MmHighestUserAddress)
+ {
+ /* We are in kernel */
+ *BaseOfImage = KiPcToFileHeader(PcValue, &LdrEntry, FALSE, &InSystem);
+ }
+ else
+ {
+ /* We are in user land */
+ *BaseOfImage = KiRosPcToUserFileHeader(PcValue, &LdrEntry);
+ }
+
+ return *BaseOfImage;
+}
VOID
NTAPI
@@ -417,6 +441,19 @@
#endif
+#ifdef _AMD64_
+VOID
+NTAPI
+RtlpGetStackLimits(
+ OUT PULONG_PTR LowLimit,
+ OUT PULONG_PTR HighLimit)
+{
+ PKTHREAD CurrentThread = KeGetCurrentThread();
+ *HighLimit = (ULONG_PTR)CurrentThread->InitialStack;
+ *LowLimit = (ULONG_PTR)CurrentThread->StackLimit;
+}
+#endif
+
/* RTL Atom Tables ************************************************************/
NTSTATUS