]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/alpha/swapcontext.S
2.5-18.1
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / alpha / swapcontext.S
1 /* Save current context and install the given one.
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
19
20 #include <sysdep.h>
21 #include <ucontext-offsets.h>
22
23 ENTRY(__swapcontext)
24
25 #ifdef PROF
26 ldgp $29, 0($27)
27 .set noat
28 lda AT, _mcount
29 jsr AT, (AT), _mcount
30 .set at
31 .prologue 1
32 #elif defined PIC
33 .prologue 0
34 #else
35 ldgp $29, 0($27)
36 .prologue 1
37 #endif
38
39 #ifdef PIC
40 unop
41 bsr $0, __getcontext_x !samegp
42 mov $17, $16
43 br $31, __setcontext !samegp
44 #else
45 jsr $0, __getcontext_x
46 mov $17, $16
47 jmp $31, __setcontext
48 #endif
49
50 END(__swapcontext)
51 weak_alias (__swapcontext, swapcontext)