Lines Matching refs:rsp

85 	sub	$8, %rsp			;\
88 movq %rax, 8(%rsp) ;\
145 cmpl $(KERNEL64_CS), ISF64_CS(%rsp)
151 * Check for trap from EFI32, and restore cr3 and rsp if so.
154 cmpl $(KERNEL32_CS), ISF64_CS(%rsp)
161 shl $32, %rsp /* .. and the lower 32-bits of rsp */
162 shrd $32, %rcx, %rsp /* to recover the full 64-bits of rsp */
174 subq $(ISS64_OFFSET), %rsp
175 movl $(SS_64), SS_FLAVOR(%rsp)
182 movl %fs, R64_FS(%rsp)
183 movl %gs, R64_GS(%rsp)
186 mov %rax, R64_RAX(%rsp)
187 mov %rcx, R64_RCX(%rsp)
188 mov %rbx, R64_RBX(%rsp)
189 mov %rbp, R64_RBP(%rsp)
190 mov %r11, R64_R11(%rsp)
191 mov %r12, R64_R12(%rsp)
192 mov %r13, R64_R13(%rsp)
193 mov %r14, R64_R14(%rsp)
194 mov %r15, R64_R15(%rsp)
198 mov %rax, R64_CR2(%rsp)
201 mov %rdi, R64_RDI(%rsp) /* arg0 .. */
202 mov %rsi, R64_RSI(%rsp)
203 mov %rdx, R64_RDX(%rsp)
204 mov %r10, R64_R10(%rsp)
205 mov %r8, R64_R8(%rsp)
206 mov %r9, R64_R9(%rsp) /* .. arg5 */
208 mov R64_TRAPNO(%rsp), %ebx /* %ebx := trapno for later */
209 mov R64_TRAPFN(%rsp), %rdx /* %rdx := trapfn for later */
210 mov R64_CS(%rsp), %esi /* %esi := cs for later */
220 movq %rax, ISF64_TRAPFN+8(%rsp)
222 movq $(T_INVALID_OPCODE), ISF64_TRAPNO(%rsp)
234 subq $(ISC32_OFFSET), %rsp
235 movl $(SS_32), SS_FLAVOR(%rsp)
241 movl %ds, R32_DS(%rsp)
242 movl %es, R32_ES(%rsp)
243 movl %fs, R32_FS(%rsp)
244 movl %gs, R32_GS(%rsp)
249 mov %eax, R32_EAX(%rsp)
250 mov %ebx, R32_EBX(%rsp)
251 mov %ecx, R32_ECX(%rsp)
252 mov %edx, R32_EDX(%rsp)
253 mov %ebp, R32_EBP(%rsp)
254 mov %esi, R32_ESI(%rsp)
255 mov %edi, R32_EDI(%rsp)
259 mov %eax, R32_CR2(%rsp)
265 mov ISC32_RIP(%rsp), %eax
266 mov %eax, R32_EIP(%rsp)
267 mov ISC32_RFLAGS(%rsp), %eax
268 mov %eax, R32_EFLAGS(%rsp)
269 mov ISC32_RSP(%rsp), %eax
270 mov %eax, R32_UESP(%rsp)
271 mov ISC32_SS(%rsp), %eax
272 mov %eax, R32_SS(%rsp)
274 mov ISC32_CS(%rsp), %esi /* %esi := %cs for later */
275 mov %esi, R32_CS(%rsp)
276 mov ISC32_TRAPNO(%rsp), %ebx /* %ebx := trapno for later */
277 mov %ebx, R32_TRAPNO(%rsp)
278 mov ISC32_ERR(%rsp), %eax
279 mov %eax, R32_ERR(%rsp)
280 mov ISC32_TRAPFN(%rsp), %rdx /* %rdx := trapfn for later */
387 cmpl $(SS_64), SS_FLAVOR(%rsp) /* 64-bit state? */
392 cmpl $(SS_32), SS_FLAVOR(%rsp) /* 32-bit state? */
396 CCALL1(panic_idt64, %rsp)
403 movl R32_EIP(%rsp), %eax
404 movl %eax, ISC32_RIP(%rsp)
405 movl R32_EFLAGS(%rsp), %eax
406 movl %eax, ISC32_RFLAGS(%rsp)
407 movl R32_CS(%rsp), %eax
408 movl %eax, ISC32_CS(%rsp)
409 movl R32_UESP(%rsp), %eax
410 movl %eax, ISC32_RSP(%rsp)
411 movl R32_SS(%rsp), %eax
412 movl %eax, ISC32_SS(%rsp)
417 movl R32_EAX(%rsp), %eax
418 movl R32_EBX(%rsp), %ebx
419 movl R32_ECX(%rsp), %ecx
420 movl R32_EDX(%rsp), %edx
421 movl R32_EBP(%rsp), %ebp
422 movl R32_ESI(%rsp), %esi
423 movl R32_EDI(%rsp), %edi
432 movl R32_DS(%rsp), %ds
434 movl R32_ES(%rsp), %es
436 movl R32_FS(%rsp), %fs
438 movl R32_GS(%rsp), %gs
441 add $(ISC32_OFFSET)+8+8+8, %rsp
442 cmpl $(SYSENTER_CS),ISF64_CS-8-8-8(%rsp)
451 andl $(~EFL_IF), (%rsp) /* clear interrupts enable, sti below */
459 cmpl $(SS_64), SS_FLAVOR(%rsp) /* 64-bit state? */
463 CCALL1(panic_idt64, %rsp)
466 cmpl $(KERNEL64_CS), R64_CS(%rsp)
468 CCALL1(panic_idt64, %rsp)
474 testb $3, R64_CS(%rsp) /* returning to user-space? */
482 mov R64_R15(%rsp), %r15
483 mov R64_R14(%rsp), %r14
484 mov R64_R13(%rsp), %r13
485 mov R64_R12(%rsp), %r12
486 mov R64_R11(%rsp), %r11
487 mov R64_R10(%rsp), %r10
488 mov R64_R9(%rsp), %r9
489 mov R64_R8(%rsp), %r8
490 mov R64_RSI(%rsp), %rsi
491 mov R64_RDI(%rsp), %rdi
492 mov R64_RBP(%rsp), %rbp
493 mov R64_RDX(%rsp), %rdx
494 mov R64_RBX(%rsp), %rbx
495 mov R64_RCX(%rsp), %rcx
496 mov R64_RAX(%rsp), %rax
498 add $(ISS64_OFFSET)+24, %rsp /* pop saved state frame +
500 cmpl $(SYSCALL_CS),ISF64_CS-24(%rsp)
509 * Here to load rcx/r11/rsp and perform the sysret back to user-space.
512 * rsp user stack pointer
514 mov ISF64_RIP-24(%rsp), %rcx
515 mov ISF64_RFLAGS-24(%rsp), %r11
516 mov ISF64_RSP-24(%rsp), %rsp
558 mov %rsp, %gs:CPU_UBER_TMP /* save user stack */
559 mov %gs:CPU_UBER_ISF, %rsp /* switch stack to pcb */
565 movl $(USER_DS), ISF64_SS(%rsp)
566 movl $(SYSCALL_CS), ISF64_CS(%rsp) /* cs - a pseudo-segment */
567 mov %r11, ISF64_RFLAGS(%rsp) /* rflags */
568 mov %rcx, ISF64_RIP(%rsp) /* rip */
570 mov %rcx, ISF64_RSP(%rsp) /* user stack */
571 mov %rax, ISF64_ERR(%rsp) /* err/rax - syscall code */
572 movq $(T_SYSCALL), ISF64_TRAPNO(%rsp) /* trapno */
574 movq %r11, ISF64_TRAPFN(%rsp)
575 mov ISF64_RFLAGS(%rsp), %r11 /* Avoid info leak,restore R11 */
590 movq (%rsp), %rsp
611 orl $(EFL_IF), ISF64_RFLAGS(%rsp)
620 cmp %rax, 8+ISF64_RIP(%rsp) /* fault during copy args? */
622 testb $3, 8+ISF64_CS(%rsp) /* was trap from kernel? */
628 add $(8+ISF64_SIZE), %rsp /* remove entire intr stack frame */
643 testb $3, ISF64_CS(%rsp)
652 cmp %rax, ISF64_RIP+8(%rsp)
659 mov %rcx, ISF64_ERR(%rsp) /* save %rcx in error slot */
660 mov ISF64_SS+8(%rsp), %rcx /* top of temp stack -> pcb stack */
661 xchg %rcx,%rsp /* switch to pcb stack */
663 push ISF64_ERR(%rcx) /* saved %rcx into rsp slot */
676 cmp %rax, ISF64_RIP+8(%rsp)
680 mov ISF64_RSP(%rsp), %rsp
689 * rsp-> 0 ISF64_TRAPNO: trap code (NP or GP)
695 * 48 ISF64_RIP: rsp
714 testb $3,ISF64_CS(%rsp)
723 cmp %rax, 8+ISF64_RIP(%rsp)
726 cmp %rax, 8+ISF64_RIP(%rsp)
729 cmp %rax, 8+ISF64_RIP(%rsp)
732 cmp %rax, 8+ISF64_RIP(%rsp)
735 cmp %rax, 8+ISF64_RIP(%rsp)
738 cmp %rax, 8+ISF64_RIP(%rsp)
742 cmp %rax, 8+ISF64_RIP(%rsp)
743 cmove 8+ISF64_RSP(%rsp), %rsp
763 subq %rsp, %rax
770 * Here if %rsp is in the PCB
774 xchgq %rax, %rsp
789 * stack back to contain just the rip/cs/rflags/rsp/ss before issuing the iret.
801 * 48 ISF64_RSP: rsp <-- new trapno
807 * 96 user rsp
812 mov %rax, ISF64_RIP(%rsp) /* save rax (we don`t need saved rip) */
813 mov ISF64_TRAPNO(%rsp), %rax
814 mov %rax, ISF64_RSP(%rsp) /* put in user trap number */
815 mov ISF64_TRAPFN(%rsp), %rax
816 mov %rax, ISF64_SS(%rsp) /* put in user trap function */
817 mov ISF64_ERR(%rsp), %rax /* get error code */
818 mov %rax, 8+ISF64_SS(%rsp) /* put in user errcode */
819 mov ISF64_RIP(%rsp), %rax /* restore rax */
820 add $(ISF64_RSP),%rsp /* reset to new trapfn */
831 mov ISF64_TRAPNO(%rsp), %rax
832 mov ISF64_TRAPFN(%rsp), %rcx
833 mov ISF64_ERR(%rsp), %rdx
834 mov ISF64_RSP(%rsp), %rsp /* reset stack to saved state */
835 mov %rax,ISC32_TRAPNO(%rsp)
836 mov %rcx,ISC32_TRAPFN(%rsp)
837 mov %rdx,ISC32_ERR(%rsp)
867 * rsp -> x86_saved_state_t
886 movq %rsp, %rdi /* also pass it as arg0 */
887 movq %gs:CPU_KERNEL_STACK,%rsp /* switch to kernel stack */
898 movq %gs:CPU_ACTIVE_THREAD,%rsp
899 movq TH_PCB_ISS(%rsp), %rsp /* switch back to PCB stack */
905 movq %rsp, %r13
906 movq %gs:CPU_KERNEL_STACK, %rsp
919 movq %r13, %rsp /* switch back to PCB stack */
928 movq %r13, %rsp /* switch back to PCB stack */
949 movq %rsp, %rdi /* saved state addr */
950 pushq R64_RIP(%rsp) /* Simulate a CALL from fault point */
952 movq %rsp, %rbp
955 addq $8, %rsp
961 cmpl $(T_PREEMPT),R64_TRAPNO(%rsp)
963 testl $(EFL_IF),R64_RFLAGS(%rsp) /* interrupts disabled? */
968 movq %rsp,%rcx
980 * rsp-> x86_saved_state_t
991 cmpq %rsp,%rcx
994 cmpq %rsp,%rdx
997 xchgq %rcx,%rsp /* switch to interrupt stack */
1003 subq $8, %rsp /* for 16-byte stack alignment */
1047 popq %rsp /* switch back to old stack */
1050 movl R32_CS(%rsp),%eax /* assume 32-bit state */
1051 cmpl $(SS_64),SS_FLAVOR(%rsp)/* 64-bit? */
1054 movl R64_CS(%rsp),%eax /* 64-bit user mode */
1057 cmpl $(SS_32),SS_FLAVOR(%rsp)
1060 CCALL1(panic_idt64, %rsp)
1064 movl R64_CS(%rsp),%eax /* 64-bit user mode */
1082 movq %rsp,%rcx
1105 mov %rsp, %rdi /* x86_saved_state */
1112 CCALL1(panic_idt64, %rsp)
1139 * rsp -> x86_saved_state32_t
1149 movl R32_EAX(%rsp),%eax
1168 mov ISC32_RSP(%rsp), %rsi
1180 xchgq %rdi,%rsp /* switch to kernel stack */
1200 xchgq %rdi,%rsp /* switch to kernel stack */
1220 xchgq %rdi,%rsp /* switch to kernel stack */
1238 * rsp -> x86_saved_state64_t
1247 xchgq %rdi,%rsp /* switch to kernel stack */
1311 popq %rsp // Get back the pcb stack
1319 CCALL1(panic_machine_check64, %rsp)
1323 CCALL1(panic_double_fault64, %rsp)