Lines Matching full:stack

7  * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.
123 * When we're here from kernel mode; the (exception) stack looks like:
171 * so any attempt to access the stack needs to use SS. (except for
180 * middle doesn't scribble our stack.
233 /* Switch to kernel stack if necessary */
325 * Setup and switch to ESPFIX stack
327 * We're returning to userspace with a 16 bit stack. The CPU will not
361 * entry-stack, it will overwrite the task-stack and everything we
362 * copied there. So allocate the stack-frame on the task-stack and
377 /* Are we on the entry stack? Bail out if not! */
384 /* Load stack pointer into %esi and %edi */
388 /* Move %edi to the top of the entry stack */
392 /* Load top of task-stack into %edi */
395 /* Special case - entry from kernel mode via entry stack */
415 * Stack-frame contains 4 additional segment registers when
423 /* Allocate frame on task-stack */
426 /* Switch to task-stack */
430 * We are now on the task-stack and can safely copy over the
431 * stack-frame
443 * kernel-mode and %esp points to the entry-stack. When this
444 * happens we need to switch to the task-stack to run C code,
445 * but switch back to the entry-stack again when we approach
451 * When we switch to the task-stack here, we can't trust the
452 * contents of the entry-stack anymore, as the exception handler
454 * copy the complete entry-stack to the task-stack and set a
459 * entry-stack, so that the interrupted kernel code-path
460 * continues on the same stack it was interrupted with.
464 * %esi: Entry-Stack pointer (same as %esp)
465 * %edi: Top of the task stack
469 /* Calculate number of bytes on the entry stack in %ecx */
472 /* %ecx to the top of entry-stack */
476 /* Number of bytes on the entry stack to %ecx */
479 /* Mark stackframe as coming from entry stack */
493 * the stack-frame on task-stack and copy everything over
501 * Switch back from the kernel stack to the entry stack.
503 * The %esp register must point to pt_regs on the task stack. It will
504 * first calculate the size of the stack-frame to copy, depending on
506 * to copy the contents of the stack over to the entry stack.
509 * task-stack once we switched to the entry-stack. When an NMI happens
510 * while on the entry-stack, the NMI handler will switch back to the top
511 * of the task stack, overwriting our stack-frame we are about to copy.
512 * Therefore we switch the stack only after everything is copied over.
534 /* Save future stack pointer in %ebx */
537 /* Copy over the stack-frame */
543 * Switch to entry-stack - needs to happen after everything is
544 * copied because the NMI handler will overwrite the task-stack
545 * when on entry-stack
554 * path and have to switch back to the entry stack and/or user-cr3
562 * Test if we entered the kernel with the entry-stack. Most
571 /* Clear marker from stack-frame */
574 /* Copy the remaining task-stack contents to entry-stack */
578 /* Bytes on the task-stack to ecx */
582 /* Allocate stack-frame on entry-stack */
586 * Save future stack-pointer, we must not switch until the
588 * contents of the task-stack we are about to copy.
597 /* Safe to switch to entry-stack now */
601 * We came from entry-stack and need to check if we also need to
607 /* Clear marker from stack-frame */
620 * @has_error_code: Hardware pushed error code on stack
645 movl PT_ORIG_EAX(%esp), %edx /* get the vector from stack */
692 /* switch stack */
702 * When switching from a shallower to a deeper call stack
723 * The unwinder expects the last frame on the stack to always be at the same
724 * offset from the end of the page, which allows it to validate the stack.
726 * asmlinkage function so its argument has to be pushed on the stack. This
727 * wrapper creates a proper "end of stack" frame header before the call.
800 * SYSENTER does not save anything on the stack,
814 * ebp user stack
819 * On entry-stack with all userspace-regs live - save and
830 /* Stack empty again, switch to task stack */
840 SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest, stack already switched */
875 * Setup entry stack - we keep the pointer in %eax and do the
879 /* Load entry stack pointer and allocate frame for eflags/eax */
883 /* Copy eflags and eax to entry stack */
900 /* Switch to entry stack */
998 * The stack-frame here is the one that iret faulted on, so its a
1015 * Switch back for ESPFIX stack to the normal zerobased stack
1017 * We can't call C functions using the ESPFIX stack. This code reads
1019 * normal stack and adjusts ESP with the matching offset.
1026 /* fixup the stack */
1040 addl %esp, %eax /* the adjusted stack pointer */
1043 lss (%esp), %esp /* switch to the normal stack segment */
1051 /* see if on espfix stack */
1054 /* switch to normal stack */
1061 /* the function address is in %gs's slot on the stack */
1103 * The error code is on the stack, but the stack is otherwise
1144 * interrupted kernel code running on the SYSENTER stack.
1152 * after we've switched to the entry stack.
1167 /* Are we currently on the SYSENTER stack? */
1174 /* Not on SYSENTER stack. */
1180 * We're on the SYSENTER stack. Switch off. No one (not even debug)
1181 * is using the thread stack right now, so it's safe for us to use it.
1236 lss (1+5+6)*4(%esp), %esp # back to espfix stack