Ignore:
File:
1 edited

Legend:

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

    ra35a3d8 ra35b458  
    3535#
    3636# Save CPU context to the context_t variable
    37 # pointed by the 1st argument. Returns 0 in EAX.
     37# pointed by the 1st argument. Returns 1 in EAX.
    3838#
    39 FUNCTION_BEGIN(__setjmp)
     39FUNCTION_BEGIN(context_save)
    4040        movl 0(%esp), %eax  # the caller's return %eip
    4141        movl 4(%esp), %edx  # address of the context variable to save context to
     
    5353        movl %eax, CONTEXT_OFFSET_TLS(%edx)     # tls -> ctx->tls
    5454
    55         xorl %eax, %eax         # __setjmp returns 0
     55        xorl %eax, %eax         # context_save returns 1
     56        incl %eax
    5657        ret
    57 FUNCTION_END(__setjmp)
     58FUNCTION_END(context_save)
    5859
    5960## Restore saved CPU context
    6061#
    6162# Restore CPU context from context_t variable
    62 # pointed by the 1st argument. Returns second argument in EAX.
     63# pointed by the 1st argument. Returns 0 in EAX.
    6364#
    64 FUNCTION_BEGIN(__longjmp)
     65FUNCTION_BEGIN(context_restore)
    6566        movl 4(%esp), %eax  # address of the context variable to restore context from
    66         movl 8(%esp), %ecx  # return value
    6767
    6868        # restore registers from the context structure
     
    8080        movl %edx, %gs:0
    8181
    82         movl %ecx, %eax
     82        xorl %eax, %eax         # context_restore returns 0
    8383        ret
    84 FUNCTION_END(__longjmp)
     84FUNCTION_END(context_restore)
    8585
Note: See TracChangeset for help on using the changeset viewer.