1/* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS kernel 4 * FILE: ntdll/dispatch/amd64/dispatch.S 5 * PURPOSE: Usermode dispatcher stubs 6 * 7 * PROGRAMMER: Timo kreuzer (timo.kreuzer@reactos.org) 8 */ 9 10/* INCLUDES ******************************************************************/ 11 12#include <asm.inc> 13#include <ksamd64.inc> 14 15EXTERN NtContinue:PROC 16EXTERN LdrpInit:PROC 17 18.code 19 20PUBLIC LdrInitializeThunk 21.PROC LdrInitializeThunk 22 mov rbp, 0 23 .setframe rbp, 0 24 .endprolog 25 26 /* First parameter is the APC context */ 27 mov rcx, r9 28 jmp LdrpInit 29 30.ENDP 31 32PUBLIC KiUserApcDispatcher 33.PROC KiUserApcDispatcher 34 .endprolog 35 /* We enter with a 16 byte aligned stack */ 36 37 mov rcx, [rsp + CONTEXT_P1Home] /* NormalContext */ 38 mov rdx, [rsp + CONTEXT_P2Home] /* SystemArgument1 */ 39 mov r8, [rsp + CONTEXT_P3Home] /* SystemArgument2 */ 40 lea r9, [rsp] /* Context */ 41 call qword ptr [rsp + CONTEXT_P4Home] /* NormalRoutine */ 42 43 /* NtContinue(Context, TRUE); */ 44 lea rcx, [rsp] 45 mov dl, 1 46 call NtContinue 47 48 nop 49 int 3 50.ENDP 51 52 53PUBLIC KiRaiseUserExceptionDispatcher 54.PROC KiRaiseUserExceptionDispatcher 55 .endprolog 56 int 3 57 58.ENDP 59 60PUBLIC KiUserCallbackDispatcher 61.PROC KiUserCallbackDispatcher 62 .endprolog 63 int 3 64 65.ENDP 66 67PUBLIC KiUserExceptionDispatcher 68.PROC KiUserExceptionDispatcher 69 .endprolog 70 int 3 71 72.ENDP 73 74END 75 76