diff options
Diffstat (limited to 'meta/packages/glibc/glibc-cvs/eabi-patch-2')
| -rw-r--r-- | meta/packages/glibc/glibc-cvs/eabi-patch-2 | 2446 |
1 files changed, 2446 insertions, 0 deletions
diff --git a/meta/packages/glibc/glibc-cvs/eabi-patch-2 b/meta/packages/glibc/glibc-cvs/eabi-patch-2 new file mode 100644 index 0000000000..955a9bb51f --- /dev/null +++ b/meta/packages/glibc/glibc-cvs/eabi-patch-2 | |||
| @@ -0,0 +1,2446 @@ | |||
| 1 | From libc-alpha-return-17231-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com Tue Mar 22 17:39:38 2005 | ||
| 2 | Return-Path: <libc-alpha-return-17231-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com> | ||
| 3 | Delivered-To: listarch-libc-alpha at sources dot redhat dot com | ||
| 4 | Received: (qmail 15063 invoked by alias); 22 Mar 2005 17:39:38 -0000 | ||
| 5 | Mailing-List: contact libc-alpha-help at sources dot redhat dot com; run by ezmlm | ||
| 6 | Precedence: bulk | ||
| 7 | List-Subscribe: <mailto:libc-alpha-subscribe at sources dot redhat dot com> | ||
| 8 | List-Archive: <http://sources.redhat.com/ml/libc-alpha/> | ||
| 9 | List-Post: <mailto:libc-alpha at sources dot redhat dot com> | ||
| 10 | List-Help: <mailto:libc-alpha-help at sources dot redhat dot com>, <http://sources dot redhat dot com/ml/#faqs> | ||
| 11 | Sender: libc-alpha-owner at sources dot redhat dot com | ||
| 12 | Delivered-To: mailing list libc-alpha at sources dot redhat dot com | ||
| 13 | Received: (qmail 13714 invoked from network); 22 Mar 2005 17:38:53 -0000 | ||
| 14 | Received: from unknown (HELO nevyn.them.org) (66.93.172.17) | ||
| 15 | by sourceware dot org with SMTP; 22 Mar 2005 17:38:53 -0000 | ||
| 16 | Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) | ||
| 17 | id 1DDnLP-00007R-0B; Tue, 22 Mar 2005 12:39:07 -0500 | ||
| 18 | Date: Tue, 22 Mar 2005 12:39:06 -0500 | ||
| 19 | From: Daniel Jacobowitz <drow at false dot org> | ||
| 20 | To: libc-alpha at sources dot redhat dot com, Phil Blundell <pb at reciva dot com> | ||
| 21 | Subject: Re: Remainder of ARM EABI support | ||
| 22 | Message-ID: <20050322173906.GA316@nevyn.them.org> | ||
| 23 | Mail-Followup-To: libc-alpha at sources dot redhat dot com, | ||
| 24 | Phil Blundell <pb at reciva dot com> | ||
| 25 | References: <20050322162137.GA26662@nevyn.them.org> | ||
| 26 | Mime-Version: 1.0 | ||
| 27 | Content-Type: text/plain; charset=us-ascii | ||
| 28 | Content-Disposition: inline | ||
| 29 | In-Reply-To: <20050322162137 dot GA26662 at nevyn dot them dot org> | ||
| 30 | User-Agent: Mutt/1.5.6+20040907i | ||
| 31 | |||
| 32 | On Tue, Mar 22, 2005 at 11:21:37AM -0500, Daniel Jacobowitz wrote: | ||
| 33 | > This patch is the remaining pieces of ARM EABI support, the | ||
| 34 | > arm*-*-linux-gnueabi target. | ||
| 35 | > | ||
| 36 | > Highlights of the new ABI compared to the old one: | ||
| 37 | > - Eight byte stack alignment instead of four. | ||
| 38 | > - VFP floating point support instead of FPA; there's actually hardware | ||
| 39 | > which supports VFP... | ||
| 40 | > - More standard structure layout. The old ABI (APCS) always rounded | ||
| 41 | > structures up to 32-bit alignment even if they contained only chars; | ||
| 42 | > it also aligned 64-bit fields to four bytes. | ||
| 43 | > - Some types have been grown to accomodate modern ARM cores, particularly | ||
| 44 | > jmp_buf. | ||
| 45 | > | ||
| 46 | > The EABI also defines some additional symbols that a C library has to | ||
| 47 | > define, which allow "portable" ARM objects to be linked to multiple C | ||
| 48 | > libraries even if certain implementation-defined constants differ. | ||
| 49 | > They're added to ARM-specific files in libc_nonshared.a. | ||
| 50 | > | ||
| 51 | > Most of the contents of sysdeps/unix/sysv/linux/arm/eabi are wrappers for | ||
| 52 | > syscalls whose types have changed between the old and new ABI. The kernel | ||
| 53 | > developers are discussing an EABI syscall interface, but for now the swi | ||
| 54 | > based syscalls take the same argument types they used to for APCS. Only | ||
| 55 | > a handful of syscalls are affected. | ||
| 56 | |||
| 57 | My track record is not very good this morning; I apologize. I sent the | ||
| 58 | wrong version of the patch. This one includes a couple of VFP fixes | ||
| 59 | left out of the last posting, and a complete changelog. | ||
| 60 | |||
| 61 | -- | ||
| 62 | Daniel Jacobowitz | ||
| 63 | CodeSourcery, LLC | ||
| 64 | |||
| 65 | 2005-03-22 Daniel Jacobowitz <dan@codesourcery.com> | ||
| 66 | Mark Mitchell <mark@codesourcery.com> | ||
| 67 | Paul Brook <paul@codesourcery.com> | ||
| 68 | |||
| 69 | * sysdeps/arm/eabi/Makefile, sysdeps/arm/eabi/Versions, | ||
| 70 | sysdeps/arm/eabi/aeabi_assert.c, sysdeps/arm/eabi/aeabi_atexit.c, | ||
| 71 | sysdeps/arm/eabi/aeabi_errno_addr.c, sysdeps/arm/eabi/aeabi_lcsts.c, | ||
| 72 | sysdeps/arm/eabi/aeabi_localeconv.c, sysdeps/arm/eabi/aeabi_math.c, | ||
| 73 | sysdeps/arm/eabi/aeabi_mb_cur_max.c, | ||
| 74 | sysdeps/arm/eabi/aeabi_sighandlers.S, | ||
| 75 | sysdeps/arm/eabi/aeabi_unwind_cpp_pr1.c, | ||
| 76 | sysdeps/arm/eabi/bits/huge_val.h, sysdeps/arm/eabi/bits/setjmp.h, | ||
| 77 | sysdeps/arm/eabi/find_exidx.c, sysdeps/arm/eabi/fpu/__longjmp.S, | ||
| 78 | sysdeps/arm/eabi/fpu/bits/fenv.h, sysdeps/arm/eabi/fpu/fclrexcpt.c, | ||
| 79 | sysdeps/arm/eabi/fpu/fegetround.c, sysdeps/arm/eabi/fpu/fesetenv.c, | ||
| 80 | sysdeps/arm/eabi/fpu/fesetround.c, sysdeps/arm/eabi/fpu/fpu_control.h, | ||
| 81 | sysdeps/arm/eabi/fpu/feholdexcpt.c, | ||
| 82 | sysdeps/arm/eabi/fpu/fraiseexcpt.c, | ||
| 83 | sysdeps/arm/eabi/fpu/setjmp.S, | ||
| 84 | sysdeps/unix/sysv/linux/arm/eabi/configure, | ||
| 85 | sysdeps/unix/sysv/linux/arm/eabi/configure.in, | ||
| 86 | sysdeps/unix/sysv/linux/arm/eabi/epoll_ctl.c, | ||
| 87 | sysdeps/unix/sysv/linux/arm/eabi/epoll_wait.c, | ||
| 88 | sysdeps/unix/sysv/linux/arm/eabi/fstatfs64.c, | ||
| 89 | sysdeps/unix/sysv/linux/arm/eabi/fxstat64.c, | ||
| 90 | sysdeps/unix/sysv/linux/arm/eabi/kernel_stat.h, | ||
| 91 | sysdeps/unix/sysv/linux/arm/eabi/lxstat64.c, | ||
| 92 | sysdeps/unix/sysv/linux/arm/eabi/oldgetrlimit.c, | ||
| 93 | sysdeps/unix/sysv/linux/arm/eabi/oldsetrlimit.c, | ||
| 94 | sysdeps/unix/sysv/linux/arm/eabi/semop.c, | ||
| 95 | sysdeps/unix/sysv/linux/arm/eabi/semtimedop.c, | ||
| 96 | sysdeps/unix/sysv/linux/arm/eabi/statfs64.c, | ||
| 97 | sysdeps/unix/sysv/linux/arm/eabi/uname.c, | ||
| 98 | sysdeps/unix/sysv/linux/arm/eabi/xstat64.c, | ||
| 99 | sysdeps/unix/sysv/linux/arm/eabi/xstatconv.c, | ||
| 100 | sysdeps/unix/sysv/linux/arm/eabi/xstatconv.h: New files. | ||
| 101 | |||
| 102 | |||
| 103 | Index: glibc/sysdeps/arm/eabi/Makefile | ||
| 104 | =================================================================== | ||
| 105 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 106 | +++ glibc/sysdeps/arm/eabi/Makefile 2005-03-22 11:53:10.049703870 -0500 | ||
| 107 | @@ -0,0 +1,15 @@ | ||
| 108 | +ifeq ($(subdir),csu) | ||
| 109 | +aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math | ||
| 110 | +aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \ | ||
| 111 | + aeabi_mb_cur_max aeabi_atexit | ||
| 112 | + | ||
| 113 | +sysdep_routines += $(aeabi_constants) $(aeabi_routines) | ||
| 114 | +static-only-routines += $(aeabi_constants) $(aeabi_routines) | ||
| 115 | +endif | ||
| 116 | + | ||
| 117 | +ifeq ($(subdir),elf) | ||
| 118 | +sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx | ||
| 119 | +shared-only-routines += aeabi_unwind_cpp_pr1 | ||
| 120 | +sysdep-rtld-routines += aeabi_unwind_cpp_pr1 | ||
| 121 | +endif | ||
| 122 | + | ||
| 123 | Index: glibc/sysdeps/arm/eabi/Versions | ||
| 124 | =================================================================== | ||
| 125 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 126 | +++ glibc/sysdeps/arm/eabi/Versions 2005-03-22 11:53:10.049703870 -0500 | ||
| 127 | @@ -0,0 +1,6 @@ | ||
| 128 | +libc { | ||
| 129 | + GLIBC_2.4 { | ||
| 130 | + # Helper routines | ||
| 131 | + __gnu_Unwind_Find_exidx; | ||
| 132 | + } | ||
| 133 | +} | ||
| 134 | Index: glibc/sysdeps/arm/eabi/aeabi_assert.c | ||
| 135 | =================================================================== | ||
| 136 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 137 | +++ glibc/sysdeps/arm/eabi/aeabi_assert.c 2005-03-22 11:53:10.049703870 -0500 | ||
| 138 | @@ -0,0 +1,27 @@ | ||
| 139 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 140 | + This file is part of the GNU C Library. | ||
| 141 | + | ||
| 142 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 143 | + modify it under the terms of the GNU Lesser General Public | ||
| 144 | + License as published by the Free Software Foundation; either | ||
| 145 | + version 2.1 of the License, or (at your option) any later version. | ||
| 146 | + | ||
| 147 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 148 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 149 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 150 | + Lesser General Public License for more details. | ||
| 151 | + | ||
| 152 | + You should have received a copy of the GNU Lesser General Public | ||
| 153 | + License along with the GNU C Library; if not, write to the Free | ||
| 154 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 155 | + 02111-1307 USA. */ | ||
| 156 | + | ||
| 157 | +#include <assert.h> | ||
| 158 | +#include <stdlib.h> | ||
| 159 | + | ||
| 160 | +void attribute_hidden | ||
| 161 | +__aeabi_assert (const char *assertion, const char *file, | ||
| 162 | + unsigned int line) | ||
| 163 | +{ | ||
| 164 | + __assert_fail (assertion, file, line, NULL); | ||
| 165 | +} | ||
| 166 | Index: glibc/sysdeps/arm/eabi/aeabi_atexit.c | ||
| 167 | =================================================================== | ||
| 168 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 169 | +++ glibc/sysdeps/arm/eabi/aeabi_atexit.c 2005-03-22 11:53:10.050703627 -0500 | ||
| 170 | @@ -0,0 +1,28 @@ | ||
| 171 | +/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 172 | + This file is part of the GNU C Library. | ||
| 173 | + | ||
| 174 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 175 | + modify it under the terms of the GNU Lesser General Public | ||
| 176 | + License as published by the Free Software Foundation; either | ||
| 177 | + version 2.1 of the License, or (at your option) any later version. | ||
| 178 | + | ||
| 179 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 180 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 181 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 182 | + Lesser General Public License for more details. | ||
| 183 | + | ||
| 184 | + You should have received a copy of the GNU Lesser General Public | ||
| 185 | + License along with the GNU C Library; if not, write to the Free | ||
| 186 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 187 | + 02111-1307 USA. */ | ||
| 188 | + | ||
| 189 | +#include <stdlib.h> | ||
| 190 | + | ||
| 191 | +/* Register a function to be called by exit or when a shared library | ||
| 192 | + is unloaded. This routine is like __cxa_atexit, but uses the | ||
| 193 | + calling sequence required by the ARM EABI. */ | ||
| 194 | +int attribute_hidden | ||
| 195 | +__aeabi_atexit (void *arg, void (*func) (void *), void *d) | ||
| 196 | +{ | ||
| 197 | + return __cxa_atexit (func, arg, d); | ||
| 198 | +} | ||
| 199 | Index: glibc/sysdeps/arm/eabi/aeabi_errno_addr.c | ||
| 200 | =================================================================== | ||
| 201 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 202 | +++ glibc/sysdeps/arm/eabi/aeabi_errno_addr.c 2005-03-22 11:53:10.050703627 -0500 | ||
| 203 | @@ -0,0 +1,26 @@ | ||
| 204 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 205 | + This file is part of the GNU C Library. | ||
| 206 | + | ||
| 207 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 208 | + modify it under the terms of the GNU Lesser General Public | ||
| 209 | + License as published by the Free Software Foundation; either | ||
| 210 | + version 2.1 of the License, or (at your option) any later version. | ||
| 211 | + | ||
| 212 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 213 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 214 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 215 | + Lesser General Public License for more details. | ||
| 216 | + | ||
| 217 | + You should have received a copy of the GNU Lesser General Public | ||
| 218 | + License along with the GNU C Library; if not, write to the Free | ||
| 219 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 220 | + 02111-1307 USA. */ | ||
| 221 | + | ||
| 222 | +#include <errno.h> | ||
| 223 | + | ||
| 224 | +attribute_hidden | ||
| 225 | +volatile int * | ||
| 226 | +__aeabi_errno_addr (void) | ||
| 227 | +{ | ||
| 228 | + return &errno; | ||
| 229 | +} | ||
| 230 | Index: glibc/sysdeps/arm/eabi/aeabi_lcsts.c | ||
| 231 | =================================================================== | ||
| 232 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 233 | +++ glibc/sysdeps/arm/eabi/aeabi_lcsts.c 2005-03-22 11:53:10.050703627 -0500 | ||
| 234 | @@ -0,0 +1,67 @@ | ||
| 235 | +/* Link-time constants for ARM EABI. | ||
| 236 | + Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 237 | + This file is part of the GNU C Library. | ||
| 238 | + | ||
| 239 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 240 | + modify it under the terms of the GNU Lesser General Public | ||
| 241 | + License as published by the Free Software Foundation; either | ||
| 242 | + version 2.1 of the License, or (at your option) any later version. | ||
| 243 | + | ||
| 244 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 245 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 246 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 247 | + Lesser General Public License for more details. | ||
| 248 | + | ||
| 249 | + You should have received a copy of the GNU Lesser General Public | ||
| 250 | + License along with the GNU C Library; if not, write to the Free | ||
| 251 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 252 | + 02111-1307 USA. */ | ||
| 253 | + | ||
| 254 | +/* The ARM EABI requires that we provide ISO compile-time constants as | ||
| 255 | + link-time constants. Some portable applications may reference these. */ | ||
| 256 | + | ||
| 257 | +#include <errno.h> | ||
| 258 | +#include <limits.h> | ||
| 259 | +#include <locale.h> | ||
| 260 | +#include <setjmp.h> | ||
| 261 | +#include <signal.h> | ||
| 262 | +#include <stdio.h> | ||
| 263 | +#include <time.h> | ||
| 264 | + | ||
| 265 | +#define eabi_constant2(X,Y) const int __aeabi_##X attribute_hidden = Y | ||
| 266 | +#define eabi_constant(X) const int __aeabi_##X attribute_hidden = X | ||
| 267 | + | ||
| 268 | +eabi_constant (EDOM); | ||
| 269 | +eabi_constant (ERANGE); | ||
| 270 | +eabi_constant (EILSEQ); | ||
| 271 | + | ||
| 272 | +eabi_constant (MB_LEN_MAX); | ||
| 273 | + | ||
| 274 | +eabi_constant (LC_COLLATE); | ||
| 275 | +eabi_constant (LC_CTYPE); | ||
| 276 | +eabi_constant (LC_MONETARY); | ||
| 277 | +eabi_constant (LC_NUMERIC); | ||
| 278 | +eabi_constant (LC_TIME); | ||
| 279 | +eabi_constant (LC_ALL); | ||
| 280 | + | ||
| 281 | +/* The value of __aeabi_JMP_BUF_SIZE is the number of doublewords in a | ||
| 282 | + jmp_buf. */ | ||
| 283 | +eabi_constant2 (JMP_BUF_SIZE, sizeof (jmp_buf) / 8); | ||
| 284 | + | ||
| 285 | +eabi_constant (SIGABRT); | ||
| 286 | +eabi_constant (SIGFPE); | ||
| 287 | +eabi_constant (SIGILL); | ||
| 288 | +eabi_constant (SIGINT); | ||
| 289 | +eabi_constant (SIGSEGV); | ||
| 290 | +eabi_constant (SIGTERM); | ||
| 291 | + | ||
| 292 | +eabi_constant2 (IOFBF, _IOFBF); | ||
| 293 | +eabi_constant2 (IOLBF, _IOLBF); | ||
| 294 | +eabi_constant2 (IONBF, _IONBF); | ||
| 295 | +eabi_constant (BUFSIZ); | ||
| 296 | +eabi_constant (FOPEN_MAX); | ||
| 297 | +eabi_constant (TMP_MAX); | ||
| 298 | +eabi_constant (FILENAME_MAX); | ||
| 299 | +eabi_constant (L_tmpnam); | ||
| 300 | + | ||
| 301 | +eabi_constant (CLOCKS_PER_SEC); | ||
| 302 | Index: glibc/sysdeps/arm/eabi/aeabi_localeconv.c | ||
| 303 | =================================================================== | ||
| 304 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 305 | +++ glibc/sysdeps/arm/eabi/aeabi_localeconv.c 2005-03-22 11:53:10.050703627 -0500 | ||
| 306 | @@ -0,0 +1,26 @@ | ||
| 307 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 308 | + This file is part of the GNU C Library. | ||
| 309 | + | ||
| 310 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 311 | + modify it under the terms of the GNU Lesser General Public | ||
| 312 | + License as published by the Free Software Foundation; either | ||
| 313 | + version 2.1 of the License, or (at your option) any later version. | ||
| 314 | + | ||
| 315 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 316 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 317 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 318 | + Lesser General Public License for more details. | ||
| 319 | + | ||
| 320 | + You should have received a copy of the GNU Lesser General Public | ||
| 321 | + License along with the GNU C Library; if not, write to the Free | ||
| 322 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 323 | + 02111-1307 USA. */ | ||
| 324 | + | ||
| 325 | +#include <locale.h> | ||
| 326 | + | ||
| 327 | +attribute_hidden | ||
| 328 | +struct lconv * | ||
| 329 | +__aeabi_localeconv (void) | ||
| 330 | +{ | ||
| 331 | + return localeconv (); | ||
| 332 | +} | ||
| 333 | Index: glibc/sysdeps/arm/eabi/aeabi_math.c | ||
| 334 | =================================================================== | ||
| 335 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 336 | +++ glibc/sysdeps/arm/eabi/aeabi_math.c 2005-03-22 11:53:10.050703627 -0500 | ||
| 337 | @@ -0,0 +1,25 @@ | ||
| 338 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 339 | + This file is part of the GNU C Library. | ||
| 340 | + | ||
| 341 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 342 | + modify it under the terms of the GNU Lesser General Public | ||
| 343 | + License as published by the Free Software Foundation; either | ||
| 344 | + version 2.1 of the License, or (at your option) any later version. | ||
| 345 | + | ||
| 346 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 347 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 348 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 349 | + Lesser General Public License for more details. | ||
| 350 | + | ||
| 351 | + You should have received a copy of the GNU Lesser General Public | ||
| 352 | + License along with the GNU C Library; if not, write to the Free | ||
| 353 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 354 | + 02111-1307 USA. */ | ||
| 355 | + | ||
| 356 | +#include <math.h> | ||
| 357 | + | ||
| 358 | +const double __aeabi_HUGE_VAL attribute_hidden = HUGE_VAL; | ||
| 359 | +const long double __aeabi_HUGE_VALL attribute_hidden = HUGE_VALL; | ||
| 360 | +const float __aeabi_HUGE_VALF attribute_hidden = HUGE_VALF; | ||
| 361 | +const float __aeabi_INFINITY attribute_hidden = INFINITY; | ||
| 362 | +const float __aeabi_NAN attribute_hidden = NAN; | ||
| 363 | Index: glibc/sysdeps/arm/eabi/aeabi_mb_cur_max.c | ||
| 364 | =================================================================== | ||
| 365 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 366 | +++ glibc/sysdeps/arm/eabi/aeabi_mb_cur_max.c 2005-03-22 11:53:10.051703385 -0500 | ||
| 367 | @@ -0,0 +1,28 @@ | ||
| 368 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 369 | + This file is part of the GNU C Library. | ||
| 370 | + | ||
| 371 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 372 | + modify it under the terms of the GNU Lesser General Public | ||
| 373 | + License as published by the Free Software Foundation; either | ||
| 374 | + version 2.1 of the License, or (at your option) any later version. | ||
| 375 | + | ||
| 376 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 377 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 378 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 379 | + Lesser General Public License for more details. | ||
| 380 | + | ||
| 381 | + You should have received a copy of the GNU Lesser General Public | ||
| 382 | + License along with the GNU C Library; if not, write to the Free | ||
| 383 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 384 | + 02111-1307 USA. */ | ||
| 385 | + | ||
| 386 | +#include <langinfo.h> | ||
| 387 | +#include <locale.h> | ||
| 388 | +#include <stdlib.h> | ||
| 389 | +#include <locale/localeinfo.h> | ||
| 390 | + | ||
| 391 | +int attribute_hidden | ||
| 392 | +__aeabi_MB_CUR_MAX (void) | ||
| 393 | +{ | ||
| 394 | + return MB_CUR_MAX; | ||
| 395 | +} | ||
| 396 | Index: glibc/sysdeps/arm/eabi/aeabi_sighandlers.S | ||
| 397 | =================================================================== | ||
| 398 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 399 | +++ glibc/sysdeps/arm/eabi/aeabi_sighandlers.S 2005-03-22 11:53:10.051703385 -0500 | ||
| 400 | @@ -0,0 +1,37 @@ | ||
| 401 | +/* Link-time constants for ARM EABI - signal handlers. | ||
| 402 | + Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 403 | + This file is part of the GNU C Library. | ||
| 404 | + | ||
| 405 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 406 | + modify it under the terms of the GNU Lesser General Public | ||
| 407 | + License as published by the Free Software Foundation; either | ||
| 408 | + version 2.1 of the License, or (at your option) any later version. | ||
| 409 | + | ||
| 410 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 411 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 412 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 413 | + Lesser General Public License for more details. | ||
| 414 | + | ||
| 415 | + You should have received a copy of the GNU Lesser General Public | ||
| 416 | + License along with the GNU C Library; if not, write to the Free | ||
| 417 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 418 | + 02111-1307 USA. */ | ||
| 419 | + | ||
| 420 | +/* The ARM EABI defines these as "functions". */ | ||
| 421 | + | ||
| 422 | +#include <sysdep.h> | ||
| 423 | + | ||
| 424 | + .global __aeabi_SIG_DFL | ||
| 425 | + .hidden __aeabi_SIG_DFL | ||
| 426 | + .type __aeabi_SIG_DFL, %function | ||
| 427 | + .set __aeabi_SIG_DFL, 0 | ||
| 428 | + | ||
| 429 | + .global __aeabi_SIG_IGN | ||
| 430 | + .hidden __aeabi_SIG_IGN | ||
| 431 | + .type __aeabi_SIG_IGN, %function | ||
| 432 | + .set __aeabi_SIG_IGN, 1 | ||
| 433 | + | ||
| 434 | + .global __aeabi_SIG_ERR | ||
| 435 | + .hidden __aeabi_SIG_ERR | ||
| 436 | + .type __aeabi_SIG_ERR, %function | ||
| 437 | + .set __aeabi_SIG_ERR, -1 | ||
| 438 | Index: glibc/sysdeps/arm/eabi/aeabi_unwind_cpp_pr1.c | ||
| 439 | =================================================================== | ||
| 440 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 441 | +++ glibc/sysdeps/arm/eabi/aeabi_unwind_cpp_pr1.c 2005-03-22 11:53:10.051703385 -0500 | ||
| 442 | @@ -0,0 +1,28 @@ | ||
| 443 | +/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 444 | + This file is part of the GNU C Library. | ||
| 445 | + | ||
| 446 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 447 | + modify it under the terms of the GNU Lesser General Public | ||
| 448 | + License as published by the Free Software Foundation; either | ||
| 449 | + version 2.1 of the License, or (at your option) any later version. | ||
| 450 | + | ||
| 451 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 452 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 453 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 454 | + Lesser General Public License for more details. | ||
| 455 | + | ||
| 456 | + You should have received a copy of the GNU Lesser General Public | ||
| 457 | + License along with the GNU C Library; if not, write to the Free | ||
| 458 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 459 | + 02111-1307 USA. */ | ||
| 460 | + | ||
| 461 | +/* Because some objects in ld.so and libc.so are built with | ||
| 462 | + -fexceptions, we end up with references to this personality | ||
| 463 | + routine. However, these libraries are not linked against | ||
| 464 | + libgcc_eh.a, so we need a dummy definition. This routine will | ||
| 465 | + never actually be called. */ | ||
| 466 | + | ||
| 467 | +void | ||
| 468 | +__aeabi_unwind_cpp_pr1 (void) | ||
| 469 | +{ | ||
| 470 | +} | ||
| 471 | Index: glibc/sysdeps/arm/eabi/bits/huge_val.h | ||
| 472 | =================================================================== | ||
| 473 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 474 | +++ glibc/sysdeps/arm/eabi/bits/huge_val.h 2005-03-22 11:53:10.051703385 -0500 | ||
| 475 | @@ -0,0 +1,55 @@ | ||
| 476 | +/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity). | ||
| 477 | + Used by <stdlib.h> and <math.h> functions for overflow. | ||
| 478 | + Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004 | ||
| 479 | + Free Software Foundation, Inc. | ||
| 480 | + This file is part of the GNU C Library. | ||
| 481 | + | ||
| 482 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 483 | + modify it under the terms of the GNU Lesser General Public | ||
| 484 | + License as published by the Free Software Foundation; either | ||
| 485 | + version 2.1 of the License, or (at your option) any later version. | ||
| 486 | + | ||
| 487 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 488 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 489 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 490 | + Lesser General Public License for more details. | ||
| 491 | + | ||
| 492 | + You should have received a copy of the GNU Lesser General Public | ||
| 493 | + License along with the GNU C Library; if not, write to the Free | ||
| 494 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 495 | + 02111-1307 USA. */ | ||
| 496 | + | ||
| 497 | +#ifndef _MATH_H | ||
| 498 | +# error "Never use <bits/huge_val.h> directly; include <math.h> instead." | ||
| 499 | +#endif | ||
| 500 | + | ||
| 501 | +/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ | ||
| 502 | + | ||
| 503 | +#if __GNUC_PREREQ(3,3) | ||
| 504 | +# define HUGE_VAL (__builtin_huge_val()) | ||
| 505 | +#elif __GNUC_PREREQ(2,96) | ||
| 506 | +# define HUGE_VAL (__extension__ 0x1.0p2047) | ||
| 507 | +#elif defined __GNUC__ | ||
| 508 | + | ||
| 509 | +# define HUGE_VAL \ | ||
| 510 | + (__extension__ \ | ||
| 511 | + ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ | ||
| 512 | + { __l: 0x7ff0000000000000ULL }).__d) | ||
| 513 | + | ||
| 514 | +#else /* not GCC */ | ||
| 515 | + | ||
| 516 | +# include <endian.h> | ||
| 517 | + | ||
| 518 | +typedef union { unsigned char __c[8]; double __d; } __huge_val_t; | ||
| 519 | + | ||
| 520 | +# if __BYTE_ORDER == __BIG_ENDIAN | ||
| 521 | +# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } | ||
| 522 | +# endif | ||
| 523 | +# if __BYTE_ORDER == __LITTLE_ENDIAN | ||
| 524 | +# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } | ||
| 525 | +# endif | ||
| 526 | + | ||
| 527 | +static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; | ||
| 528 | +# define HUGE_VAL (__huge_val.__d) | ||
| 529 | + | ||
| 530 | +#endif /* GCC. */ | ||
| 531 | Index: glibc/sysdeps/arm/eabi/bits/setjmp.h | ||
| 532 | =================================================================== | ||
| 533 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 534 | +++ glibc/sysdeps/arm/eabi/bits/setjmp.h 2005-03-22 11:53:10.052703143 -0500 | ||
| 535 | @@ -0,0 +1,45 @@ | ||
| 536 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 537 | + This file is part of the GNU C Library. | ||
| 538 | + | ||
| 539 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 540 | + modify it under the terms of the GNU Lesser General Public | ||
| 541 | + License as published by the Free Software Foundation; either | ||
| 542 | + version 2.1 of the License, or (at your option) any later version. | ||
| 543 | + | ||
| 544 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 545 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 546 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 547 | + Lesser General Public License for more details. | ||
| 548 | + | ||
| 549 | + You should have received a copy of the GNU Lesser General Public | ||
| 550 | + License along with the GNU C Library; if not, write to the Free | ||
| 551 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 552 | + 02111-1307 USA. */ | ||
| 553 | + | ||
| 554 | +/* Define the machine-dependent type `jmp_buf'. ARM EABI version. */ | ||
| 555 | + | ||
| 556 | +#ifndef _BITS_SETJMP_H | ||
| 557 | +#define _BITS_SETJMP_H 1 | ||
| 558 | + | ||
| 559 | +#if !defined _SETJMP_H && !defined _PTHREAD_H | ||
| 560 | +# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." | ||
| 561 | +#endif | ||
| 562 | + | ||
| 563 | +#ifndef _ASM | ||
| 564 | +/* The exact set of registers saved may depend on the particular core | ||
| 565 | + in use, as some coprocessor registers may need to be saved. The C | ||
| 566 | + Library ABI requires that the buffer be 8-byte aligned, and | ||
| 567 | + recommends that the buffer contain 64 words. The first 28 words | ||
| 568 | + are occupied by v1-v6, sl, fp, sp, pc, d8-d15, and fpscr. (Note | ||
| 569 | + that d8-15 require 17 words, due to the use of fstmx.) */ | ||
| 570 | +typedef int __jmp_buf[64] __attribute__((aligned (8))); | ||
| 571 | +#endif | ||
| 572 | + | ||
| 573 | +#define __JMP_BUF_SP 8 | ||
| 574 | + | ||
| 575 | +/* Test if longjmp to JMPBUF would unwind the frame | ||
| 576 | + containing a local variable at ADDRESS. */ | ||
| 577 | +#define _JMPBUF_UNWINDS(jmpbuf, address) \ | ||
| 578 | + ((void *) (address) < (void *) (jmpbuf[__JMP_BUF_SP])) | ||
| 579 | + | ||
| 580 | +#endif | ||
| 581 | Index: glibc/sysdeps/arm/eabi/find_exidx.c | ||
| 582 | =================================================================== | ||
| 583 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 584 | +++ glibc/sysdeps/arm/eabi/find_exidx.c 2005-03-22 11:53:10.052703143 -0500 | ||
| 585 | @@ -0,0 +1,80 @@ | ||
| 586 | +/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 587 | + This file is part of the GNU C Library. | ||
| 588 | + | ||
| 589 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 590 | + modify it under the terms of the GNU Lesser General Public | ||
| 591 | + License as published by the Free Software Foundation; either | ||
| 592 | + version 2.1 of the License, or (at your option) any later version. | ||
| 593 | + | ||
| 594 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 595 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 596 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 597 | + Lesser General Public License for more details. | ||
| 598 | + | ||
| 599 | + You should have received a copy of the GNU Lesser General Public | ||
| 600 | + License along with the GNU C Library; if not, write to the Free | ||
| 601 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 602 | + 02111-1307 USA. */ | ||
| 603 | + | ||
| 604 | +#include <link.h> | ||
| 605 | +#include <unwind.h> | ||
| 606 | + | ||
| 607 | +struct unw_eh_callback_data | ||
| 608 | +{ | ||
| 609 | + _Unwind_Ptr pc; | ||
| 610 | + _Unwind_Ptr exidx_start; | ||
| 611 | + int exidx_len; | ||
| 612 | +}; | ||
| 613 | + | ||
| 614 | + | ||
| 615 | +/* Callback to determins if the PC lies within an object, and remember the | ||
| 616 | + location of the exception index table if it does. */ | ||
| 617 | + | ||
| 618 | +static int | ||
| 619 | +find_exidx_callback (struct dl_phdr_info * info, size_t size, void * ptr) | ||
| 620 | +{ | ||
| 621 | + struct unw_eh_callback_data * data; | ||
| 622 | + const ElfW(Phdr) *phdr; | ||
| 623 | + int i; | ||
| 624 | + int match; | ||
| 625 | + _Unwind_Ptr load_base; | ||
| 626 | + | ||
| 627 | + data = (struct unw_eh_callback_data *) ptr; | ||
| 628 | + load_base = info->dlpi_addr; | ||
| 629 | + phdr = info->dlpi_phdr; | ||
| 630 | + | ||
| 631 | + match = 0; | ||
| 632 | + for (i = info->dlpi_phnum; i > 0; i--, phdr++) | ||
| 633 | + { | ||
| 634 | + if (phdr->p_type == PT_LOAD) | ||
| 635 | + { | ||
| 636 | + _Unwind_Ptr vaddr = phdr->p_vaddr + load_base; | ||
| 637 | + if (data->pc >= vaddr && data->pc < vaddr + phdr->p_memsz) | ||
| 638 | + match = 1; | ||
| 639 | + } | ||
| 640 | + else if (phdr->p_type == PT_ARM_EXIDX) | ||
| 641 | + { | ||
| 642 | + data->exidx_start = (_Unwind_Ptr) (phdr->p_vaddr + load_base); | ||
| 643 | + data->exidx_len = phdr->p_memsz; | ||
| 644 | + } | ||
| 645 | + } | ||
| 646 | + | ||
| 647 | + return match; | ||
| 648 | +} | ||
| 649 | + | ||
| 650 | + | ||
| 651 | +/* Find the exception index table containing PC. */ | ||
| 652 | + | ||
| 653 | +_Unwind_Ptr | ||
| 654 | +__gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount) | ||
| 655 | +{ | ||
| 656 | + struct unw_eh_callback_data data; | ||
| 657 | + | ||
| 658 | + data.pc = pc; | ||
| 659 | + data.exidx_start = 0; | ||
| 660 | + if (dl_iterate_phdr (find_exidx_callback, &data) <= 0) | ||
| 661 | + return 0; | ||
| 662 | + | ||
| 663 | + *pcount = data.exidx_len / 8; | ||
| 664 | + return data.exidx_start; | ||
| 665 | +} | ||
| 666 | Index: glibc/sysdeps/arm/eabi/fpu/__longjmp.S | ||
| 667 | =================================================================== | ||
| 668 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 669 | +++ glibc/sysdeps/arm/eabi/fpu/__longjmp.S 2005-03-22 11:53:10.052703143 -0500 | ||
| 670 | @@ -0,0 +1,43 @@ | ||
| 671 | +/* longjmp for ARM. | ||
| 672 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 673 | + This file is part of the GNU C Library. | ||
| 674 | + | ||
| 675 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 676 | + modify it under the terms of the GNU Lesser General Public | ||
| 677 | + License as published by the Free Software Foundation; either | ||
| 678 | + version 2.1 of the License, or (at your option) any later version. | ||
| 679 | + | ||
| 680 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 681 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 682 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 683 | + Lesser General Public License for more details. | ||
| 684 | + | ||
| 685 | + You should have received a copy of the GNU Lesser General Public | ||
| 686 | + License along with the GNU C Library; if not, write to the Free | ||
| 687 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 688 | + 02111-1307 USA. */ | ||
| 689 | + | ||
| 690 | +#include <sysdep.h> | ||
| 691 | +#define _SETJMP_H | ||
| 692 | +#define _ASM | ||
| 693 | +#include <bits/setjmp.h> | ||
| 694 | + | ||
| 695 | +/* __longjmp(jmpbuf, val) */ | ||
| 696 | + | ||
| 697 | +ENTRY (__longjmp) | ||
| 698 | + mov ip, r0 /* save jmp_buf pointer */ | ||
| 699 | + | ||
| 700 | + movs r0, r1 /* get the return value in place */ | ||
| 701 | + moveq r0, #1 /* can't let setjmp() return zero! */ | ||
| 702 | + | ||
| 703 | + /* Restore the integer registers. */ | ||
| 704 | + LOADREGS(ia, ip!, {v1-v6, sl, fp, sp, lr}) | ||
| 705 | + | ||
| 706 | + /* Restore the VFP registers. */ | ||
| 707 | + fldmiax ip!, {d8-d15} | ||
| 708 | + /* Restore the floating-point status register. */ | ||
| 709 | + ldr r1, [ip], #4 | ||
| 710 | + fmxr fpscr, r1 | ||
| 711 | + | ||
| 712 | + DO_RET(lr) | ||
| 713 | +END (__longjmp) | ||
| 714 | Index: glibc/sysdeps/arm/eabi/fpu/bits/fenv.h | ||
| 715 | =================================================================== | ||
| 716 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 717 | +++ glibc/sysdeps/arm/eabi/fpu/bits/fenv.h 2005-03-22 12:34:55.511467536 -0500 | ||
| 718 | @@ -0,0 +1,74 @@ | ||
| 719 | +/* Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 720 | + This file is part of the GNU C Library. | ||
| 721 | + | ||
| 722 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 723 | + modify it under the terms of the GNU Lesser General Public | ||
| 724 | + License as published by the Free Software Foundation; either | ||
| 725 | + version 2.1 of the License, or (at your option) any later version. | ||
| 726 | + | ||
| 727 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 728 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 729 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 730 | + Lesser General Public License for more details. | ||
| 731 | + | ||
| 732 | + You should have received a copy of the GNU Lesser General Public | ||
| 733 | + License along with the GNU C Library; if not, write to the Free | ||
| 734 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 735 | + 02111-1307 USA. */ | ||
| 736 | + | ||
| 737 | +#ifndef _FENV_H | ||
| 738 | +# error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | ||
| 739 | +#endif | ||
| 740 | + | ||
| 741 | +/* Define bits representing exceptions in the FPU status word. */ | ||
| 742 | +enum | ||
| 743 | + { | ||
| 744 | + FE_INVALID = 1, | ||
| 745 | +#define FE_INVALID FE_INVALID | ||
| 746 | + FE_DIVBYZERO = 2, | ||
| 747 | +#define FE_DIVBYZERO FE_DIVBYZERO | ||
| 748 | + FE_OVERFLOW = 4, | ||
| 749 | +#define FE_OVERFLOW FE_OVERFLOW | ||
| 750 | + FE_UNDERFLOW = 8, | ||
| 751 | +#define FE_UNDERFLOW FE_UNDERFLOW | ||
| 752 | + FE_INEXACT = 16, | ||
| 753 | +#define FE_INEXACT FE_INEXACT | ||
| 754 | + }; | ||
| 755 | + | ||
| 756 | +/* Amount to shift by to convert an exception to a mask bit. */ | ||
| 757 | +#define FE_EXCEPT_SHIFT 8 | ||
| 758 | + | ||
| 759 | +/* All supported exceptions. */ | ||
| 760 | +#define FE_ALL_EXCEPT \ | ||
| 761 | + (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) | ||
| 762 | + | ||
| 763 | +/* VFP supports all of the four defined rounding modes. */ | ||
| 764 | +enum | ||
| 765 | + { | ||
| 766 | + FE_TONEAREST = 0, | ||
| 767 | +#define FE_TONEAREST FE_TONEAREST | ||
| 768 | + FE_UPWARD = 0x400000, | ||
| 769 | +#define FE_UPWARD FE_UPWARD | ||
| 770 | + FE_DOWNWARD = 0x800000, | ||
| 771 | +#define FE_DOWNWARD FE_DOWNWARD | ||
| 772 | + FE_TOWARDZERO = 0xc00000 | ||
| 773 | +#define FE_TOWARDZERO FE_TOWARDZERO | ||
| 774 | + }; | ||
| 775 | + | ||
| 776 | +/* Type representing exception flags. */ | ||
| 777 | +typedef unsigned int fexcept_t; | ||
| 778 | + | ||
| 779 | +/* Type representing floating-point environment. */ | ||
| 780 | +typedef struct | ||
| 781 | + { | ||
| 782 | + unsigned int __cw; | ||
| 783 | + } | ||
| 784 | +fenv_t; | ||
| 785 | + | ||
| 786 | +/* If the default argument is used we use this value. */ | ||
| 787 | +#define FE_DFL_ENV ((fenv_t *) -1l) | ||
| 788 | + | ||
| 789 | +#ifdef __USE_GNU | ||
| 790 | +/* Floating-point environment where none of the exceptions are masked. */ | ||
| 791 | +# define FE_NOMASK_ENV ((__const fenv_t *) -2) | ||
| 792 | +#endif | ||
| 793 | Index: glibc/sysdeps/arm/eabi/fpu/fclrexcpt.c | ||
| 794 | =================================================================== | ||
| 795 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 796 | +++ glibc/sysdeps/arm/eabi/fpu/fclrexcpt.c 2005-03-22 11:53:10.053702900 -0500 | ||
| 797 | @@ -0,0 +1,50 @@ | ||
| 798 | +/* Clear given exceptions in current floating-point environment. | ||
| 799 | + Copyright (C) 1997,98,99,2000,01 Free Software Foundation, Inc. | ||
| 800 | + This file is part of the GNU C Library. | ||
| 801 | + | ||
| 802 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 803 | + modify it under the terms of the GNU Lesser General Public | ||
| 804 | + License as published by the Free Software Foundation; either | ||
| 805 | + version 2.1 of the License, or (at your option) any later version. | ||
| 806 | + | ||
| 807 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 808 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 809 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 810 | + Lesser General Public License for more details. | ||
| 811 | + | ||
| 812 | + You should have received a copy of the GNU Lesser General Public | ||
| 813 | + License along with the GNU C Library; if not, write to the Free | ||
| 814 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 815 | + 02111-1307 USA. */ | ||
| 816 | + | ||
| 817 | +#include <fenv.h> | ||
| 818 | +#include <fpu_control.h> | ||
| 819 | + | ||
| 820 | +int | ||
| 821 | +__feclearexcept (int excepts) | ||
| 822 | +{ | ||
| 823 | + unsigned long int temp; | ||
| 824 | + | ||
| 825 | + /* Mask out unsupported bits/exceptions. */ | ||
| 826 | + excepts &= FE_ALL_EXCEPT; | ||
| 827 | + | ||
| 828 | + /* Get the current floating point status. */ | ||
| 829 | + _FPU_GETCW (temp); | ||
| 830 | + | ||
| 831 | + /* Clear the relevant bits. */ | ||
| 832 | + temp = (temp & ~FE_ALL_EXCEPT) | (temp & FE_ALL_EXCEPT & ~excepts); | ||
| 833 | + | ||
| 834 | + /* Put the new data in effect. */ | ||
| 835 | + _FPU_SETCW (temp); | ||
| 836 | + | ||
| 837 | + /* Success. */ | ||
| 838 | + return 0; | ||
| 839 | +} | ||
| 840 | + | ||
| 841 | +#include <shlib-compat.h> | ||
| 842 | +#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) | ||
| 843 | +strong_alias (__feclearexcept, __old_feclearexcept) | ||
| 844 | +compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1); | ||
| 845 | +#endif | ||
| 846 | + | ||
| 847 | +versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2); | ||
| 848 | Index: glibc/sysdeps/arm/eabi/fpu/fegetround.c | ||
| 849 | =================================================================== | ||
| 850 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 851 | +++ glibc/sysdeps/arm/eabi/fpu/fegetround.c 2005-03-22 11:53:10.053702900 -0500 | ||
| 852 | @@ -0,0 +1,32 @@ | ||
| 853 | +/* Return current rounding direction. | ||
| 854 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 855 | + This file is part of the GNU C Library. | ||
| 856 | + | ||
| 857 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 858 | + modify it under the terms of the GNU Lesser General Public | ||
| 859 | + License as published by the Free Software Foundation; either | ||
| 860 | + version 2.1 of the License, or (at your option) any later version. | ||
| 861 | + | ||
| 862 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 863 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 864 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 865 | + Lesser General Public License for more details. | ||
| 866 | + | ||
| 867 | + You should have received a copy of the GNU Lesser General Public | ||
| 868 | + License along with the GNU C Library; if not, write to the Free | ||
| 869 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 870 | + 02111-1307 USA. */ | ||
| 871 | + | ||
| 872 | +#include <fenv.h> | ||
| 873 | +#include <fpu_control.h> | ||
| 874 | + | ||
| 875 | +int | ||
| 876 | +fegetround (void) | ||
| 877 | +{ | ||
| 878 | + unsigned int temp; | ||
| 879 | + | ||
| 880 | + /* Get the current environment. */ | ||
| 881 | + _FPU_GETCW (temp); | ||
| 882 | + | ||
| 883 | + return temp & FE_TOWARDZERO; | ||
| 884 | +} | ||
| 885 | Index: glibc/sysdeps/arm/eabi/fpu/fesetenv.c | ||
| 886 | =================================================================== | ||
| 887 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 888 | +++ glibc/sysdeps/arm/eabi/fpu/fesetenv.c 2005-03-22 12:34:55.521465156 -0500 | ||
| 889 | @@ -0,0 +1,46 @@ | ||
| 890 | +/* Install given floating-point environment. | ||
| 891 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 892 | + This file is part of the GNU C Library. | ||
| 893 | + | ||
| 894 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 895 | + modify it under the terms of the GNU Lesser General Public | ||
| 896 | + License as published by the Free Software Foundation; either | ||
| 897 | + version 2.1 of the License, or (at your option) any later version. | ||
| 898 | + | ||
| 899 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 900 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 901 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 902 | + Lesser General Public License for more details. | ||
| 903 | + | ||
| 904 | + You should have received a copy of the GNU Lesser General Public | ||
| 905 | + License along with the GNU C Library; if not, write to the Free | ||
| 906 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 907 | + 02111-1307 USA. */ | ||
| 908 | + | ||
| 909 | +#include <fenv.h> | ||
| 910 | +#include <fpu_control.h> | ||
| 911 | + | ||
| 912 | +int | ||
| 913 | +__fesetenv (const fenv_t *envp) | ||
| 914 | +{ | ||
| 915 | + unsigned int temp; | ||
| 916 | + | ||
| 917 | + _FPU_GETCW (temp); | ||
| 918 | + temp &= _FPU_RESERVED; | ||
| 919 | + | ||
| 920 | + if (envp == FE_DFL_ENV) | ||
| 921 | + temp |= _FPU_DEFAULT; | ||
| 922 | + else if (envp == FE_NOMASK_ENV) | ||
| 923 | + temp |= _FPU_IEEE; | ||
| 924 | + else | ||
| 925 | + temp |= envp->__cw & ~_FPU_RESERVED; | ||
| 926 | + | ||
| 927 | + _FPU_SETCW (temp); | ||
| 928 | + | ||
| 929 | + /* Success. */ | ||
| 930 | + return 0; | ||
| 931 | +} | ||
| 932 | + | ||
| 933 | +#include <shlib-compat.h> | ||
| 934 | +libm_hidden_ver (__fesetenv, fesetenv) | ||
| 935 | +versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); | ||
| 936 | Index: glibc/sysdeps/arm/eabi/fpu/fesetround.c | ||
| 937 | =================================================================== | ||
| 938 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 939 | +++ glibc/sysdeps/arm/eabi/fpu/fesetround.c 2005-03-22 11:53:10.053702900 -0500 | ||
| 940 | @@ -0,0 +1,41 @@ | ||
| 941 | +/* Set current rounding direction. | ||
| 942 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 943 | + This file is part of the GNU C Library. | ||
| 944 | + | ||
| 945 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 946 | + modify it under the terms of the GNU Lesser General Public | ||
| 947 | + License as published by the Free Software Foundation; either | ||
| 948 | + version 2.1 of the License, or (at your option) any later version. | ||
| 949 | + | ||
| 950 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 951 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 952 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 953 | + Lesser General Public License for more details. | ||
| 954 | + | ||
| 955 | + You should have received a copy of the GNU Lesser General Public | ||
| 956 | + License along with the GNU C Library; if not, write to the Free | ||
| 957 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 958 | + 02111-1307 USA. */ | ||
| 959 | + | ||
| 960 | +#include <fenv.h> | ||
| 961 | +#include <fpu_control.h> | ||
| 962 | + | ||
| 963 | +int | ||
| 964 | +fesetround (int round) | ||
| 965 | +{ | ||
| 966 | + fpu_control_t temp; | ||
| 967 | + | ||
| 968 | + switch (round) | ||
| 969 | + { | ||
| 970 | + case FE_TONEAREST: | ||
| 971 | + case FE_UPWARD: | ||
| 972 | + case FE_DOWNWARD: | ||
| 973 | + case FE_TOWARDZERO: | ||
| 974 | + _FPU_GETCW (temp); | ||
| 975 | + temp = (temp & ~FE_TOWARDZERO) | round; | ||
| 976 | + _FPU_SETCW (temp); | ||
| 977 | + return 0; | ||
| 978 | + default: | ||
| 979 | + return 1; | ||
| 980 | + } | ||
| 981 | +} | ||
| 982 | Index: glibc/sysdeps/arm/eabi/fpu/fpu_control.h | ||
| 983 | =================================================================== | ||
| 984 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 985 | +++ glibc/sysdeps/arm/eabi/fpu/fpu_control.h 2005-03-22 12:34:55.521465156 -0500 | ||
| 986 | @@ -0,0 +1,47 @@ | ||
| 987 | +/* FPU control word definitions. ARM VFP version. | ||
| 988 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 989 | + This file is part of the GNU C Library. | ||
| 990 | + | ||
| 991 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 992 | + modify it under the terms of the GNU Lesser General Public | ||
| 993 | + License as published by the Free Software Foundation; either | ||
| 994 | + version 2.1 of the License, or (at your option) any later version. | ||
| 995 | + | ||
| 996 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 997 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 998 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 999 | + Lesser General Public License for more details. | ||
| 1000 | + | ||
| 1001 | + You should have received a copy of the GNU Lesser General Public | ||
| 1002 | + License along with the GNU C Library; if not, write to the Free | ||
| 1003 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1004 | + 02111-1307 USA. */ | ||
| 1005 | + | ||
| 1006 | +#ifndef _FPU_CONTROL_H | ||
| 1007 | +#define _FPU_CONTROL_H | ||
| 1008 | + | ||
| 1009 | +/* masking of interrupts */ | ||
| 1010 | +#define _FPU_MASK_IM 0x00000100 /* invalid operation */ | ||
| 1011 | +#define _FPU_MASK_ZM 0x00000200 /* divide by zero */ | ||
| 1012 | +#define _FPU_MASK_OM 0x00000400 /* overflow */ | ||
| 1013 | +#define _FPU_MASK_UM 0x00000800 /* underflow */ | ||
| 1014 | +#define _FPU_MASK_PM 0x00001000 /* inexact */ | ||
| 1015 | + | ||
| 1016 | +/* Some bits in the FPSCR are not yet defined. They must be preserved when | ||
| 1017 | + modifying the contents. */ | ||
| 1018 | +#define _FPU_RESERVED 0x0e08e0e0 | ||
| 1019 | +#define _FPU_DEFAULT 0x00000000 | ||
| 1020 | +/* Default + exceptions enabled. */ | ||
| 1021 | +#define _FPU_IEEE (_FPU_DEFAULT | 0x00001f00) | ||
| 1022 | + | ||
| 1023 | +/* Type of the control word. */ | ||
| 1024 | +typedef unsigned int fpu_control_t; | ||
| 1025 | + | ||
| 1026 | +/* Macros for accessing the hardware control word. */ | ||
| 1027 | +#define _FPU_GETCW(cw) __asm__ __volatile__ ("fmrx %0, fpscr" : "=r" (cw)) | ||
| 1028 | +#define _FPU_SETCW(cw) __asm__ __volatile__ ("fmxr fpscr, %0" : : "r" (cw)) | ||
| 1029 | + | ||
| 1030 | +/* Default control word set at startup. */ | ||
| 1031 | +extern fpu_control_t __fpu_control; | ||
| 1032 | + | ||
| 1033 | +#endif /* _FPU_CONTROL_H */ | ||
| 1034 | Index: glibc/sysdeps/arm/eabi/fpu/setjmp.S | ||
| 1035 | =================================================================== | ||
| 1036 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1037 | +++ glibc/sysdeps/arm/eabi/fpu/setjmp.S 2005-03-22 11:53:10.054702658 -0500 | ||
| 1038 | @@ -0,0 +1,39 @@ | ||
| 1039 | +/* setjmp for ARM. | ||
| 1040 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 1041 | + This file is part of the GNU C Library. | ||
| 1042 | + | ||
| 1043 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1044 | + modify it under the terms of the GNU Lesser General Public | ||
| 1045 | + License as published by the Free Software Foundation; either | ||
| 1046 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1047 | + | ||
| 1048 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1049 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1050 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1051 | + Lesser General Public License for more details. | ||
| 1052 | + | ||
| 1053 | + You should have received a copy of the GNU Lesser General Public | ||
| 1054 | + License along with the GNU C Library; if not, write to the Free | ||
| 1055 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1056 | + 02111-1307 USA. */ | ||
| 1057 | + | ||
| 1058 | +#include <sysdep.h> | ||
| 1059 | +#define _SETJMP_H | ||
| 1060 | +#define _ASM | ||
| 1061 | +#include <bits/setjmp.h> | ||
| 1062 | + | ||
| 1063 | +ENTRY (__sigsetjmp) | ||
| 1064 | + mov ip, r0 | ||
| 1065 | + | ||
| 1066 | + /* Store the integer registers. */ | ||
| 1067 | + stmia ip!, {v1-v6, sl, fp, sp, lr} | ||
| 1068 | + | ||
| 1069 | + /* Store the VFP registers. */ | ||
| 1070 | + fstmiax ip!, {d8-d15} | ||
| 1071 | + /* Store the floating-point status register. */ | ||
| 1072 | + fmrx r2, fpscr | ||
| 1073 | + str r2, [ip], #4 | ||
| 1074 | + | ||
| 1075 | + /* Make a tail call to __sigjmp_save; it takes the same args. */ | ||
| 1076 | + B PLTJMP(C_SYMBOL_NAME(__sigjmp_save)) | ||
| 1077 | +END (__sigsetjmp) | ||
| 1078 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/configure | ||
| 1079 | =================================================================== | ||
| 1080 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1081 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/configure 2005-03-22 11:53:10.054702658 -0500 | ||
| 1082 | @@ -0,0 +1,5 @@ | ||
| 1083 | +# This file is generated from configure.in by Autoconf. DO NOT EDIT! | ||
| 1084 | + # Local configure fragment for sysdeps/unix/sysv/linux/arm/eabi. | ||
| 1085 | + | ||
| 1086 | +arch_minimum_kernel=2.4.17 | ||
| 1087 | +libc_cv_gcc_unwind_find_fde=no | ||
| 1088 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/configure.in | ||
| 1089 | =================================================================== | ||
| 1090 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1091 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/configure.in 2005-03-22 11:53:10.054702658 -0500 | ||
| 1092 | @@ -0,0 +1,5 @@ | ||
| 1093 | +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. | ||
| 1094 | +# Local configure fragment for sysdeps/unix/sysv/linux/arm/eabi. | ||
| 1095 | + | ||
| 1096 | +arch_minimum_kernel=2.4.17 | ||
| 1097 | +libc_cv_gcc_unwind_find_fde=no | ||
| 1098 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/epoll_ctl.c | ||
| 1099 | =================================================================== | ||
| 1100 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1101 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/epoll_ctl.c 2005-03-22 11:53:10.054702658 -0500 | ||
| 1102 | @@ -0,0 +1,37 @@ | ||
| 1103 | +/* epoll_ctl wrapper for ARM EABI. | ||
| 1104 | + Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 1105 | + This file is part of the GNU C Library. | ||
| 1106 | + | ||
| 1107 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1108 | + modify it under the terms of the GNU Lesser General Public | ||
| 1109 | + License as published by the Free Software Foundation; either | ||
| 1110 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1111 | + | ||
| 1112 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1113 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1114 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1115 | + Lesser General Public License for more details. | ||
| 1116 | + | ||
| 1117 | + You should have received a copy of the GNU Lesser General Public | ||
| 1118 | + License along with the GNU C Library; if not, write to the Free | ||
| 1119 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1120 | + 02111-1307 USA. */ | ||
| 1121 | + | ||
| 1122 | +#include <sysdep.h> | ||
| 1123 | +#include <errno.h> | ||
| 1124 | +#include <sys/epoll.h> | ||
| 1125 | + | ||
| 1126 | +#include <kernel_epoll.h> | ||
| 1127 | + | ||
| 1128 | +int | ||
| 1129 | +epoll_ctl (int __epfd, int __op, int __fd, struct epoll_event *__event) | ||
| 1130 | +{ | ||
| 1131 | + struct kernel_epoll_event k_event; | ||
| 1132 | + | ||
| 1133 | + k_event.events = __event->events; | ||
| 1134 | + memcpy (&k_event.data, &__event->data, sizeof (k_event.data)); | ||
| 1135 | + | ||
| 1136 | + return INLINE_SYSCALL (epoll_ctl, 4, __epfd, __op, __fd, &k_event); | ||
| 1137 | +} | ||
| 1138 | + | ||
| 1139 | +libc_hidden_def (epoll_ctl) | ||
| 1140 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/epoll_wait.c | ||
| 1141 | =================================================================== | ||
| 1142 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1143 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/epoll_wait.c 2005-03-22 11:53:10.055702416 -0500 | ||
| 1144 | @@ -0,0 +1,54 @@ | ||
| 1145 | +/* epoll_ctl wrapper for ARM EABI. | ||
| 1146 | + Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 1147 | + This file is part of the GNU C Library. | ||
| 1148 | + | ||
| 1149 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1150 | + modify it under the terms of the GNU Lesser General Public | ||
| 1151 | + License as published by the Free Software Foundation; either | ||
| 1152 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1153 | + | ||
| 1154 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1155 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1156 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1157 | + Lesser General Public License for more details. | ||
| 1158 | + | ||
| 1159 | + You should have received a copy of the GNU Lesser General Public | ||
| 1160 | + License along with the GNU C Library; if not, write to the Free | ||
| 1161 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1162 | + 02111-1307 USA. */ | ||
| 1163 | + | ||
| 1164 | +#include <sysdep.h> | ||
| 1165 | +#include <errno.h> | ||
| 1166 | +#include <sys/epoll.h> | ||
| 1167 | +#include <stdlib.h> | ||
| 1168 | + | ||
| 1169 | +#include <kernel_epoll.h> | ||
| 1170 | + | ||
| 1171 | +int | ||
| 1172 | +epoll_wait (int __epfd, struct epoll_event *__events, | ||
| 1173 | + int __maxevents, int __timeout); | ||
| 1174 | +{ | ||
| 1175 | + struct kernel_epoll_event *k_events; | ||
| 1176 | + int result; | ||
| 1177 | + | ||
| 1178 | + k_events = malloc (sizeof (struct kernel_epoll_event) * __maxevents); | ||
| 1179 | + if (k_events == NULL) | ||
| 1180 | + { | ||
| 1181 | + __set_errno (ENOMEM); | ||
| 1182 | + return -1; | ||
| 1183 | + } | ||
| 1184 | + | ||
| 1185 | + result = INLINE_SYSCALL (epoll_wait, 4, __epfd, __events, k_events, | ||
| 1186 | + __timeout); | ||
| 1187 | + | ||
| 1188 | + for (i = 0; i < result; i++) | ||
| 1189 | + { | ||
| 1190 | + __events[i].events = k_events[i].events; | ||
| 1191 | + memcpy (&__events[i].data, &k_events[i].data, sizeof (k_events[i].data)); | ||
| 1192 | + } | ||
| 1193 | + | ||
| 1194 | + free (k_events); | ||
| 1195 | + return result; | ||
| 1196 | +} | ||
| 1197 | + | ||
| 1198 | +libc_hidden_def (epoll_wait) | ||
| 1199 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/fstatfs64.c | ||
| 1200 | =================================================================== | ||
| 1201 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1202 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/fstatfs64.c 2005-03-22 11:53:10.055702416 -0500 | ||
| 1203 | @@ -0,0 +1,76 @@ | ||
| 1204 | +/* Return information about the filesystem on which FD resides. | ||
| 1205 | + Copyright (C) 1996,1997,1998,1999,2000,2003,2005 | ||
| 1206 | + Free Software Foundation, Inc. | ||
| 1207 | + This file is part of the GNU C Library. | ||
| 1208 | + | ||
| 1209 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1210 | + modify it under the terms of the GNU Lesser General Public | ||
| 1211 | + License as published by the Free Software Foundation; either | ||
| 1212 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1213 | + | ||
| 1214 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1215 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1216 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1217 | + Lesser General Public License for more details. | ||
| 1218 | + | ||
| 1219 | + You should have received a copy of the GNU Lesser General Public | ||
| 1220 | + License along with the GNU C Library; if not, write to the Free | ||
| 1221 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1222 | + 02111-1307 USA. */ | ||
| 1223 | + | ||
| 1224 | +#include <errno.h> | ||
| 1225 | +#include <string.h> | ||
| 1226 | +#include <sys/statfs.h> | ||
| 1227 | +#include <stddef.h> | ||
| 1228 | +#include <sysdep.h> | ||
| 1229 | + | ||
| 1230 | +/* Defined in statfs64.c. */ | ||
| 1231 | +extern int __no_statfs64 attribute_hidden; | ||
| 1232 | + | ||
| 1233 | +/* Return information about the filesystem on which FD resides. */ | ||
| 1234 | +int | ||
| 1235 | +__fstatfs64 (int fd, struct statfs64 *buf) | ||
| 1236 | +{ | ||
| 1237 | +#ifdef __NR_fstatfs64 | ||
| 1238 | +# if __ASSUME_STATFS64 == 0 | ||
| 1239 | + if (! __no_statfs64) | ||
| 1240 | +# endif | ||
| 1241 | + { | ||
| 1242 | + /* The EABI structure is the same as the old ABI structure, except | ||
| 1243 | + that it has four additional bytes of padding - at the end. We can | ||
| 1244 | + ignore them. */ | ||
| 1245 | + int result = INLINE_SYSCALL (fstatfs64, 3, fd, sizeof (*buf) - 4, buf); | ||
| 1246 | + | ||
| 1247 | +# if __ASSUME_STATFS64 == 0 | ||
| 1248 | + if (result == 0 || errno != ENOSYS) | ||
| 1249 | +# endif | ||
| 1250 | + return result; | ||
| 1251 | + | ||
| 1252 | +# if __ASSUME_STATFS64 == 0 | ||
| 1253 | + __no_statfs64 = 1; | ||
| 1254 | +# endif | ||
| 1255 | + } | ||
| 1256 | +#endif | ||
| 1257 | + | ||
| 1258 | +#if __ASSUME_STATFS64 == 0 | ||
| 1259 | + struct statfs buf32; | ||
| 1260 | + | ||
| 1261 | + if (__fstatfs (fd, &buf32) < 0) | ||
| 1262 | + return -1; | ||
| 1263 | + | ||
| 1264 | + buf->f_type = buf32.f_type; | ||
| 1265 | + buf->f_bsize = buf32.f_bsize; | ||
| 1266 | + buf->f_blocks = buf32.f_blocks; | ||
| 1267 | + buf->f_bfree = buf32.f_bfree; | ||
| 1268 | + buf->f_bavail = buf32.f_bavail; | ||
| 1269 | + buf->f_files = buf32.f_files; | ||
| 1270 | + buf->f_ffree = buf32.f_ffree; | ||
| 1271 | + buf->f_fsid = buf32.f_fsid; | ||
| 1272 | + buf->f_namelen = buf32.f_namelen; | ||
| 1273 | + buf->f_frsize = buf32.f_frsize; | ||
| 1274 | + memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare)); | ||
| 1275 | + | ||
| 1276 | + return 0; | ||
| 1277 | +#endif | ||
| 1278 | +} | ||
| 1279 | +weak_alias (__fstatfs64, fstatfs64) | ||
| 1280 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/fxstat64.c | ||
| 1281 | =================================================================== | ||
| 1282 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1283 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/fxstat64.c 2005-03-22 11:53:10.055702416 -0500 | ||
| 1284 | @@ -0,0 +1,100 @@ | ||
| 1285 | +/* fxstat64 using old-style Unix fstat system call. | ||
| 1286 | + Copyright (C) 1997-2002, 2003, 2005 Free Software Foundation, Inc. | ||
| 1287 | + This file is part of the GNU C Library. | ||
| 1288 | + | ||
| 1289 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1290 | + modify it under the terms of the GNU Lesser General Public | ||
| 1291 | + License as published by the Free Software Foundation; either | ||
| 1292 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1293 | + | ||
| 1294 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1295 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1296 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1297 | + Lesser General Public License for more details. | ||
| 1298 | + | ||
| 1299 | + You should have received a copy of the GNU Lesser General Public | ||
| 1300 | + License along with the GNU C Library; if not, write to the Free | ||
| 1301 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1302 | + 02111-1307 USA. */ | ||
| 1303 | + | ||
| 1304 | +#include <errno.h> | ||
| 1305 | +#include <stddef.h> | ||
| 1306 | +#include <sys/stat.h> | ||
| 1307 | +#include <kernel_stat.h> | ||
| 1308 | + | ||
| 1309 | +#include <sysdep.h> | ||
| 1310 | +#include <sys/syscall.h> | ||
| 1311 | +#include <bp-checks.h> | ||
| 1312 | + | ||
| 1313 | +#include "kernel-features.h" | ||
| 1314 | + | ||
| 1315 | +#if __ASSUME_STAT64_SYSCALL == 0 | ||
| 1316 | +# include <xstatconv.h> | ||
| 1317 | +#endif | ||
| 1318 | + | ||
| 1319 | +#ifdef __NR_fstat64 | ||
| 1320 | +# if __ASSUME_STAT64_SYSCALL == 0 | ||
| 1321 | +/* The variable is shared between all wrappers around *stat64 calls. */ | ||
| 1322 | +extern int __have_no_stat64; | ||
| 1323 | +# endif | ||
| 1324 | +#endif | ||
| 1325 | + | ||
| 1326 | +/* Get information about the file FD in BUF. */ | ||
| 1327 | + | ||
| 1328 | +int | ||
| 1329 | +___fxstat64 (int vers, int fd, struct stat64 *buf) | ||
| 1330 | +{ | ||
| 1331 | + int result; | ||
| 1332 | + struct kernel_stat64 kbuf64; | ||
| 1333 | + | ||
| 1334 | +#if __ASSUME_STAT64_SYSCALL > 0 | ||
| 1335 | + result = INLINE_SYSCALL (fstat64, 2, fd, CHECK_1 (&kbuf64)); | ||
| 1336 | + if (result == 0) | ||
| 1337 | + result = __xstat64_kernel64_conv (vers, &kbuf64, buf); | ||
| 1338 | +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 | ||
| 1339 | + if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino) | ||
| 1340 | + buf->st_ino = buf->__st_ino; | ||
| 1341 | +# endif | ||
| 1342 | + return result; | ||
| 1343 | +#else | ||
| 1344 | + struct kernel_stat kbuf; | ||
| 1345 | +# if defined __NR_fstat64 | ||
| 1346 | + if (! __have_no_stat64) | ||
| 1347 | + { | ||
| 1348 | + int saved_errno = errno; | ||
| 1349 | + result = INLINE_SYSCALL (fstat64, 2, fd, CHECK_1 (&kbuf64)); | ||
| 1350 | + | ||
| 1351 | + if (result != -1 || errno != ENOSYS) | ||
| 1352 | + { | ||
| 1353 | + if (result == 0) | ||
| 1354 | + result = __xstat64_kernel64_conv (vers, &kbuf64, buf); | ||
| 1355 | +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 | ||
| 1356 | + if (!result && buf->__st_ino != (__ino_t)buf->st_ino) | ||
| 1357 | + buf->st_ino = buf->__st_ino; | ||
| 1358 | +# endif | ||
| 1359 | + return result; | ||
| 1360 | + } | ||
| 1361 | + | ||
| 1362 | + __set_errno (saved_errno); | ||
| 1363 | + __have_no_stat64 = 1; | ||
| 1364 | + } | ||
| 1365 | +# endif | ||
| 1366 | + result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf)); | ||
| 1367 | + if (result == 0) | ||
| 1368 | + result = __xstat64_conv (vers, &kbuf, buf); | ||
| 1369 | + | ||
| 1370 | + return result; | ||
| 1371 | +#endif | ||
| 1372 | +} | ||
| 1373 | + | ||
| 1374 | +#include <shlib-compat.h> | ||
| 1375 | + | ||
| 1376 | +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) | ||
| 1377 | +versioned_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2); | ||
| 1378 | +strong_alias (___fxstat64, __old__fxstat64) | ||
| 1379 | +compat_symbol (libc, __old__fxstat64, __fxstat64, GLIBC_2_1); | ||
| 1380 | +hidden_ver (___fxstat64, __fxstat64) | ||
| 1381 | +#else | ||
| 1382 | +strong_alias (___fxstat64, __fxstat64) | ||
| 1383 | +hidden_def (__fxstat64) | ||
| 1384 | +#endif | ||
| 1385 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/kernel_stat.h | ||
| 1386 | =================================================================== | ||
| 1387 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1388 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/kernel_stat.h 2005-03-22 11:53:10.056702174 -0500 | ||
| 1389 | @@ -0,0 +1,59 @@ | ||
| 1390 | +/* Copyright (C) 2005 Free Software Foundation, Inc. | ||
| 1391 | + This file is part of the GNU C Library. | ||
| 1392 | + | ||
| 1393 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1394 | + modify it under the terms of the GNU Lesser General Public | ||
| 1395 | + License as published by the Free Software Foundation; either | ||
| 1396 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1397 | + | ||
| 1398 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1399 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1400 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1401 | + Lesser General Public License for more details. | ||
| 1402 | + | ||
| 1403 | + You should have received a copy of the GNU Lesser General Public | ||
| 1404 | + License along with the GNU C Library; if not, write to the Free | ||
| 1405 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1406 | + 02111-1307 USA. */ | ||
| 1407 | + | ||
| 1408 | +#include <sysdeps/unix/sysv/linux/kernel_stat.h> | ||
| 1409 | + | ||
| 1410 | +/* kernel_stat64 is just like stat64, except packed. The EABI aligns | ||
| 1411 | + st_size to an eight byte boundary but the old ABI only aligns it to | ||
| 1412 | + four. Similarly st_blocks. */ | ||
| 1413 | +struct kernel_stat64 | ||
| 1414 | + { | ||
| 1415 | + __dev_t st_dev; /* Device. */ | ||
| 1416 | + unsigned int __pad1; | ||
| 1417 | + | ||
| 1418 | + __ino_t __st_ino; /* 32bit file serial number. */ | ||
| 1419 | + __mode_t st_mode; /* File mode. */ | ||
| 1420 | + __nlink_t st_nlink; /* Link count. */ | ||
| 1421 | + __uid_t st_uid; /* User ID of the file's owner. */ | ||
| 1422 | + __gid_t st_gid; /* Group ID of the file's group.*/ | ||
| 1423 | + __dev_t st_rdev; /* Device number, if device. */ | ||
| 1424 | + unsigned int __pad2; | ||
| 1425 | + __off64_t st_size; /* Size of file, in bytes. */ | ||
| 1426 | + __blksize_t st_blksize; /* Optimal block size for I/O. */ | ||
| 1427 | + | ||
| 1428 | + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 1429 | +#ifdef __USE_MISC | ||
| 1430 | + /* Nanosecond resolution timestamps are stored in a format | ||
| 1431 | + equivalent to 'struct timespec'. This is the type used | ||
| 1432 | + whenever possible but the Unix namespace rules do not allow the | ||
| 1433 | + identifier 'timespec' to appear in the <sys/stat.h> header. | ||
| 1434 | + Therefore we have to handle the use of this header in strictly | ||
| 1435 | + standard-compliant sources special. */ | ||
| 1436 | + struct timespec st_atim; /* Time of last access. */ | ||
| 1437 | + struct timespec st_mtim; /* Time of last modification. */ | ||
| 1438 | + struct timespec st_ctim; /* Time of last status change. */ | ||
| 1439 | +#else | ||
| 1440 | + __time_t st_atime; /* Time of last access. */ | ||
| 1441 | + unsigned long int st_atimensec; /* Nscecs of last access. */ | ||
| 1442 | + __time_t st_mtime; /* Time of last modification. */ | ||
| 1443 | + unsigned long int st_mtimensec; /* Nsecs of last modification. */ | ||
| 1444 | + __time_t st_ctime; /* Time of last status change. */ | ||
| 1445 | + unsigned long int st_ctimensec; /* Nsecs of last status change. */ | ||
| 1446 | +#endif | ||
| 1447 | + __ino64_t st_ino; /* File serial number. */ | ||
| 1448 | + } __attribute__ ((packed,aligned(4))); | ||
| 1449 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/lxstat64.c | ||
| 1450 | =================================================================== | ||
| 1451 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1452 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/lxstat64.c 2005-03-22 11:53:10.056702174 -0500 | ||
| 1453 | @@ -0,0 +1,99 @@ | ||
| 1454 | +/* lxstat64 using old-style Unix lstat system call. | ||
| 1455 | + Copyright (C) 1997-2002, 2003, 2005 Free Software Foundation, Inc. | ||
| 1456 | + This file is part of the GNU C Library. | ||
| 1457 | + | ||
| 1458 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1459 | + modify it under the terms of the GNU Lesser General Public | ||
| 1460 | + License as published by the Free Software Foundation; either | ||
| 1461 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1462 | + | ||
| 1463 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1464 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1465 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1466 | + Lesser General Public License for more details. | ||
| 1467 | + | ||
| 1468 | + You should have received a copy of the GNU Lesser General Public | ||
| 1469 | + License along with the GNU C Library; if not, write to the Free | ||
| 1470 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1471 | + 02111-1307 USA. */ | ||
| 1472 | + | ||
| 1473 | +#include <errno.h> | ||
| 1474 | +#include <stddef.h> | ||
| 1475 | +#include <sys/stat.h> | ||
| 1476 | +#include <kernel_stat.h> | ||
| 1477 | + | ||
| 1478 | +#include <sysdep.h> | ||
| 1479 | +#include <sys/syscall.h> | ||
| 1480 | +#include <bp-checks.h> | ||
| 1481 | + | ||
| 1482 | +#include "kernel-features.h" | ||
| 1483 | + | ||
| 1484 | +#if __ASSUME_STAT64_SYSCALL == 0 | ||
| 1485 | +# include <xstatconv.h> | ||
| 1486 | +#endif | ||
| 1487 | + | ||
| 1488 | +#ifdef __NR_lstat64 | ||
| 1489 | +# if __ASSUME_STAT64_SYSCALL == 0 | ||
| 1490 | +/* The variable is shared between all wrappers around *stat64 calls. */ | ||
| 1491 | +extern int __have_no_stat64; | ||
| 1492 | +# endif | ||
| 1493 | +#endif | ||
| 1494 | + | ||
| 1495 | +/* Get information about the file NAME in BUF. */ | ||
| 1496 | +int | ||
| 1497 | +___lxstat64 (int vers, const char *name, struct stat64 *buf) | ||
| 1498 | +{ | ||
| 1499 | + int result; | ||
| 1500 | + struct kernel_stat64 kbuf64; | ||
| 1501 | + | ||
| 1502 | +#ifdef __ASSUME_STAT64_SYSCALL | ||
| 1503 | + result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (&kbuf64)); | ||
| 1504 | + if (result == 0) | ||
| 1505 | + result = __xstat64_kernel64_conv (vers, &kbuf64, buf); | ||
| 1506 | +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 | ||
| 1507 | + if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino) | ||
| 1508 | + buf->st_ino = buf->__st_ino; | ||
| 1509 | +# endif | ||
| 1510 | + return result; | ||
| 1511 | +#else | ||
| 1512 | + struct kernel_stat kbuf; | ||
| 1513 | +# ifdef __NR_lstat64 | ||
| 1514 | + if (! __have_no_stat64) | ||
| 1515 | + { | ||
| 1516 | + int saved_errno = errno; | ||
| 1517 | + result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (&kbuf64)); | ||
| 1518 | + | ||
| 1519 | + if (result != -1 || errno != ENOSYS) | ||
| 1520 | + { | ||
| 1521 | + if (result == 0) | ||
| 1522 | + result = __xstat64_kernel64_conv (vers, &kbuf64, buf); | ||
| 1523 | +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 | ||
| 1524 | + if (!result && buf->__st_ino != (__ino_t) buf->st_ino) | ||
| 1525 | + buf->st_ino = buf->__st_ino; | ||
| 1526 | +# endif | ||
| 1527 | + return result; | ||
| 1528 | + } | ||
| 1529 | + | ||
| 1530 | + __set_errno (saved_errno); | ||
| 1531 | + __have_no_stat64 = 1; | ||
| 1532 | + } | ||
| 1533 | +# endif | ||
| 1534 | + result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); | ||
| 1535 | + if (result == 0) | ||
| 1536 | + result = __xstat64_conv (vers, &kbuf, buf); | ||
| 1537 | + | ||
| 1538 | + return result; | ||
| 1539 | +#endif | ||
| 1540 | +} | ||
| 1541 | + | ||
| 1542 | +#include <shlib-compat.h> | ||
| 1543 | + | ||
| 1544 | +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) | ||
| 1545 | +versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2); | ||
| 1546 | +strong_alias (___lxstat64, __old__lxstat64) | ||
| 1547 | +compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1); | ||
| 1548 | +hidden_ver (___lxstat64, __lxstat64) | ||
| 1549 | +#else | ||
| 1550 | +strong_alias (___lxstat64, __lxstat64); | ||
| 1551 | +hidden_def (__lxstat64) | ||
| 1552 | +#endif | ||
| 1553 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/oldgetrlimit.c | ||
| 1554 | =================================================================== | ||
| 1555 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1556 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/oldgetrlimit.c 2005-03-22 11:53:10.056702174 -0500 | ||
| 1557 | @@ -0,0 +1 @@ | ||
| 1558 | +/* Empty. */ | ||
| 1559 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/oldsetrlimit.c | ||
| 1560 | =================================================================== | ||
| 1561 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1562 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/oldsetrlimit.c 2005-03-22 11:53:10.056702174 -0500 | ||
| 1563 | @@ -0,0 +1 @@ | ||
| 1564 | +/* Empty. */ | ||
| 1565 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/semop.c | ||
| 1566 | =================================================================== | ||
| 1567 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1568 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/semop.c 2005-03-22 11:53:10.056702174 -0500 | ||
| 1569 | @@ -0,0 +1,67 @@ | ||
| 1570 | +/* Copyright (C) 1995, 1997, 1998, 1999, 2000, 2005 | ||
| 1571 | + Free Software Foundation, Inc. | ||
| 1572 | + This file is part of the GNU C Library. | ||
| 1573 | + Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995. | ||
| 1574 | + | ||
| 1575 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1576 | + modify it under the terms of the GNU Lesser General Public | ||
| 1577 | + License as published by the Free Software Foundation; either | ||
| 1578 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1579 | + | ||
| 1580 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1581 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1582 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1583 | + Lesser General Public License for more details. | ||
| 1584 | + | ||
| 1585 | + You should have received a copy of the GNU Lesser General Public | ||
| 1586 | + License along with the GNU C Library; if not, write to the Free | ||
| 1587 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1588 | + 02111-1307 USA. */ | ||
| 1589 | + | ||
| 1590 | +#include <errno.h> | ||
| 1591 | +#include <sys/sem.h> | ||
| 1592 | +#include <ipc_priv.h> | ||
| 1593 | +#include <alloca.h> | ||
| 1594 | +#include <sysdep.h> | ||
| 1595 | +#include <sys/syscall.h> | ||
| 1596 | +#include <bp-checks.h> | ||
| 1597 | + | ||
| 1598 | +struct kernel_sembuf | ||
| 1599 | +{ | ||
| 1600 | + unsigned short int sem_num; /* semaphore number */ | ||
| 1601 | + short int sem_op; /* semaphore operation */ | ||
| 1602 | + short int sem_flg; /* operation flag */ | ||
| 1603 | + short int __pad1; | ||
| 1604 | +}; | ||
| 1605 | + | ||
| 1606 | +/* Perform user-defined atomical operation of array of semaphores. */ | ||
| 1607 | + | ||
| 1608 | +int | ||
| 1609 | +semop (semid, sops, nsops) | ||
| 1610 | + int semid; | ||
| 1611 | + struct sembuf *sops; | ||
| 1612 | + size_t nsops; | ||
| 1613 | +{ | ||
| 1614 | + struct kernel_sembuf *ksops = alloca (sizeof (sops[0]) * nsops); | ||
| 1615 | + size_t i; | ||
| 1616 | + int result; | ||
| 1617 | + | ||
| 1618 | + for (i = 0; i < nsops; i++) | ||
| 1619 | + { | ||
| 1620 | + ksops[i].sem_num = sops[i].sem_num; | ||
| 1621 | + ksops[i].sem_op = sops[i].sem_op; | ||
| 1622 | + ksops[i].sem_flg = sops[i].sem_flg; | ||
| 1623 | + } | ||
| 1624 | + | ||
| 1625 | + result = INLINE_SYSCALL (ipc, 5, IPCOP_semop, | ||
| 1626 | + semid, (int) nsops, 0, CHECK_N (ksops, nsops)); | ||
| 1627 | + | ||
| 1628 | + for (i = 0; i < nsops; i++) | ||
| 1629 | + { | ||
| 1630 | + sops[i].sem_num = ksops[i].sem_num; | ||
| 1631 | + sops[i].sem_op = ksops[i].sem_op; | ||
| 1632 | + sops[i].sem_flg = ksops[i].sem_flg; | ||
| 1633 | + } | ||
| 1634 | + | ||
| 1635 | + return result; | ||
| 1636 | +} | ||
| 1637 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/semtimedop.c | ||
| 1638 | =================================================================== | ||
| 1639 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1640 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/semtimedop.c 2005-03-22 11:53:10.057701931 -0500 | ||
| 1641 | @@ -0,0 +1,69 @@ | ||
| 1642 | +/* Copyright (C) 1995, 1997, 1998, 1999, 2000, 2005 | ||
| 1643 | + Free Software Foundation, Inc. | ||
| 1644 | + This file is part of the GNU C Library. | ||
| 1645 | + Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995. | ||
| 1646 | + | ||
| 1647 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1648 | + modify it under the terms of the GNU Lesser General Public | ||
| 1649 | + License as published by the Free Software Foundation; either | ||
| 1650 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1651 | + | ||
| 1652 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1653 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1654 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1655 | + Lesser General Public License for more details. | ||
| 1656 | + | ||
| 1657 | + You should have received a copy of the GNU Lesser General Public | ||
| 1658 | + License along with the GNU C Library; if not, write to the Free | ||
| 1659 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1660 | + 02111-1307 USA. */ | ||
| 1661 | + | ||
| 1662 | +#include <errno.h> | ||
| 1663 | +#include <sys/sem.h> | ||
| 1664 | +#include <ipc_priv.h> | ||
| 1665 | +#include <alloca.h> | ||
| 1666 | +#include <sysdep.h> | ||
| 1667 | +#include <sys/syscall.h> | ||
| 1668 | +#include <bp-checks.h> | ||
| 1669 | + | ||
| 1670 | +struct kernel_sembuf | ||
| 1671 | +{ | ||
| 1672 | + unsigned short int sem_num; /* semaphore number */ | ||
| 1673 | + short int sem_op; /* semaphore operation */ | ||
| 1674 | + short int sem_flg; /* operation flag */ | ||
| 1675 | + short int __pad1; | ||
| 1676 | +}; | ||
| 1677 | + | ||
| 1678 | +/* Perform user-defined atomical operation of array of semaphores. */ | ||
| 1679 | + | ||
| 1680 | +int | ||
| 1681 | +semtimedop (semid, sops, nsops, timeout) | ||
| 1682 | + int semid; | ||
| 1683 | + struct sembuf *sops; | ||
| 1684 | + size_t nsops; | ||
| 1685 | + const struct timespec *timeout; | ||
| 1686 | +{ | ||
| 1687 | + struct kernel_sembuf *ksops = alloca (sizeof (sops[0]) * nsops); | ||
| 1688 | + size_t i; | ||
| 1689 | + int result; | ||
| 1690 | + | ||
| 1691 | + for (i = 0; i < nsops; i++) | ||
| 1692 | + { | ||
| 1693 | + ksops[i].sem_num = sops[i].sem_num; | ||
| 1694 | + ksops[i].sem_op = sops[i].sem_op; | ||
| 1695 | + ksops[i].sem_flg = sops[i].sem_flg; | ||
| 1696 | + } | ||
| 1697 | + | ||
| 1698 | + result = INLINE_SYSCALL (ipc, 6, IPCOP_semtimedop, | ||
| 1699 | + semid, (int) nsops, 0, CHECK_N (sops, nsops), | ||
| 1700 | + timeout); | ||
| 1701 | + | ||
| 1702 | + for (i = 0; i < nsops; i++) | ||
| 1703 | + { | ||
| 1704 | + sops[i].sem_num = ksops[i].sem_num; | ||
| 1705 | + sops[i].sem_op = ksops[i].sem_op; | ||
| 1706 | + sops[i].sem_flg = ksops[i].sem_flg; | ||
| 1707 | + } | ||
| 1708 | + | ||
| 1709 | + return result; | ||
| 1710 | +} | ||
| 1711 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/statfs64.c | ||
| 1712 | =================================================================== | ||
| 1713 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1714 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/statfs64.c 2005-03-22 11:53:10.057701931 -0500 | ||
| 1715 | @@ -0,0 +1,77 @@ | ||
| 1716 | +/* Return information about the filesystem on which FILE resides. | ||
| 1717 | + Copyright (C) 1996-2000,2003,2004,2005 Free Software Foundation, Inc. | ||
| 1718 | + This file is part of the GNU C Library. | ||
| 1719 | + | ||
| 1720 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1721 | + modify it under the terms of the GNU Lesser General Public | ||
| 1722 | + License as published by the Free Software Foundation; either | ||
| 1723 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1724 | + | ||
| 1725 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1726 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1727 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1728 | + Lesser General Public License for more details. | ||
| 1729 | + | ||
| 1730 | + You should have received a copy of the GNU Lesser General Public | ||
| 1731 | + License along with the GNU C Library; if not, write to the Free | ||
| 1732 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1733 | + 02111-1307 USA. */ | ||
| 1734 | + | ||
| 1735 | +#include <errno.h> | ||
| 1736 | +#include <string.h> | ||
| 1737 | +#include <sys/statfs.h> | ||
| 1738 | +#include <stddef.h> | ||
| 1739 | +#include <sysdep.h> | ||
| 1740 | + | ||
| 1741 | + | ||
| 1742 | +# if __ASSUME_STATFS64 == 0 | ||
| 1743 | +int __no_statfs64 attribute_hidden; | ||
| 1744 | +#endif | ||
| 1745 | + | ||
| 1746 | +/* Return information about the filesystem on which FILE resides. */ | ||
| 1747 | +int | ||
| 1748 | +__statfs64 (const char *file, struct statfs64 *buf) | ||
| 1749 | +{ | ||
| 1750 | +#ifdef __NR_statfs64 | ||
| 1751 | +# if __ASSUME_STATFS64 == 0 | ||
| 1752 | + if (! __no_statfs64) | ||
| 1753 | +# endif | ||
| 1754 | + { | ||
| 1755 | + /* The EABI structure is the same as the old ABI structure, except | ||
| 1756 | + that it has four additional bytes of padding - at the end. We can | ||
| 1757 | + ignore them. */ | ||
| 1758 | + int result = INLINE_SYSCALL (statfs64, 3, file, sizeof (*buf) - 4, buf); | ||
| 1759 | + | ||
| 1760 | +# if __ASSUME_STATFS64 == 0 | ||
| 1761 | + if (result == 0 || errno != ENOSYS) | ||
| 1762 | +# endif | ||
| 1763 | + return result; | ||
| 1764 | + | ||
| 1765 | +# if __ASSUME_STATFS64 == 0 | ||
| 1766 | + __no_statfs64 = 1; | ||
| 1767 | +# endif | ||
| 1768 | + } | ||
| 1769 | +#endif | ||
| 1770 | + | ||
| 1771 | +#if __ASSUME_STATFS64 == 0 | ||
| 1772 | + struct statfs buf32; | ||
| 1773 | + | ||
| 1774 | + if (__statfs (file, &buf32) < 0) | ||
| 1775 | + return -1; | ||
| 1776 | + | ||
| 1777 | + buf->f_type = buf32.f_type; | ||
| 1778 | + buf->f_bsize = buf32.f_bsize; | ||
| 1779 | + buf->f_blocks = buf32.f_blocks; | ||
| 1780 | + buf->f_bfree = buf32.f_bfree; | ||
| 1781 | + buf->f_bavail = buf32.f_bavail; | ||
| 1782 | + buf->f_files = buf32.f_files; | ||
| 1783 | + buf->f_ffree = buf32.f_ffree; | ||
| 1784 | + buf->f_fsid = buf32.f_fsid; | ||
| 1785 | + buf->f_namelen = buf32.f_namelen; | ||
| 1786 | + buf->f_frsize = buf32.f_frsize; | ||
| 1787 | + memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare)); | ||
| 1788 | + | ||
| 1789 | + return 0; | ||
| 1790 | +#endif | ||
| 1791 | +} | ||
| 1792 | +weak_alias (__statfs64, statfs64) | ||
| 1793 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/uname.c | ||
| 1794 | =================================================================== | ||
| 1795 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1796 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/uname.c 2005-03-22 11:53:10.057701931 -0500 | ||
| 1797 | @@ -0,0 +1,43 @@ | ||
| 1798 | +/* Copyright (C) 2005 | ||
| 1799 | + Free Software Foundation, Inc. | ||
| 1800 | + This file is part of the GNU C Library. | ||
| 1801 | + | ||
| 1802 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1803 | + modify it under the terms of the GNU Lesser General Public | ||
| 1804 | + License as published by the Free Software Foundation; either | ||
| 1805 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1806 | + | ||
| 1807 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1808 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1809 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1810 | + Lesser General Public License for more details. | ||
| 1811 | + | ||
| 1812 | + You should have received a copy of the GNU Lesser General Public | ||
| 1813 | + License along with the GNU C Library; if not, write to the Free | ||
| 1814 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1815 | + 02111-1307 USA. */ | ||
| 1816 | + | ||
| 1817 | +#include <errno.h> | ||
| 1818 | +#include <sysdep.h> | ||
| 1819 | +#include <sys/syscall.h> | ||
| 1820 | +#include <string.h> | ||
| 1821 | +#include <sys/utsname.h> | ||
| 1822 | + | ||
| 1823 | +/* The kernel's struct utsname is two bytes larger than a userland struct | ||
| 1824 | + utsname due to the APCS structure size boundary. */ | ||
| 1825 | + | ||
| 1826 | +int | ||
| 1827 | +__uname (struct utsname *__name) | ||
| 1828 | +{ | ||
| 1829 | + char buf[sizeof (struct utsname) + 2]; | ||
| 1830 | + int result = INLINE_SYSCALL (uname, 1, buf); | ||
| 1831 | + | ||
| 1832 | + if (result == 0) | ||
| 1833 | + memcpy (__name, buf, sizeof (struct utsname)); | ||
| 1834 | + | ||
| 1835 | + return result; | ||
| 1836 | +} | ||
| 1837 | + | ||
| 1838 | +libc_hidden_def (__uname) | ||
| 1839 | +strong_alias (__uname, uname) | ||
| 1840 | +libc_hidden_weak (uname) | ||
| 1841 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/xstat64.c | ||
| 1842 | =================================================================== | ||
| 1843 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1844 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/xstat64.c 2005-03-22 11:53:10.058701689 -0500 | ||
| 1845 | @@ -0,0 +1,103 @@ | ||
| 1846 | +/* xstat64 using old-style Unix stat system call. | ||
| 1847 | + Copyright (C) 1991, 1995-2002, 2003, 2005 Free Software Foundation, Inc. | ||
| 1848 | + This file is part of the GNU C Library. | ||
| 1849 | + | ||
| 1850 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1851 | + modify it under the terms of the GNU Lesser General Public | ||
| 1852 | + License as published by the Free Software Foundation; either | ||
| 1853 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1854 | + | ||
| 1855 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1856 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1857 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1858 | + Lesser General Public License for more details. | ||
| 1859 | + | ||
| 1860 | + You should have received a copy of the GNU Lesser General Public | ||
| 1861 | + License along with the GNU C Library; if not, write to the Free | ||
| 1862 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1863 | + 02111-1307 USA. */ | ||
| 1864 | + | ||
| 1865 | +#include <errno.h> | ||
| 1866 | +#include <stddef.h> | ||
| 1867 | +#include <sys/stat.h> | ||
| 1868 | +#include <kernel_stat.h> | ||
| 1869 | + | ||
| 1870 | +#include <sysdep.h> | ||
| 1871 | +#include <sys/syscall.h> | ||
| 1872 | +#include <bp-checks.h> | ||
| 1873 | + | ||
| 1874 | +#include "kernel-features.h" | ||
| 1875 | + | ||
| 1876 | +#if __ASSUME_STAT64_SYSCALL == 0 | ||
| 1877 | +# include <xstatconv.h> | ||
| 1878 | +#endif | ||
| 1879 | + | ||
| 1880 | +#ifdef __NR_stat64 | ||
| 1881 | +# if __ASSUME_STAT64_SYSCALL == 0 | ||
| 1882 | +/* The variable is shared between all wrappers around *stat64 calls. | ||
| 1883 | + This is the definition. */ | ||
| 1884 | +int __have_no_stat64; | ||
| 1885 | +# endif | ||
| 1886 | +#endif | ||
| 1887 | + | ||
| 1888 | +/* Get information about the file NAME in BUF. */ | ||
| 1889 | + | ||
| 1890 | +int | ||
| 1891 | +___xstat64 (int vers, const char *name, struct stat64 *buf) | ||
| 1892 | +{ | ||
| 1893 | + int result; | ||
| 1894 | + struct kernel_stat64 kbuf64; | ||
| 1895 | + | ||
| 1896 | +#if __ASSUME_STAT64_SYSCALL > 0 | ||
| 1897 | + result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), CHECK_1 (&kbuf64)); | ||
| 1898 | + if (result == 0) | ||
| 1899 | + result = __xstat64_kernel64_conv (vers, &kbuf64, buf); | ||
| 1900 | +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 | ||
| 1901 | + if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino) | ||
| 1902 | + buf->st_ino = buf->__st_ino; | ||
| 1903 | +# endif | ||
| 1904 | + return result; | ||
| 1905 | +#else | ||
| 1906 | + struct kernel_stat kbuf; | ||
| 1907 | +# if defined __NR_stat64 | ||
| 1908 | + if (! __have_no_stat64) | ||
| 1909 | + { | ||
| 1910 | + int saved_errno = errno; | ||
| 1911 | + result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), CHECK_1 (&kbuf64)); | ||
| 1912 | + | ||
| 1913 | + if (result != -1 || errno != ENOSYS) | ||
| 1914 | + { | ||
| 1915 | + if (result == 0) | ||
| 1916 | + result = __xstat64_kernel64_conv (vers, &kbuf64, buf); | ||
| 1917 | +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 | ||
| 1918 | + if (!result && buf->__st_ino != (__ino_t) buf->st_ino) | ||
| 1919 | + buf->st_ino = buf->__st_ino; | ||
| 1920 | +# endif | ||
| 1921 | + return result; | ||
| 1922 | + } | ||
| 1923 | + | ||
| 1924 | + __set_errno (saved_errno); | ||
| 1925 | + __have_no_stat64 = 1; | ||
| 1926 | + } | ||
| 1927 | +# endif | ||
| 1928 | + | ||
| 1929 | + result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); | ||
| 1930 | + if (result == 0) | ||
| 1931 | + result = __xstat64_conv (vers, &kbuf, buf); | ||
| 1932 | + | ||
| 1933 | + return result; | ||
| 1934 | +#endif | ||
| 1935 | +} | ||
| 1936 | + | ||
| 1937 | + | ||
| 1938 | +#include <shlib-compat.h> | ||
| 1939 | + | ||
| 1940 | +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) | ||
| 1941 | +versioned_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2); | ||
| 1942 | +strong_alias (___xstat64, __old__xstat64) | ||
| 1943 | +compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1); | ||
| 1944 | +hidden_ver (___xstat64, __xstat64) | ||
| 1945 | +#else | ||
| 1946 | +strong_alias (___xstat64, __xstat64) | ||
| 1947 | +hidden_def (__xstat64) | ||
| 1948 | +#endif | ||
| 1949 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/xstatconv.c | ||
| 1950 | =================================================================== | ||
| 1951 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1952 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/xstatconv.c 2005-03-22 11:53:10.058701689 -0500 | ||
| 1953 | @@ -0,0 +1,341 @@ | ||
| 1954 | +/* Convert between the kernel's `struct stat' format, and libc's. | ||
| 1955 | + Copyright (C) 1991,1995-1997,2000,2002,2003 Free Software Foundation, Inc. | ||
| 1956 | + This file is part of the GNU C Library. | ||
| 1957 | + | ||
| 1958 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 1959 | + modify it under the terms of the GNU Lesser General Public | ||
| 1960 | + License as published by the Free Software Foundation; either | ||
| 1961 | + version 2.1 of the License, or (at your option) any later version. | ||
| 1962 | + | ||
| 1963 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 1964 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1965 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 1966 | + Lesser General Public License for more details. | ||
| 1967 | + | ||
| 1968 | + You should have received a copy of the GNU Lesser General Public | ||
| 1969 | + License along with the GNU C Library; if not, write to the Free | ||
| 1970 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 1971 | + 02111-1307 USA. */ | ||
| 1972 | + | ||
| 1973 | +#include <errno.h> | ||
| 1974 | +#include <sys/stat.h> | ||
| 1975 | +#include <kernel_stat.h> | ||
| 1976 | + | ||
| 1977 | +#ifdef STAT_IS_KERNEL_STAT | ||
| 1978 | + | ||
| 1979 | +/* Dummy. */ | ||
| 1980 | +struct kernel_stat; | ||
| 1981 | + | ||
| 1982 | +#else | ||
| 1983 | + | ||
| 1984 | +#include <string.h> | ||
| 1985 | + | ||
| 1986 | + | ||
| 1987 | +#if !defined __ASSUME_STAT64_SYSCALL || defined XSTAT_IS_XSTAT64 | ||
| 1988 | +int | ||
| 1989 | +__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) | ||
| 1990 | +{ | ||
| 1991 | + switch (vers) | ||
| 1992 | + { | ||
| 1993 | + case _STAT_VER_KERNEL: | ||
| 1994 | + /* Nothing to do. The struct is in the form the kernel expects. | ||
| 1995 | + We should have short-circuted before we got here, but for | ||
| 1996 | + completeness... */ | ||
| 1997 | + *(struct kernel_stat *) ubuf = *kbuf; | ||
| 1998 | + break; | ||
| 1999 | + | ||
| 2000 | + case _STAT_VER_LINUX: | ||
| 2001 | + { | ||
| 2002 | + struct stat *buf = ubuf; | ||
| 2003 | + | ||
| 2004 | + /* Convert to current kernel version of `struct stat'. */ | ||
| 2005 | + buf->st_dev = kbuf->st_dev; | ||
| 2006 | +#ifdef _HAVE_STAT___PAD1 | ||
| 2007 | + buf->__pad1 = 0; | ||
| 2008 | +#endif | ||
| 2009 | + buf->st_ino = kbuf->st_ino; | ||
| 2010 | + buf->st_mode = kbuf->st_mode; | ||
| 2011 | + buf->st_nlink = kbuf->st_nlink; | ||
| 2012 | + buf->st_uid = kbuf->st_uid; | ||
| 2013 | + buf->st_gid = kbuf->st_gid; | ||
| 2014 | + buf->st_rdev = kbuf->st_rdev; | ||
| 2015 | +#ifdef _HAVE_STAT___PAD2 | ||
| 2016 | + buf->__pad2 = 0; | ||
| 2017 | +#endif | ||
| 2018 | + buf->st_size = kbuf->st_size; | ||
| 2019 | + buf->st_blksize = kbuf->st_blksize; | ||
| 2020 | + buf->st_blocks = kbuf->st_blocks; | ||
| 2021 | +#ifdef _HAVE_STAT_NSEC | ||
| 2022 | + buf->st_atim.tv_sec = kbuf->st_atim.tv_sec; | ||
| 2023 | + buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec; | ||
| 2024 | + buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec; | ||
| 2025 | + buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec; | ||
| 2026 | + buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec; | ||
| 2027 | + buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; | ||
| 2028 | +#else | ||
| 2029 | + buf->st_atime = kbuf->st_atime; | ||
| 2030 | + buf->st_mtime = kbuf->st_mtime; | ||
| 2031 | + buf->st_ctime = kbuf->st_ctime; | ||
| 2032 | +#endif | ||
| 2033 | +#ifdef _HAVE_STAT___UNUSED1 | ||
| 2034 | + buf->__unused1 = 0; | ||
| 2035 | +#endif | ||
| 2036 | +#ifdef _HAVE_STAT___UNUSED2 | ||
| 2037 | + buf->__unused2 = 0; | ||
| 2038 | +#endif | ||
| 2039 | +#ifdef _HAVE_STAT___UNUSED3 | ||
| 2040 | + buf->__unused3 = 0; | ||
| 2041 | +#endif | ||
| 2042 | +#ifdef _HAVE_STAT___UNUSED4 | ||
| 2043 | + buf->__unused4 = 0; | ||
| 2044 | +#endif | ||
| 2045 | +#ifdef _HAVE_STAT___UNUSED5 | ||
| 2046 | + buf->__unused5 = 0; | ||
| 2047 | +#endif | ||
| 2048 | + } | ||
| 2049 | + break; | ||
| 2050 | + | ||
| 2051 | + default: | ||
| 2052 | + __set_errno (EINVAL); | ||
| 2053 | + return -1; | ||
| 2054 | + } | ||
| 2055 | + | ||
| 2056 | + return 0; | ||
| 2057 | +} | ||
| 2058 | +#endif | ||
| 2059 | + | ||
| 2060 | +int | ||
| 2061 | +__xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf) | ||
| 2062 | +{ | ||
| 2063 | +#ifdef XSTAT_IS_XSTAT64 | ||
| 2064 | + return __xstat_conv (vers, kbuf, ubuf); | ||
| 2065 | +#else | ||
| 2066 | + switch (vers) | ||
| 2067 | + { | ||
| 2068 | + case _STAT_VER_LINUX: | ||
| 2069 | + { | ||
| 2070 | + struct stat64 *buf = ubuf; | ||
| 2071 | + | ||
| 2072 | + /* Convert to current kernel version of `struct stat64'. */ | ||
| 2073 | + buf->st_dev = kbuf->st_dev; | ||
| 2074 | +#ifdef _HAVE_STAT64___PAD1 | ||
| 2075 | + buf->__pad1 = 0; | ||
| 2076 | +#endif | ||
| 2077 | + buf->st_ino = kbuf->st_ino; | ||
| 2078 | +#ifdef _HAVE_STAT64___ST_INO | ||
| 2079 | + buf->__st_ino = kbuf->st_ino; | ||
| 2080 | +#endif | ||
| 2081 | + buf->st_mode = kbuf->st_mode; | ||
| 2082 | + buf->st_nlink = kbuf->st_nlink; | ||
| 2083 | + buf->st_uid = kbuf->st_uid; | ||
| 2084 | + buf->st_gid = kbuf->st_gid; | ||
| 2085 | + buf->st_rdev = kbuf->st_rdev; | ||
| 2086 | +#ifdef _HAVE_STAT64___PAD2 | ||
| 2087 | + buf->__pad2 = 0; | ||
| 2088 | +#endif | ||
| 2089 | + buf->st_size = kbuf->st_size; | ||
| 2090 | + buf->st_blksize = kbuf->st_blksize; | ||
| 2091 | + buf->st_blocks = kbuf->st_blocks; | ||
| 2092 | +#ifdef _HAVE_STAT64_NSEC | ||
| 2093 | + buf->st_atim.tv_sec = kbuf->st_atim.tv_sec; | ||
| 2094 | + buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec; | ||
| 2095 | + buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec; | ||
| 2096 | + buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec; | ||
| 2097 | + buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec; | ||
| 2098 | + buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; | ||
| 2099 | +#else | ||
| 2100 | + buf->st_atime = kbuf->st_atime; | ||
| 2101 | + buf->st_mtime = kbuf->st_mtime; | ||
| 2102 | + buf->st_ctime = kbuf->st_ctime; | ||
| 2103 | +#endif | ||
| 2104 | +#ifdef _HAVE_STAT64___UNUSED1 | ||
| 2105 | + buf->__unused1 = 0; | ||
| 2106 | +#endif | ||
| 2107 | +#ifdef _HAVE_STAT64___UNUSED2 | ||
| 2108 | + buf->__unused2 = 0; | ||
| 2109 | +#endif | ||
| 2110 | +#ifdef _HAVE_STAT64___UNUSED3 | ||
| 2111 | + buf->__unused3 = 0; | ||
| 2112 | +#endif | ||
| 2113 | +#ifdef _HAVE_STAT64___UNUSED4 | ||
| 2114 | + buf->__unused4 = 0; | ||
| 2115 | +#endif | ||
| 2116 | +#ifdef _HAVE_STAT64___UNUSED5 | ||
| 2117 | + buf->__unused5 = 0; | ||
| 2118 | +#endif | ||
| 2119 | + } | ||
| 2120 | + break; | ||
| 2121 | + | ||
| 2122 | + /* If struct stat64 is different from struct stat then | ||
| 2123 | + _STAT_VER_KERNEL does not make sense. */ | ||
| 2124 | + case _STAT_VER_KERNEL: | ||
| 2125 | + default: | ||
| 2126 | + __set_errno (EINVAL); | ||
| 2127 | + return -1; | ||
| 2128 | + } | ||
| 2129 | + | ||
| 2130 | + return 0; | ||
| 2131 | +#endif | ||
| 2132 | +} | ||
| 2133 | + | ||
| 2134 | +int | ||
| 2135 | +__xstat32_conv (int vers, void *kbuf_, struct stat *buf) | ||
| 2136 | +{ | ||
| 2137 | + struct kernel_stat64 *kbuf = kbuf_; | ||
| 2138 | + | ||
| 2139 | + switch (vers) | ||
| 2140 | + { | ||
| 2141 | + case _STAT_VER_LINUX: | ||
| 2142 | + { | ||
| 2143 | + /* Convert current kernel version of `struct stat64' to | ||
| 2144 | + `struct stat'. */ | ||
| 2145 | + buf->st_dev = kbuf->st_dev; | ||
| 2146 | +#ifdef _HAVE_STAT___PAD1 | ||
| 2147 | + buf->__pad1 = 0; | ||
| 2148 | +#endif | ||
| 2149 | +#ifdef _HAVE_STAT64___ST_INO | ||
| 2150 | +# if __ASSUME_ST_INO_64_BIT == 0 | ||
| 2151 | + if (kbuf->st_ino == 0) | ||
| 2152 | + buf->st_ino = kbuf->__st_ino; | ||
| 2153 | + else | ||
| 2154 | +# endif | ||
| 2155 | + { | ||
| 2156 | + buf->st_ino = kbuf->st_ino; | ||
| 2157 | + if (sizeof (buf->st_ino) != sizeof (kbuf->st_ino) | ||
| 2158 | + && buf->st_ino != kbuf->st_ino) | ||
| 2159 | + { | ||
| 2160 | + __set_errno (EOVERFLOW); | ||
| 2161 | + return -1; | ||
| 2162 | + } | ||
| 2163 | + } | ||
| 2164 | +#else | ||
| 2165 | + buf->st_ino = kbuf->st_ino; | ||
| 2166 | + if (sizeof (buf->st_ino) != sizeof (kbuf->st_ino) | ||
| 2167 | + && buf->st_ino != kbuf->st_ino) | ||
| 2168 | + { | ||
| 2169 | + __set_errno (EOVERFLOW); | ||
| 2170 | + return -1; | ||
| 2171 | + } | ||
| 2172 | +#endif | ||
| 2173 | + buf->st_mode = kbuf->st_mode; | ||
| 2174 | + buf->st_nlink = kbuf->st_nlink; | ||
| 2175 | + buf->st_uid = kbuf->st_uid; | ||
| 2176 | + buf->st_gid = kbuf->st_gid; | ||
| 2177 | + buf->st_rdev = kbuf->st_rdev; | ||
| 2178 | +#ifdef _HAVE_STAT___PAD2 | ||
| 2179 | + buf->__pad2 = 0; | ||
| 2180 | +#endif | ||
| 2181 | + buf->st_size = kbuf->st_size; | ||
| 2182 | + /* Check for overflow. */ | ||
| 2183 | + if (sizeof (buf->st_size) != sizeof (kbuf->st_size) | ||
| 2184 | + && buf->st_size != kbuf->st_size) | ||
| 2185 | + { | ||
| 2186 | + __set_errno (EOVERFLOW); | ||
| 2187 | + return -1; | ||
| 2188 | + } | ||
| 2189 | + buf->st_blksize = kbuf->st_blksize; | ||
| 2190 | + buf->st_blocks = kbuf->st_blocks; | ||
| 2191 | + /* Check for overflow. */ | ||
| 2192 | + if (sizeof (buf->st_blocks) != sizeof (kbuf->st_blocks) | ||
| 2193 | + && buf->st_blocks != kbuf->st_blocks) | ||
| 2194 | + { | ||
| 2195 | + __set_errno (EOVERFLOW); | ||
| 2196 | + return -1; | ||
| 2197 | + } | ||
| 2198 | +#ifdef _HAVE_STAT_NSEC | ||
| 2199 | + buf->st_atim.tv_sec = kbuf->st_atim.tv_sec; | ||
| 2200 | + buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec; | ||
| 2201 | + buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec; | ||
| 2202 | + buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec; | ||
| 2203 | + buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec; | ||
| 2204 | + buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; | ||
| 2205 | +#else | ||
| 2206 | + buf->st_atime = kbuf->st_atime; | ||
| 2207 | + buf->st_mtime = kbuf->st_mtime; | ||
| 2208 | + buf->st_ctime = kbuf->st_ctime; | ||
| 2209 | +#endif | ||
| 2210 | + | ||
| 2211 | +#ifdef _HAVE_STAT___UNUSED1 | ||
| 2212 | + buf->__unused1 = 0; | ||
| 2213 | +#endif | ||
| 2214 | +#ifdef _HAVE_STAT___UNUSED2 | ||
| 2215 | + buf->__unused2 = 0; | ||
| 2216 | +#endif | ||
| 2217 | +#ifdef _HAVE_STAT___UNUSED3 | ||
| 2218 | + buf->__unused3 = 0; | ||
| 2219 | +#endif | ||
| 2220 | +#ifdef _HAVE_STAT___UNUSED4 | ||
| 2221 | + buf->__unused4 = 0; | ||
| 2222 | +#endif | ||
| 2223 | +#ifdef _HAVE_STAT___UNUSED5 | ||
| 2224 | + buf->__unused5 = 0; | ||
| 2225 | +#endif | ||
| 2226 | + } | ||
| 2227 | + break; | ||
| 2228 | + | ||
| 2229 | + /* If struct stat64 is different from struct stat then | ||
| 2230 | + _STAT_VER_KERNEL does not make sense. */ | ||
| 2231 | + case _STAT_VER_KERNEL: | ||
| 2232 | + default: | ||
| 2233 | + __set_errno (EINVAL); | ||
| 2234 | + return -1; | ||
| 2235 | + } | ||
| 2236 | + | ||
| 2237 | + return 0; | ||
| 2238 | +} | ||
| 2239 | + | ||
| 2240 | +int | ||
| 2241 | +__xstat64_kernel64_conv (int vers, void *kbuf_, struct stat64 *buf) | ||
| 2242 | +{ | ||
| 2243 | + struct kernel_stat64 *kbuf = kbuf_; | ||
| 2244 | + | ||
| 2245 | + switch (vers) | ||
| 2246 | + { | ||
| 2247 | + case _STAT_VER_LINUX: | ||
| 2248 | + { | ||
| 2249 | + /* Convert current kernel version of `struct stat64' to | ||
| 2250 | + user version of `struct stat64'. */ | ||
| 2251 | + buf->st_dev = kbuf->st_dev; | ||
| 2252 | +#ifdef _HAVE_STAT64___PAD1 | ||
| 2253 | + buf->__pad1 = kbuf->__pad1; | ||
| 2254 | +#endif | ||
| 2255 | +#ifdef _HAVE_STAT64___ST_INO | ||
| 2256 | + buf->__st_ino = kbuf->__st_ino; | ||
| 2257 | +#endif | ||
| 2258 | + buf->st_mode = kbuf->st_mode; | ||
| 2259 | + buf->st_nlink = kbuf->st_nlink; | ||
| 2260 | + buf->st_uid = kbuf->st_uid; | ||
| 2261 | + buf->st_gid = kbuf->st_gid; | ||
| 2262 | + buf->st_rdev = kbuf->st_rdev; | ||
| 2263 | +#ifdef _HAVE_STAT64___PAD2 | ||
| 2264 | + buf->__pad2 = kbuf->__pad2; | ||
| 2265 | +#endif | ||
| 2266 | + buf->st_size = kbuf->st_size; | ||
| 2267 | + buf->st_blksize = kbuf->st_blksize; | ||
| 2268 | + buf->st_blocks = kbuf->st_blocks; | ||
| 2269 | +#ifdef _HAVE_STAT64_NSEC | ||
| 2270 | + buf->st_atim.tv_sec = kbuf->st_atim.tv_sec; | ||
| 2271 | + buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec; | ||
| 2272 | + buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec; | ||
| 2273 | + buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec; | ||
| 2274 | + buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec; | ||
| 2275 | + buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; | ||
| 2276 | +#else | ||
| 2277 | + buf->st_atime = kbuf->st_atime; | ||
| 2278 | + buf->st_mtime = kbuf->st_mtime; | ||
| 2279 | + buf->st_ctime = kbuf->st_ctime; | ||
| 2280 | +#endif | ||
| 2281 | + buf->st_ino = kbuf->st_ino; | ||
| 2282 | + } | ||
| 2283 | + break; | ||
| 2284 | + | ||
| 2285 | + case _STAT_VER_KERNEL: | ||
| 2286 | + default: | ||
| 2287 | + __set_errno (EINVAL); | ||
| 2288 | + return -1; | ||
| 2289 | + } | ||
| 2290 | + | ||
| 2291 | + return 0; | ||
| 2292 | +} | ||
| 2293 | + | ||
| 2294 | +#endif | ||
| 2295 | Index: glibc/sysdeps/unix/sysv/linux/arm/eabi/xstatconv.h | ||
| 2296 | =================================================================== | ||
| 2297 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 2298 | +++ glibc/sysdeps/unix/sysv/linux/arm/eabi/xstatconv.h 2005-03-22 11:53:10.058701689 -0500 | ||
| 2299 | @@ -0,0 +1,28 @@ | ||
| 2300 | +/* Convert between the kernel's `struct stat' format, and libc's. | ||
| 2301 | + Copyright (C) 1991,1995-1997,2000,2002,2003 Free Software Foundation, Inc. | ||
| 2302 | + This file is part of the GNU C Library. | ||
| 2303 | + | ||
| 2304 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 2305 | + modify it under the terms of the GNU Lesser General Public | ||
| 2306 | + License as published by the Free Software Foundation; either | ||
| 2307 | + version 2.1 of the License, or (at your option) any later version. | ||
| 2308 | + | ||
| 2309 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 2310 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2311 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 2312 | + Lesser General Public License for more details. | ||
| 2313 | + | ||
| 2314 | + You should have received a copy of the GNU Lesser General Public | ||
| 2315 | + License along with the GNU C Library; if not, write to the Free | ||
| 2316 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 2317 | + 02111-1307 USA. */ | ||
| 2318 | + | ||
| 2319 | +#include "kernel-features.h" | ||
| 2320 | + | ||
| 2321 | +#ifndef STAT_IS_KERNEL_STAT | ||
| 2322 | +extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf); | ||
| 2323 | +extern int __xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf); | ||
| 2324 | +#endif | ||
| 2325 | +extern int __xstat32_conv (int vers, void *kbuf, struct stat *buf); | ||
| 2326 | +extern int __xstat64_kernel64_conv (int vers, struct kernel_stat64 *kbuf, | ||
| 2327 | + struct stat64 *buf); | ||
| 2328 | Index: glibc/sysdeps/arm/eabi/fpu/fraiseexcpt.c | ||
| 2329 | =================================================================== | ||
| 2330 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 2331 | +++ glibc/sysdeps/arm/eabi/fpu/fraiseexcpt.c 2005-03-22 12:34:55.522464918 -0500 | ||
| 2332 | @@ -0,0 +1,67 @@ | ||
| 2333 | +/* Raise given exceptions. | ||
| 2334 | + Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 2335 | + This file is part of the GNU C Library. | ||
| 2336 | + | ||
| 2337 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 2338 | + modify it under the terms of the GNU Lesser General Public | ||
| 2339 | + License as published by the Free Software Foundation; either | ||
| 2340 | + version 2.1 of the License, or (at your option) any later version. | ||
| 2341 | + | ||
| 2342 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 2343 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2344 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 2345 | + Lesser General Public License for more details. | ||
| 2346 | + | ||
| 2347 | + You should have received a copy of the GNU Lesser General Public | ||
| 2348 | + License along with the GNU C Library; if not, write to the Free | ||
| 2349 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 2350 | + 02111-1307 USA. */ | ||
| 2351 | + | ||
| 2352 | +#include <fpu_control.h> | ||
| 2353 | +#include <fenv.h> | ||
| 2354 | +#include <float.h> | ||
| 2355 | + | ||
| 2356 | +int | ||
| 2357 | +feraiseexcept (int excepts) | ||
| 2358 | +{ | ||
| 2359 | + float dummy; | ||
| 2360 | + int fpscr; | ||
| 2361 | + | ||
| 2362 | + /* Raise exceptions represented by EXPECTS. But we must raise only | ||
| 2363 | + one signal at a time. It is important that if the overflow/underflow | ||
| 2364 | + exception and the inexact exception are given at the same time, | ||
| 2365 | + the overflow/underflow exception follows the inexact exception. After | ||
| 2366 | + each exception we read from the fpscr, to force the exception to be | ||
| 2367 | + raised immediately. */ | ||
| 2368 | + | ||
| 2369 | + /* First: invalid exception. */ | ||
| 2370 | + if (FE_INVALID & excepts) | ||
| 2371 | + __asm__ __volatile__ ("fdivs %0,%2,%3\n\tfmrx %1, fpscr" | ||
| 2372 | + : "=w" (dummy), "=r" (fpscr) : "w" (0.0f), "w" (0.0f) ); | ||
| 2373 | + | ||
| 2374 | + /* Next: division by zero. */ | ||
| 2375 | + if (FE_DIVBYZERO & excepts) | ||
| 2376 | + __asm__ __volatile__ ("fdivs %0,%2,%3\n\tfmrx %1, fpscr" | ||
| 2377 | + : "=w" (dummy), "=r" (fpscr) : "w" (1.0f), "w" (0.0f) ); | ||
| 2378 | + | ||
| 2379 | + /* Next: overflow. */ | ||
| 2380 | + if (FE_OVERFLOW & excepts) | ||
| 2381 | + /* There's no way to raise overflow without also raising inexact. */ | ||
| 2382 | + __asm__ __volatile__ ("fadds %0,%2,%3\n\tfmrx %1, fpscr" | ||
| 2383 | + : "=w" (dummy), "=r" (fpscr) : "w" (FLT_MAX), "w" (1.0e32f) ); | ||
| 2384 | + | ||
| 2385 | + /* Next: underflow. */ | ||
| 2386 | + if (FE_UNDERFLOW & excepts) | ||
| 2387 | + __asm__ __volatile__ ("fdivs %0,%2,%3\n\tfmrx %1, fpscr" | ||
| 2388 | + : "=w" (dummy), "=r" (fpscr) : "w" (FLT_MIN), "w" (3.0f) ); | ||
| 2389 | + | ||
| 2390 | + /* Last: inexact. */ | ||
| 2391 | + if (FE_INEXACT & excepts) | ||
| 2392 | + __asm__ __volatile__ ("fdivs %0,%2,%3\n\tfmrx %1, fpscr" | ||
| 2393 | + : "=w" (dummy), "=r" (fpscr) : "w" (2.0f), "w" (3.0f) ); | ||
| 2394 | + | ||
| 2395 | + /* Success. */ | ||
| 2396 | + return 0; | ||
| 2397 | +} | ||
| 2398 | + | ||
| 2399 | +libm_hidden_def (feraiseexcept) | ||
| 2400 | Index: glibc/sysdeps/arm/eabi/fpu/feholdexcpt.c | ||
| 2401 | =================================================================== | ||
| 2402 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 2403 | +++ glibc/sysdeps/arm/eabi/fpu/feholdexcpt.c 2005-03-22 12:34:55.521465156 -0500 | ||
| 2404 | @@ -0,0 +1,41 @@ | ||
| 2405 | +/* Store current floating-point environment and clear exceptions. | ||
| 2406 | + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. | ||
| 2407 | + This file is part of the GNU C Library. | ||
| 2408 | + | ||
| 2409 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 2410 | + modify it under the terms of the GNU Lesser General Public | ||
| 2411 | + License as published by the Free Software Foundation; either | ||
| 2412 | + version 2.1 of the License, or (at your option) any later version. | ||
| 2413 | + | ||
| 2414 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 2415 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2416 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 2417 | + Lesser General Public License for more details. | ||
| 2418 | + | ||
| 2419 | + You should have received a copy of the GNU Lesser General Public | ||
| 2420 | + License along with the GNU C Library; if not, write to the Free | ||
| 2421 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 2422 | + 02111-1307 USA. */ | ||
| 2423 | + | ||
| 2424 | +#include <fenv.h> | ||
| 2425 | +#include <fpu_control.h> | ||
| 2426 | + | ||
| 2427 | +int | ||
| 2428 | +feholdexcept (fenv_t *envp) | ||
| 2429 | +{ | ||
| 2430 | + unsigned long int temp; | ||
| 2431 | + | ||
| 2432 | + /* Store the environment. */ | ||
| 2433 | + _FPU_GETCW(temp); | ||
| 2434 | + envp->__cw = temp; | ||
| 2435 | + | ||
| 2436 | + /* Now set all exceptions to non-stop. */ | ||
| 2437 | + temp &= ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT); | ||
| 2438 | + | ||
| 2439 | + /* And clear all exception flags. */ | ||
| 2440 | + temp &= ~FE_ALL_EXCEPT; | ||
| 2441 | + | ||
| 2442 | + _FPU_SETCW(temp); | ||
| 2443 | + | ||
| 2444 | + return 0; | ||
| 2445 | +} | ||
| 2446 | |||
