Deleted Added
full compact
setjmp.S (217106) setjmp.S (227023)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34 .asciz "@(#)setjmp.s 5.1 (Berkeley) 4/23/90"
35#endif /* LIBC_SCCS and not lint */
36#include <machine/asm.h>
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34 .asciz "@(#)setjmp.s 5.1 (Berkeley) 4/23/90"
35#endif /* LIBC_SCCS and not lint */
36#include <machine/asm.h>
37__FBSDID("$FreeBSD: head/lib/libc/amd64/gen/setjmp.S 217106 2011-01-07 16:08:40Z kib $");
37__FBSDID("$FreeBSD: head/lib/libc/amd64/gen/setjmp.S 227023 2011-11-02 18:06:22Z kib $");
38
39/*
40 * C library -- _setjmp, _longjmp
41 *
42 * longjmp(a,v)
43 * will generate a "return(v)" from the last call to
44 * setjmp(a)
45 * by restoring registers from the environment 'a'.
46 * The previous signal state is restored.
47 */
48
49#include "SYS.h"
50
51ENTRY(setjmp)
52 pushq %rdi
53 movq %rdi,%rcx
54 movq $1,%rdi /* SIG_BLOCK */
55 movq $0,%rsi /* (sigset_t*)set */
56 leaq 72(%rcx),%rdx /* 9,10; (sigset_t*)oset */
38
39/*
40 * C library -- _setjmp, _longjmp
41 *
42 * longjmp(a,v)
43 * will generate a "return(v)" from the last call to
44 * setjmp(a)
45 * by restoring registers from the environment 'a'.
46 * The previous signal state is restored.
47 */
48
49#include "SYS.h"
50
51ENTRY(setjmp)
52 pushq %rdi
53 movq %rdi,%rcx
54 movq $1,%rdi /* SIG_BLOCK */
55 movq $0,%rsi /* (sigset_t*)set */
56 leaq 72(%rcx),%rdx /* 9,10; (sigset_t*)oset */
57 /* stack is 16-byte aligned */
57 call PIC_PLT(CNAME(_sigprocmask))
58 popq %rdi
59 movq %rdi,%rcx
60 movq 0(%rsp),%rdx /* retval */
61 movq %rdx, 0(%rcx) /* 0; retval */
62 movq %rbx, 8(%rcx) /* 1; rbx */
63 movq %rsp,16(%rcx) /* 2; rsp */
64 movq %rbp,24(%rcx) /* 3; rbp */

--- 11 unchanged lines hidden (view full) ---

76 .set CNAME(longjmp),CNAME(__longjmp)
77ENTRY(__longjmp)
78 pushq %rdi
79 pushq %rsi
80 movq %rdi,%rdx
81 movq $3,%rdi /* SIG_SETMASK */
82 leaq 72(%rdx),%rsi /* (sigset_t*)set */
83 movq $0,%rdx /* (sigset_t*)oset */
58 call PIC_PLT(CNAME(_sigprocmask))
59 popq %rdi
60 movq %rdi,%rcx
61 movq 0(%rsp),%rdx /* retval */
62 movq %rdx, 0(%rcx) /* 0; retval */
63 movq %rbx, 8(%rcx) /* 1; rbx */
64 movq %rsp,16(%rcx) /* 2; rsp */
65 movq %rbp,24(%rcx) /* 3; rbp */

--- 11 unchanged lines hidden (view full) ---

77 .set CNAME(longjmp),CNAME(__longjmp)
78ENTRY(__longjmp)
79 pushq %rdi
80 pushq %rsi
81 movq %rdi,%rdx
82 movq $3,%rdi /* SIG_SETMASK */
83 leaq 72(%rdx),%rsi /* (sigset_t*)set */
84 movq $0,%rdx /* (sigset_t*)oset */
85 subq $0x8,%rsp /* make the stack 16-byte aligned */
84 call PIC_PLT(CNAME(_sigprocmask))
86 call PIC_PLT(CNAME(_sigprocmask))
87 addq $0x8,%rsp
85 popq %rsi
86 popq %rdi /* jmpbuf */
87 movq %rdi,%rdx
88 /* Restore the mxcsr, but leave exception flags intact. */
89 stmxcsr -4(%rsp)
90 movl 68(%rdx),%eax
91 andl $0xffffffc0,%eax
92 movl -4(%rsp),%edi

--- 22 unchanged lines hidden ---
88 popq %rsi
89 popq %rdi /* jmpbuf */
90 movq %rdi,%rdx
91 /* Restore the mxcsr, but leave exception flags intact. */
92 stmxcsr -4(%rsp)
93 movl 68(%rdx),%eax
94 andl $0xffffffc0,%eax
95 movl -4(%rsp),%edi

--- 22 unchanged lines hidden ---