欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 维修 > _KiFastCallEntry函数的作用是运行_KiSystemServiceRepeat函数

_KiFastCallEntry函数的作用是运行_KiSystemServiceRepeat函数

2024/10/24 4:31:40 来源:https://blog.csdn.net/sitelist/article/details/141069824  浏览:    关键词:_KiFastCallEntry函数的作用是运行_KiSystemServiceRepeat函数

..//ntos/ke/i386/trap.asm:1127:_KiFastCallEntry        proc

..//ntos/ke/i386/trap.asm:1180:_KiFastCallEntry endp

_KiFastCallEntry函数的作用是运行_KiSystemServiceRepeat函数

返回系统输入后的指令
; 位于共享用户中已知位置的指令
; 数据结构(这样我们就可以动态地放置正确的
; 系统初始化时处理器的代码)

        PUBLIC _KiFastCallEntry
_KiFastCallEntry        proc

;
;       Return to the instruction immediately following the sysenter
;       instruction which is at a known location in the shared user
;       data structure (this is so we can dynamically place the right
;       code for the processor at system init).
;

ifndef NT_UP

        mov     ecx, KGDT_R0_PCR
        mov     fs, ecx

endif ;; NT_UP

        mov     ecx, PCR[PcPrcbData+PbCurrentThread] ; get current thread address
;
; Calculate initial stack pointer from thread initial stack.
; If this isn't the same as esp0 then we are a VX86 thread and we are rejected
;

        mov     ecx, [ecx].ThInitialStack
        lea     esp, [ecx-(NPX_FRAME_LENGTH + (TsV86Gs - TsHardwareSegSS))]
        mov     ecx, PCR[PcTss]

        cmp     esp, [ecx].TssEsp0
        jne     Kfsc90
;
;       Set ecx to return address in user mode
;

        mov     ecx, MM_SHARED_USER_DATA_VA+UsSystemCall+fscrOffset
Kfsc10:
        push    KGDT_R3_DATA  OR RPL_MASK   ; Push user SS
        push    edx                         ; Push ESP
        pushfd
        push    2                           ; Sanitize eflags
        popfd                               ;
        add     edx, 8                      ; (edx) -> arguments
        or      dword ptr [esp], EFLAGS_INTERRUPT_MASK ; Enable interrupts
        push    KGDT_R3_CODE OR RPL_MASK    ; Push user CS
        push    ecx                         ; push return address

ifndef NT_UP

        ; For the MP case, FS is already loaded above

        ENTER_SYSCALL   kfce_a, kfce_t, NoFSLoad
        jmp     _KiSystemServiceRepeat

endif ;; NT_UP

_KiFastCallEntry endp
 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com