Ticket #5217: x86_enter_userspace.patch

File x86_enter_userspace.patch, 1020 bytes (added by Grey, 14 years ago)
  • src/system/kernel/arch/x86/arch_x86.S

     
    164164FUNCTION(x86_enter_userspace):
    165165    movl    4(%esp), %eax   // get entry point
    166166    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)
    168170    movw    %cx, %ds
    169171    movw    %cx, %es
    170172    //movw  $0x33 + cpu_num, %fs    -> fs points to the TLS storage (CPU dependent segment)
    171173    movw    %cx, %gs
    172174
    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
    176176    pushl   %ebx            // user stack
    177177    pushl   $(1 << 9) | 2   // user flags
    178178    pushl   $USER_CODE_SEG  // user code segment