~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to src/setjmp/x86_64/setjmp.s

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
 
2
.global __setjmp
 
3
.global _setjmp
 
4
.global setjmp
 
5
.type __setjmp,@function
 
6
.type _setjmp,@function
 
7
.type setjmp,@function
 
8
__setjmp:
 
9
_setjmp:
 
10
setjmp:
 
11
        mov %rbx,(%rdi)         /* rdi is jmp_buf, move registers onto it */
 
12
        mov %rbp,8(%rdi)
 
13
        mov %r12,16(%rdi)
 
14
        mov %r13,24(%rdi)
 
15
        mov %r14,32(%rdi)
 
16
        mov %r15,40(%rdi)
 
17
        lea 8(%rsp),%rdx        /* this is our rsp WITHOUT current ret addr */
 
18
        mov %rdx,48(%rdi)
 
19
        mov (%rsp),%rdx         /* save return addr ptr for new rip */
 
20
        mov %rdx,56(%rdi)
 
21
        xor %rax,%rax           /* always return 0 */
 
22
        ret