Lines Matching +full:set +full:- +full:top
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
47 if (ucp->uc_link == NULL) in _ctx_done()
55 ucp->uc_mcontext.mc_len = 0; in _ctx_done()
57 /* Set context to next one in link */ in _ctx_done()
58 /* XXX - what to do for error, abort? */ in _ctx_done()
59 setcontext((const ucontext_t *)ucp->uc_link); in _ctx_done()
74 else if ((ucp->uc_stack.ss_sp == NULL) || in __makecontext()
75 (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { in __makecontext()
77 * This should really return -1 with errno set to ENOMEM in __makecontext()
82 ucp->uc_mcontext.mc_len = 0; in __makecontext()
84 /* XXX - Do we want to sanity check argc? */ in __makecontext()
86 ucp->uc_mcontext.mc_len = 0; in __makecontext()
89 else if (ucp->uc_mcontext.mc_len == sizeof(mcontext_t)) { in __makecontext()
93 * _ctx_start() - context start wrapper in __makecontext()
94 * start() - user start routine in __makecontext()
95 * arg1 - first argument, aligned(16) in __makecontext()
98 * ucp - this context, %ebp points here in __makecontext()
102 * start routine from the top of the stack. After that, in __makecontext()
103 * the top of the stack will be setup with all arguments in __makecontext()
111 stack_top = (char *)(ucp->uc_stack.ss_sp + in __makecontext()
112 ucp->uc_stack.ss_size - sizeof(intptr_t)); in __makecontext()
115 * Adjust top of stack to allow for 3 pointers (return in __makecontext()
120 stack_top = stack_top - (sizeof(intptr_t) * (1 + argc)); in __makecontext()
122 stack_top = stack_top - (2 * sizeof(intptr_t)); in __makecontext()
126 * Setup the top of the stack with the user start routine in __makecontext()
128 * ucontext. We need to leave a spare spot at the top of in __makecontext()
129 * the stack because setcontext will move eip to the top in __makecontext()
149 * Set the machine context to point to the top of the in __makecontext()
152 * address onto the top of the stack, so allow for this in __makecontext()
153 * by adjusting the stack downward 1 slot. Also set in __makecontext()
157 ucp->uc_mcontext.mc_esi = (int)argp; in __makecontext()
158 ucp->uc_mcontext.mc_ebp = 0; in __makecontext()
159 ucp->uc_mcontext.mc_esp = (int)stack_top + sizeof(caddr_t); in __makecontext()
160 ucp->uc_mcontext.mc_eip = (int)_ctx_start; in __makecontext()