Lines Matching +full:swap +full:- +full:bytes

4  * SPDX-License-Identifier: Apache-2.0
31 * in user mode we are going to switch CR3 to the domain-specific tables when
46 _main_tss.esp0 = (uintptr_t)incoming->arch.psp; in z_x86_swap_update_page_tables()
55 uintptr_t ptables_phys = incoming->arch.ptables; in z_x86_swap_update_page_tables()
69 * Returns the initial entry point to swap into.
75 if (z_stack_is_user_capable(thread->stack_obj)) { in z_x86_userspace_prepare_thread()
78 (struct z_x86_thread_stack_header *)thread->stack_info.mapped.addr; in z_x86_userspace_prepare_thread()
80 (struct z_x86_thread_stack_header *)thread->stack_obj; in z_x86_userspace_prepare_thread()
83 thread->arch.psp = header->privilege_stack + sizeof(header->privilege_stack); in z_x86_userspace_prepare_thread()
85 thread->arch.psp = NULL; in z_x86_userspace_prepare_thread()
93 thread->arch.ptables = (uintptr_t)NULL; in z_x86_userspace_prepare_thread()
96 if ((thread->base.user_options & K_USER) != 0U) { in z_x86_userspace_prepare_thread()
114 (struct z_x86_thread_stack_header *)thread->stack_obj; in z_x86_userspace_prepare_thread()
116 (void)memset(&hdr_stack_obj->privilege_stack[0], 0xaa, in z_x86_userspace_prepare_thread()
117 sizeof(hdr_stack_obj->privilege_stack)); in z_x86_userspace_prepare_thread()
133 * any old context since this is a one-way operation in arch_user_mode_enter()
135 stack_end = Z_STACK_PTR_ALIGN(arch_current_thread()->stack_info.start + in arch_user_mode_enter()
136 arch_current_thread()->stack_info.size - in arch_user_mode_enter()
137 arch_current_thread()->stack_info.delta); in arch_user_mode_enter()
142 * that pushes 8 bytes) the stack must be MISALIGNED by in arch_user_mode_enter()
143 * exactly 8 bytes. in arch_user_mode_enter()
145 stack_end -= 8; in arch_user_mode_enter()
159 * arch_current_thread()->stack_info.start. in arch_user_mode_enter()
166 stack_start = POINTER_TO_UINT(arch_current_thread()->stack_obj); in arch_user_mode_enter()
167 stack_size = K_THREAD_STACK_LEN(arch_current_thread()->stack_info.size); in arch_user_mode_enter()
174 stack_size -= CONFIG_MMU_PAGE_SIZE; in arch_user_mode_enter()
185 arch_current_thread()->stack_info.start); in arch_user_mode_enter()
194 if ((thread->base.user_options & K_USER) != K_USER) { in arch_thread_priv_stack_space_get()
195 return -EINVAL; in arch_thread_priv_stack_space_get()
198 hdr_stack_obj = (struct z_x86_thread_stack_header *)thread->stack_obj; in arch_thread_priv_stack_space_get()
200 return z_stack_space_get(&hdr_stack_obj->privilege_stack[0], in arch_thread_priv_stack_space_get()
201 sizeof(hdr_stack_obj->privilege_stack), in arch_thread_priv_stack_space_get()