Changes in kernel/arch/ia32/src/userspace.c [d6f9fff:0f17bff] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/userspace.c
rd6f9fff r0f17bff 39 39 #include <abi/proc/uarg.h> 40 40 #include <mm/as.h> 41 #include <arch/cpu.h> 42 #include <arch/asm.h> 41 43 42 44 /** Enter userspace … … 47 49 void userspace(uspace_arg_t *kernel_uarg) 48 50 { 49 ipl_t ipl = interrupts_disable();51 uint32_t eflags = read_eflags(); 50 52 51 53 asm volatile ( 52 /*53 * Clear nested task flag.54 */55 "pushfl\n"56 "pop %%eax\n"57 "and $0xffffbfff, %%eax\n"58 "push %%eax\n"59 "popfl\n"60 61 54 /* Set up GS register (virtual register segment) */ 62 55 "movl %[vreg_des], %%gs\n" … … 64 57 "pushl %[udata_des]\n" 65 58 "pushl %[stack_top]\n" 66 "pushl %[ ipl]\n"59 "pushl %[eflags]\n" 67 60 "pushl %[utext_des]\n" 68 61 "pushl %[entry]\n" … … 74 67 "iret\n" 75 68 : 76 : [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 69 : [eflags_mask] "i" (~EFLAGS_NT), 70 [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 77 71 [stack_top] "r" ((uint8_t *) kernel_uarg->uspace_stack + 78 72 kernel_uarg->uspace_stack_size), 79 [ ipl] "r" (ipl),73 [eflags] "r" ((eflags & ~(EFLAGS_NT)) | EFLAGS_IF), 80 74 [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER), 81 75 [entry] "r" (kernel_uarg->uspace_entry),
Note:
See TracChangeset
for help on using the changeset viewer.