- Implement amd64 version of LdrInitializeThunk and KiUserApcDispatcher
- Export ExpInterlockedPopEntrySList* on amd64, too
- Fix some 64 bit issues

svn path=/trunk/; revision=55414
This commit is contained in:
Timo Kreuzer 2012-02-04 18:25:25 +00:00
parent 85bb9f1bce
commit cbee83498e
4 changed files with 85 additions and 10 deletions

View file

@ -27,7 +27,7 @@ list(APPEND SOURCE
if(ARCH MATCHES i386)
list(APPEND SOURCE dispatch/i386/dispatch.S)
elseif(ARCH MATCHES amd64)
list(APPEND SOURCE dispatch/amd64/stubs.c)
list(APPEND SOURCE dispatch/amd64/dispatch.S)
elseif(ARCH MATCHES arm)
list(APPEND SOURCE dispatch/arm/stubs_asm.s)
else()

View file

@ -60,9 +60,9 @@
@ stdcall -arch=i386 KiFastSystemCall()
@ stdcall -arch=i386 KiFastSystemCallRet()
@ stdcall -arch=i386 KiIntSystemCall()
@ stdcall -arch=i386 ExpInterlockedPopEntrySListEnd()
@ stdcall -arch=i386 ExpInterlockedPopEntrySListFault()
@ stdcall -arch=i386 ExpInterlockedPopEntrySListResume()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListEnd()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListFault()
@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListResume()
@ stdcall KiRaiseUserExceptionDispatcher()
@ stdcall KiUserApcDispatcher(ptr ptr ptr ptr)
@ stdcall KiUserCallbackDispatcher(ptr ptr long) ; CHECKME

View file

@ -0,0 +1,75 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntdll/dispatch/amd64/dispatch.S
* PURPOSE: Usermode dispatcher stubs
*
* PROGRAMMER: Timo kreuzer (timo.kreuzer@reactos.org)
*/
/* INCLUDES ******************************************************************/
#include <asm.inc>
#include <ksamd64.inc>
EXTERN NtContinue:PROC
EXTERN LdrpInit:PROC
.code
PUBLIC LdrInitializeThunk
.PROC LdrInitializeThunk
mov rbp, 0
.setframe rbp, 0
.endprolog
/* First parameter is the APC context */
mov rcx, r9
jmp LdrpInit
.ENDP
PUBLIC KiUserApcDispatcher
.PROC KiUserApcDispatcher
.endprolog
/* We enter with a 16 byte aligned stack */
mov rcx, [rsp + CONTEXT_P1Home] /* NormalContext */
mov rdx, [rsp + CONTEXT_P2Home] /* SystemArgument1 */
mov r8, [rsp + CONTEXT_P3Home] /* SystemArgument2 */
lea r9, [rsp] /* Context */
call qword ptr [rsp + CONTEXT_P4Home] /* NormalRoutine */
/* NtContinue(Context, TRUE); */
lea rcx, [rsp]
mov dl, 1
call NtContinue
nop
int 3
.ENDP
PUBLIC KiRaiseUserExceptionDispatcher
.PROC KiRaiseUserExceptionDispatcher
.endprolog
int 3
.ENDP
PUBLIC KiUserCallbackDispatcher
.PROC KiUserCallbackDispatcher
.endprolog
int 3
.ENDP
PUBLIC KiUserExceptionDispatcher
.PROC KiUserExceptionDispatcher
.endprolog
int 3
.ENDP
END

View file

@ -124,7 +124,7 @@ LdrOpenImageFileOptionsKey(IN PUNICODE_STRING SubKey,
/* Setup the object attributes */
InitializeObjectAttributes(&ObjectAttributes,
Wow64 ?
Wow64 ?
&Wow64OptionsString : &ImageExecOptionsString,
OBJ_CASE_INSENSITIVE,
NULL,
@ -441,7 +441,7 @@ LdrpInitSecurityCookie(PLDR_DATA_TABLE_ENTRY LdrEntry)
{
PULONG_PTR Cookie;
LARGE_INTEGER Counter;
ULONG NewCookie;
ULONG_PTR NewCookie;
/* Fetch address of the cookie */
Cookie = LdrpFetchAddressOfSecurityCookie(LdrEntry->DllBase, LdrEntry->SizeOfImage);
@ -536,7 +536,7 @@ LdrpInitializeThread(IN PCONTEXT Context)
EntryPoint = LdrEntry->EntryPoint;
/* Check if we are ready to call it */
if ((EntryPoint) &&
if ((EntryPoint) &&
(LdrEntry->Flags & LDRP_PROCESS_ATTACH_CALLED) &&
(LdrEntry->Flags & LDRP_IMAGE_DLL))
{
@ -939,7 +939,7 @@ LdrShutdownProcess(VOID)
EntryPoint = LdrEntry->EntryPoint;
/* Check if we are ready to call it */
if (EntryPoint &&
if (EntryPoint &&
(LdrEntry->Flags & LDRP_PROCESS_ATTACH_CALLED) &&
LdrEntry->Flags)
{
@ -1212,7 +1212,7 @@ LdrpAllocateTls(VOID)
PTEB Teb = NtCurrentTeb();
PLIST_ENTRY NextEntry, ListHead;
PLDRP_TLS_DATA TlsData;
ULONG TlsDataSize;
SIZE_T TlsDataSize;
PVOID *TlsVector;
/* Check if we have any entries */
@ -1236,7 +1236,7 @@ LdrpAllocateTls(VOID)
NextEntry = NextEntry->Flink;
/* Allocate this vector */
TlsDataSize = TlsData->TlsDirectory.EndAddressOfRawData -
TlsDataSize = TlsData->TlsDirectory.EndAddressOfRawData -
TlsData->TlsDirectory.StartAddressOfRawData;
TlsVector[TlsData->TlsDirectory.Characteristics] = RtlAllocateHeap(RtlGetProcessHeap(),
0,