Ignore:
File:
1 edited

Legend:

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

    r1a5eca4 r4dc7a84  
    2727#
    2828
    29 #include <abi/asmtool.h>
     29.text
     30
     31.global context_save
     32.global context_restore
     33
    3034#include <libarch/fibril_context.h>
    31 
    32 .text
    3335
    3436## Save current CPU context
     
    3739# pointed by the 1st argument. Returns 1 in EAX.
    3840#
    39 FUNCTION_BEGIN(context_save)
     41context_save:
    4042        movq (%rsp), %rdx     # the caller's return %eip
    4143       
     
    5153        movq %r15, CONTEXT_OFFSET_R15(%rdi)
    5254       
     55        # save TLS
    5356        movq %fs:0, %rax
    5457        movq %rax, CONTEXT_OFFSET_TLS(%rdi)
     
    5760        incl %eax
    5861        ret
    59 FUNCTION_END(context_save)
    6062
    6163## Restore current CPU context
     
    6466# pointed by the 1st argument. Returns 0 in EAX.
    6567#
    66 FUNCTION_BEGIN(context_restore)
     68context_restore:
     69       
    6770        movq CONTEXT_OFFSET_R15(%rdi), %r15
    6871        movq CONTEXT_OFFSET_R14(%rdi), %r14
     
    7881        movq %rdx,(%rsp)
    7982       
    80         movq CONTEXT_OFFSET_TLS(%rdi), %rdi
    81         movq %rdi, %fs:0
     83        # Set thread local storage
     84        movq CONTEXT_OFFSET_TLS(%rdi), %rdi  # Set arg1 to TLS addr
     85        movl $1, %eax                        # SYS_TLS_SET
     86        syscall
    8287       
    8388        xorl %eax, %eax                      # context_restore returns 0
    8489        ret
    85 FUNCTION_END(context_restore)
    8690
Note: See TracChangeset for help on using the changeset viewer.