OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / arm / syscall-eabi.S
1 /* Copyright (C) 2005 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
17
18 #include <sys/syscall.h>
19 #include <bits/arm_asm.h>
20
21 /* In the EABI syscall interface, we don't need a special syscall to
22    implement syscall().  It won't work reliably with 64-bit arguments
23    (but that is true on many modern platforms).  */
24
25 .text
26 .global syscall
27 .type syscall,%function
28 .align 4
29 #if defined(THUMB1_ONLY)
30 .thumb_func
31 syscall:
32         push    {r4, r5, r6, r7}
33         mov     ip, r0
34         mov     r0, r1
35         mov     r1, r2
36         mov     r2, r3
37         add     r7, sp, #(4 * 4)
38         ldmia   r7!, {r3, r4, r5, r6}
39         mov     r7, ip
40         swi     0x0
41         pop     {r4, r5, r6, r7}
42         ldr     r1, =0xfffff000
43         cmp     r0, r1
44         bcs     1f
45         bx lr
46 1:
47         push    {r3, lr}
48         bl      __syscall_error
49         POP_RET
50 .pool
51 #else
52 syscall:
53         mov     ip, sp
54         stmfd   sp!, {r4, r5, r6, r7}
55         mov     r7, r0
56         mov     r0, r1
57         mov     r1, r2
58         mov     r2, r3
59         ldmfd   ip, {r3, r4, r5, r6}
60         swi     0x0
61         ldmfd   sp!, {r4, r5, r6, r7}
62         cmn     r0, #4096
63         IT(t, cc)
64 #if defined(__USE_BX__)
65         bxcc    lr
66 #else
67         movcc   pc, lr
68 #endif
69         b       __syscall_error
70 #endif
71
72 .size syscall,.-syscall