Ignore:
File:
1 edited

Legend:

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

    ra35a3d8 rb4f1171  
    3737# pointed by the 1st argument. Returns 0 in RAX.
    3838#
    39 FUNCTION_BEGIN(__setjmp)
     39FUNCTION_BEGIN(__context_save)
    4040        movq (%rsp), %rdx     # the caller's return %eip
    4141
    4242        # in %rdi is passed 1st argument
    43         movq %rdx, CONTEXT_OFFSET_PC(%rdi)
    44         movq %rsp, CONTEXT_OFFSET_SP(%rdi)
     43        movq %rdx, __CONTEXT_OFFSET_PC(%rdi)
     44        movq %rsp, __CONTEXT_OFFSET_SP(%rdi)
    4545
    46         movq %rbx, CONTEXT_OFFSET_RBX(%rdi)
    47         movq %rbp, CONTEXT_OFFSET_RBP(%rdi)
    48         movq %r12, CONTEXT_OFFSET_R12(%rdi)
    49         movq %r13, CONTEXT_OFFSET_R13(%rdi)
    50         movq %r14, CONTEXT_OFFSET_R14(%rdi)
    51         movq %r15, CONTEXT_OFFSET_R15(%rdi)
     46        movq %rbx, __CONTEXT_OFFSET_RBX(%rdi)
     47        movq %rbp, __CONTEXT_OFFSET_RBP(%rdi)
     48        movq %r12, __CONTEXT_OFFSET_R12(%rdi)
     49        movq %r13, __CONTEXT_OFFSET_R13(%rdi)
     50        movq %r14, __CONTEXT_OFFSET_R14(%rdi)
     51        movq %r15, __CONTEXT_OFFSET_R15(%rdi)
    5252
    5353        movq %fs:0, %rax
    54         movq %rax, CONTEXT_OFFSET_TLS(%rdi)
     54        movq %rax, __CONTEXT_OFFSET_TLS(%rdi)
    5555
    56         xorq %rax, %rax                      # __setjmp returns 0
     56        xorq %rax, %rax                      # __context_save returns 0
    5757        ret
    58 FUNCTION_END(__setjmp)
     58FUNCTION_END(__context_save)
    5959
    6060## Restore current CPU context
     
    6363# pointed by the 1st argument. Returns second argument in RAX.
    6464#
    65 FUNCTION_BEGIN(__longjmp)
    66         movq CONTEXT_OFFSET_R15(%rdi), %r15
    67         movq CONTEXT_OFFSET_R14(%rdi), %r14
    68         movq CONTEXT_OFFSET_R13(%rdi), %r13
    69         movq CONTEXT_OFFSET_R12(%rdi), %r12
    70         movq CONTEXT_OFFSET_RBP(%rdi), %rbp
    71         movq CONTEXT_OFFSET_RBX(%rdi), %rbx
     65FUNCTION_BEGIN(__context_restore)
     66        movq __CONTEXT_OFFSET_R15(%rdi), %r15
     67        movq __CONTEXT_OFFSET_R14(%rdi), %r14
     68        movq __CONTEXT_OFFSET_R13(%rdi), %r13
     69        movq __CONTEXT_OFFSET_R12(%rdi), %r12
     70        movq __CONTEXT_OFFSET_RBP(%rdi), %rbp
     71        movq __CONTEXT_OFFSET_RBX(%rdi), %rbx
    7272
    73         movq CONTEXT_OFFSET_SP(%rdi), %rsp   # ctx->sp -> %rsp
     73        movq __CONTEXT_OFFSET_SP(%rdi), %rsp   # ctx->sp -> %rsp
    7474
    75         movq CONTEXT_OFFSET_PC(%rdi), %rdx
     75        movq __CONTEXT_OFFSET_PC(%rdi), %rdx
    7676
    7777        movq %rdx,(%rsp)
    7878
    79         movq CONTEXT_OFFSET_TLS(%rdi), %rdi
     79        movq __CONTEXT_OFFSET_TLS(%rdi), %rdi
    8080        movq %rdi, %fs:0
    8181
    82         movq %rsi, %rax                      # __longjmp returns second argument
     82        movq %rsi, %rax                      # __context_restore returns second argument
    8383        ret
    84 FUNCTION_END(__longjmp)
     84FUNCTION_END(__context_restore)
    8585
Note: See TracChangeset for help on using the changeset viewer.