Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia32/src/fibril.S

    r2b903ca rc0699467  
    3434.global context_restore
    3535
     36
    3637## Save current CPU context
    3738#
     
    4041#
    4142context_save:
    42         movl 0(%esp), %eax  # the caller's return %eip
    43         movl 4(%esp), %edx  # address of the context variable to save context to
    44        
    45         # save registers to the context structure
     43        movl 0(%esp),%eax       # the caller's return %eip
     44        movl 4(%esp),%edx       # address of the context variable to save context to
     45
     46                # save registers to the context structure
    4647        CONTEXT_SAVE_ARCH_CORE %edx %eax
    47        
    48         # save TLS
     48
     49        # Save TLS
    4950        movl %gs:0, %eax
    5051        movl %eax, OFFSET_TLS(%edx)     # tls -> ctx->tls
    5152       
    52         xorl %eax, %eax     # context_save returns 1
     53        xorl %eax,%eax          # context_save returns 1
    5354        incl %eax
    5455        ret
     56
    5557
    5658## Restore saved CPU context
     
    6062#
    6163context_restore:
    62         movl 4(%esp), %eax  # address of the context variable to restore context from
    63        
    64         # restore registers from the context structure
     64        movl 4(%esp),%eax       # address of the context variable to restore context from
     65
     66                # restore registers from the context structure
    6567        CONTEXT_RESTORE_ARCH_CORE %eax %edx
    66        
    67         movl %edx, 0(%esp)  # ctx->pc -> saver's return %eip
    68        
    69         # set thread local storage
     68
     69        movl %edx,0(%esp)       # ctx->pc -> saver's return %eip
     70
     71        # Set thread local storage
    7072        pushl %edx
    71         movl OFFSET_TLS(%eax), %edx  # Set arg1 to TLS addr
    72         movl $1, %eax                # Syscall SYS_TLS_SET
     73        movl OFFSET_TLS(%eax), %edx   # Set arg1 to TLS addr
     74        movl $1, %eax         # Syscall SYS_TLS_SET
    7375        int $0x30
    7476        popl %edx
    7577       
    76         xorl %eax, %eax     # context_restore returns 0
     78        xorl %eax,%eax          # context_restore returns 0
    7779        ret
Note: See TracChangeset for help on using the changeset viewer.