1 /* Copyright (C) 2008 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 #include_next <aio_misc.h>
25 /* The Thumb-2 definition of INTERNAL_SYSCALL_RAW has to hide the use
26 of r7 from the compiler because it cannot handle asm clobbering the
27 hard frame pointer. In aio_suspend, GCC does not eliminate the
28 hard frame pointer because the function uses variable-length
29 arrays, so it generates unwind information using r7 as virtual
30 stack pointer. During system calls, when r7 has been saved on the
31 stack, this means the unwind information is invalid. Without extra
32 unwind directives, which would need to cause unwind information for
33 the asm to be generated separately from that for the parts of the
34 function before and after the asm (with three index table entries),
35 it is not possible to represent any temporary change to the virtual
36 stack pointer. Instead, we move the problematic system calls out
37 of line into a function that does not require a frame pointer. */
39 static __attribute_noinline__ void
40 aio_misc_wait (int *resultp,
42 const struct timespec *timeout,
45 AIO_MISC_WAIT (*resultp, *futexp, timeout, cancel);
49 #define AIO_MISC_WAIT(result, futex, timeout, cancel) \
50 aio_misc_wait (&result, &futex, timeout, cancel)