4 %include "arch/x86_64/include/common.inc.asm"
9 [extern glThreadListLock]
17 [global NewTaskHeader]
20 ; [rsp+0x08]: Function
21 ; [rsp+0x10]: Argument
23 mov rdi, glThreadListLock
28 add rsp, 0x10 ; Reclaim stack space (thread/fcn)
32 ; Quit thread with RAX as the return code
41 [extern MM_DumpTables]
42 [global Proc_CloneInt]
47 ; Call MM_Clone (with bNoUserCopy flag)
51 mov rsi, [rsp+0x30] ; Saved version of RSI
59 ; mov rsi, 0x800000000000
73 ; Return RSI as the RSP value
83 mov rsp, [rsp-0x60] ; Restore RSP from the saved value
84 mov [rsp], rax ; Restore return address
90 ; rsi = Old RSP save loc
92 ; rcx = Old RIP save loc
97 ; Save state RIP and RSP
98 lea rax, [rel .restore]
102 ; Change CR3 if requested
107 ; Make sure the stack is valid before jumping
117 ; Restore point for saved state
120 xor eax, eax ; Return zero
123 [global Proc_InitialiseSSE]
126 or ax, (1 << 9)|(1 << 10) ; Set OSFXSR and OSXMMEXCPT
129 and ax, ~(1 << 2) ; Clear EM
130 or rax, (1 << 1) ; Set MP
133 [global Proc_DisableSSE]
136 or ax, 1 << 3 ; Set TS
139 [global Proc_EnableSSE]
142 and ax, ~(1 << 3) ; Clear TS
146 [global Proc_SaveSSE]
150 [global Proc_RestoreSSE]
157 [global User_Signal_Kill]