Changeset 3fcea34 in mainline for kernel/arch/amd64/src/userspace.c
- Timestamp:
- 2024-09-20T12:16:28Z (5 months ago)
- Branches:
- master
- Children:
- d3109ff
- Parents:
- 2cf8f994
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-09-20 11:42:13)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-09-20 12:16:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/userspace.c
r2cf8f994 r3fcea34 39 39 #include <stdint.h> 40 40 #include <arch.h> 41 #include <abi/proc/uarg.h>42 41 #include <mm/as.h> 42 43 uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size) 44 { 45 return stack_base + stack_size; 46 } 43 47 44 48 /** Enter userspace … … 47 51 * 48 52 */ 49 void userspace(u space_arg_t *kernel_uarg)53 void userspace(uintptr_t pc, uintptr_t sp) 50 54 { 51 55 uint64_t rflags = read_rflags(); … … 60 64 "pushq %[utext_des]\n" 61 65 "pushq %[entry]\n" 62 "movq %[uarg], %%rax\n"63 66 64 67 /* %rdi is defined to hold pcb_ptr - set it to 0 */ … … 66 69 "iretq\n" 67 70 :: [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 68 [stack_top] "r" (kernel_uarg->uspace_stack + 69 kernel_uarg->uspace_stack_size), 71 [stack_top] "r" (sp), 70 72 [rflags] "r" (rflags), 71 73 [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER), 72 [entry] "r" (kernel_uarg->uspace_entry), 73 [uarg] "r" (kernel_uarg->uspace_uarg) 74 : "rax" 74 [entry] "r" (pc) 75 75 ); 76 76
Note:
See TracChangeset
for help on using the changeset viewer.