Changeset 3fcea34 in mainline for kernel/arch/ia32/src/userspace.c
- Timestamp:
- 2024-09-20T12:16:28Z (2 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/ia32/src/userspace.c
r2cf8f994 r3fcea34 38 38 #include <stdint.h> 39 39 #include <arch.h> 40 #include <abi/proc/uarg.h>41 40 #include <mm/as.h> 42 41 #include <arch/cpu.h> 43 42 #include <arch/asm.h> 43 44 uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size) 45 { 46 return stack_base + stack_size; 47 } 44 48 45 49 /** Enter userspace … … 48 52 * 49 53 */ 50 void userspace(u space_arg_t *kernel_uarg)54 void userspace(uintptr_t pc, uintptr_t sp) 51 55 { 52 56 uint32_t eflags = read_eflags(); … … 61 65 "pushl %[utext_des]\n" 62 66 "pushl %[entry]\n" 63 "movl %[uarg], %%eax\n"64 67 65 68 /* %edi is defined to hold pcb_ptr - set it to 0 */ … … 70 73 : [eflags_mask] "i" (~EFLAGS_NT), 71 74 [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 72 [stack_top] "r" (kernel_uarg->uspace_stack + 73 kernel_uarg->uspace_stack_size), 75 [stack_top] "r" (sp), 74 76 [eflags] "r" ((eflags & ~(EFLAGS_NT)) | EFLAGS_IF), 75 77 [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER), 76 [entry] "r" (kernel_uarg->uspace_entry), 77 [uarg] "r" (kernel_uarg->uspace_uarg), 78 [entry] "r" (pc), 78 79 [vreg_des] "r" (GDT_SELECTOR(VREG_DES)) 79 80 : "eax");
Note:
See TracChangeset
for help on using the changeset viewer.