Changes in kernel/arch/amd64/src/userspace.c [3fcea34:5a5269d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/userspace.c
r3fcea34 r5a5269d 39 39 #include <stdint.h> 40 40 #include <arch.h> 41 #include <abi/proc/uarg.h> 41 42 #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 }47 43 48 44 /** Enter userspace … … 51 47 * 52 48 */ 53 void userspace(u intptr_t pc, uintptr_t sp)49 void userspace(uspace_arg_t *kernel_uarg) 54 50 { 55 51 uint64_t rflags = read_rflags(); … … 64 60 "pushq %[utext_des]\n" 65 61 "pushq %[entry]\n" 62 "movq %[uarg], %%rax\n" 66 63 67 64 /* %rdi is defined to hold pcb_ptr - set it to 0 */ … … 69 66 "iretq\n" 70 67 :: [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 71 [stack_top] "r" (sp), 68 [stack_top] "r" (kernel_uarg->uspace_stack + 69 kernel_uarg->uspace_stack_size), 72 70 [rflags] "r" (rflags), 73 71 [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER), 74 [entry] "r" (pc) 72 [entry] "r" (kernel_uarg->uspace_entry), 73 [uarg] "r" (kernel_uarg->uspace_uarg) 74 : "rax" 75 75 ); 76 76
Note:
See TracChangeset
for help on using the changeset viewer.