Changeset 615e83d in mainline for uspace/lib/c/arch/ia32/src/fibril.S


Ignore:
Timestamp:
2018-03-08T18:25:31Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
55f068c
Parents:
e0a4686
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-08 17:43:06)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-08 18:25:31)
Message:

Turn context_save/context_restore into standard setjmp/longjmp.

File:
1 edited

Legend:

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

    re0a4686 r615e83d  
    3535#
    3636# Save CPU context to the context_t variable
    37 # pointed by the 1st argument. Returns 1 in EAX.
     37# pointed by the 1st argument. Returns 0 in EAX.
    3838#
    39 FUNCTION_BEGIN(context_save)
     39FUNCTION_BEGIN(setjmp)
    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         # context_save returns 1
    56         incl %eax
     55        xorl %eax, %eax         # setjmp returns 0
    5756        ret
    58 FUNCTION_END(context_save)
     57FUNCTION_END(setjmp)
    5958
    6059## Restore saved CPU context
    6160#
    6261# Restore CPU context from context_t variable
    63 # pointed by the 1st argument. Returns 0 in EAX.
     62# pointed by the 1st argument. Returns second argument in EAX.
    6463#
    65 FUNCTION_BEGIN(context_restore)
     64FUNCTION_BEGIN(__longjmp)
    6665        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         xorl %eax, %eax         # context_restore returns 0
     82        movl %ecx, %eax
    8383        ret
    84 FUNCTION_END(context_restore)
     84FUNCTION_END(__longjmp)
    8585
Note: See TracChangeset for help on using the changeset viewer.