cld
SAVE_SCRATCH
-/* We must reset the cancel flag here atomically
- if we are entering fresh from user mode and an IPC might occur.
+/* We must reset the cancel flag here atomically
+ if we are entering fresh from user mode and an IPC might occur.
NOTE: We cannot test the user-mode bit in the error code because
it will flag "kernel" in case an I/O-bitmap page is not mapped
during an I/O access. */
call thread_restore_exc_state
ESP_TO_TCB_AT %rcx
+ mov OFS__THREAD__USER_VCPU(%rcx), %rdi
mov OFS__THREAD__VCPU_STATE(%rcx), %rcx
add $(VAL__SIZEOF_TRAP_STATE - 40), %rcx
mov SCRATCH_REGISTER_SIZE(%rsp), %rdx
mov 32 + SCRATCH_REGISTER_SIZE(%rsp), %rdx
mov %rdx, 32(%rcx) /* SS */
- mov 0(%rsp), %rdx /* R11 */
+ mov (0*8)(%rsp), %rdx /* r11 */
mov %rdx, -(14*8)(%rcx)
- mov 8(%rsp), %rdx /* R10 */
+ mov (1*8)(%rsp), %rdx /* r10 */
mov %rdx, -(13*8)(%rcx)
mov (2*8)(%rsp), %rdx
- mov %rdx, -(12*8)(%rcx)
+ mov %rdx, -(12*8)(%rcx) /* r9 */
mov (3*8)(%rsp), %rdx
- mov %rdx, -(11*8)(%rcx)
+ mov %rdx, -(11*8)(%rcx) /* r8 */
mov (4*8)(%rsp), %rdx
- mov %rdx, -(5*8)(%rcx)
+ mov %rdx, -(5*8)(%rcx) /* rdx */
mov (5*8)(%rsp), %rdx
- mov %rdx, -(4*8)(%rcx)
+ mov %rdx, -(4*8)(%rcx) /* rcx */
mov (6*8)(%rsp), %rdx
- mov %rdx, -(3*8)(%rcx)
+ mov %rdx, -(3*8)(%rcx) /* rax */
mov (7*8)(%rsp), %rdx
- mov %rdx, -(9*8)(%rcx)
+ mov %rdx, -(9*8)(%rcx) /* rsi */
mov (8*8)(%rsp), %rdx
- mov %rdx, -(10*8)(%rcx)
+ mov %rdx, -(10*8)(%rcx) /* rdi */
lea SCRATCH_REGISTER_SIZE(%rsp), %rdx
lea -(5*8)(%rcx), %rsp
push %rbx
sub $8, %rsp
push %rbp
+ sub $(6*8), %rsp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
/*add SCRATCH_REGISTER_SIZE, %esp*/
#if 0
mov %rax, 24(%rsp)
mov -VAL__SIZEOF_TRAP_STATE + 40 + OFS__VCPU_STATE__ENTRY_IP(%rcx), %rax
mov %rax, 0(%rsp)
+ movq $EFLAGS_IF, 16(%rsp)
iretq
.p2align