Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/CtxSwitch-i386.S

    rb78129a rbf71cfd  
    4141#define PC_OFFSET       ( 2 * PTR_BYTE )
    4242
    43         .text
     43.text
    4444        .align 2
    45         .globl CtxSwitch
    46         .type  CtxSwitch, @function
     45.globl  CtxSwitch
    4746CtxSwitch:
    4847
     
    5150
    5251        movl 4(%esp),%eax
     52
     53        // Save floating & SSE control words on the stack.
     54
     55        sub    $8,%esp
     56        stmxcsr 0(%esp)         // 4 bytes
     57        fnstcw  4(%esp)         // 2 bytes
    5358
    5459        // Save volatile registers on the stack.
     
    6267        movl %esp,SP_OFFSET(%eax)
    6368        movl %ebp,FP_OFFSET(%eax)
     69//      movl 4(%ebp),%ebx       // save previous eip for debugger
     70//      movl %ebx,PC_OFFSET(%eax)
    6471
    6572        // Copy the "to" context argument from the stack to register eax
     
    6774        // argument is now at 8 + 12 = 20(%esp)
    6875
    69         movl 20(%esp),%eax
     76        movl 28(%esp),%eax
    7077
    7178        // Load new context from the "to" area.
     
    8087        popl %ebx
    8188
     89        // Load floating & SSE control words from the stack.
     90
     91        fldcw   4(%esp)
     92        ldmxcsr 0(%esp)
     93        add    $8,%esp
     94
    8295        // Return to thread.
    8396
    8497        ret
    85         .size  CtxSwitch, .-CtxSwitch
    8698
    8799// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.