]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/cris/__longjmp.S
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / cris / __longjmp.S
1 /* longjmp for CRIS.
2    Copyright (C) 2001, 2003 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 Library General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    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    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public
16    License along with the GNU C Library; see the file COPYING.LIB.  If not,
17    see <http://www.gnu.org/licenses/>.  */
18
19 #include "sysdep.h"
20
21         .syntax no_register_prefix
22
23 /* Saving and restoring CCR is meaningless, so we don't do it.  */
24 ENTRY (__longjmp)
25         /* Note that r10 = jmp_buf, r11 = retval.  */
26 #ifdef __arch_v32
27
28         /* We don't restore the call-clobbered registers for v32;
29            their space (corresponding to v10) is now defined as
30            reserved.  */
31         movem [r10],r9
32         addq 14*4,r10
33         cmpq 0,r11
34         beq 0f
35         move.d [r10+],sp
36
37         move.d r11,r9
38 0:
39         move.d [r10+],acr
40         jump acr
41         move [r10],srp
42
43 #else
44
45         move [r10+16*4],srp
46         test.d r11
47         beq 0f                  /* Already a 1 in place. */
48         nop
49         /* Offset for r9, the return value (see setjmp).  */
50         move.d r11,[r10+6*4]
51 0:
52         movem [r10],pc
53
54 #endif
55 END (__longjmp)
56
57 libc_hidden_def(__longjmp)