Changeset add04f7 in mainline for kernel/arch/ia32/src/userspace.c
- Timestamp:
- 2009-03-03T15:20:49Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f24d300
- Parents:
- deca67b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/userspace.c
rdeca67b radd04f7 27 27 */ 28 28 29 /** @addtogroup ia32 29 /** @addtogroup ia32 30 30 * @{ 31 31 */ … … 48 48 void userspace(uspace_arg_t *kernel_uarg) 49 49 { 50 ipl_t ipl; 51 52 ipl = interrupts_disable(); 53 50 ipl_t ipl = interrupts_disable(); 51 54 52 asm volatile ( 55 53 /* … … 61 59 "push %%eax\n" 62 60 "popfl\n" 63 61 64 62 /* Set up GS register (TLS) */ 65 "movl % 6, %%gs\n"66 67 "pushl % 0\n"68 "pushl % 1\n"69 "pushl % 2\n"70 "pushl % 3\n"71 "pushl % 4\n"72 "movl % 5, %%eax\n"73 63 "movl %[tls_des], %%gs\n" 64 65 "pushl %[udata_des]\n" 66 "pushl %[stack_size]\n" 67 "pushl %[ipl]\n" 68 "pushl %[utext_des]\n" 69 "pushl %[entry]\n" 70 "movl %[uarg], %%eax\n" 71 74 72 /* %ebx is defined to hold pcb_ptr - set it to 0 */ 75 "xorl %%ebx, %%ebx\n" 76 73 "xorl %%ebx, %%ebx\n" 74 77 75 "iret\n" 78 : 79 : "i" (selector(UDATA_DES) | PL_USER), 80 "r" ((uint8_t *) kernel_uarg->uspace_stack + 81 THREAD_STACK_SIZE), 82 "r" (ipl), 83 "i" (selector(UTEXT_DES) | PL_USER), 84 "r" (kernel_uarg->uspace_entry), 85 "r" (kernel_uarg->uspace_uarg), 86 "r" (selector(TLS_DES)) 76 : 77 : [udata_des] "i" (selector(UDATA_DES) | PL_USER), 78 [stack_size] "r" ((uint8_t *) kernel_uarg->uspace_stack + THREAD_STACK_SIZE), 79 [ipl] "r" (ipl), 80 [utext_des] "i" (selector(UTEXT_DES) | PL_USER), 81 [entry] "r" (kernel_uarg->uspace_entry), 82 [uarg] "r" (kernel_uarg->uspace_uarg), 83 [tls_des] "r" (selector(TLS_DES)) 87 84 : "eax"); 88 85 89 86 /* Unreachable */ 90 for(;;) 91 ; 87 while (1); 92 88 } 93 89
Note:
See TracChangeset
for help on using the changeset viewer.