SYSENTER: Difference between revisions

m
SYSCALL saves "return RIP" into ECX, so caller doesn't need to do this..
[unchecked revision][unchecked revision]
m (Fix typing error)
m (SYSCALL saves "return RIP" into ECX, so caller doesn't need to do this..)
Line 46:
*CSTAR (0xC0000083) - The kernel's RIP for SYSCALL in compatibility mode.
*SFMASK (0xC0000084) - The low 32 bits are the SYSCALL flag mask. If a bit in this is set, the corresponding bit in rFLAGS is cleared.
====CPU registers====
'''These must be set by the application, or the C library wrapper'''<br />
*ECX: User mode return address
===Operation===
NOTE: these instructions assume a flat segmented memory model (paging allowed). They require that "the code-segment base, limit, and attributes (except for CPL) are consistent for all application and system processes." --AMD System programming
consistent for all application and system processes." --AMD System programming
 
SYSCALL loads CS from STAR 47:32. It masks EFLAGS with SFMASK. Next it stores EIP in ECX. It then loads EIP from STAR 32:0 and SS from STAR 47:32 + 8. It then executes.
250

edits