Ignore:
File:
1 edited

Legend:

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

    ra35a3d8 ra35b458  
    3535#
    3636# Save CPU context to context_t variable
    37 # pointed by the 1st argument. Returns 0 in RAX.
     37# pointed by the 1st argument. Returns 1 in EAX.
    3838#
    39 FUNCTION_BEGIN(__setjmp)
     39FUNCTION_BEGIN(context_save)
    4040        movq (%rsp), %rdx     # the caller's return %eip
    4141
     
    5454        movq %rax, CONTEXT_OFFSET_TLS(%rdi)
    5555
    56         xorq %rax, %rax                      # __setjmp returns 0
     56        xorl %eax, %eax                      # context_save returns 1
     57        incl %eax
    5758        ret
    58 FUNCTION_END(__setjmp)
     59FUNCTION_END(context_save)
    5960
    6061## Restore current CPU context
    6162#
    6263# Restore CPU context from context_t variable
    63 # pointed by the 1st argument. Returns second argument in RAX.
     64# pointed by the 1st argument. Returns 0 in EAX.
    6465#
    65 FUNCTION_BEGIN(__longjmp)
     66FUNCTION_BEGIN(context_restore)
    6667        movq CONTEXT_OFFSET_R15(%rdi), %r15
    6768        movq CONTEXT_OFFSET_R14(%rdi), %r14
     
    8081        movq %rdi, %fs:0
    8182
    82         movq %rsi, %rax                      # __longjmp returns second argument
     83        xorl %eax, %eax                      # context_restore returns 0
    8384        ret
    84 FUNCTION_END(__longjmp)
     85FUNCTION_END(context_restore)
    8586
Note: See TracChangeset for help on using the changeset viewer.