Changeset 0dc2fec in mainline for kernel/arch/ia32/src/userspace.c
- Timestamp:
- 2016-05-22T19:19:43Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b272c67a
- Parents:
- 153c7a29 (diff), af2254ec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/userspace.c
r153c7a29 r0dc2fec 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.