[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

svn path=/trunk/; revision=48219
This commit is contained in:
Timo Kreuzer 2010-07-23 23:30:00 +00:00
parent c168961990
commit 19540dcad5
7 changed files with 60 additions and 3 deletions

View file

@ -96,6 +96,9 @@ extern ULONG KeI386CpuStep;
#define KeGetTrapFramePc(TrapFrame) \
((TrapFrame)->Rip)
#define KiGetLinkedTrapFrame(x) \
(PKTRAP_FRAME)((x)->Rdx)
#define KeGetContextReturnRegister(Context) \
((Context)->Rax)

View file

@ -102,6 +102,17 @@ _MiAddressToPte(PVOID Address)
}
#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
FORCEINLINE

View file

@ -1407,14 +1407,14 @@ NTAPI
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
);

View file

@ -145,7 +145,7 @@ typedef struct _INFORMATION_CLASS_INFO
#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);

View file

@ -1,5 +1,9 @@
#pragma once
#ifdef _WIN64
#define InitializeSListHead RtlInitializeSListHead
#endif
NTSTATUS
NTAPI
RtlQueryAtomListInAtomTable(

View file

@ -350,6 +350,7 @@ SIZE_T MmTotalCommitLimitMaximum;
/* PRIVATE FUNCTIONS **********************************************************/
#ifndef _M_AMD64
//
// In Bavaria, this is probably a hate crime
//
@ -372,6 +373,7 @@ MiSyncARM3WithROS(IN PVOID AddressStart,
Pde++;
}
}
#endif
PFN_NUMBER
NTAPI

View file

@ -28,6 +28,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
RtlInitializeRangeListPackage(VOID)
@ -417,6 +441,19 @@ RtlWalkFrameChain(OUT PVOID *Callers,
#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