Changeset 2b903ca in mainline for uspace/lib/c/arch/ia32/src/fibril.S


Ignore:
Timestamp:
2013-05-30T22:26:46Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ce0683
Parents:
45b4300
Message:

cstyle

File:
1 edited

Legend:

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

    r45b4300 r2b903ca  
    3434.global context_restore
    3535
    36 
    3736## Save current CPU context
    3837#
     
    4140#
    4241context_save:
    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
     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
    4746        CONTEXT_SAVE_ARCH_CORE %edx %eax
    48 
    49         # Save TLS
     47       
     48        # save TLS
    5049        movl %gs:0, %eax
    5150        movl %eax, OFFSET_TLS(%edx)     # tls -> ctx->tls
    5251       
    53         xorl %eax,%eax          # context_save returns 1
     52        xorl %eax, %eax     # context_save returns 1
    5453        incl %eax
    5554        ret
    56 
    5755
    5856## Restore saved CPU context
     
    6260#
    6361context_restore:
    64         movl 4(%esp),%eax       # address of the context variable to restore context from
    65 
    66                 # restore registers from the context structure
     62        movl 4(%esp), %eax  # address of the context variable to restore context from
     63       
     64        # restore registers from the context structure
    6765        CONTEXT_RESTORE_ARCH_CORE %eax %edx
    68 
    69         movl %edx,0(%esp)       # ctx->pc -> saver's return %eip
    70 
    71         # Set thread local storage
     66       
     67        movl %edx, 0(%esp)  # ctx->pc -> saver's return %eip
     68       
     69        # set thread local storage
    7270        pushl %edx
    73         movl OFFSET_TLS(%eax), %edx   # Set arg1 to TLS addr
    74         movl $1, %eax         # Syscall SYS_TLS_SET
     71        movl OFFSET_TLS(%eax), %edx  # Set arg1 to TLS addr
     72        movl $1, %eax                # Syscall SYS_TLS_SET
    7573        int $0x30
    7674        popl %edx
    7775       
    78         xorl %eax,%eax          # context_restore returns 0
     76        xorl %eax, %eax     # context_restore returns 0
    7977        ret
Note: See TracChangeset for help on using the changeset viewer.