Ticket #5217: x86_enter_userspace.patch
File x86_enter_userspace.patch, 1020 bytes (added by , 14 years ago) |
---|
-
src/system/kernel/arch/x86/arch_x86.S
164 164 FUNCTION(x86_enter_userspace): 165 165 movl 4(%esp), %eax // get entry point 166 166 movl 8(%esp), %ebx // get user stack 167 movw $USER_DATA_SEG, %cx 167 movl $USER_DATA_SEG, %ecx 168 xorl %ebp, %ebp // this is the last stack frame - we don't need one on return 169 // (%ebp marks the beginning of this stack frame) 168 170 movw %cx, %ds 169 171 movw %cx, %es 170 172 //movw $0x33 + cpu_num, %fs -> fs points to the TLS storage (CPU dependent segment) 171 173 movw %cx, %gs 172 174 173 xorl %ebp, %ebp // this is the last stack frame - we don't need one on return 174 // (%ebp marks the beginning of this stack frame) 175 pushl $USER_DATA_SEG // user data segment 175 pushl %ecx // user data segment 176 176 pushl %ebx // user stack 177 177 pushl $(1 << 9) | 2 // user flags 178 178 pushl $USER_CODE_SEG // user code segment