diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-07-01 13:06:41 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-07-01 13:06:41 +0000 |
commit | e64ac02c24b43659048622714afdc92fedf561fa (patch) | |
tree | 37162878b72d302de351788bec4c9360c9d55f1d /ports/sysdeps/unix | |
parent | a20c2b3c87aebc7d4b090c622d36480263b80042 (diff) | |
download | glibc-e64ac02c24b43659048622714afdc92fedf561fa.tar.gz glibc-e64ac02c24b43659048622714afdc92fedf561fa.tar.xz glibc-e64ac02c24b43659048622714afdc92fedf561fa.zip |
Move all files into ports/ subdirectory in preparation for merge with glibc glibc-2.16-ports-before-merge
Diffstat (limited to 'ports/sysdeps/unix')
1015 files changed, 89885 insertions, 0 deletions
diff --git a/ports/sysdeps/unix/alpha/Makefile b/ports/sysdeps/unix/alpha/Makefile new file mode 100644 index 0000000000..441aa02a83 --- /dev/null +++ b/ports/sysdeps/unix/alpha/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),rt) +librt-sysdep_routines += rt-sysdep +endif diff --git a/ports/sysdeps/unix/alpha/getegid.S b/ports/sysdeps/unix/alpha/getegid.S new file mode 100644 index 0000000000..a564f6c7a7 --- /dev/null +++ b/ports/sysdeps/unix/alpha/getegid.S @@ -0,0 +1,26 @@ +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + +PSEUDO (__getegid, getxgid, 0) + MOVE (r1, r0) + ret +PSEUDO_END (__getegid) + +weak_alias (__getegid, getegid) diff --git a/ports/sysdeps/unix/alpha/geteuid.S b/ports/sysdeps/unix/alpha/geteuid.S new file mode 100644 index 0000000000..289acbd1e3 --- /dev/null +++ b/ports/sysdeps/unix/alpha/geteuid.S @@ -0,0 +1,26 @@ +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + +PSEUDO (__geteuid, getxuid, 0) + MOVE (r1, r0) + ret +PSEUDO_END (__geteuid) + +weak_alias (__geteuid, geteuid) diff --git a/ports/sysdeps/unix/alpha/getppid.S b/ports/sysdeps/unix/alpha/getppid.S new file mode 100644 index 0000000000..8f7e7746de --- /dev/null +++ b/ports/sysdeps/unix/alpha/getppid.S @@ -0,0 +1,26 @@ +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + +PSEUDO (__getppid, getxpid, 0) + MOVE (r1, r0) + ret +PSEUDO_END (__getppid) + +weak_alias (__getppid, getppid) diff --git a/ports/sysdeps/unix/alpha/pipe.S b/ports/sysdeps/unix/alpha/pipe.S new file mode 100644 index 0000000000..b3b53a7687 --- /dev/null +++ b/ports/sysdeps/unix/alpha/pipe.S @@ -0,0 +1,31 @@ +/* Copyright (C) 1993, 1995, 1997, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger (davidm@cs.arizona.edu). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* __pipe is a special syscall since it returns two values. */ + +#include <sysdep.h> + +PSEUDO (__pipe, pipe, 0) + stl r0, 0(a0) + stl r1, 4(a0) + mov zero, v0 + ret +PSEUDO_END(__pipe) + +libc_hidden_def (__pipe) +weak_alias (__pipe, pipe) diff --git a/ports/sysdeps/unix/alpha/rt-sysdep.S b/ports/sysdeps/unix/alpha/rt-sysdep.S new file mode 100644 index 0000000000..f966bf1e59 --- /dev/null +++ b/ports/sysdeps/unix/alpha/rt-sysdep.S @@ -0,0 +1 @@ +#include <sysdep.S> diff --git a/ports/sysdeps/unix/alpha/sysdep.S b/ports/sysdeps/unix/alpha/sysdep.S new file mode 100644 index 0000000000..2e5e776268 --- /dev/null +++ b/ports/sysdeps/unix/alpha/sysdep.S @@ -0,0 +1,66 @@ +/* Copyright (C) 1993, 1996, 1998, 2002, 2003, 2004, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <features.h> + +#if defined(PIC) + /* Put this at the end of libc's text segment so that all of + the direct branches from the syscalls are forward, and + thus predicted not taken. */ + .section .text.last, "ax", @progbits +#else + .text +#endif + +#ifndef NOT_IN_libc +# define SYSCALL_ERROR_ERRNO __libc_errno +#else +# define SYSCALL_ERROR_ERRNO errno +#endif + + .align 4 + .globl __syscall_error + .ent __syscall_error +__syscall_error: + /* When building a shared library, we branch here without having + loaded the GP. Nor, since it was a direct branch, have we + loaded PV with our address. + + When building a static library, we tail call here from another + object file, possibly with a different GP, and must return with + the GP of our caller in place so that linker relaxation works. + + Both issues are solved by computing the GP into T1 instead of + clobbering the traditional GP register. */ + .prologue 0 + mov v0, t0 + br t1, 1f +1: ldah t1, 0(t1) !gpdisp!1 + call_pal PAL_rduniq + + lda t1, 0(t1) !gpdisp!1 + ldq t1, SYSCALL_ERROR_ERRNO(t1) !gottprel + addq v0, t1, t1 + lda v0, -1 + + stl t0, 0(t1) + ret + + .end __syscall_error diff --git a/ports/sysdeps/unix/alpha/sysdep.h b/ports/sysdeps/unix/alpha/sysdep.h new file mode 100644 index 0000000000..4ee0746acc --- /dev/null +++ b/ports/sysdeps/unix/alpha/sysdep.h @@ -0,0 +1,385 @@ +/* Copyright (C) 1992-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/sysdep.h> + +#ifdef __ASSEMBLER__ + +#ifdef __linux__ +# include <alpha/regdef.h> +#else +# include <regdef.h> +#endif + +#ifdef IS_IN_rtld +# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ +#endif + + +#define __LABEL(x) x##: + +#define LEAF(name, framesize) \ + .globl name; \ + .align 4; \ + .ent name, 0; \ + __LABEL(name) \ + .frame sp, framesize, ra + +#define ENTRY(name) \ + .globl name; \ + .align 4; \ + .ent name, 0; \ + __LABEL(name) \ + .frame sp, 0, ra + +/* Mark the end of function SYM. */ +#undef END +#define END(sym) .end sym + +#ifdef PROF +# define PSEUDO_PROLOGUE \ + .frame sp, 0, ra; \ + ldgp gp,0(pv); \ + .set noat; \ + lda AT,_mcount; \ + jsr AT,(AT),_mcount; \ + .set at; \ + .prologue 1 +#elif defined PIC +# define PSEUDO_PROLOGUE \ + .frame sp, 0, ra; \ + .prologue 0 +#else +# define PSEUDO_PROLOGUE \ + .frame sp, 0, ra; \ + ldgp gp,0(pv); \ + .prologue 1 +#endif /* PROF */ + +#ifdef PROF +# define USEPV_PROF std +#else +# define USEPV_PROF no +#endif + +#if RTLD_PRIVATE_ERRNO +# define SYSCALL_ERROR_LABEL $syscall_error +# define SYSCALL_ERROR_HANDLER \ + stl v0, rtld_errno(gp) !gprel; \ + lda v0, -1; \ + ret +#elif defined(PIC) +# define SYSCALL_ERROR_LABEL __syscall_error !samegp +# define SYSCALL_ERROR_HANDLER +#else +# define SYSCALL_ERROR_LABEL $syscall_error +# define SYSCALL_ERROR_HANDLER \ + jmp $31, __syscall_error +#endif /* RTLD_PRIVATE_ERRNO */ + +/* Overridden by specific syscalls. */ +#undef PSEUDO_PREPARE_ARGS +#define PSEUDO_PREPARE_ARGS /* Nothing. */ + +#define PSEUDO(name, syscall_name, args) \ + .globl name; \ + .align 4; \ + .ent name,0; \ +__LABEL(name) \ + PSEUDO_PROLOGUE; \ + PSEUDO_PREPARE_ARGS \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; \ + bne a3, SYSCALL_ERROR_LABEL + +#undef PSEUDO_END +#if defined(PIC) && !RTLD_PRIVATE_ERRNO +# define PSEUDO_END(sym) END(sym) +#else +# define PSEUDO_END(sym) \ +$syscall_error: \ + SYSCALL_ERROR_HANDLER; \ + END(sym) +#endif + +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .globl name; \ + .align 4; \ + .ent name,0; \ +__LABEL(name) \ + PSEUDO_PROLOGUE; \ + PSEUDO_PREPARE_ARGS \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(sym) END(sym) + +#define ret_NOERRNO ret + +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .globl name; \ + .align 4; \ + .ent name,0; \ +__LABEL(name) \ + PSEUDO_PROLOGUE; \ + PSEUDO_PREPARE_ARGS \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(sym) END(sym) + +#define ret_ERRVAL ret + +#define r0 v0 +#define r1 a4 + +#define MOVE(x,y) mov x,y + +#else /* !ASSEMBLER */ + +/* ??? Linux needs to be able to override INLINE_SYSCALL for one + particular special case. Make this easy. */ + +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + INLINE_SYSCALL1(name, nr, args) + +#define INLINE_SYSCALL1(name, nr, args...) \ +({ \ + long _sc_ret, _sc_err; \ + inline_syscall##nr(__NR_##name, args); \ + if (__builtin_expect (_sc_err, 0)) \ + { \ + __set_errno (_sc_ret); \ + _sc_ret = -1L; \ + } \ + _sc_ret; \ +}) + +#define INTERNAL_SYSCALL(name, err_out, nr, args...) \ + INTERNAL_SYSCALL1(name, err_out, nr, args) + +#define INTERNAL_SYSCALL1(name, err_out, nr, args...) \ + INTERNAL_SYSCALL_NCS(__NR_##name, err_out, nr, args) + +#define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \ +({ \ + long _sc_ret, _sc_err; \ + inline_syscall##nr(name, args); \ + err_out = _sc_err; \ + _sc_ret; \ +}) + +#define INTERNAL_SYSCALL_DECL(err) \ + long int err __attribute__((unused)) + +/* The normal Alpha calling convention sign-extends 32-bit quantties + no matter what the "real" sign of the 32-bit type. We want to + preserve that when filling in values for the kernel. */ +#define syscall_promote(arg) \ + (sizeof(arg) == 4 ? (long)(int)(long)(arg) : (long)(arg)) + +/* Make sure and "use" the variable that we're not returning, + in order to suppress unused variable warnings. */ +#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void)val, err) +#define INTERNAL_SYSCALL_ERRNO(val, err) ((void)err, val) + +#define inline_syscall_clobbers \ + "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \ + "$22", "$23", "$24", "$25", "$27", "$28", "memory" + +/* It is moderately important optimization-wise to limit the lifetime + of the hard-register variables as much as possible. Thus we copy + in/out as close to the asm as possible. */ + +#define inline_syscall0(name, args...) \ +{ \ + register long _sc_19 __asm__("$19"); \ + register long _sc_0 = name; \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2" \ + : "+v"(_sc_0), "=r"(_sc_19) \ + : : inline_syscall_clobbers, \ + "$16", "$17", "$18", "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +#define inline_syscall1(name,arg1) \ +{ \ + register long _tmp_16 = syscall_promote (arg1); \ + register long _sc_0 = name; \ + register long _sc_16 __asm__("$16") = _tmp_16; \ + register long _sc_19 __asm__("$19"); \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3" \ + : "+v"(_sc_0), "=r"(_sc_19), "+r"(_sc_16) \ + : : inline_syscall_clobbers, \ + "$17", "$18", "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +#define inline_syscall2(name,arg1,arg2) \ +{ \ + register long _tmp_16 = syscall_promote (arg1); \ + register long _tmp_17 = syscall_promote (arg2); \ + register long _sc_0 = name; \ + register long _sc_16 __asm__("$16") = _tmp_16; \ + register long _sc_17 __asm__("$17") = _tmp_17; \ + register long _sc_19 __asm__("$19"); \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4" \ + : "+v"(_sc_0), "=r"(_sc_19), \ + "+r"(_sc_16), "+r"(_sc_17) \ + : : inline_syscall_clobbers, \ + "$18", "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +#define inline_syscall3(name,arg1,arg2,arg3) \ +{ \ + register long _tmp_16 = syscall_promote (arg1); \ + register long _tmp_17 = syscall_promote (arg2); \ + register long _tmp_18 = syscall_promote (arg3); \ + register long _sc_0 = name; \ + register long _sc_16 __asm__("$16") = _tmp_16; \ + register long _sc_17 __asm__("$17") = _tmp_17; \ + register long _sc_18 __asm__("$18") = _tmp_18; \ + register long _sc_19 __asm__("$19"); \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4 %5" \ + : "+v"(_sc_0), "=r"(_sc_19), "+r"(_sc_16), \ + "+r"(_sc_17), "+r"(_sc_18) \ + : : inline_syscall_clobbers, "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +#define inline_syscall4(name,arg1,arg2,arg3,arg4) \ +{ \ + register long _tmp_16 = syscall_promote (arg1); \ + register long _tmp_17 = syscall_promote (arg2); \ + register long _tmp_18 = syscall_promote (arg3); \ + register long _tmp_19 = syscall_promote (arg4); \ + register long _sc_0 = name; \ + register long _sc_16 __asm__("$16") = _tmp_16; \ + register long _sc_17 __asm__("$17") = _tmp_17; \ + register long _sc_18 __asm__("$18") = _tmp_18; \ + register long _sc_19 __asm__("$19") = _tmp_19; \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4 %5 %6" \ + : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16), \ + "+r"(_sc_17), "+r"(_sc_18) \ + : : inline_syscall_clobbers, "$20", "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \ +{ \ + register long _tmp_16 = syscall_promote (arg1); \ + register long _tmp_17 = syscall_promote (arg2); \ + register long _tmp_18 = syscall_promote (arg3); \ + register long _tmp_19 = syscall_promote (arg4); \ + register long _tmp_20 = syscall_promote (arg5); \ + register long _sc_0 = name; \ + register long _sc_16 __asm__("$16") = _tmp_16; \ + register long _sc_17 __asm__("$17") = _tmp_17; \ + register long _sc_18 __asm__("$18") = _tmp_18; \ + register long _sc_19 __asm__("$19") = _tmp_19; \ + register long _sc_20 __asm__("$20") = _tmp_20; \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7" \ + : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16), \ + "+r"(_sc_17), "+r"(_sc_18), "+r"(_sc_20) \ + : : inline_syscall_clobbers, "$21"); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ +{ \ + register long _tmp_16 = syscall_promote (arg1); \ + register long _tmp_17 = syscall_promote (arg2); \ + register long _tmp_18 = syscall_promote (arg3); \ + register long _tmp_19 = syscall_promote (arg4); \ + register long _tmp_20 = syscall_promote (arg5); \ + register long _tmp_21 = syscall_promote (arg6); \ + register long _sc_0 = name; \ + register long _sc_16 __asm__("$16") = _tmp_16; \ + register long _sc_17 __asm__("$17") = _tmp_17; \ + register long _sc_18 __asm__("$18") = _tmp_18; \ + register long _sc_19 __asm__("$19") = _tmp_19; \ + register long _sc_20 __asm__("$20") = _tmp_20; \ + register long _sc_21 __asm__("$21") = _tmp_21; \ + __asm__ __volatile__ \ + ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8" \ + : "+v"(_sc_0), "+r"(_sc_19), "+r"(_sc_16), \ + "+r"(_sc_17), "+r"(_sc_18), "+r"(_sc_20), \ + "+r"(_sc_21) \ + : : inline_syscall_clobbers); \ + _sc_ret = _sc_0, _sc_err = _sc_19; \ +} + +/* Pointer mangling support. Note that tls access is slow enough that + we don't deoptimize things by placing the pointer check value there. */ + +#include <stdint.h> + +#if defined NOT_IN_libc && defined IS_IN_rtld +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(dst, src, tmp) \ + ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \ + ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \ + xor src, tmp, dst +# define PTR_MANGLE2(dst, src, tmp) \ + xor src, tmp, dst +# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp) +# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp) +# else +extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; +# define PTR_MANGLE(var) \ + (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local) +# define PTR_DEMANGLE(var) PTR_MANGLE(var) +# endif +#elif defined PIC +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(dst, src, tmp) \ + ldq tmp, __pointer_chk_guard; \ + xor src, tmp, dst +# define PTR_MANGLE2(dst, src, tmp) \ + xor src, tmp, dst +# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp) +# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp) +# else +extern const uintptr_t __pointer_chk_guard attribute_relro; +# define PTR_MANGLE(var) \ + (var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard) +# define PTR_DEMANGLE(var) PTR_MANGLE(var) +# endif +#else +/* There exists generic C code that assumes that PTR_MANGLE is always + defined. When generating code for the static libc, we don't have + __pointer_chk_guard defined. Nor is there any place that would + initialize it if it were defined, so there's little point in doing + anything more than nothing. */ +# ifndef __ASSEMBLER__ +# define PTR_MANGLE(var) +# define PTR_DEMANGLE(var) +# endif +#endif + +#endif /* ASSEMBLER */ diff --git a/ports/sysdeps/unix/am33/sysdep.S b/ports/sysdeps/unix/am33/sysdep.S new file mode 100644 index 0000000000..26740c2404 --- /dev/null +++ b/ports/sysdeps/unix/am33/sysdep.S @@ -0,0 +1,63 @@ +/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/sysdep.S. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define _ERRNO_H +#include <bits/errno.h> + +.globl C_SYMBOL_NAME(errno) +.globl syscall_error + +#undef syscall_error +#ifdef NO_UNDERSCORES +__syscall_error: +#else +syscall_error: +#endif +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN + /* We translate the system's EWOULDBLOCK error into EAGAIN. + The GNU C library always defines EWOULDBLOCK==EAGAIN. + EWOULDBLOCK_sys is the original number. */ + cmp EWOULDBLOCK_sys,d0 /* Is it the old EWOULDBLOCK? */ + bne .Lnotb /* Branch if not. */ + mov EAGAIN,d0 /* Yes; translate it to EAGAIN. */ +.Lnotb: +#endif +#ifndef PIC +# ifndef _LIBC_REENTRANT + mov d0,(C_SYMBOL_NAME (errno)) +# else + movm [d2],(sp) + add -12,sp + mov d0,d2 + call __errno_location,[],0 + mov d2,(a0) + add 12,sp + movm (sp),[d2] +# endif +#else +# error "This shouldn't be assembled for PIC" +#endif + mov -1,d0 + mov d0,a0 + ret + +#undef __syscall_error +END (__syscall_error) diff --git a/ports/sysdeps/unix/am33/sysdep.h b/ports/sysdeps/unix/am33/sysdep.h new file mode 100644 index 0000000000..dff1baebf4 --- /dev/null +++ b/ports/sysdeps/unix/am33/sysdep.h @@ -0,0 +1,32 @@ +/* Copyright 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/sysdep.h. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/sysdep.h> +#include "../../am33/sysdep.h" + +#ifdef __ASSEMBLER__ + +#define r0 d0 /* Normal return-value register. */ +#define r1 !!!! /* Secondary return-value register. */ +#define scratch d1 /* Call-clobbered register for random use. */ +#define MOVE(x,y) mov x, y + +#define ret ret [],0 + +#endif /* __ASSEMBLER__ */ diff --git a/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S new file mode 100644 index 0000000000..e0d60732ee --- /dev/null +++ b/ports/sysdeps/unix/arm/sysdep.S @@ -0,0 +1,68 @@ +/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003, + 2004, 2005, 2009, 2011, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define _ERRNO_H +#include <bits/errno.h> + +#ifdef IS_IN_rtld +# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ +#endif + +#include <tls.h> + +#undef syscall_error +__syscall_error: +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN + /* We translate the system's EWOULDBLOCK error into EAGAIN. + The GNU C library always defines EWOULDBLOCK==EAGAIN. + EWOULDBLOCK_sys is the original number. */ + cmp r0, $EWOULDBLOCK_sys /* Is it the old EWOULDBLOCK? */ + moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */ +#endif + +#ifndef IS_IN_rtld + mov ip, lr + cfi_register (lr, ip) + mov r1, r0 + + mov r0, #0xffff0fff + mov lr, pc + sub pc, r0, #31 + + ldr r2, 1f +2: ldr r2, [pc, r2] + str r1, [r0, r2] + mvn r0, #0 + RETINSTR (, ip) + +1: .word errno(gottpoff) + (. - 2b - 8) +#elif RTLD_PRIVATE_ERRNO + ldr r1, 1f +0: str r0, [pc, r1] + mvn r0, $0 + DO_RET(r14) + +1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8 +#else +#error "Unsupported non-TLS case" +#endif + +#undef __syscall_error +END (__syscall_error) diff --git a/ports/sysdeps/unix/arm/sysdep.h b/ports/sysdeps/unix/arm/sysdep.h new file mode 100644 index 0000000000..1f7b5cf3d7 --- /dev/null +++ b/ports/sysdeps/unix/arm/sysdep.h @@ -0,0 +1,30 @@ +/* Copyright (C) 1997, 1998, 2005, 2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/sysdep.h> +#include <sysdeps/arm/sysdep.h> + +/* Some definitions to allow the assembler in sysdeps/unix/ to build + without needing ARM-specific versions of all the files. */ + +#ifdef __ASSEMBLER__ + +#define ret DO_RET (r14) +#define MOVE(a,b) mov b,a + +#endif diff --git a/ports/sysdeps/unix/mips/entry.h b/ports/sysdeps/unix/mips/entry.h new file mode 100644 index 0000000000..04d05d2b0a --- /dev/null +++ b/ports/sysdeps/unix/mips/entry.h @@ -0,0 +1,5 @@ +#ifndef __ASSEMBLY__ +extern void __start (void); +#endif + +#define ENTRY_POINT __start diff --git a/ports/sysdeps/unix/mips/mips32/sysdep.h b/ports/sysdeps/unix/mips/mips32/sysdep.h new file mode 100644 index 0000000000..4c0b2a94f1 --- /dev/null +++ b/ports/sysdeps/unix/mips/mips32/sysdep.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/mips/sysdep.h> + +/* Note that while it's better structurally, going back to call __syscall_error + can make things confusing if you're debugging---it looks like it's jumping + backwards into the previous fn. */ +#ifdef __PIC__ +#define PSEUDO(name, syscall_name, args) \ + .align 2; \ + 99: la t9,__syscall_error; \ + jr t9; \ + ENTRY(name) \ + .set noreorder; \ + .cpload t9; \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, 99b; \ +L(syse1): +#else +#define PSEUDO(name, syscall_name, args) \ + .set noreorder; \ + .align 2; \ + 99: j __syscall_error; \ + nop; \ + ENTRY(name) \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, 99b; \ +L(syse1): +#endif diff --git a/ports/sysdeps/unix/mips/mips64/n32/sysdep.h b/ports/sysdeps/unix/mips/mips64/n32/sysdep.h new file mode 100644 index 0000000000..3da31cba48 --- /dev/null +++ b/ports/sysdeps/unix/mips/mips64/n32/sysdep.h @@ -0,0 +1,57 @@ +/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/mips/sysdep.h> + +#ifdef __ASSEMBLER__ + +/* Note that while it's better structurally, going back to call __syscall_error + can make things confusing if you're debugging---it looks like it's jumping + backwards into the previous fn. */ +#ifdef __PIC__ +#define PSEUDO(name, syscall_name, args) \ + .align 2; \ + 99:; \ + .set noat; \ + .cpsetup t9, $1, name; \ + .set at; \ + la t9,__syscall_error; \ + .cpreturn; \ + jr t9; \ + ENTRY(name) \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + bne a3, zero, 99b; \ +L(syse1): +#else +#define PSEUDO(name, syscall_name, args) \ + .set noreorder; \ + .align 2; \ + 99: j __syscall_error; \ + nop; \ + ENTRY(name) \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, 99b; \ +L(syse1): +#endif + +#endif diff --git a/ports/sysdeps/unix/mips/mips64/n64/sysdep.h b/ports/sysdeps/unix/mips/mips64/n64/sysdep.h new file mode 100644 index 0000000000..54e55116a9 --- /dev/null +++ b/ports/sysdeps/unix/mips/mips64/n64/sysdep.h @@ -0,0 +1,57 @@ +/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/unix/mips/sysdep.h> + +#ifdef __ASSEMBLER__ + +/* Note that while it's better structurally, going back to call __syscall_error + can make things confusing if you're debugging---it looks like it's jumping + backwards into the previous fn. */ +#ifdef __PIC__ +#define PSEUDO(name, syscall_name, args) \ + .align 2; \ + 99:; \ + .set noat; \ + .cpsetup t9, $1, name; \ + .set at; \ + dla t9,__syscall_error; \ + .cpreturn; \ + jr t9; \ + ENTRY(name) \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + bne a3, zero, 99b; \ +L(syse1): +#else +#define PSEUDO(name, syscall_name, args) \ + .set noreorder; \ + .align 2; \ + 99: j __syscall_error; \ + nop; \ + ENTRY(name) \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, 99b; \ +L(syse1): +#endif + +#endif diff --git a/ports/sysdeps/unix/mips/pipe.S b/ports/sysdeps/unix/mips/pipe.S new file mode 100644 index 0000000000..d30b8e48a9 --- /dev/null +++ b/ports/sysdeps/unix/mips/pipe.S @@ -0,0 +1,32 @@ +/* Copyright (C) 1992, 1995, 1997, 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +SYSCALL__ (pipe, 1) + /* Plop in the two descriptors. */ + sw v0, 0(a0) + sw v1, 4(a0) + + /* Go out with a clean status. */ + move v0, zero + j ra +PSEUDO_END(__pipe) + +libc_hidden_def (__pipe) +weak_alias (__pipe, pipe) diff --git a/ports/sysdeps/unix/mips/rt-sysdep.S b/ports/sysdeps/unix/mips/rt-sysdep.S new file mode 100644 index 0000000000..f966bf1e59 --- /dev/null +++ b/ports/sysdeps/unix/mips/rt-sysdep.S @@ -0,0 +1 @@ +#include <sysdep.S> diff --git a/ports/sysdeps/unix/mips/sysdep.S b/ports/sysdeps/unix/mips/sysdep.S new file mode 100644 index 0000000000..f42d0f94f9 --- /dev/null +++ b/ports/sysdeps/unix/mips/sysdep.S @@ -0,0 +1,99 @@ +/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define _ERRNO_H +#include <bits/errno.h> +#include <sys/asm.h> + +#ifdef _LIBC_REENTRANT + +LOCALSZ= 3 +FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK +RAOFF= FRAMESZ-(1*SZREG) +GPOFF= FRAMESZ-(2*SZREG) +V0OFF= FRAMESZ-(3*SZREG) + +ENTRY(__syscall_error) +#ifdef __PIC__ + .set noat + SETUP_GPX (AT) + .set at +#endif + PTR_SUBU sp, FRAMESZ + .set noat + SETUP_GPX64(GPOFF,AT) + .set at +#ifdef __PIC__ + SAVE_GP(GPOFF) +#endif + REG_S v0, V0OFF(sp) + REG_S ra, RAOFF(sp) + +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN + /* We translate the system's EWOULDBLOCK error into EAGAIN. + The GNU C library always defines EWOULDBLOCK==EAGAIN. + EWOULDBLOCK_sys is the original number. */ + bne v0, EWOULDBLOCK_sys, L(skip) + nop + li v0, EAGAIN +L(skip): +#endif + /* Find our per-thread errno address */ + jal __errno_location + + /* Store the error value. */ + REG_L t0, V0OFF(sp) + sw t0, 0(v0) + + /* And just kick back a -1. */ + REG_L ra, RAOFF(sp) + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + li v0, -1 + j ra + END(__syscall_error) + +#else /* _LIBC_REENTRANT */ + + +ENTRY(__syscall_error) +#ifdef __PIC__ + SETUP_GPX (AT) +#endif + SETUP_GPX64 (t9, AT) + +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN + /* We translate the system's EWOULDBLOCK error into EAGAIN. + The GNU C library always defines EWOULDBLOCK==EAGAIN. + EWOULDBLOCK_sys is the original number. */ + bne v0, EWOULDBLOCK_sys, L(skip) + li v0, EAGAIN +L(skip): +#endif + /* Store it in errno... */ + sw v0, errno + + /* And just kick back a -1. */ + li v0, -1 + + RESTORE_GP64 + j ra + END(__syscall_error) +#endif /* _LIBC_REENTRANT */ diff --git a/ports/sysdeps/unix/mips/sysdep.h b/ports/sysdeps/unix/mips/sysdep.h new file mode 100644 index 0000000000..d6e615c078 --- /dev/null +++ b/ports/sysdeps/unix/mips/sysdep.h @@ -0,0 +1,78 @@ +/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003, 2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe (brendan@zen.org). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sgidefs.h> +#include <sysdeps/unix/sysdep.h> + +#ifdef __ASSEMBLER__ + +#include <regdef.h> + +#define ENTRY(name) \ + .globl name; \ + .align 2; \ + .ent name,0; \ + name##: + +#undef END +#define END(function) \ + .end function; \ + .size function,.-function + +#define ret j ra ; nop + +#undef PSEUDO_END +#define PSEUDO_END(sym) .end sym; .size sym,.-sym + +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .align 2; \ + ENTRY(name) \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym + +#define ret_NOERRNO ret + +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .align 2; \ + ENTRY(name) \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym + +#define ret_ERRVAL ret + +#define r0 v0 +#define r1 v1 +/* The mips move insn is d,s. */ +#define MOVE(x,y) move y , x + +#if _MIPS_SIM == _ABIO32 +# define L(label) $L ## label +#else +# define L(label) .L ## label +#endif + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/Implies b/ports/sysdeps/unix/sysv/linux/alpha/Implies new file mode 100644 index 0000000000..1616efecbe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/Implies @@ -0,0 +1,4 @@ +unix/sysv/linux/wordsize-64 +# These supply the ABI compatibility for when long double was double. +ieee754/ldbl-64-128 +ieee754/ldbl-opt diff --git a/ports/sysdeps/unix/sysv/linux/alpha/Makefile b/ports/sysdeps/unix/sysv/linux/alpha/Makefile new file mode 100644 index 0000000000..f64f23fd7a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/Makefile @@ -0,0 +1,38 @@ +ifeq ($(subdir),posix) +sysdep_routines += oldglob +endif + +ifeq ($(subdir),stdlib) +gen-as-const-headers += ucontext-offsets.sym +endif + +ifeq ($(subdir),misc) +sysdep_headers += alpha/ptrace.h alpha/regdef.h sys/io.h + +sysdep_routines += ieee_get_fp_control ieee_set_fp_control \ + ioperm llseek + +# Support old timeval32 entry points +sysdep_routines += osf_select osf_gettimeofday osf_settimeofday \ + osf_getitimer osf_setitimer osf_utimes \ + osf_getrusage osf_wait4 + +# Support old ipc control +sysdep_routines += oldmsgctl oldsemctl oldshmctl + +CFLAGS-ioperm.c = -Wa,-mev6 +endif + +ifeq ($(subdir),signal) +sysdep_routines += rt_sigaction +endif + +ifeq ($(subdir),math) +# These 2 routines are normally in libgcc{.a,_s.so.1}. +# However, alpha -mlong-double-128 libgcc relies on +# glibc providing _Ots* routines and without these files +# glibc relies on __multc3/__divtc3 only provided +# by libgcc if configured with -mlong-double-128. +# Provide these routines here as well. +libm-routines += multc3 divtc3 +endif # math diff --git a/ports/sysdeps/unix/sysv/linux/alpha/Versions b/ports/sysdeps/unix/sysv/linux/alpha/Versions new file mode 100644 index 0000000000..b3cec3a75f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/Versions @@ -0,0 +1,102 @@ +libc { + # The comment lines with "#errlist-compat" are magic; see + # sysdeps/gnu/errlist-compat.awk. + # When you get an error from errlist-compat.awk, you need to add a new + # version here. Don't do this blindly, since this means changing the ABI + # for all GNU/Linux configurations. + + GLIBC_2.0 { + #errlist-compat 131 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + + # Unfortunately in wider use. + _inb; _inw; _inl; _outb; _outw; _outl; _bus_base; _bus_base_sparse; + _hae_shift; + + # Exception handling support functions from libgcc + __register_frame; __register_frame_table; __deregister_frame; + __frame_state_for; __register_frame_info_table; + + # b* + bus_base; bus_base_sparse; + + # h* + hae_shift; + + # i* + inb; inl; inw; ioperm; iopl; + + # o* + outb; outl; outw; + + # p* + pciconfig_read; pciconfig_write; sethae; + } + GLIBC_2.1 { + #errlist-compat 131 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + + # Linux/Alpha 64-bit timeval functions. + __select; select; + adjtime; adjtimex; __adjtimex; + __gettimeofday; + + # glob interface change + glob; globfree; + + # limit type change + getrusage; + + # time type change + gettimeofday; getitimer; + + # i* + ieee_get_fp_control; ieee_set_fp_control; + + # s* + setitimer; settimeofday; + + # u* + utimes; + + # w* + wait4; + } + GLIBC_2.1.4 { + pciconfig_iobase; + } + GLIBC_2.2.2 { + # w* + wordexp; + } + GLIBC_2.3 { + #errlist-compat 132 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_2.4 { + #errlist-compat 138 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_2.12 { + #errlist-compat 139 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_2.16 { + #errlist-compat 140 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_PRIVATE { + __libc_alpha_cache_shape; + } +} +ld { + GLIBC_PRIVATE { + __libc_alpha_cache_shape; + } +} +librt { + GLIBC_2.3 { + # AIO functions. + aio_cancel; aio_cancel64; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S new file mode 100644 index 0000000000..c5fe5c19fb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S @@ -0,0 +1,145 @@ +/* Copyright (C) 1992, 1994, 1997, 2006, 2010, 2011 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <jmpbuf-offsets.h> + + + .section .rodata.str1.1,"aMS",@progbits,1 + .type longjmp_msg,@object +longjmp_msg: + .string "longjmp causes uninitialized stack frame" + .size longjmp_msg, .-longjmp_msg + + +/* Jump to the position specified by ENV, causing the + setjmp call there to return VAL, or 1 if VAL is 0. + void __longjmp (__jmp_buf env, int val). */ + .text + .align 4 + .globl ____longjmp_chk + .type ____longjmp_chk, @function + .usepv ____longjmp_chk, std + + cfi_startproc +____longjmp_chk: + ldgp gp, 0(pv) +#ifdef PROF + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at +#endif + + ldq s2, JB_PC*8(a0) + mov a0, s0 + ldq fp, JB_FP*8(a0) + mov a1, s1 + ldq s3, JB_SP*8(a0) + cmoveq s1, 1, s1 + +#ifdef PTR_DEMANGLE + PTR_DEMANGLE(s2, t1) + PTR_DEMANGLE2(s3, t1) + PTR_DEMANGLE2(fp, t1) +#endif + /* ??? While this is a proper test for detecting a longjmp to an + invalid frame within any given stack, the main thread stack is + located *below* almost everything in the address space. Which + means that the test at Lfail vs the signal stack will almost + certainly never pass. We ought bounds check top and bottom of + the current thread's stack. */ + cmpule s3, sp, t1 + bne t1, $Lfail + + .align 4 +$Lok: + mov s0, a0 + mov s1, v0 + mov s3, t0 + mov s2, ra + cfi_remember_state + cfi_def_cfa(a0, 0) + cfi_register(sp, t0) + cfi_offset(s0, JB_S0*8) + cfi_offset(s1, JB_S1*8) + cfi_offset(s2, JB_S2*8) + cfi_offset(s3, JB_S3*8) + cfi_offset(s4, JB_S4*8) + cfi_offset(s5, JB_S5*8) + cfi_offset(s3, JB_S3*8) + cfi_offset($f2, JB_F2*8) + cfi_offset($f3, JB_F3*8) + cfi_offset($f4, JB_F4*8) + cfi_offset($f5, JB_F5*8) + cfi_offset($f6, JB_F6*8) + cfi_offset($f7, JB_F7*8) + cfi_offset($f8, JB_F8*8) + cfi_offset($f9, JB_F9*8) + ldq s0, JB_S0*8(a0) + ldq s1, JB_S1*8(a0) + ldq s2, JB_S2*8(a0) + ldq s3, JB_S3*8(a0) + ldq s4, JB_S4*8(a0) + ldq s5, JB_S5*8(a0) + ldt $f2, JB_F2*8(a0) + ldt $f3, JB_F3*8(a0) + ldt $f4, JB_F4*8(a0) + ldt $f5, JB_F5*8(a0) + ldt $f6, JB_F6*8(a0) + ldt $f7, JB_F7*8(a0) + ldt $f8, JB_F8*8(a0) + ldt $f9, JB_F9*8(a0) + mov t0, sp + ret + + .align 4 +$Lfail: + cfi_restore_state + lda v0, __NR_sigaltstack + lda a0, 0 + lda a1, -32(sp) + lda sp, -32(sp) + cfi_adjust_cfa_offset(32) + callsys + ldq t0, 0(sp) /* ss_sp */ + ldl t1, 8(sp) /* ss_flags */ + ldq t2, 16(sp) /* ss_size */ + lda sp, 32(sp) + cfi_adjust_cfa_offset(-32) + + /* Without working sigaltstack we cannot perform the test. */ + bne a3, $Lok + + addq t0, t2, t0 /* t0 = ss_sp + ss_size */ + subq t0, s3, t0 /* t0 = (ss_sp + ss_size) - new_sp */ + cmpule t2, t0, t0 /* t0 = (t0 >= ss_size) */ + and t0, t1, t0 /* t0 = (t0 >= ss_size) & (ss_flags & SS_ONSTACK) */ + bne t0, $Lok + + ldah a0, longjmp_msg(gp) !gprelhigh + lda a0, longjmp_msg(a0) !gprellow +#ifdef PIC + jsr ra, HIDDEN_JUMPTARGET(__fortify_fail) +#else + bsr ra, HIDDEN_JUMPTARGET(__fortify_fail) !samegp +#endif + bugchk + + cfi_endproc + .size ____longjmp_chk, .-____longjmp_chk diff --git a/ports/sysdeps/unix/sysv/linux/alpha/a.out.h b/ports/sysdeps/unix/sysv/linux/alpha/a.out.h new file mode 100644 index 0000000000..a7699f0fe0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/a.out.h @@ -0,0 +1,197 @@ +#ifndef __A_OUT_GNU_H__ +#define __A_OUT_GNU_H__ + +#include <bits/a.out.h> + +#define __GNU_EXEC_MACROS__ + +/* + * OSF/1 ECOFF header structs. ECOFF files consist of: + * - a file header (struct filehdr), + * - an a.out header (struct aouthdr), + * - one or more section headers (struct scnhdr). + * The filhdr's "f_nscns" field contains the + * number of section headers. + */ + +struct filehdr +{ + /* OSF/1 "file" header */ + unsigned short f_magic, f_nscns; + unsigned int f_timdat; + unsigned long f_symptr; + unsigned int f_nsyms; + unsigned short f_opthdr, f_flags; +}; + +struct aouthdr +{ + unsigned long info; /* After that it looks quite normal.. */ + unsigned long tsize; + unsigned long dsize; + unsigned long bsize; + unsigned long entry; + unsigned long text_start; /* With a few additions that actually make sense. */ + unsigned long data_start; + unsigned long bss_start; + unsigned int gprmask, fprmask; /* Bitmask of general & floating point regs used in binary. */ + unsigned long gpvalue; +}; + +struct scnhdr +{ + char s_name[8]; + unsigned long s_paddr; + unsigned long s_vaddr; + unsigned long s_size; + unsigned long s_scnptr; + unsigned long s_relptr; + unsigned long s_lnnoptr; + unsigned short s_nreloc; + unsigned short s_nlnno; + unsigned int s_flags; +}; + +struct exec +{ + /* OSF/1 "file" header */ + struct filehdr fh; + struct aouthdr ah; +}; + +#define a_info ah.info +#define a_text ah.tsize +#define a_data ah.dsize +#define a_bss ah.bsize +#define a_entry ah.entry +#define a_textstart ah.text_start +#define a_datastart ah.data_start +#define a_bssstart ah.bss_start +#define a_gprmask ah.gprmask +#define a_fprmask ah.fprmask +#define a_gpvalue ah.gpvalue + + +#define AOUTHSZ sizeof(struct aouthdr) +#define SCNHSZ sizeof(struct scnhdr) +#define SCNROUND 16 + +enum machine_type +{ + M_OLDSUN2 = 0, + M_68010 = 1, + M_68020 = 2, + M_SPARC = 3, + M_386 = 100, + M_MIPS1 = 151, + M_MIPS2 = 152 +}; + +#define N_MAGIC(exec) ((exec).a_info & 0xffff) +#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) +#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) +#define N_SET_INFO(exec, magic, type, flags) \ + ((exec).a_info = ((magic) & 0xffff) \ + | (((int)(type) & 0xff) << 16) \ + | (((flags) & 0xff) << 24)) +#define N_SET_MAGIC(exec, magic) \ + ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff)) +#define N_SET_MACHTYPE(exec, machtype) \ + ((exec).a_info = \ + ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) +#define N_SET_FLAGS(exec, flags) \ + ((exec).a_info = \ + ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) + +/* Code indicating object file or impure executable. */ +#define OMAGIC 0407 +/* Code indicating pure executable. */ +#define NMAGIC 0410 +/* Code indicating demand-paged executable. */ +#define ZMAGIC 0413 +/* This indicates a demand-paged executable with the header in the text. + The first page is unmapped to help trap NULL pointer references. */ +#define QMAGIC 0314 +/* Code indicating core file. */ +#define CMAGIC 0421 + +#define N_TRSIZE(x) 0 +#define N_DRSIZE(x) 0 +#define N_SYMSIZE(x) 0 +#define N_BADMAG(x) \ + (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ + && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) +#define _N_HDROFF(x) (1024 - sizeof (struct exec)) +#define N_TXTOFF(x) \ + ((long) N_MAGIC(x) == ZMAGIC ? 0 : \ + (sizeof (struct exec) + (x).fh.f_nscns * SCNHSZ + SCNROUND - 1) \ + & ~(SCNROUND - 1)) + +#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) +#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) +#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) +#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) +#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) + +/* Address of text segment in memory after it is loaded. */ +#define N_TXTADDR(x) ((x).a_textstart) + +/* Address of data segment in memory after it is loaded. */ +#define SEGMENT_SIZE 1024 + +#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) +#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) + +#define N_DATADDR(x) ((x).a_datastart) +#define N_BSSADDR(x) ((x).a_bssstart) + +#if !defined (N_NLIST_DECLARED) +struct nlist +{ + union + { + char *n_name; + struct nlist *n_next; + long n_strx; + } n_un; + unsigned char n_type; + char n_other; + short n_desc; + unsigned long n_value; +}; +#endif /* no N_NLIST_DECLARED. */ + +#define N_UNDF 0 +#define N_ABS 2 +#define N_TEXT 4 +#define N_DATA 6 +#define N_BSS 8 +#define N_FN 15 +#define N_EXT 1 +#define N_TYPE 036 +#define N_STAB 0340 +#define N_INDR 0xa +#define N_SETA 0x14 /* Absolute set element symbol. */ +#define N_SETT 0x16 /* Text set element symbol. */ +#define N_SETD 0x18 /* Data set element symbol. */ +#define N_SETB 0x1A /* Bss set element symbol. */ +#define N_SETV 0x1C /* Pointer to set vector in data area. */ + +#if !defined (N_RELOCATION_INFO_DECLARED) +/* This structure describes a single relocation to be performed. + The text-relocation section of the file is a vector of these structures, + all of which apply to the text section. + Likewise, the data-relocation section applies to the data section. */ + +struct relocation_info +{ + int r_address; + unsigned int r_symbolnum:24; + unsigned int r_pcrel:1; + unsigned int r_length:2; + unsigned int r_extern:1; + unsigned int r_pad:4; +}; +#endif /* no N_RELOCATION_INFO_DECLARED. */ + +#endif /* __A_OUT_GNU_H__ */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/adjtime.c b/ports/sysdeps/unix/sysv/linux/alpha/adjtime.c new file mode 100644 index 0000000000..b8c9820203 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/adjtime.c @@ -0,0 +1,94 @@ +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <shlib-compat.h> +#include <sysdep.h> +#include <sys/time.h> + + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) +struct timeval32 +{ + int tv_sec, tv_usec; +}; + +struct timex32 { + unsigned int modes; /* mode selector */ + long offset; /* time offset (usec) */ + long freq; /* frequency offset (scaled ppm) */ + long maxerror; /* maximum error (usec) */ + long esterror; /* estimated error (usec) */ + int status; /* clock command/status */ + long constant; /* pll time constant */ + long precision; /* clock precision (usec) (read only) */ + long tolerance; /* clock frequency tolerance (ppm) + * (read only) + */ + struct timeval32 time; /* (read only) */ + long tick; /* (modified) usecs between clock ticks */ + + long ppsfreq; /* pps frequency (scaled ppm) (ro) */ + long jitter; /* pps jitter (us) (ro) */ + int shift; /* interval duration (s) (shift) (ro) */ + long stabil; /* pps stability (scaled ppm) (ro) */ + long jitcnt; /* jitter limit exceeded (ro) */ + long calcnt; /* calibration intervals (ro) */ + long errcnt; /* calibration errors (ro) */ + long stbcnt; /* stability limit exceeded (ro) */ + + int :32; int :32; int :32; int :32; + int :32; int :32; int :32; int :32; + int :32; int :32; int :32; int :32; +}; + +#define TIMEVAL timeval32 +#define TIMEX timex32 +#define ADJTIME attribute_compat_text_section __adjtime_tv32 +#define ADJTIMEX(x) INLINE_SYSCALL (old_adjtimex, 1, x) +#define ADJTIMEX32(x) INLINE_SYSCALL (old_adjtimex, 1, x) + +#include <sysdeps/unix/sysv/linux/adjtime.c> + +int attribute_compat_text_section +__adjtimex_tv32 (struct timex32 *tx) { return ADJTIMEX (tx); } + +strong_alias (__adjtimex_tv32, __adjtimex_tv32_1); +strong_alias (__adjtimex_tv32, __adjtimex_tv32_2); +compat_symbol (libc, __adjtimex_tv32_1, __adjtimex, GLIBC_2_0); +compat_symbol (libc, __adjtimex_tv32_2, adjtimex, GLIBC_2_0); +compat_symbol (libc, __adjtime_tv32, adjtime, GLIBC_2_0); +#endif /* SHLIB_COMPAT */ + +#undef TIMEVAL +#undef TIMEX +#undef ADJTIME +#undef ADJTIMEX +#define TIMEVAL timeval +#define TIMEX timex +#define ADJTIMEX(x) INLINE_SYSCALL (adjtimex, 1, x) + +#include <sysdeps/unix/sysv/linux/adjtime.c> + +int +__adjtimex_tv64 (struct timex *tx) { return ADJTIMEX (tx); } + +strong_alias (__adjtimex_tv64, __adjtimex_internal); +strong_alias (__adjtimex_tv64, __adjtimex_tv64p); +weak_alias (__adjtimex_tv64, ntp_adjtime); +versioned_symbol (libc, __adjtimex_tv64, __adjtimex, GLIBC_2_1); +versioned_symbol (libc, __adjtimex_tv64p, adjtimex, GLIBC_2_1); +versioned_symbol (libc, __adjtime, adjtime, GLIBC_2_1); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/alpha/ptrace.h b/ports/sysdeps/unix/sysv/linux/alpha/alpha/ptrace.h new file mode 100644 index 0000000000..57b96d64db --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/alpha/ptrace.h @@ -0,0 +1,18 @@ +#ifndef __alpha_ptrace_h__ +#define __alpha_ptrace_h__ + +/* + * Mostly for OSF/1 compatibility. + */ + +#define REG_BASE 0 +#define NGP_REGS 32 +#define NFP_REGS 32 + +#define GPR_BASE REG_BASE +#define FPR_BASE (GPR_BASE+NGP_REGS) +#define PC (FPR_BASE+NFP_REGS) +#define SPR_PS (PC+1) +#define NPTRC_REGS (SPR_PS+1) + +#endif /* __alpha_ptrace_h__ */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/alpha/regdef.h b/ports/sysdeps/unix/sysv/linux/alpha/alpha/regdef.h new file mode 100644 index 0000000000..142df9c4f8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/alpha/regdef.h @@ -0,0 +1,44 @@ +#ifndef __alpha_regdef_h__ +#define __alpha_regdef_h__ + +#define v0 $0 /* function return value */ + +#define t0 $1 /* temporary registers (caller-saved) */ +#define t1 $2 +#define t2 $3 +#define t3 $4 +#define t4 $5 +#define t5 $6 +#define t6 $7 +#define t7 $8 + +#define s0 $9 /* saved-registers (callee-saved registers) */ +#define s1 $10 +#define s2 $11 +#define s3 $12 +#define s4 $13 +#define s5 $14 +#define s6 $15 +#define fp s6 /* frame-pointer (s6 in frame-less procedures) */ + +#define a0 $16 /* argument registers (caller-saved) */ +#define a1 $17 +#define a2 $18 +#define a3 $19 +#define a4 $20 +#define a5 $21 + +#define t8 $22 /* more temps (caller-saved) */ +#define t9 $23 +#define t10 $24 +#define t11 $25 +#define ra $26 /* return address register */ +#define t12 $27 + +#define pv t12 /* procedure-variable register */ +#define AT $at /* assembler temporary */ +#define gp $29 /* global pointer */ +#define sp $30 /* stack pointer */ +#define zero $31 /* reads as zero, writes are noops */ + +#endif /* __alpha_regdef_h__ */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/alphaev6/fpu/Implies b/ports/sysdeps/unix/sysv/linux/alpha/alphaev6/fpu/Implies new file mode 100644 index 0000000000..0d7000dc2d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/alphaev6/fpu/Implies @@ -0,0 +1,2 @@ +# Override ldbl-opt with alpha specific routines. +alpha/alphaev6/fpu diff --git a/ports/sysdeps/unix/sysv/linux/alpha/alphaev67/fpu/Implies b/ports/sysdeps/unix/sysv/linux/alpha/alphaev67/fpu/Implies new file mode 100644 index 0000000000..617c388d2d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/alphaev67/fpu/Implies @@ -0,0 +1,2 @@ +# Override ldbl-opt with alpha specific routines. +alpha/alphaev67/fpu diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/a.out.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/a.out.h new file mode 100644 index 0000000000..82a3dd4c0d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/a.out.h @@ -0,0 +1,9 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use <bits/a.out.h> directly; include <a.out.h> instead." +#endif +#ifndef __A_OUT_GNU_H__ +# error "Never use <bits/a.out.h> directly; include <a.out.h> instead." +#endif +#ifndef __A_OUT_GNU_H__ +# error "Never use <bits/a.out.h> directly; include <a.out.h> instead." +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h new file mode 100644 index 0000000000..f146466e68 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h @@ -0,0 +1,54 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_DIRENT_H +#define _BITS_DIRENT_H 1 + +struct dirent + { +#ifdef __USE_FILE_OFFSET64 + __ino64_t d_ino; +#else + __ino_t d_ino; + int __pad; +#endif + __off_t d_off; + unsigned short int d_reclen; + unsigned char d_type; + char d_name[256]; /* We must not include limits.h! */ + }; + +#ifdef __USE_LARGEFILE64 +/* Note dirent64 is the same as dirent. */ +struct dirent64 + { + __ino64_t d_ino; + __off64_t d_off; + unsigned short int d_reclen; + unsigned char d_type; + char d_name[256]; /* We must not include limits.h! */ + }; +#endif + +#define d_fileno d_ino /* Backwards compatibility. */ + +#undef _DIRENT_HAVE_D_NAMLEN +#define _DIRENT_HAVE_D_RECLEN +#define _DIRENT_HAVE_D_OFF +#define _DIRENT_HAVE_D_TYPE + +#endif /* bits/dirent.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/elfclass.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/elfclass.h new file mode 100644 index 0000000000..e5aa4a0fbd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/elfclass.h @@ -0,0 +1,14 @@ +/* This file specifies the native word size of the machine, which indicates + the ELF file class used for executables and shared objects on this + machine. */ + +#ifndef _LINK_H +# error "Never use <bits/elfclass.h> directly; include <link.h> instead." +#endif + +#include <bits/wordsize.h> + +#define __ELF_NATIVE_CLASS __WORDSIZE + +/* Linux/Alpha is exceptional as it has .hash section with 64 bit entries. */ +typedef uint64_t Elf_Symndx; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/epoll.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/epoll.h new file mode 100644 index 0000000000..7f9f37497e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/epoll.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EPOLL_H +# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead." +#endif + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 010000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 000000004 +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h new file mode 100644 index 0000000000..d85dd8db24 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/errno.h @@ -0,0 +1,65 @@ +/* Error constants. Linux/Alpha specific version. + Copyright (C) 1996,1997,1998,1999,2002,2005,2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _ERRNO_H + +# undef EDOM +# undef EILSEQ +# undef ERANGE +# include <linux/errno.h> + +/* Linux has no ENOTSUP error code. */ +# define ENOTSUP EOPNOTSUPP + +# ifndef ECANCELED +# define ECANCELED 131 +# endif + +/* Support for error codes to support robust mutexes was added later, too. */ +# ifndef EOWNERDEAD +# define EOWNERDEAD 136 +# define ENOTRECOVERABLE 137 +# endif + +# ifndef ERFKILL +# define ERFKILL 138 +# endif + +# ifndef EHWPOISON +# define EHWPOISON 139 +# endif + +# ifndef __ASSEMBLER__ +/* Function to get address of global `errno' variable. */ +extern int *__errno_location (void) __THROW __attribute__ ((__const__)); + +# if !defined _LIBC || defined _LIBC_REENTRANT +/* When using threads, errno is a per-thread value. */ +# define errno (*__errno_location ()) +# endif +# endif /* !__ASSEMBLER__ */ +#endif /* _ERRNO_H */ + +#if !defined _ERRNO_H && defined __need_Emath +/* This is ugly but the kernel header is not clean enough. We must + define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is + defined. */ +# define EDOM 33 /* Math argument out of domain of function. */ +# define EILSEQ 116 /* Illegal byte sequence. */ +# define ERANGE 34 /* Math result not representable. */ +#endif /* !_ERRNO_H && __need_Emath */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h new file mode 100644 index 0000000000..346794ad0f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/eventfd.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2007-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." +#endif + +/* Flags for eventfd. */ +enum + { + EFD_SEMAPHORE = 000000001, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 010000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 000000004 +#define EFD_NONBLOCK EFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h new file mode 100644 index 0000000000..4c55071146 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h @@ -0,0 +1,301 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + +#include <sys/types.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 01000 /* not fcntl */ +#define O_TRUNC 02000 /* not fcntl */ +#define O_EXCL 04000 /* not fcntl */ +#define O_NOCTTY 010000 /* not fcntl */ + +#define O_NONBLOCK 00004 +#define O_APPEND 00010 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 020040000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 /* fcntl, for BSD compatibility */ + +#ifdef __USE_XOPEN2K8 +# define O_DIRECTORY 0100000 /* Must be a directory. */ +# define O_NOFOLLOW 0200000 /* Do not follow links. */ +# define O_CLOEXEC 010000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 02000000 /* Direct disk access. */ +# define O_NOATIME 04000000 /* Do not set atime. */ +# define O_PATH 040000000 /* Resolve pathname but do not open file. */ +#endif + +#ifdef __USE_LARGEFILE64 +/* Not necessary, files are always with 64bit off_t. */ +# define O_LARGEFILE 0 +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 040000 /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ +#define F_GETLK64 F_GETLK /* Get record locking info. */ +#define F_SETLK64 F_SETLK /* Set record locking info (non-blocking). */ +#define F_SETLKW64 F_SETLKW /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_SETOWN 5 /* Get owner of socket (receiver of SIGIO). */ +# define F_GETOWN 6 /* Set owner of socket (receiver of SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* for F_[GET|SET]FD */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf() */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 8 /* Remove lock. */ + +/* for old implementation of bsd flock () */ +#define F_EXLCK 16 /* or 3 */ +#define F_SHLCK 32 /* or 4 */ + +/* Operations for bsd flock(), also used by the kernel implementation */ +#ifdef __USE_BSD +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +/* We don't need to support __USE_FILE_OFFSET64. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/inotify.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/inotify.h new file mode 100644 index 0000000000..3fbe3b8ec9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/inotify.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2005-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_INOTIFY_H +# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." +#endif + +/* Flags for the parameter of inotify_init1. */ +enum + { + IN_CLOEXEC = 010000000, +#define IN_CLOEXEC IN_CLOEXEC + IN_NONBLOCK = 000000004 +#define IN_NONBLOCK IN_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h new file mode 100644 index 0000000000..1f3482fb4f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/ioctls.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IOCTL_H +# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead." +#endif + +/* Use the definitions from the kernel header files. */ +#include <asm/ioctls.h> + +/* Oh well, this is necessary since the kernel data structure is + different from the user-level version. */ +#undef TCGETS +#undef TCSETS +#undef TCSETSW +#undef TCSETSF +#define TCGETS _IOR ('t', 19, char[44]) +#define TCSETS _IOW ('t', 20, char[44]) +#define TCSETSW _IOW ('t', 21, char[44]) +#define TCSETSF _IOW ('t', 22, char[44]) + +#include <linux/sockios.h> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/ipc.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/ipc.h new file mode 100644 index 0000000000..7df2acea35 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/ipc.h @@ -0,0 +1,54 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IPC_H +# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." +#endif + +#include <bits/types.h> + +/* Mode bits for `msgget', `semget', and `shmget'. */ +#define IPC_CREAT 01000 /* Create key if key does not exist. */ +#define IPC_EXCL 02000 /* Fail if key exists. */ +#define IPC_NOWAIT 04000 /* Return error on wait. */ + +/* Control commands for `msgctl', `semctl', and `shmctl'. */ +#define IPC_RMID 0 /* Remove identifier. */ +#define IPC_SET 1 /* Set `ipc_perm' options. */ +#define IPC_STAT 2 /* Get `ipc_perm' options. */ +#ifdef __USE_GNU +# define IPC_INFO 3 /* See ipcs. */ +#endif + +/* Special key values. */ +#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ + + +/* Data structure used to pass permission information to IPC operations. */ +struct ipc_perm + { + __key_t __key; /* Key. */ + unsigned int uid; /* Owner's user ID. */ + unsigned int gid; /* Owner's group ID. */ + unsigned int cuid; /* Creator's user ID. */ + unsigned int cgid; /* Creator's group ID. */ + unsigned int mode; /* Read/write permission. */ + unsigned short int __seq; /* Sequence number. */ + unsigned short int __pad1; + unsigned long int __unused1; + unsigned long int __unused2; + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h new file mode 100644 index 0000000000..419cc5cbdb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h @@ -0,0 +1,126 @@ +/* Definitions for POSIX memory map interface. Linux/Alpha version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x100 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x10 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +/* Not used by Linux, but here to make sure we don't clash with + OSF/1 defines. */ +#if 0 && defined __USE_BSD +# define MAP_HASSEMAPHORE 0x0200 +# define MAP_INHERIT 0x0400 +# define MAP_UNALIGNED 0x0800 +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x01000 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x02000 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x04000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x08000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x10000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x20000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x40000 /* Do not block on IO. */ +# define MAP_STACK 0x80000 /* Allocation is for a stack. */ +# define MAP_HUGETLB 0x100000 /* Create huge page mapping. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 2 /* Synchronous memory sync. */ +#define MS_INVALIDATE 4 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 8192 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 16384 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 6 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ +# define MADV_DONTDUMP 16 /* Exclude from the core dump. */ +# define MADV_DODUMP 17 /* Clear MADV_DONTDUMP. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 6 /* Don't need these pages. */ +#endif + +/* Not used by Linux, but here to make sure we don't clash with + OSF/1 defines. */ +#if 0 && defined __USE_BSD +# define MADV_DONTNEED_COMPAT 4 /* Old version? */ +# define MADV_SPACEAVAIL 5 /* Ensure resources are available. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h new file mode 100644 index 0000000000..7e260d22fe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h @@ -0,0 +1,73 @@ +/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MSG_H +# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." +#endif + +#include <bits/types.h> + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ +#ifdef __USE_GNU +# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ +#endif + +/* Types used in the structure definition. */ +typedef unsigned long int msgqnum_t; +typedef unsigned long int msglen_t; + + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ + __time_t msg_stime; /* time of last msgsnd command */ + __time_t msg_rtime; /* time of last msgrcv command */ + __time_t msg_ctime; /* time of last change */ + unsigned long int __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +#ifdef __USE_MISC + +# define msg_cbytes __msg_cbytes + +/* ipcs ctl commands */ +# define MSG_STAT 11 +# define MSG_INFO 12 + +/* buffer for msgctl calls IPC_INFO, MSG_INFO */ +struct msginfo + { + int msgpool; + int msgmap; + int msgmax; + int msgmnb; + int msgmni; + int msgssz; + int msgtql; + unsigned short int msgseg; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/netdb.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/netdb.h new file mode 100644 index 0000000000..fc34c86696 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/netdb.h @@ -0,0 +1,34 @@ +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _NETDB_H +# error "Never include <bits/netdb.h> directly; use <netdb.h> instead." +#endif + + +/* Description of data base entry for a single network. NOTE: here a + poor assumption is made. The network number is expected to fit + into an unsigned long int variable. */ +struct netent +{ + char *n_name; /* Official name of network. */ + char **n_aliases; /* Alias list. */ + int n_addrtype; /* Net address type. */ + /* XXX We should probably use uint32_t for the field and ensure + compatiblity by adding appropriate padding. */ + unsigned long int n_net; /* Network number. */ +}; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/resource.h new file mode 100644 index 0000000000..4df082cd21 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/resource.h @@ -0,0 +1,266 @@ +/* Bit values & structures for resource limits. Alpha/Linux version. + Copyright (C) 1994-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_RESOURCE_H +# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." +#endif + +#include <bits/types.h> + +/* Transmute defines to enumerations. The macro re-definitions are + necessary because some programs want to test for operating system + features with #ifdef RUSAGE_SELF. In ISO C the reflexive + definition is a no-op. */ + +/* Kinds of resource limit. */ +enum __rlimit_resource +{ + /* Per-process CPU limit, in seconds. */ + RLIMIT_CPU = 0, +#define RLIMIT_CPU RLIMIT_CPU + + /* Largest file that can be created, in bytes. */ + RLIMIT_FSIZE = 1, +#define RLIMIT_FSIZE RLIMIT_FSIZE + + /* Maximum size of data segment, in bytes. */ + RLIMIT_DATA = 2, +#define RLIMIT_DATA RLIMIT_DATA + + /* Maximum size of stack segment, in bytes. */ + RLIMIT_STACK = 3, +#define RLIMIT_STACK RLIMIT_STACK + + /* Largest core file that can be created, in bytes. */ + RLIMIT_CORE = 4, +#define RLIMIT_CORE RLIMIT_CORE + + /* Largest resident set size, in bytes. + This affects swapping; processes that are exceeding their + resident set size will be more likely to have physical memory + taken from them. */ + __RLIMIT_RSS = 5, +#define RLIMIT_RSS __RLIMIT_RSS + + /* Number of open files. */ + RLIMIT_NOFILE = 6, + __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE __RLIMIT_OFILE + + /* Address space limit (?) */ + RLIMIT_AS = 7, +#define RLIMIT_AS RLIMIT_AS + + /* Number of processes. */ + __RLIMIT_NPROC = 8, +#define RLIMIT_NPROC __RLIMIT_NPROC + + /* Locked-in-memory address space. */ + __RLIMIT_MEMLOCK = 9, +#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK + + /* Maximum number of file locks. */ + __RLIMIT_LOCKS = 10, +#define RLIMIT_LOCKS __RLIMIT_LOCKS + + /* Maximum number of pending signals. */ + __RLIMIT_SIGPENDING = 11, +#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING + + /* Maximum bytes in POSIX message queues. */ + __RLIMIT_MSGQUEUE = 12, +#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE + + /* Maximum nice priority allowed to raise to. + Nice levels 19 .. -20 correspond to 0 .. 39 + values of this resource limit. */ + __RLIMIT_NICE = 13, +#define RLIMIT_NICE __RLIMIT_NICE + + /* Maximum realtime priority allowed for non-priviledged + processes. */ + __RLIMIT_RTPRIO = 14, +#define RLIMIT_RTPRIO __RLIMIT_RTPRIO + + /* Maximum CPU time in µs that a process scheduled under a real-time + scheduling policy may consume without making a blocking system + call before being forcibly descheduled. */ + __RLIMIT_RTTIME = 15, +#define RLIMIT_RTTIME __RLIMIT_RTTIME + + __RLIMIT_NLIMITS = 16, + __RLIM_NLIMITS = __RLIMIT_NLIMITS +#define RLIMIT_NLIMITS __RLIMIT_NLIMITS +#define RLIM_NLIMITS __RLIM_NLIMITS +}; + +/* Value to indicate that there is no limit. */ +#ifndef __USE_FILE_OFFSET64 +# define RLIM_INFINITY ((long int)(~0UL >> 1)) +#else +# define RLIM_INFINITY 0x7fffffffffffffffLL +#endif + +#ifdef __USE_LARGEFILE64 +# define RLIM64_INFINITY 0x7fffffffffffffffLL +#endif + +/* We can represent all limits. */ +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY + + +/* Type for resource quantity measurement. */ +#ifndef __USE_FILE_OFFSET64 +typedef __rlim_t rlim_t; +#else +typedef __rlim64_t rlim_t; +#endif +#ifdef __USE_LARGEFILE64 +typedef __rlim64_t rlim64_t; +#endif + +struct rlimit + { + /* The current (soft) limit. */ + rlim_t rlim_cur; + /* The hard limit. */ + rlim_t rlim_max; + }; + +#ifdef __USE_LARGEFILE64 +struct rlimit64 + { + /* The current (soft) limit. */ + rlim64_t rlim_cur; + /* The hard limit. */ + rlim64_t rlim_max; + }; +#endif + +/* Whose usage statistics do you want? */ +enum __rusage_who +{ + /* The calling process. */ + RUSAGE_SELF = 0, +#define RUSAGE_SELF RUSAGE_SELF + + /* All of its terminated child processes. */ + RUSAGE_CHILDREN = -1 +#define RUSAGE_CHILDREN RUSAGE_CHILDREN + +#ifdef __USE_GNU + , + /* The calling thread. */ + RUSAGE_THREAD = 1 +# define RUSAGE_THREAD RUSAGE_THREAD + /* Name for the same functionality on Solaris. */ +# define RUSAGE_LWP RUSAGE_THREAD +#endif +}; + +#define __need_timeval +#include <bits/time.h> /* For `struct timeval'. */ + +/* Structure which says how much of each resource has been used. */ +struct rusage + { + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + long int ru_maxrss; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + long int ru_ixrss; + /* Amount of data segment memory used (kilobyte-seconds). */ + long int ru_idrss; + /* Amount of stack memory used (kilobyte-seconds). */ + long int ru_isrss; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + long int ru_minflt; + /* Number of hard page faults (i.e. those that required I/O). */ + long int ru_majflt; + /* Number of times a process was swapped out of physical memory. */ + long int ru_nswap; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + long int ru_inblock; + /* Number of output operations via the file system. */ + long int ru_oublock; + /* Number of IPC messages sent. */ + long int ru_msgsnd; + /* Number of IPC messages received. */ + long int ru_msgrcv; + /* Number of signals delivered. */ + long int ru_nsignals; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + long int ru_nvcsw; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + long int ru_nivcsw; + }; + +/* Priority limits. */ +#define PRIO_MIN -20 /* Minimum priority a process can have. */ +#define PRIO_MAX 20 /* Maximum priority a process can have. */ + +/* The type of the WHICH argument to `getpriority' and `setpriority', + indicating what flavor of entity the WHO argument specifies. */ +enum __priority_which +{ + PRIO_PROCESS = 0, /* WHO is a process ID. */ +#define PRIO_PROCESS PRIO_PROCESS + PRIO_PGRP = 1, /* WHO is a process group ID. */ +#define PRIO_PGRP PRIO_PGRP + PRIO_USER = 2 /* WHO is a user ID. */ +#define PRIO_USER PRIO_USER +}; + + +__BEGIN_DECLS + +#ifdef __USE_GNU +/* Modify and return resource limits of a process atomically. */ +# ifndef __USE_FILE_OFFSET64 +extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, + enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit), prlimit64); +# else +# define prlimit prlimit64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit64 *__new_limit, + struct rlimit64 *__old_limit) __THROW; +# endif +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/sem.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/sem.h new file mode 100644 index 0000000000..6cff0fd741 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/sem.h @@ -0,0 +1,84 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SEM_H +# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." +#endif + +#include <sys/types.h> + +/* Flags for `semop'. */ +#define SEM_UNDO 0x1000 /* undo the operation on exit */ + +/* Commands for `semctl'. */ +#define GETPID 11 /* get sempid */ +#define GETVAL 12 /* get semval */ +#define GETALL 13 /* get all semval's */ +#define GETNCNT 14 /* get semncnt */ +#define GETZCNT 15 /* get semzcnt */ +#define SETVAL 16 /* set semval */ +#define SETALL 17 /* set all semval's */ + + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ + unsigned long int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +/* The user should define a union like the following to use it for arguments + for `semctl'. + + union semun + { + int val; <= value for SETVAL + struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET + unsigned short int *array; <= array for GETALL & SETALL + struct seminfo *__buf; <= buffer for IPC_INFO + }; + + Previous versions of this file used to define this union but this is + incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether + one must define the union or not. */ +#define _SEM_SEMUN_UNDEFINED 1 + +#ifdef __USE_MISC + +/* ipcs ctl cmds */ +# define SEM_STAT 18 +# define SEM_INFO 19 + +struct seminfo +{ + int semmap; + int semmni; + int semmns; + int semmnu; + int semmsl; + int semopm; + int semume; + int semusz; + int semvmx; + int semaem; +}; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/shm.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/shm.h new file mode 100644 index 0000000000..48f4cb9305 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/shm.h @@ -0,0 +1,100 @@ +/* Copyright (C) 1995-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." +#endif + +#include <bits/types.h> + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ +#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ + +/* Flags for `shmat'. */ +#define SHM_RDONLY 010000 /* attach read-only else read-write */ +#define SHM_RND 020000 /* round attach address to SHMLBA */ +#define SHM_REMAP 040000 /* take-over region on attach */ +#define SHM_EXEC 0100000 /* execution access */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + +__BEGIN_DECLS + +/* Segment low boundary address multiple. */ +#define SHMLBA (__getpagesize ()) +extern int __getpagesize (void) __THROW __attribute__ ((__const__)); + + +/* Type to count number of attaches. */ +typedef unsigned long int shmatt_t; + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __unused1; + unsigned long int __unused2; + }; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +# define SHM_STAT 13 +# define SHM_INFO 14 + +/* shm_mode upper byte flags */ +# define SHM_DEST 01000 /* segment will be destroyed on last detach */ +# define SHM_LOCKED 02000 /* segment will not be swapped */ +# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ +# define SHM_NORESERVE 010000 /* don't check for reservations */ + +struct shminfo + { + unsigned long int shmmax; + unsigned long int shmmin; + unsigned long int shmmni; + unsigned long int shmseg; + unsigned long int shmall; + unsigned long int __unused1; + unsigned long int __unused2; + unsigned long int __unused3; + unsigned long int __unused4; + }; + +struct shm_info + { + int used_ids; + unsigned long int shm_tot; /* total allocated shm */ + unsigned long int shm_rss; /* total resident shm */ + unsigned long int shm_swp; /* total swapped shm */ + unsigned long int swap_attempts; + unsigned long int swap_successes; + }; + +#endif /* __USE_MISC */ + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h new file mode 100644 index 0000000000..2d900185bb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h @@ -0,0 +1,75 @@ +/* The proper definitions for Linux/Alpha sigaction. + Copyright (C) 1996, 1997, 1999, 2000, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." +#endif + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ +#ifdef __USE_POSIX199309 + union + { + /* Used if SA_SIGINFO is not set. */ + __sighandler_t sa_handler; + /* Used if SA_SIGINFO is set. */ + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction +#else + __sighandler_t sa_handler; +#endif + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + unsigned int sa_flags; + }; + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDWAIT 0x00000020 /* Don't create zombie on child death. */ +#define SA_SIGINFO 0x00000040 /* Invoke signal-catching function with + three arguments instead of one. */ +#if defined __USE_UNIX98 || defined __USE_MISC +# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +#endif +#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8 +# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */ +# define SA_NODEFER 0x00000008 /* Don't automatically block the signal + when its handler is being executed. */ +# define SA_RESETHAND 0x00000010 /* Reset to SIG_DFL on entry to handler. */ +#endif +#ifdef __USE_MISC +# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ + +/* Some aliases for the SA_ constants. */ +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND +# define SA_STACK SA_ONSTACK +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/siginfo.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/siginfo.h new file mode 100644 index 0000000000..4a465a5bd5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/siginfo.h @@ -0,0 +1,308 @@ +/* siginfo_t, sigevent and constants. Linux/Alpha version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SIGNAL_H && !defined __need_siginfo_t \ + && !defined __need_sigevent_t +# error "Never include this file directly. Use <signal.h> instead" +#endif + +#if (!defined __have_sigval_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t \ + || defined __need_sigevent_t)) +# define __have_sigval_t 1 + +/* Type for data associated with a signal. */ +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; +#endif + +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 + +# define __SI_MAX_SIZE 128 +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) + +typedef struct + { + int si_signo; /* Signal number. */ + int si_errno; /* If non-zero, an errno value associated with + this signal, as defined in <errno.h>. */ + int si_code; /* Signal code. */ + + union + { + int _pad[__SI_PAD_SIZE]; + + /* kill(). */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + } _kill; + + /* POSIX.1b timers. */ + struct + { + int si_tid; /* Timer ID. */ + int si_overrun; /* Overrun count. */ + sigval_t si_sigval; /* Signal value. */ + } _timer; + + /* POSIX.1b signals. */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + sigval_t si_sigval; /* Signal value. */ + } _rt; + + /* SIGCHLD. */ + struct + { + __pid_t si_pid; /* Which child. */ + __uid_t si_uid; /* Real user ID of sending process. */ + int si_status; /* Exit value or signal. */ + __clock_t si_utime; + __clock_t si_stime; + } _sigchld; + + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ + struct + { + void *si_addr; /* Faulting insn/memory ref. */ + } _sigfault; + + /* SIGPOLL. */ + struct + { + int si_band; /* Band event for SIGPOLL. */ + int si_fd; + } _sigpoll; + } _sifields; + } siginfo_t; + + +/* X/Open requires some more fields with fixed names. */ +# define si_pid _sifields._kill.si_pid +# define si_uid _sifields._kill.si_uid +# define si_timerid _sifields._timer.si_tid +# define si_overrun _sifields._timer.si_overrun +# define si_status _sifields._sigchld.si_status +# define si_utime _sifields._sigchld.si_utime +# define si_stime _sifields._sigchld.si_stime +# define si_value _sifields._rt.si_sigval +# define si_int _sifields._rt.si_sigval.sival_int +# define si_ptr _sifields._rt.si_sigval.sival_ptr +# define si_addr _sifields._sigfault.si_addr +# define si_band _sifields._sigpoll.si_band +# define si_fd _sifields._sigpoll.si_fd + + +/* Values for `si_code'. Positive values are reserved for kernel-generated + signals. */ +enum +{ + SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ +# define SI_ASYNCNL SI_ASYNCNL + SI_TKILL = -6, /* Sent by tkill. */ +# define SI_TKILL SI_TKILL + SI_SIGIO, /* Sent by queued SIGIO. */ +# define SI_SIGIO SI_SIGIO + SI_ASYNCIO, /* Sent by AIO completion. */ +# define SI_ASYNCIO SI_ASYNCIO + SI_MESGQ, /* Sent by real time mesq state change. */ +# define SI_MESGQ SI_MESGQ + SI_TIMER, /* Sent by timer expiration. */ +# define SI_TIMER SI_TIMER + SI_QUEUE, /* Sent by sigqueue. */ +# define SI_QUEUE SI_QUEUE + SI_USER, /* Sent by kill, sigsend, raise. */ +# define SI_USER SI_USER + SI_KERNEL = 0x80 /* Send by kernel. */ +#define SI_KERNEL SI_KERNEL +}; + + +/* `si_code' values for SIGILL signal. */ +enum +{ + ILL_ILLOPC = 1, /* Illegal opcode. */ +# define ILL_ILLOPC ILL_ILLOPC + ILL_ILLOPN, /* Illegal operand. */ +# define ILL_ILLOPN ILL_ILLOPN + ILL_ILLADR, /* Illegal addressing mode. */ +# define ILL_ILLADR ILL_ILLADR + ILL_ILLTRP, /* Illegal trap. */ +# define ILL_ILLTRP ILL_ILLTRP + ILL_PRVOPC, /* Privileged opcode. */ +# define ILL_PRVOPC ILL_PRVOPC + ILL_PRVREG, /* Privileged register. */ +# define ILL_PRVREG ILL_PRVREG + ILL_COPROC, /* Coprocessor error. */ +# define ILL_COPROC ILL_COPROC + ILL_BADSTK /* Internal stack error. */ +# define ILL_BADSTK ILL_BADSTK +}; + +/* `si_code' values for SIGFPE signal. */ +enum +{ + FPE_INTDIV = 1, /* Integer divide by zero. */ +# define FPE_INTDIV FPE_INTDIV + FPE_INTOVF, /* Integer overflow. */ +# define FPE_INTOVF FPE_INTOVF + FPE_FLTDIV, /* Floating point divide by zero. */ +# define FPE_FLTDIV FPE_FLTDIV + FPE_FLTOVF, /* Floating point overflow. */ +# define FPE_FLTOVF FPE_FLTOVF + FPE_FLTUND, /* Floating point underflow. */ +# define FPE_FLTUND FPE_FLTUND + FPE_FLTRES, /* Floating point inexact result. */ +# define FPE_FLTRES FPE_FLTRES + FPE_FLTINV, /* Floating point invalid operation. */ +# define FPE_FLTINV FPE_FLTINV + FPE_FLTSUB /* Subscript out of range. */ +# define FPE_FLTSUB FPE_FLTSUB +}; + +/* `si_code' values for SIGSEGV signal. */ +enum +{ + SEGV_MAPERR = 1, /* Address not mapped to object. */ +# define SEGV_MAPERR SEGV_MAPERR + SEGV_ACCERR /* Invalid permissions for mapped object. */ +# define SEGV_ACCERR SEGV_ACCERR +}; + +/* `si_code' values for SIGBUS signal. */ +enum +{ + BUS_ADRALN = 1, /* Invalid address alignment. */ +# define BUS_ADRALN BUS_ADRALN + BUS_ADRERR, /* Non-existant physical address. */ +# define BUS_ADRERR BUS_ADRERR + BUS_OBJERR /* Object specific hardware error. */ +# define BUS_OBJERR BUS_OBJERR +}; + +/* `si_code' values for SIGTRAP signal. */ +enum +{ + TRAP_BRKPT = 1, /* Process breakpoint. */ +# define TRAP_BRKPT TRAP_BRKPT + TRAP_TRACE /* Process trace trap. */ +# define TRAP_TRACE TRAP_TRACE +}; + +/* `si_code' values for SIGCHLD signal. */ +enum +{ + CLD_EXITED = 1, /* Child has exited. */ +# define CLD_EXITED CLD_EXITED + CLD_KILLED, /* Child was killed. */ +# define CLD_KILLED CLD_KILLED + CLD_DUMPED, /* Child terminated abnormally. */ +# define CLD_DUMPED CLD_DUMPED + CLD_TRAPPED, /* Traced child has trapped. */ +# define CLD_TRAPPED CLD_TRAPPED + CLD_STOPPED, /* Child has stopped. */ +# define CLD_STOPPED CLD_STOPPED + CLD_CONTINUED /* Stopped child has continued. */ +# define CLD_CONTINUED CLD_CONTINUED +}; + +/* `si_code' values for SIGPOLL signal. */ +enum +{ + POLL_IN = 1, /* Data input available. */ +# define POLL_IN POLL_IN + POLL_OUT, /* Output buffers available. */ +# define POLL_OUT POLL_OUT + POLL_MSG, /* Input message available. */ +# define POLL_MSG POLL_MSG + POLL_ERR, /* I/O error. */ +# define POLL_ERR POLL_ERR + POLL_PRI, /* High priority input available. */ +# define POLL_PRI POLL_PRI + POLL_HUP /* Device disconnected. */ +# define POLL_HUP POLL_HUP +}; + +# undef __need_siginfo_t +#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ + + +#if (defined _SIGNAL_H || defined __need_sigevent_t) \ + && !defined __have_sigevent_t +# define __have_sigevent_t 1 + +/* Structure to transport application-defined values with signals. */ +# define __SIGEV_MAX_SIZE 64 +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) + +/* Forward declaration. */ +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + +typedef struct sigevent + { + sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + + union + { + int _pad[__SIGEV_PAD_SIZE]; + + /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the + thread to receive the signal. */ + __pid_t _tid; + + struct + { + void (*_function) (sigval_t); /* Function to start. */ + pthread_attr_t *_attribute; /* Thread attributes. */ + } _sigev_thread; + } _sigev_un; + } sigevent_t; + +/* POSIX names to access some of the members. */ +# define sigev_notify_function _sigev_un._sigev_thread._function +# define sigev_notify_attributes _sigev_un._sigev_thread._attribute + +/* `sigev_notify' values. */ +enum +{ + SIGEV_SIGNAL = 0, /* Notify via signal. */ +# define SIGEV_SIGNAL SIGEV_SIGNAL + SIGEV_NONE, /* Other notification: meaningless. */ +# define SIGEV_NONE SIGEV_NONE + SIGEV_THREAD, /* Deliver via thread creation. */ +# define SIGEV_THREAD SIGEV_THREAD + + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ +#define SIGEV_THREAD_ID SIGEV_THREAD_ID +}; + +#endif /* have _SIGNAL_H. */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h new file mode 100644 index 0000000000..7ea70faef3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/signalfd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2007-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SIGNALFD_H +# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." +#endif + +/* Flags for signalfd. */ +enum + { + SFD_CLOEXEC = 010000000, +#define SFD_CLOEXEC SFD_CLOEXEC + SFD_NONBLOCK = 000000004 +#define SFD_NONBLOCK SFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/signum.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/signum.h new file mode 100644 index 0000000000..8ae74fcf83 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/signum.h @@ -0,0 +1,81 @@ +/* Signal number definitions. Linux/Alpha version. + Copyright (C) 1996, 1997, 1998, 1999, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +#ifdef __USE_UNIX98 +# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ +#endif + +/* + * Linux/AXP has different signal numbers that Linux/i386: I'm trying + * to make it OSF/1 binary compatible, at least for normal binaries. + */ +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGEMT 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGBUS 10 +#define SIGSEGV 11 +#define SIGSYS 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGURG 16 +#define SIGSTOP 17 +#define SIGTSTP 18 +#define SIGCONT 19 +#define SIGCHLD 20 +#define SIGCLD SIGCHLD +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGIO 23 +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGINFO 29 +#define SIGUSR1 30 +#define SIGUSR2 31 + +#define SIGPOLL SIGIO +#define SIGPWR SIGINFO +#define SIGIOT SIGABRT + +#define _NSIG 65 /* Biggest signal number + 1. */ + +#define SIGRTMIN (__libc_current_sigrtmin ()) +#define SIGRTMAX (__libc_current_sigrtmax ()) + +/* These are the hard limits of the kernel. These values should not be + used directly at user level. */ +#define __SIGRTMIN 32 +#define __SIGRTMAX (_NSIG - 1) + +#endif /* <signal.h> included. */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h new file mode 100644 index 0000000000..5cea395955 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h @@ -0,0 +1,54 @@ +/* sigstack, sigaltstack definitions. + Copyright (C) 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include this file directly. Use <signal.h> instead" +#endif + + +/* Structure describing a signal stack (obsolete). */ +struct sigstack + { + __ptr_t ss_sp; /* Signal stack pointer. */ + int ss_onstack; /* Nonzero if executing on this stack. */ + }; + + +/* Possible values for `ss_flags.'. */ +enum +{ + SS_ONSTACK = 1, +#define SS_ONSTACK SS_ONSTACK + SS_DISABLE +#define SS_DISABLE SS_DISABLE +}; + +/* Minimum stack size for a signal handler. */ +#define MINSIGSTKSZ 4096 + +/* System default stack size. */ +#define SIGSTKSZ 16384 + + +/* Alternate, preferred interface. */ +typedef struct sigaltstack + { + __ptr_t ss_sp; + int ss_flags; + size_t ss_size; + } stack_t; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h new file mode 100644 index 0000000000..d3f45436b6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h @@ -0,0 +1,55 @@ +/* Define enum __socket_type for Linux/Alpha. + Copyright (C) 1991-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SOCKET_H +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." +#endif + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ +#define SOCK_DCCP SOCK_DCCP + SOCK_PACKET = 10, /* Linux specific way of getting packets + at the dev level. For writing rarp and + other similar things on the user level. */ +#define SOCK_PACKET SOCK_PACKET + + /* Flags to be ORed into the type parameter of socket and socketpair and + used for the flags parameter of paccept. */ + + SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the + new descriptor(s). */ +#define SOCK_CLOEXEC SOCK_CLOEXEC + SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as + non-blocking. */ +#define SOCK_NONBLOCK SOCK_NONBLOCK +}; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h new file mode 100644 index 0000000000..68e5989aa2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/stat.h @@ -0,0 +1,160 @@ +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_GLIBC2 1 +#define _STAT_VER_GLIBC2_1 2 +#define _STAT_VER_KERNEL64 3 +#define _STAT_VER_GLIBC2_3_4 3 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + + +/* Nanosecond resolution timestamps are stored in a format equivalent to + 'struct timespec'. This is the type used whenever possible but the + Unix namespace rules do not allow the identifier 'timespec' to appear + in the <sys/stat.h> header. Therefore we have to handle the use of + this header in strictly standard-compliant sources special. + + Use neat tidy anonymous unions and structures when possible. */ + +#if defined __USE_MISC || defined __USE_XOPEN2K8 +# if __GNUC_PREREQ(3,3) +# define __ST_TIME(X) \ + __extension__ union { \ + struct timespec st_##X##tim; \ + struct { \ + __time_t st_##X##time; \ + unsigned long st_##X##timensec; \ + }; \ + } +# else +# define __ST_TIME(X) struct timespec st_##X##tim +# define st_atime st_atim.tv_sec +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# endif +#else +# define __ST_TIME(X) \ + __time_t st_##X##time; \ + unsigned long st_##X##timensec +#endif + + +struct stat + { + __dev_t st_dev; /* Device. */ +#ifdef __USE_FILE_OFFSET64 + __ino64_t st_ino; /* File serial number. */ +#else + __ino_t st_ino; /* File serial number. */ + int __pad0; /* 64-bit st_ino. */ +#endif + __dev_t st_rdev; /* Device number, if device. */ + __off_t st_size; /* Size of file, in bytes. */ +#ifdef __USE_FILE_OFFSET64 + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +#else + __blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */ + int __pad1; /* 64-bit st_blocks. */ +#endif + __mode_t st_mode; /* File mode. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + __nlink_t st_nlink; /* Link count. */ + int __pad2; /* Real padding. */ + __ST_TIME(a); /* Time of last access. */ + __ST_TIME(m); /* Time of last modification. */ + __ST_TIME(c); /* Time of last status change. */ + long __unused[3]; + }; + +#ifdef __USE_LARGEFILE64 +/* Note stat64 is the same shape as stat. */ +struct stat64 + { + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __dev_t st_rdev; /* Device number, if device. */ + __off_t st_size; /* Size of file, in bytes. */ + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ + __mode_t st_mode; /* File mode. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + __nlink_t st_nlink; /* Link count. */ + int __pad0; /* Real padding. */ + __ST_TIME(a); /* Time of last access. */ + __ST_TIME(m); /* Time of last modification. */ + __ST_TIME(c); /* Time of last status change. */ + long __unused[3]; + }; +#endif + +#undef __ST_TIME + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h new file mode 100644 index 0000000000..0b820281e6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/statfs.h @@ -0,0 +1,68 @@ +/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_STATFS_H +# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." +#endif + +#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t. */ + +struct statfs + { + int f_type; + int f_bsize; +#ifndef __USE_FILE_OFFSET64 + __fsblkcnt_t f_blocks; + __fsblkcnt_t f_bfree; + __fsblkcnt_t f_bavail; + __fsfilcnt_t f_files; + __fsfilcnt_t f_ffree; +#else + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; +#endif + __fsid_t f_fsid; + int f_namelen; + int f_frsize; + int f_flags; + int f_spare[4]; + }; + +#ifdef __USE_LARGEFILE64 +struct statfs64 + { + int f_type; + int f_bsize; + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; + __fsid_t f_fsid; + int f_namelen; + int f_frsize; + int f_flags; + int f_spare[4]; + }; +#endif + +/* Tell code we have this member. */ +#define _STATFS_F_NAMELEN +#define _STATFS_F_FRSIZE diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h new file mode 100644 index 0000000000..534a8bf2ff --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -0,0 +1,225 @@ +/* termios type and macro definitions. Linux version. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2003, 2005 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios.h> directly; use <termios.h> instead." +#endif + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 32 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_cc[NCCS]; /* control characters */ + cc_t c_line; /* line discipline (== c_cc[33]) */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 + }; + +/* c_cc characters */ +#define VEOF 0 +#define VEOL 1 +#define VEOL2 2 +#define VERASE 3 +#define VWERASE 4 +#define VKILL 5 +#define VREPRINT 6 +#define VSWTC 7 +#define VINTR 8 +#define VQUIT 9 +#define VSUSP 10 +#define VSTART 12 +#define VSTOP 13 +#define VLNEXT 14 +#define VDISCARD 15 +#define VMIN 16 +#define VTIME 17 + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#ifdef __USE_BSD + /* POSIX.1 doesn't want these... */ +# define IXANY 0004000 +# define IUCLC 0010000 +# define IMAXBEL 0020000 +# define IUTF8 0040000 +#endif + +/* c_oflag bits */ +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 + +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 + +#define OFILL 00000100 +#define OFDEL 00000200 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 00001400 +# define NL0 00000000 +# define NL1 00000400 +# define NL2 00001000 +# define NL3 00001400 +# define TABDLY 00006000 +# define TAB0 00000000 +# define TAB1 00002000 +# define TAB2 00004000 +# define TAB3 00006000 +# define CRDLY 00030000 +# define CR0 00000000 +# define CR1 00010000 +# define CR2 00020000 +# define CR3 00030000 +# define FFDLY 00040000 +# define FF0 00000000 +# define FF1 00040000 +# define BSDLY 00100000 +# define BS0 00000000 +# define BS1 00100000 +#endif + +#define VTDLY 00200000 +#define VT0 00000000 +#define VT1 00200000 + +#ifdef __USE_MISC +# define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ +#endif + +/* c_cflag bit meaning */ +#ifdef __USE_MISC +# define CBAUD 0000037 +#endif +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#ifdef __USE_MISC +# define EXTA B19200 +# define EXTB B38400 +# define CBAUDEX 0000000 +#endif +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 +#define B500000 00024 +#define B576000 00025 +#define B921600 00026 +#define B1000000 00027 +#define B1152000 00030 +#define B1500000 00031 +#define B2000000 00032 +#define B2500000 00033 +#define B3000000 00034 +#define B3500000 00035 +#define B4000000 00036 + +#define __MAX_BAUD B4000000 + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 + +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 + +#define CLOCAL 00100000 +#ifdef __USE_MISC +# define CMSPAR 010000000000 /* mark or space (stick) parity */ +# define CRTSCTS 020000000000 /* flow control */ +#endif + +/* c_lflag bits */ +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#if defined __USE_MISC || defined __USE_XOPEN +# define XCASE 0x00004000 +#endif +#define ECHO 0x00000008 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHONL 0x00000010 +#define NOFLSH 0x80000000 +#define TOSTOP 0x00400000 +#ifdef __USE_MISC +# define ECHOCTL 0x00000040 +# define ECHOPRT 0x00000020 +# define ECHOKE 0x00000001 +# define FLUSHO 0x00800000 +# define PENDIN 0x20000000 +#endif +#define IEXTEN 0x00000400 + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h new file mode 100644 index 0000000000..f04833d3fd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/timerfd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2008-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_TIMERFD_H +# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." +#endif + +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 010000000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 000000004 +#define TFD_NONBLOCK TFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h new file mode 100644 index 0000000000..2dbeb42a17 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -0,0 +1,69 @@ +/* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_TYPES_H +# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See <bits/types.h> for the meaning of these macros. This file exists so + that <bits/types.h> need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __U64_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __U32_TYPE +#define __INO64_T_TYPE __U64_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __S64_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __U64_TYPE +#define __BLKCNT_T_TYPE __U32_TYPE +#define __BLKCNT64_T_TYPE __U64_TYPE +#define __FSBLKCNT_T_TYPE __S32_TYPE +#define __FSBLKCNT64_T_TYPE __S64_TYPE +#define __FSFILCNT_T_TYPE __U32_TYPE +#define __FSFILCNT64_T_TYPE __U64_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __S64_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __SWBLK_T_TYPE __SLONGWORD_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __U32_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __FSWORD_T_TYPE __S32_TYPE + + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h new file mode 100644 index 0000000000..bc4551195b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h @@ -0,0 +1,29 @@ +/* Copyright (C) 1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define __WORDSIZE 64 + +#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL + +/* Signal that we didn't used to have a `long double'. The changes all + the `long double' function variants to be redirects to the double + functions. */ +# define __LONG_DOUBLE_MATH_OPTIONAL 1 +# ifndef __LONG_DOUBLE_128__ +# define __NO_LONG_DOUBLE_MATH 1 +# endif +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/brk.S b/ports/sysdeps/unix/sysv/linux/alpha/brk.S new file mode 100644 index 0000000000..cb759dbe9f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/brk.S @@ -0,0 +1,84 @@ +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Brendan Kehoe <brendan@zen.org>, 1993. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* __brk is a special syscall under Linux since it never returns an + error. Instead, the error condition is indicated by returning the old + break value (instead of the new, requested one). */ + +#include <sysdep.h> +#define _ERRNO_H +#include <bits/errno.h> + +#ifdef PIC +.section .bss + .align 3 + .globl __curbrk +__curbrk: .skip 8 + .type __curbrk,@object + .size __curbrk,8 +#else +.comm __curbrk, 8 +#endif + + .text + .align 4 + .globl __brk + .ent __brk + .usepv __brk, std + + cfi_startproc +__brk: + ldgp gp, 0(t12) + subq sp, 16, sp + cfi_adjust_cfa_offset (16) +#ifdef PROF + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at +#endif + + /* Save the requested brk across the system call. */ + stq a0, 0(sp) + + ldiq v0, __NR_brk + call_pal PAL_callsys + + ldq a0, 0(sp) + addq sp, 16, sp + cfi_adjust_cfa_offset (-16) + + /* Be prepared for an OSF-style brk. */ + bne a3, SYSCALL_ERROR_LABEL + beq v0, $ok + + /* Correctly handle the brk(0) query case. */ + cmoveq a0, v0, a0 + xor a0, v0, t0 + lda v0, ENOMEM + bne t0, SYSCALL_ERROR_LABEL + + /* Update __curbrk and return cleanly. */ + lda v0, 0 +$ok: stq a0, __curbrk + ret + +PSEUDO_END(__brk) + cfi_endproc + +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/clone.S b/ports/sysdeps/unix/sysv/linux/alpha/clone.S new file mode 100644 index 0000000000..1c6c8d6b7e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/clone.S @@ -0,0 +1,148 @@ +/* Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson <rth@tamu.edu>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after its all over. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 + +/* int clone(int (*fn)(void *arg), void *child_stack, int flags, + void *arg, pid_t *ptid, void *tls, pid_t *ctid); + + Note that everything past ARG is technically optional, based + on FLAGS, and that CTID is arg 7, and thus is on the stack. + However, since a load from top-of-stack better be legal always, + we don't bother checking FLAGS. */ + + .text +ENTRY(__clone) +#ifdef PROF + ldgp gp,0(pv) + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at + .prologue 1 +#else + .prologue 0 +#endif + + /* Sanity check arguments. */ + ldiq v0,EINVAL + beq a0,$error /* no NULL function pointers */ + beq a1,$error /* no NULL stack pointers */ + + /* Save the fn ptr and arg on the new stack. */ + subq a1,32,a1 + stq a0,0(a1) + stq a3,8(a1) +#ifdef RESET_PID + stq a2,16(a1) +#endif + + /* The syscall is of the form clone(flags, usp, ptid, ctid, tls). + Shift the flags, ptid, ctid, tls arguments into place; the + child_stack argument is already correct. */ + mov a2,a0 + mov a4,a2 + ldq a3,0(sp) + mov a5,a4 + + /* Do the system call. */ + ldiq v0,__NR_clone + call_pal PAL_callsys + + bne a3,$error + beq v0,thread_start + + /* Successful return from the parent. */ + ret + + /* Something bad happened -- no child created. */ +$error: +#ifndef PROF + br gp,1f +1: ldgp gp,0(gp) +#endif + SYSCALL_ERROR_HANDLER + + END(__clone) + +/* Load up the arguments to the function. Put this block of code in + its own function so that we can terminate the stack trace with our + debug info. */ + + .ent thread_start +thread_start: + .frame fp,0,fp,0 + mov 0, fp + .prologue 0 + +#ifdef RESET_PID + /* Check and see if we need to reset the PID. */ + ldq t0,16(sp) + lda t1,CLONE_THREAD + and t0,t1,t2 + beq t2,2f +1: +#endif + + /* Load up the arguments. */ + ldq pv,0(sp) + ldq a0,8(sp) + addq sp,32,sp + + /* Call the user's function. */ + jsr ra,(pv) + ldgp gp,0(ra) + + /* Call _exit rather than doing it inline for breakpoint purposes. */ + mov v0,a0 +#ifdef PIC + bsr ra, HIDDEN_JUMPTARGET(_exit) !samegp +#else + jsr ra, HIDDEN_JUMPTARGET(_exit) +#endif + + /* Die horribly. */ + halt + +#ifdef RESET_PID +2: + rduniq + lda t1, CLONE_VM + mov v0, s0 + lda v0, -1 + and t0, t1, t2 + bne t2, 3f + lda v0, __NR_getxpid + callsys +3: + stl v0, PID_OFFSET(s0) + stl v0, TID_OFFSET(s0) + br 1b +#endif + + .end thread_start + +weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/configure b/ports/sysdeps/unix/sysv/linux/alpha/configure new file mode 100644 index 0000000000..c7c4feeea1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/configure @@ -0,0 +1,11 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/alpha + +# There are several bits that no longer compile cleanly without +# realtime signal support (ver 2.2.0). Given that we also now +# require TLS (ver 2.6.0), it seems pointless to fix them. +# ??? Surely this should now be the generic default. +arch_minimum_kernel=2.6.0 + +# We did historically export the unwinder from glibc. +libc_cv_gcc_unwind_find_fde=yes diff --git a/ports/sysdeps/unix/sysv/linux/alpha/configure.in b/ports/sysdeps/unix/sysv/linux/alpha/configure.in new file mode 100644 index 0000000000..5a1af62073 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/configure.in @@ -0,0 +1,11 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/alpha + +# There are several bits that no longer compile cleanly without +# realtime signal support (ver 2.2.0). Given that we also now +# require TLS (ver 2.6.0), it seems pointless to fix them. +# ??? Surely this should now be the generic default. +arch_minimum_kernel=2.6.0 + +# We did historically export the unwinder from glibc. +libc_cv_gcc_unwind_find_fde=yes diff --git a/ports/sysdeps/unix/sysv/linux/alpha/creat.c b/ports/sysdeps/unix/sysv/linux/alpha/creat.c new file mode 100644 index 0000000000..9e661bab04 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/creat.c @@ -0,0 +1,8 @@ +/* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list defines creat and + creat64 for most linux targets, but on alpha creat is not a syscall. + If we do nothing, we'll wind up with creat64 being undefined, because + the syscalls.list assumes the creat->creat64 alias was created. We + could have overridden that with a create64.c, but we might as well do + the right thing and set up creat64 as an alias. */ +#include <io/creat.c> +weak_alias(__libc_creat, creat64) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h b/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h new file mode 100644 index 0000000000..ce80eb04b2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-auxv.h @@ -0,0 +1,35 @@ +/* Auxiliary vector processing for Linux/Alpha. + Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Scan the Aux Vector for the cache shape entries. */ + +extern long __libc_alpha_cache_shape[4]; + +#define DL_PLATFORM_AUXV \ + case AT_L1I_CACHESHAPE: \ + __libc_alpha_cache_shape[0] = av->a_un.a_val; \ + break; \ + case AT_L1D_CACHESHAPE: \ + __libc_alpha_cache_shape[1] = av->a_un.a_val; \ + break; \ + case AT_L2_CACHESHAPE: \ + __libc_alpha_cache_shape[2] = av->a_un.a_val; \ + break; \ + case AT_L3_CACHESHAPE: \ + __libc_alpha_cache_shape[3] = av->a_un.a_val; \ + break; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-brk.S b/ports/sysdeps/unix/sysv/linux/alpha/dl-brk.S new file mode 100644 index 0000000000..eeb96544e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-brk.S @@ -0,0 +1 @@ +#include <brk.S> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c b/ports/sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c new file mode 100644 index 0000000000..41e83bcf11 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c @@ -0,0 +1,9 @@ +/* In this implementation we do not really care whether the call fails + because of missing kernel support since we do not even call the + function in this case. */ +/* For Alpha, in <kernel-features.h> we redefine the default definition of + when __ASSUME_ATFCTS is present. The hack must wait until after that. */ +#include <kernel-features.h> +#undef __ASSUME_ATFCTS +#define __ASSUME_ATFCTS 1 +#include "fxstatat.c" diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-support.c b/ports/sysdeps/unix/sysv/linux/alpha/dl-support.c new file mode 100644 index 0000000000..290217671c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-support.c @@ -0,0 +1,2 @@ +#include "dl-auxv.h" +#include <elf/dl-support.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c b/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c new file mode 100644 index 0000000000..5d0867a100 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c @@ -0,0 +1,5 @@ +#include "dl-auxv.h" + +long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 }; + +#include <sysdeps/unix/sysv/linux/dl-sysdep.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fpu/Implies b/ports/sysdeps/unix/sysv/linux/alpha/fpu/Implies new file mode 100644 index 0000000000..d76f511c2e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fpu/Implies @@ -0,0 +1,2 @@ +# Override ldbl-opt with alpha specific routines. +alpha/fpu diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c b/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c new file mode 100644 index 0000000000..a01b2cf11a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c @@ -0,0 +1,91 @@ +/* Copyright (C) 2004,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <fenv_libc.h> +#include <sysdep.h> +#include <float.h> +#include <kernel-features.h> +#include "kernel_sysinfo.h" + + +int +__feraiseexcept (int excepts) +{ + INTERNAL_SYSCALL_DECL (err); + unsigned long t = excepts; + long r; + + r = INTERNAL_SYSCALL (osf_setsysinfo, err, 2, SSI_IEEE_RAISE_EXCEPTION, &t); + +#ifndef __ASSUME_IEEE_RAISE_EXCEPTION + if (!INTERNAL_SYSCALL_ERROR_P (r, err)) + return 0; + + double d; + + /* If we got an error from SSI_IEEE_RAISE_EXCEPTION, assume it means that + the system call isn't actually implemented. Do the best we can. */ + + /* Invalid implemented with 0 / 0 -> NaN. */ + if (excepts & FE_INVALID) + __asm__ __volatile__ ("divs/su $f31,$f31,%0; trapb" : "=f"(d) : ); + + /* Division By Zero implemented with 1 / 0 -> NaN. */ + if (excepts & FE_DIVBYZERO) + __asm__ __volatile__ ("divs/su %1,$f31,%0; trapb" : "=&f"(d) : "f"(1.0f)); + + /* Overflow and underflow cannot be had all by themselves. We can + generate them with arithmetic, but we always get INEXACT raised + at the same time. Prepare to undo. */ + if ((excepts & (FE_OVERFLOW | FE_UNDERFLOW)) && !(excepts & FE_INEXACT)) + INTERNAL_SYSCALL (osf_getsysinfo, err, 2, GSI_IEEE_FP_CONTROL, &t); + + /* Overflow implemented with FLT_MAX + FLT_MAX -> Inf. */ + if (excepts & FE_OVERFLOW) + __asm__ __volatile__ ("adds/sui %1,%1,%0; trapb" + : "=&f"(d) : "f"(FLT_MAX)); + + /* Underflow implemented with FLT_MIN * FLT_MIN -> 0. */ + if (excepts & FE_UNDERFLOW) + __asm__ __volatile__ ("muls/sui %1,%1,%0; trapb" + : "=&f"(d) : "f"(FLT_MIN)); + + /* Inexact implemented with (long)0.5 -> 0. */ + if ((excepts & (FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)) == FE_INEXACT) + __asm__ __volatile__ ("cvttq/svi %1,%0; trapb" : "=&f"(d) : "f"(0.5f)); + + /* If we raised inexact when not asked, and inexact was not previously + raised, then clear that exception. */ + if ((excepts & (FE_OVERFLOW | FE_UNDERFLOW)) + && !((excepts | t) & FE_INEXACT)) + { + t |= excepts & SWCR_STATUS_MASK; + INTERNAL_SYSCALL (osf_setsysinfo, err, 2, SSI_IEEE_FP_CONTROL, &t); + } +#endif /* !__ASSUME_IEEE_RAISE_EXCEPTION */ + + return 0; +} + +#include <shlib-compat.h> +#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) +strong_alias (__feraiseexcept, __old_feraiseexcept) +compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); +#endif + +libm_hidden_ver (__feraiseexcept, feraiseexcept) +versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c new file mode 100644 index 0000000000..5639959adb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/fstatfs64.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c new file mode 100644 index 0000000000..92e772347b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/fstatvfs.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c new file mode 100644 index 0000000000..0f1e71027a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/fstatvfs64.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c b/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c new file mode 100644 index 0000000000..e53b2da13d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c @@ -0,0 +1,75 @@ +/* fxstat using old-style Unix stat system call. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define __fxstat64 __fxstat64_disable + +#include <errno.h> +#include <stddef.h> +#include <sys/stat.h> +#include <kernel_stat.h> +#include <sysdep.h> +#include <sys/syscall.h> +#include <xstatconv.h> + +#undef __fxstat64 + + +/* Get information about the file NAME in BUF. */ +int +__fxstat (int vers, int fd, struct stat *buf) +{ + INTERNAL_SYSCALL_DECL (err); + int result; + struct kernel_stat kbuf; + +#if __ASSUME_STAT64_SYSCALL > 0 + if (vers == _STAT_VER_KERNEL64) + { + result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; + } +#elif defined __NR_fstat64 + if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64) + { + int errno_out; + result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); + if (errno_out != ENOSYS) + { + __set_errno (errno_out); + return -1; + } + __libc_missing_axp_stat64 = 1; + } +#endif + + result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat_conv (vers, &kbuf, buf); + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; +} +hidden_def (__fxstat) +weak_alias (__fxstat, _fxstat); +strong_alias (__fxstat, __fxstat64); +hidden_ver (__fxstat, __fxstat64) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c new file mode 100644 index 0000000000..417f9d3eab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c @@ -0,0 +1,140 @@ +/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define __fxstatat64 __fxstatat64_disable + +#include <errno.h> +#include <fcntl.h> +#include <stddef.h> +#include <stdio.h> +#include <sys/stat.h> +#include <kernel_stat.h> +#include <sysdep.h> +#include <sys/syscall.h> +#include <xstatconv.h> + +#undef __fxstatat64 + +#ifdef __ASSUME_ATFCTS +# define __have_atfcts 1 +#endif +#ifdef __ASSUME_STAT64_SYSCALL +# define __libc_missing_axp_stat64 0 +#endif + +/* Get information about the file NAME in BUF. */ +int +__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) +{ + INTERNAL_SYSCALL_DECL (err); + int result, errno_out; + + /* ??? The __fxstatat entry point is new enough that it must be using + vers == _STAT_VER_KERNEL64. For the benefit of dl-fxstatat64.c, we + cannot actually check this, lest the compiler not optimize the rest + of the function away. */ + +#ifdef __NR_fstatat64 + if (__have_atfcts >= 0) + { + result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, st, flag); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); +#ifndef __ASSUME_ATFCTS + if (errno_out == ENOSYS) + __have_atfcts = -1; + else +#endif + { + __set_errno (errno_out); + return -1; + } + } +#endif /* __NR_fstatat64 */ + + if (flag & ~AT_SYMLINK_NOFOLLOW) + { + __set_errno (EINVAL); + return -1; + } + + char *buf = NULL; + + if (fd != AT_FDCWD && file[0] != '/') + { + size_t filelen = strlen (file); + if (__builtin_expect (filelen == 0, 0)) + { + __set_errno (ENOENT); + return -1; + } + + static const char procfd[] = "/proc/self/fd/%d/%s"; + /* Buffer for the path name we are going to use. It consists of + - the string /proc/self/fd/ + - the file descriptor number + - the file name provided. + The final NUL is included in the sizeof. A bit of overhead + due to the format elements compensates for possible negative + numbers. */ + size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen; + buf = alloca (buflen); + + __snprintf (buf, buflen, procfd, fd, file); + file = buf; + } + +#ifdef __NR_stat64 + if (!__libc_missing_axp_stat64) + { + if (flag & AT_SYMLINK_NOFOLLOW) + result = INTERNAL_SYSCALL (lstat64, err, 2, file, st); + else + result = INTERNAL_SYSCALL (stat64, err, 2, file, st); + + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); +# if __ASSUME_STAT64_SYSCALL == 0 + if (errno_out == ENOSYS) + __libc_missing_axp_stat64 = 1; + else +# endif + goto fail; + } +#endif /* __NR_stat64 */ + + struct kernel_stat kst; + + if (flag & AT_SYMLINK_NOFOLLOW) + result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst); + else + result = INTERNAL_SYSCALL (stat, err, 2, file, &kst); + + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat_conv (vers, &kst, st); + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); + + fail: + __atfct_seterrno (errno_out, fd, buf); + + return -1; +} +libc_hidden_def (__fxstatat) +strong_alias (__fxstatat, __fxstatat64); +libc_hidden_ver(__fxstatat, __fxstatat64); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/getclktck.c b/ports/sysdeps/unix/sysv/linux/alpha/getclktck.c new file mode 100644 index 0000000000..6636bbe689 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/getclktck.c @@ -0,0 +1,2 @@ +#define SYSTEM_CLK_TCK 1024 +#include <sysdeps/unix/sysv/linux/getclktck.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/getcontext.S b/ports/sysdeps/unix/sysv/linux/alpha/getcontext.S new file mode 100644 index 0000000000..6224b62633 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/getcontext.S @@ -0,0 +1,187 @@ +/* Save current context. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <ucontext-offsets.h> + +/* ??? Should be a better place for this that's asm friendly. */ +#define SIG_BLOCK 1 + + +ENTRY (__getcontext) +#ifdef PROF + ldgp gp, 0(pv) + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at + .prologue 1 +#else + .prologue 0 +#endif + + bsr $0, __getcontext_x + mov $31, $0 + ret + +END(__getcontext) +weak_alias (__getcontext, getcontext) + + +/* An internal routine used by getcontext and setcontext. + The incomming return address register is $0. */ + + .align 4 + .globl __getcontext_x + .hidden __getcontext_x + .usepv __getcontext_x, no + + cfi_startproc + cfi_return_column (64) +__getcontext_x: + cfi_register (64, 0) + + .set noat + + /* Return value of getcontext. $0 is the only register + whose value is not preserved. */ + stq $31, UC_SIGCTX+SC_REGS($16) + + /* Store all registers into the context. */ + stq $1, UC_SIGCTX+SC_REGS+1*8($16) + stq $2, UC_SIGCTX+SC_REGS+2*8($16) + stq $3, UC_SIGCTX+SC_REGS+3*8($16) + stq $4, UC_SIGCTX+SC_REGS+4*8($16) + stq $5, UC_SIGCTX+SC_REGS+5*8($16) + stq $6, UC_SIGCTX+SC_REGS+6*8($16) + stq $7, UC_SIGCTX+SC_REGS+7*8($16) + stq $8, UC_SIGCTX+SC_REGS+8*8($16) + stq $9, UC_SIGCTX+SC_REGS+9*8($16) + stq $10, UC_SIGCTX+SC_REGS+10*8($16) + stq $11, UC_SIGCTX+SC_REGS+11*8($16) + stq $12, UC_SIGCTX+SC_REGS+12*8($16) + stq $13, UC_SIGCTX+SC_REGS+13*8($16) + stq $14, UC_SIGCTX+SC_REGS+14*8($16) + stq $15, UC_SIGCTX+SC_REGS+15*8($16) + stq $16, UC_SIGCTX+SC_REGS+16*8($16) + stq $17, UC_SIGCTX+SC_REGS+17*8($16) + stq $18, UC_SIGCTX+SC_REGS+18*8($16) + stq $19, UC_SIGCTX+SC_REGS+19*8($16) + stq $20, UC_SIGCTX+SC_REGS+20*8($16) + stq $21, UC_SIGCTX+SC_REGS+21*8($16) + stq $22, UC_SIGCTX+SC_REGS+22*8($16) + stq $23, UC_SIGCTX+SC_REGS+23*8($16) + stq $24, UC_SIGCTX+SC_REGS+24*8($16) + stq $25, UC_SIGCTX+SC_REGS+25*8($16) + stq $26, UC_SIGCTX+SC_REGS+26*8($16) + stq $27, UC_SIGCTX+SC_REGS+27*8($16) + stq $28, UC_SIGCTX+SC_REGS+28*8($16) + stq $29, UC_SIGCTX+SC_REGS+29*8($16) + stq $30, UC_SIGCTX+SC_REGS+30*8($16) + stq $31, UC_SIGCTX+SC_REGS+31*8($16) + + stt $f0, UC_SIGCTX+SC_FPREGS+0*8($16) + stt $f1, UC_SIGCTX+SC_FPREGS+1*8($16) + stt $f2, UC_SIGCTX+SC_FPREGS+2*8($16) + stt $f3, UC_SIGCTX+SC_FPREGS+3*8($16) + stt $f4, UC_SIGCTX+SC_FPREGS+4*8($16) + stt $f5, UC_SIGCTX+SC_FPREGS+5*8($16) + stt $f6, UC_SIGCTX+SC_FPREGS+6*8($16) + stt $f7, UC_SIGCTX+SC_FPREGS+7*8($16) + stt $f8, UC_SIGCTX+SC_FPREGS+8*8($16) + stt $f9, UC_SIGCTX+SC_FPREGS+9*8($16) + stt $f10, UC_SIGCTX+SC_FPREGS+10*8($16) + stt $f11, UC_SIGCTX+SC_FPREGS+11*8($16) + stt $f12, UC_SIGCTX+SC_FPREGS+12*8($16) + stt $f13, UC_SIGCTX+SC_FPREGS+13*8($16) + stt $f14, UC_SIGCTX+SC_FPREGS+14*8($16) + stt $f15, UC_SIGCTX+SC_FPREGS+15*8($16) + stt $f16, UC_SIGCTX+SC_FPREGS+16*8($16) + stt $f17, UC_SIGCTX+SC_FPREGS+17*8($16) + stt $f18, UC_SIGCTX+SC_FPREGS+18*8($16) + stt $f19, UC_SIGCTX+SC_FPREGS+19*8($16) + stt $f20, UC_SIGCTX+SC_FPREGS+20*8($16) + stt $f21, UC_SIGCTX+SC_FPREGS+21*8($16) + stt $f22, UC_SIGCTX+SC_FPREGS+22*8($16) + stt $f23, UC_SIGCTX+SC_FPREGS+23*8($16) + stt $f24, UC_SIGCTX+SC_FPREGS+24*8($16) + stt $f25, UC_SIGCTX+SC_FPREGS+25*8($16) + stt $f26, UC_SIGCTX+SC_FPREGS+26*8($16) + stt $f27, UC_SIGCTX+SC_FPREGS+27*8($16) + stt $f28, UC_SIGCTX+SC_FPREGS+28*8($16) + stt $f29, UC_SIGCTX+SC_FPREGS+29*8($16) + stt $f30, UC_SIGCTX+SC_FPREGS+30*8($16) + stt $f31, UC_SIGCTX+SC_FPREGS+31*8($16) + + mf_fpcr $f0 + lda $1, 8 + stt $f0, UC_SIGCTX+SC_FPCR($16) + + /* The return address of getcontext is the restart pc. */ + stq $26, UC_SIGCTX+SC_PC($16) + + /* Userlevel always has a processor status word of 8. */ + stq $1, UC_SIGCTX+SC_PS($16) + + /* Save registers around the syscall. We preserve $17 + for the benefit of swapcontext. */ + subq $30, 4*8, $30 + cfi_adjust_cfa_offset(4*8) + stq $0, 0($30) + cfi_rel_offset(64, 0) + stq $16, 8($30) + stq $17, 16($30) + + /* Save the current signal mask. Whee, there are three + copies of this in the alpha ucontext_t. */ + lda $16, SIG_BLOCK + lda $17, 0 + lda $0, __NR_osf_sigprocmask + callsys + + ldq $16, 8($30) + ldq $17, 16($30) + + stq $0, UC_OSF_SIGMASK($16) + stq $0, UC_SIGCTX+SC_MASK($16) + stq $0, UC_SIGMASK($16) + stq $31, UC_SIGMASK + 1*8($16) + stq $31, UC_SIGMASK + 2*8($16) + stq $31, UC_SIGMASK + 3*8($16) + stq $31, UC_SIGMASK + 4*8($16) + stq $31, UC_SIGMASK + 5*8($16) + stq $31, UC_SIGMASK + 6*8($16) + stq $31, UC_SIGMASK + 7*8($16) + stq $31, UC_SIGMASK + 8*8($16) + stq $31, UC_SIGMASK + 9*8($16) + stq $31, UC_SIGMASK +10*8($16) + stq $31, UC_SIGMASK +11*8($16) + stq $31, UC_SIGMASK +12*8($16) + stq $31, UC_SIGMASK +13*8($16) + stq $31, UC_SIGMASK +14*8($16) + stq $31, UC_SIGMASK +15*8($16) + + ldq $0, 0($30) + addq $30, 4*8, $30 + cfi_register (64, 0) + cfi_adjust_cfa_offset(-4*8) + ret $31, ($0), 1 + + cfi_endproc + .size __getcontext_x, .-__getcontext_x + .type __getcontext_x, @function diff --git a/ports/sysdeps/unix/sysv/linux/alpha/getdents.c b/ports/sysdeps/unix/sysv/linux/alpha/getdents.c new file mode 100644 index 0000000000..dfecfef924 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/getdents.c @@ -0,0 +1,3 @@ +#define DIRENT_SET_DP_INO(dp, value) \ + do { (dp)->d_ino = (value); (dp)->__pad = 0; } while (0) +#include <sysdeps/unix/sysv/linux/getdents.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/getdents64.c b/ports/sysdeps/unix/sysv/linux/alpha/getdents64.c new file mode 100644 index 0000000000..50f1368b74 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/getdents64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/getdents64.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c b/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c new file mode 100644 index 0000000000..cec26d9815 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c @@ -0,0 +1,46 @@ +/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2001 + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <string.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +int +__gethostname (char *name, size_t len) +{ + int result; + + result = INLINE_SYSCALL (gethostname, 2, CHECK_N (name, len), len); + + if (result == 0 + /* See whether the string is terminated. If not we will return + an error. */ + && memchr (name, '\0', len) == NULL) + { + __set_errno (EOVERFLOW); + result = -1; + } + + return result; +} + +weak_alias (__gethostname, gethostname) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c b/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c new file mode 100644 index 0000000000..5c36d9348f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c @@ -0,0 +1,57 @@ +/* Determine various system internal values, Linux/Alpha version. + Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@suse.de> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +/* We need to define a special parser for /proc/cpuinfo. */ +#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \ + do \ + { \ + /* Find the line that contains the information about the number of \ + active cpus. We don't have to fear extremely long lines since \ + the kernel will not generate them. 8192 bytes are really enough. \ + If there is no "CPUs ..." line then we are on a UP system. */ \ + char *l; \ + (RESULT) = 1; \ + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ + if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1) \ + || (sscanf (BUFFER, "CPUs probed %*d active %d", \ + &(RESULT)) == 1)) \ + break; \ + } \ + while (0) + + +/* On the Alpha we can distinguish between the number of configured and + active cpus. */ +#define GET_NPROCS_CONF_PARSER(FP, BUFFER, RESULT) \ + do \ + { \ + /* Find the line that contains the information about the number of \ + probed cpus. We don't have to fear extremely long lines since \ + the kernel will not generate them. 8192 bytes are really enough. \ + If there is no "CPUs ..." line then we are on a UP system. */ \ + (RESULT) = 1; \ + while (fgets_unlocked ((BUFFER), sizeof (BUFFER), (FP)) != NULL) \ + if ((sscanf (buffer, "cpus detected : %d", &(RESULT)) == 1) \ + || (sscanf (buffer, "CPUs probed %d", &(RESULT)) == 1)) \ + break; \ + } \ + while (0) + +#include <sysdeps/unix/sysv/linux/getsysstats.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/glob.c b/ports/sysdeps/unix/sysv/linux/alpha/glob.c new file mode 100644 index 0000000000..42bafdba56 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/glob.c @@ -0,0 +1,51 @@ +/* Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define glob64 __no_glob64_decl +#define globfree64 __no_globfree64_decl + +#include <sys/types.h> +#include <glob.h> +#include <shlib-compat.h> + +/* For Linux/Alpha we have to make the glob symbols versioned. */ +#define glob(pattern, flags, errfunc, pglob) \ + __new_glob (pattern, flags, errfunc, pglob) +#define globfree(pglob) \ + __new_globfree (pglob) + +/* We need prototypes for these new names. */ +extern int __new_glob (const char *__pattern, int __flags, + int (*__errfunc) (const char *, int), + glob_t *__pglob); +extern void __new_globfree (glob_t *__pglob); + +#include <posix/glob.c> + +#undef glob +#undef globfree +#undef glob64 +#undef globfree64 + +versioned_symbol (libc, __new_glob, glob, GLIBC_2_1); +versioned_symbol (libc, __new_globfree, globfree, GLIBC_2_1); +libc_hidden_ver (__new_glob, glob) +libc_hidden_ver (__new_globfree, globfree) + +weak_alias (__new_glob, glob64) +weak_alias (__new_globfree, globfree64) +libc_hidden_ver (__new_globfree, globfree64) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S new file mode 100644 index 0000000000..ec24297b0b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S @@ -0,0 +1,60 @@ +/* Copyright (C) 1993, 1995, 1996, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger <davidm@azstarnet.com>, 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include "kernel_sysinfo.h" + + + .text + +LEAF(__ieee_get_fp_control, 16) +#ifdef PROF + ldgp gp, 0(pv) + lda sp, -16(sp) + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at + .prologue 1 +#elif defined PIC + lda sp, -16(sp) + .prologue 0 +#else + ldgp gp, 0(pv) + lda sp, -16(sp) + .prologue 1 +#endif + + mov sp, a1 + ldi a0, GSI_IEEE_FP_CONTROL + ldi v0, __NR_osf_getsysinfo + call_pal PAL_callsys + bne a3, $error + + ldq v0, 0(sp) + lda sp, 16(sp) + ret + +$error: + lda sp, 16(sp) + SYSCALL_ERROR_HANDLER + + END(__ieee_get_fp_control) + +libc_hidden_def(__ieee_get_fp_control) +weak_alias (__ieee_get_fp_control, ieee_get_fp_control) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S new file mode 100644 index 0000000000..1d425249da --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S @@ -0,0 +1,60 @@ +/* Copyright (C) 1993, 1995, 1996, 1997, 2003, 2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger <davidm@azstarnet.com>, 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include "kernel_sysinfo.h" + + +LEAF(__ieee_set_fp_control, 16) +#ifdef PROF + ldgp gp, 0(pv) + lda sp, -16(sp) + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at + .prologue 1 +#elif defined PIC + lda sp, -16(sp) + .prologue 0 +#else + ldgp gp, 0(pv) + lda sp, -16(sp) + .prologue 1 +#endif + + stq a0, 0(sp) + mov sp, a1 + ldi a0, SSI_IEEE_FP_CONTROL + ldi v0, __NR_osf_setsysinfo + call_pal PAL_callsys + + bne a3, $error + + lda sp, 16(sp) + ret + +$error: + lda sp, 16(sp) + SYSCALL_ERROR_HANDLER + + END(__ieee_set_fp_control) + +libc_hidden_def(__ieee_set_fp_control) +weak_alias (__ieee_set_fp_control, ieee_set_fp_control) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c new file mode 100644 index 0000000000..81d18f7bb2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/internal_statvfs64.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c b/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c new file mode 100644 index 0000000000..686c7ed237 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c @@ -0,0 +1,882 @@ +/* Copyright (C) 1992-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* I/O access is restricted to ISA port space (ports 0..65535). + Modern devices hopefully are sane enough not to put any performance + critical registers in i/o space. + + On the first call to ioperm, the entire (E)ISA port space is mapped + into the virtual address space at address io.base. mprotect calls + are then used to enable/disable access to ports. Per page, there + are PAGE_SIZE>>IO_SHIFT I/O ports (e.g., 256 ports on a Low Cost Alpha + based system using 8KB pages). + + Keep in mind that this code should be able to run in a 32bit address + space. It is therefore unreasonable to expect mmap'ing the entire + sparse address space would work (e.g., the Low Cost Alpha chip has an + I/O address space that's 512MB large!). */ + +/* Make sure the ldbu/stb asms below are not expaneded to macros. */ +#ifndef __alpha_bwx__ +asm(".arch ev56"); +#endif + +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <sys/types.h> +#include <sys/mman.h> +#include <sys/io.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +#define PATH_ALPHA_SYSTYPE "/etc/alpha_systype" +#define PATH_CPUINFO "/proc/cpuinfo" + +#define MAX_PORT 0x10000 +#define vip volatile int * +#define vuip volatile unsigned int * +#define vusp volatile unsigned short * +#define vucp volatile unsigned char * + +#define JENSEN_IO_BASE (0x300000000UL) +#define JENSEN_SPARSE_MEM (0x200000000UL) + +/* With respect to the I/O architecture, APECS and LCA are identical, + so the following defines apply to LCA as well. */ +#define APECS_IO_BASE (0x1c0000000UL) +#define APECS_SPARSE_MEM (0x200000000UL) +#define APECS_DENSE_MEM (0x300000000UL) + +/* The same holds for CIA and PYXIS, except for PYXIS we prefer BWX. */ +#define CIA_IO_BASE (0x8580000000UL) +#define CIA_SPARSE_MEM (0x8000000000UL) +#define CIA_DENSE_MEM (0x8600000000UL) + +#define PYXIS_IO_BASE (0x8900000000UL) +#define PYXIS_DENSE_MEM (0x8800000000UL) + +/* SABLE is EV4, GAMMA is EV5 */ +#define T2_IO_BASE (0x3a0000000UL) +#define T2_SPARSE_MEM (0x200000000UL) +#define T2_DENSE_MEM (0x3c0000000UL) + +#define GAMMA_IO_BASE (0x83a0000000UL) +#define GAMMA_SPARSE_MEM (0x8200000000UL) +#define GAMMA_DENSE_MEM (0x83c0000000UL) + +/* NOTE: these are hardwired to PCI bus 0 addresses!!! */ +#define MCPCIA_IO_BASE (0xf980000000UL) +#define MCPCIA_SPARSE_MEM (0xf800000000UL) +#define MCPCIA_DENSE_MEM (0xf900000000UL) + +/* Tsunami and Irongate use the same offsets, at least for hose 0. */ +#define TSUNAMI_IO_BASE (0x801fc000000UL) +#define TSUNAMI_DENSE_MEM (0x80000000000UL) + +/* Polaris has SPARSE space, but we prefer to use only DENSE + because of some idiosyncracies in actually using SPARSE. */ +#define POLARIS_IO_BASE (0xf9fc000000UL) +#define POLARIS_DENSE_MEM (0xf900000000UL) + +typedef enum { + IOSYS_UNKNOWN, IOSYS_JENSEN, IOSYS_APECS, IOSYS_CIA, IOSYS_PYXIS, IOSYS_T2, + IOSYS_TSUNAMI, IOSYS_MCPCIA, IOSYS_GAMMA, IOSYS_POLARIS, + IOSYS_CPUDEP, IOSYS_PCIDEP +} iosys_t; + +typedef enum { + IOSWIZZLE_JENSEN, IOSWIZZLE_SPARSE, IOSWIZZLE_DENSE +} ioswizzle_t; + +static struct io_system { + unsigned long int bus_memory_base; + unsigned long int sparse_bus_mem_base; + unsigned long int bus_io_base; +} io_system[] = { /* NOTE! must match iosys_t enumeration */ +/* UNKNOWN */ {0, 0, 0}, +/* JENSEN */ {0, JENSEN_SPARSE_MEM, JENSEN_IO_BASE}, +/* APECS */ {APECS_DENSE_MEM, APECS_SPARSE_MEM, APECS_IO_BASE}, +/* CIA */ {CIA_DENSE_MEM, CIA_SPARSE_MEM, CIA_IO_BASE}, +/* PYXIS */ {PYXIS_DENSE_MEM, 0, PYXIS_IO_BASE}, +/* T2 */ {T2_DENSE_MEM, T2_SPARSE_MEM, T2_IO_BASE}, +/* TSUNAMI */ {TSUNAMI_DENSE_MEM, 0, TSUNAMI_IO_BASE}, +/* MCPCIA */ {MCPCIA_DENSE_MEM, MCPCIA_SPARSE_MEM, MCPCIA_IO_BASE}, +/* GAMMA */ {GAMMA_DENSE_MEM, GAMMA_SPARSE_MEM, GAMMA_IO_BASE}, +/* POLARIS */ {POLARIS_DENSE_MEM, 0, POLARIS_IO_BASE}, +/* CPUDEP */ {0, 0, 0}, /* for platforms dependent on CPU type */ +/* PCIDEP */ {0, 0, 0}, /* for platforms dependent on core logic */ +}; + +static struct platform { + const char *name; + iosys_t io_sys; +} platform[] = { + {"Alcor", IOSYS_CIA}, + {"Avanti", IOSYS_APECS}, + {"Cabriolet", IOSYS_APECS}, + {"EB164", IOSYS_PCIDEP}, + {"EB64+", IOSYS_APECS}, + {"EB66", IOSYS_APECS}, + {"EB66P", IOSYS_APECS}, + {"Jensen", IOSYS_JENSEN}, + {"Miata", IOSYS_PYXIS}, + {"Mikasa", IOSYS_CPUDEP}, + {"Nautilus", IOSYS_TSUNAMI}, + {"Noname", IOSYS_APECS}, + {"Noritake", IOSYS_CPUDEP}, + {"Rawhide", IOSYS_MCPCIA}, + {"Ruffian", IOSYS_PYXIS}, + {"Sable", IOSYS_CPUDEP}, + {"Takara", IOSYS_CIA}, + {"Tsunami", IOSYS_TSUNAMI}, + {"XL", IOSYS_APECS}, +}; + +struct ioswtch { + void (*sethae)(unsigned long int addr); + void (*outb)(unsigned char b, unsigned long int port); + void (*outw)(unsigned short b, unsigned long int port); + void (*outl)(unsigned int b, unsigned long int port); + unsigned int (*inb)(unsigned long int port); + unsigned int (*inw)(unsigned long int port); + unsigned int (*inl)(unsigned long int port); +}; + +static struct { + unsigned long int hae_cache; + unsigned long int base; + struct ioswtch * swp; + unsigned long int bus_memory_base; + unsigned long int sparse_bus_memory_base; + unsigned long int io_base; + ioswizzle_t swiz; +} io; + +static inline void +stb_mb(unsigned char val, unsigned long addr) +{ + __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val)); +} + +static inline void +stw_mb(unsigned short val, unsigned long addr) +{ + __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val)); +} + +static inline void +stl_mb(unsigned int val, unsigned long addr) +{ + __asm__("stl %1,%0; mb" : "=m"(*(vip)addr) : "r"(val)); +} + +/* No need to examine error -- sethae never fails. */ +static inline void +__sethae(unsigned long value) +{ + register unsigned long r16 __asm__("$16") = value; + register unsigned long r0 __asm__("$0") = __NR_sethae; + __asm__ __volatile__ ("callsys" + : "=r"(r0) + : "0"(r0), "r" (r16) + : inline_syscall_clobbers, "$19"); +} + +extern long __pciconfig_iobase(enum __pciconfig_iobase_which __which, + unsigned long int __bus, + unsigned long int __dfn); + +static inline unsigned long int +port_to_cpu_addr (unsigned long int port, ioswizzle_t ioswiz, int size) +{ + if (ioswiz == IOSWIZZLE_SPARSE) + return io.base + (port << 5) + ((size - 1) << 3); + else if (ioswiz == IOSWIZZLE_DENSE) + return port + io.base; + else + return io.base + (port << 7) + ((size - 1) << 5); +} + +static inline __attribute__((always_inline)) void +inline_sethae (unsigned long int addr, ioswizzle_t ioswiz) +{ + if (ioswiz == IOSWIZZLE_SPARSE) + { + unsigned long int msb; + + /* no need to set hae if msb is 0: */ + msb = addr & 0xf8000000; + if (msb && msb != io.hae_cache) + { + io.hae_cache = msb; + __sethae (msb); + } + } + else if (ioswiz == IOSWIZZLE_JENSEN) + { + /* HAE on the Jensen is bits 31:25 shifted right. */ + addr >>= 25; + if (addr != io.hae_cache) + { + io.hae_cache = addr; + __sethae (addr); + } + } +} + +static inline void +inline_outb (unsigned char b, unsigned long int port, ioswizzle_t ioswiz) +{ + unsigned int w; + unsigned long int addr = port_to_cpu_addr (port, ioswiz, 1); + + asm ("insbl %2,%1,%0" : "=r" (w) : "ri" (port & 0x3), "r" (b)); + stl_mb(w, addr); +} + + +static inline void +inline_outw (unsigned short int b, unsigned long int port, ioswizzle_t ioswiz) +{ + unsigned long w; + unsigned long int addr = port_to_cpu_addr (port, ioswiz, 2); + + asm ("inswl %2,%1,%0" : "=r" (w) : "ri" (port & 0x3), "r" (b)); + stl_mb(w, addr); +} + + +static inline void +inline_outl (unsigned int b, unsigned long int port, ioswizzle_t ioswiz) +{ + unsigned long int addr = port_to_cpu_addr (port, ioswiz, 4); + + stl_mb(b, addr); +} + + +static inline unsigned int +inline_inb (unsigned long int port, ioswizzle_t ioswiz) +{ + unsigned long int addr = port_to_cpu_addr (port, ioswiz, 1); + int result; + + result = *(vip) addr; + result >>= (port & 3) * 8; + return 0xffUL & result; +} + + +static inline unsigned int +inline_inw (unsigned long int port, ioswizzle_t ioswiz) +{ + unsigned long int addr = port_to_cpu_addr (port, ioswiz, 2); + int result; + + result = *(vip) addr; + result >>= (port & 3) * 8; + return 0xffffUL & result; +} + + +static inline unsigned int +inline_inl (unsigned long int port, ioswizzle_t ioswiz) +{ + unsigned long int addr = port_to_cpu_addr (port, ioswiz, 4); + + return *(vuip) addr; +} + +/* + * Now define the inline functions for CPUs supporting byte/word insns, + * and whose core logic supports I/O space accesses utilizing them. + * + * These routines could be used by MIATA, for example, because it has + * and EV56 plus PYXIS, but it currently uses SPARSE anyway. This is + * also true of RX164 which used POLARIS, but we will choose to use + * these routines in that case instead of SPARSE. + * + * These routines are necessary for TSUNAMI/TYPHOON based platforms, + * which will have (at least) EV6. + */ + +static inline unsigned long int +dense_port_to_cpu_addr (unsigned long int port) +{ + return port + io.base; +} + +static inline void +inline_bwx_outb (unsigned char b, unsigned long int port) +{ + unsigned long int addr = dense_port_to_cpu_addr (port); + stb_mb (b, addr); +} + +static inline void +inline_bwx_outw (unsigned short int b, unsigned long int port) +{ + unsigned long int addr = dense_port_to_cpu_addr (port); + stw_mb (b, addr); +} + +static inline void +inline_bwx_outl (unsigned int b, unsigned long int port) +{ + unsigned long int addr = dense_port_to_cpu_addr (port); + stl_mb (b, addr); +} + +static inline unsigned int +inline_bwx_inb (unsigned long int port) +{ + unsigned long int addr = dense_port_to_cpu_addr (port); + unsigned char r; + + __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr)); + return r; +} + +static inline unsigned int +inline_bwx_inw (unsigned long int port) +{ + unsigned long int addr = dense_port_to_cpu_addr (port); + unsigned short r; + + __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr)); + return r; +} + +static inline unsigned int +inline_bwx_inl (unsigned long int port) +{ + unsigned long int addr = dense_port_to_cpu_addr (port); + + return *(vuip) addr; +} + +/* macros to define routines with appropriate names and functions */ + +/* these do either SPARSE or JENSEN swizzle */ + +#define DCL_SETHAE(name, ioswiz) \ +static void \ +name##_sethae (unsigned long int addr) \ +{ \ + inline_sethae (addr, IOSWIZZLE_##ioswiz); \ +} + +#define DCL_OUT(name, func, type, ioswiz) \ +static void \ +name##_##func (unsigned type b, unsigned long int addr) \ +{ \ + inline_##func (b, addr, IOSWIZZLE_##ioswiz); \ +} + +#define DCL_IN(name, func, ioswiz) \ +static unsigned int \ +name##_##func (unsigned long int addr) \ +{ \ + return inline_##func (addr, IOSWIZZLE_##ioswiz); \ +} + +/* these do DENSE, so no swizzle is needed */ + +#define DCL_OUT_BWX(name, func, type) \ +static void \ +name##_##func (unsigned type b, unsigned long int addr) \ +{ \ + inline_bwx_##func (b, addr); \ +} + +#define DCL_IN_BWX(name, func) \ +static unsigned int \ +name##_##func (unsigned long int addr) \ +{ \ + return inline_bwx_##func (addr); \ +} + +/* now declare/define the necessary routines */ + +DCL_SETHAE(jensen, JENSEN) +DCL_OUT(jensen, outb, char, JENSEN) +DCL_OUT(jensen, outw, short int, JENSEN) +DCL_OUT(jensen, outl, int, JENSEN) +DCL_IN(jensen, inb, JENSEN) +DCL_IN(jensen, inw, JENSEN) +DCL_IN(jensen, inl, JENSEN) + +DCL_SETHAE(sparse, SPARSE) +DCL_OUT(sparse, outb, char, SPARSE) +DCL_OUT(sparse, outw, short int, SPARSE) +DCL_OUT(sparse, outl, int, SPARSE) +DCL_IN(sparse, inb, SPARSE) +DCL_IN(sparse, inw, SPARSE) +DCL_IN(sparse, inl, SPARSE) + +DCL_SETHAE(dense, DENSE) +DCL_OUT_BWX(dense, outb, char) +DCL_OUT_BWX(dense, outw, short int) +DCL_OUT_BWX(dense, outl, int) +DCL_IN_BWX(dense, inb) +DCL_IN_BWX(dense, inw) +DCL_IN_BWX(dense, inl) + +/* define the "swizzle" switch */ +static struct ioswtch ioswtch[] = { + { + jensen_sethae, + jensen_outb, jensen_outw, jensen_outl, + jensen_inb, jensen_inw, jensen_inl + }, + { + sparse_sethae, + sparse_outb, sparse_outw, sparse_outl, + sparse_inb, sparse_inw, sparse_inl + }, + { + dense_sethae, + dense_outb, dense_outw, dense_outl, + dense_inb, dense_inw, dense_inl + } +}; + +#undef DEBUG_IOPERM + +/* Routine to process the /proc/cpuinfo information into the fields + that are required for correctly determining the platform parameters. */ + +struct cpuinfo_data +{ + char systype[256]; /* system type field */ + char sysvari[256]; /* system variation field */ + char cpumodel[256]; /* cpu model field */ +}; + +static inline int +process_cpuinfo(struct cpuinfo_data *data) +{ + int got_type, got_vari, got_model; + char dummy[256]; + FILE * fp; + int n; + + data->systype[0] = 0; + data->sysvari[0] = 0; + data->cpumodel[0] = 0; + + /* If there's an /etc/alpha_systype link, we're intending to override + whatever's in /proc/cpuinfo. */ + n = __readlink (PATH_ALPHA_SYSTYPE, data->systype, 256 - 1); + if (n > 0) + { + data->systype[n] = '\0'; + return 1; + } + + fp = fopen (PATH_CPUINFO, "rce"); + if (!fp) + return 0; + + got_type = got_vari = got_model = 0; + + while (1) + { + if (fgets_unlocked (dummy, 256, fp) == NULL) + break; + if (!got_type && + sscanf (dummy, "system type : %256[^\n]\n", data->systype) == 1) + got_type = 1; + if (!got_vari && + sscanf (dummy, "system variation : %256[^\n]\n", data->sysvari) == 1) + got_vari = 1; + if (!got_model && + sscanf (dummy, "cpu model : %256[^\n]\n", data->cpumodel) == 1) + got_model = 1; + } + + fclose (fp); + +#ifdef DEBUG_IOPERM + fprintf(stderr, "system type: `%s'\n", data->systype); + fprintf(stderr, "system vari: `%s'\n", data->sysvari); + fprintf(stderr, "cpu model: `%s'\n", data->cpumodel); +#endif + + return got_type + got_vari + got_model; +} + + +/* + * Initialize I/O system. + */ +static int +init_iosys (void) +{ + long addr; + int i, olderrno = errno; + struct cpuinfo_data data; + + /* First try the pciconfig_iobase syscall added to 2.2.15 and 2.3.99. */ + +#ifdef __NR_pciconfig_iobase + addr = __pciconfig_iobase (IOBASE_DENSE_MEM, 0, 0); + if (addr != -1) + { + ioswizzle_t io_swiz; + + if (addr == 0) + { + /* Only Jensen doesn't have dense mem space. */ + io.sparse_bus_memory_base + = io_system[IOSYS_JENSEN].sparse_bus_mem_base; + io.io_base = io_system[IOSYS_JENSEN].bus_io_base; + io_swiz = IOSWIZZLE_JENSEN; + } + else + { + io.bus_memory_base = addr; + + addr = __pciconfig_iobase (IOBASE_DENSE_IO, 0, 0); + if (addr != 0) + { + /* The X server uses _bus_base_sparse == 0 to know that + BWX access are supported to dense mem space. This is + true of every system that supports dense io space, so + never fill in io.sparse_bus_memory_base in this case. */ + io_swiz = IOSWIZZLE_DENSE; + io.io_base = addr; + } + else + { + io.sparse_bus_memory_base + = __pciconfig_iobase (IOBASE_SPARSE_MEM, 0, 0); + io.io_base = __pciconfig_iobase (IOBASE_SPARSE_IO, 0, 0); + io_swiz = IOSWIZZLE_SPARSE; + } + } + + io.swiz = io_swiz; + io.swp = &ioswtch[io_swiz]; + + return 0; + } +#endif + + /* Second, collect the contents of /etc/alpha_systype or /proc/cpuinfo. */ + + if (process_cpuinfo(&data) == 0) + { + /* This can happen if the format of /proc/cpuinfo changes. */ + fprintf (stderr, + "ioperm.init_iosys: Unable to determine system type.\n" + "\t(May need " PATH_ALPHA_SYSTYPE " symlink?)\n"); + __set_errno (ENODEV); + return -1; + } + + /* Translate systype name into i/o system. */ + for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i) + { + if (strcmp (platform[i].name, data.systype) == 0) + { + iosys_t io_sys = platform[i].io_sys; + + /* Some platforms can have either EV4 or EV5 CPUs. */ + if (io_sys == IOSYS_CPUDEP) + { + /* SABLE or MIKASA or NORITAKE so far. */ + if (strcmp (platform[i].name, "Sable") == 0) + { + if (strncmp (data.cpumodel, "EV4", 3) == 0) + io_sys = IOSYS_T2; + else if (strncmp (data.cpumodel, "EV5", 3) == 0) + io_sys = IOSYS_GAMMA; + } + else + { + /* This covers MIKASA/NORITAKE. */ + if (strncmp (data.cpumodel, "EV4", 3) == 0) + io_sys = IOSYS_APECS; + else if (strncmp (data.cpumodel, "EV5", 3) == 0) + io_sys = IOSYS_CIA; + } + if (io_sys == IOSYS_CPUDEP) + { + /* This can happen if the format of /proc/cpuinfo changes.*/ + fprintf (stderr, "ioperm.init_iosys: Unable to determine" + " CPU model.\n"); + __set_errno (ENODEV); + return -1; + } + } + /* Some platforms can have different core logic chipsets */ + if (io_sys == IOSYS_PCIDEP) + { + /* EB164 so far */ + if (strcmp (data.systype, "EB164") == 0) + { + if (strncmp (data.sysvari, "RX164", 5) == 0) + io_sys = IOSYS_POLARIS; + else if (strncmp (data.sysvari, "LX164", 5) == 0 + || strncmp (data.sysvari, "SX164", 5) == 0) + io_sys = IOSYS_PYXIS; + else + io_sys = IOSYS_CIA; + } + if (io_sys == IOSYS_PCIDEP) + { + /* This can happen if the format of /proc/cpuinfo changes.*/ + fprintf (stderr, "ioperm.init_iosys: Unable to determine" + " core logic chipset.\n"); + __set_errno (ENODEV); + return -1; + } + } + io.bus_memory_base = io_system[io_sys].bus_memory_base; + io.sparse_bus_memory_base = io_system[io_sys].sparse_bus_mem_base; + io.io_base = io_system[io_sys].bus_io_base; + + if (io_sys == IOSYS_JENSEN) + io.swiz = IOSWIZZLE_JENSEN; + else if (io_sys == IOSYS_TSUNAMI + || io_sys == IOSYS_POLARIS + || io_sys == IOSYS_PYXIS) + io.swiz = IOSWIZZLE_DENSE; + else + io.swiz = IOSWIZZLE_SPARSE; + io.swp = &ioswtch[io.swiz]; + + __set_errno (olderrno); + return 0; + } + } + + __set_errno (ENODEV); + fprintf(stderr, "ioperm.init_iosys: Platform not recognized.\n" + "\t(May need " PATH_ALPHA_SYSTYPE " symlink?)\n"); + return -1; +} + + +int +_ioperm (unsigned long int from, unsigned long int num, int turn_on) +{ + unsigned long int addr, len, pagesize = __getpagesize(); + int prot; + + if (!io.swp && init_iosys() < 0) + { +#ifdef DEBUG_IOPERM + fprintf(stderr, "ioperm: init_iosys() failed (%m)\n"); +#endif + return -1; + } + + /* This test isn't as silly as it may look like; consider overflows! */ + if (from >= MAX_PORT || from + num > MAX_PORT) + { + __set_errno (EINVAL); +#ifdef DEBUG_IOPERM + fprintf(stderr, "ioperm: from/num out of range\n"); +#endif + return -1; + } + +#ifdef DEBUG_IOPERM + fprintf(stderr, "ioperm: turn_on %d io.base %ld\n", turn_on, io.base); +#endif + + if (turn_on) + { + if (!io.base) + { + int fd; + + io.hae_cache = 0; + if (io.swiz != IOSWIZZLE_DENSE) + { + /* Synchronize with hw. */ + __sethae (0); + } + + fd = __open ("/dev/mem", O_RDWR); + if (fd < 0) + { +#ifdef DEBUG_IOPERM + fprintf(stderr, "ioperm: /dev/mem open failed (%m)\n"); +#endif + return -1; + } + + addr = port_to_cpu_addr (0, io.swiz, 1); + len = port_to_cpu_addr (MAX_PORT, io.swiz, 1) - addr; + io.base = + (unsigned long int) __mmap (0, len, PROT_NONE, MAP_SHARED, + fd, io.io_base); + __close (fd); +#ifdef DEBUG_IOPERM + fprintf(stderr, "ioperm: mmap of len 0x%lx returned 0x%lx\n", + len, io.base); +#endif + if ((long) io.base == -1) + return -1; + } + prot = PROT_READ | PROT_WRITE; + } + else + { + if (!io.base) + return 0; /* never was turned on... */ + + /* turnoff access to relevant pages: */ + prot = PROT_NONE; + } + addr = port_to_cpu_addr (from, io.swiz, 1); + addr &= ~(pagesize - 1); + len = port_to_cpu_addr (from + num, io.swiz, 1) - addr; + return __mprotect ((void *) addr, len, prot); +} + + +int +_iopl (int level) +{ + switch (level) + { + case 0: + return 0; + + case 1: case 2: case 3: + return _ioperm (0, MAX_PORT, 1); + + default: + __set_errno (EINVAL); + return -1; + } +} + + +void +_sethae (unsigned long int addr) +{ + if (!io.swp && init_iosys () < 0) + return; + + io.swp->sethae (addr); +} + + +void +_outb (unsigned char b, unsigned long int port) +{ + if (port >= MAX_PORT) + return; + + io.swp->outb (b, port); +} + + +void +_outw (unsigned short b, unsigned long int port) +{ + if (port >= MAX_PORT) + return; + + io.swp->outw (b, port); +} + + +void +_outl (unsigned int b, unsigned long int port) +{ + if (port >= MAX_PORT) + return; + + io.swp->outl (b, port); +} + + +unsigned int +_inb (unsigned long int port) +{ + return io.swp->inb (port); +} + + +unsigned int +_inw (unsigned long int port) +{ + return io.swp->inw (port); +} + + +unsigned int +_inl (unsigned long int port) +{ + return io.swp->inl (port); +} + + +unsigned long int +_bus_base(void) +{ + if (!io.swp && init_iosys () < 0) + return -1; + return io.bus_memory_base; +} + +unsigned long int +_bus_base_sparse(void) +{ + if (!io.swp && init_iosys () < 0) + return -1; + return io.sparse_bus_memory_base; +} + +int +_hae_shift(void) +{ + if (!io.swp && init_iosys () < 0) + return -1; + if (io.swiz == IOSWIZZLE_JENSEN) + return 7; + if (io.swiz == IOSWIZZLE_SPARSE) + return 5; + return 0; +} + +weak_alias (_sethae, sethae); +weak_alias (_ioperm, ioperm); +weak_alias (_iopl, iopl); +weak_alias (_inb, inb); +weak_alias (_inw, inw); +weak_alias (_inl, inl); +weak_alias (_outb, outb); +weak_alias (_outw, outw); +weak_alias (_outl, outl); +weak_alias (_bus_base, bus_base); +weak_alias (_bus_base_sparse, bus_base_sparse); +weak_alias (_hae_shift, hae_shift); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ipc_priv.h b/ports/sysdeps/unix/sysv/linux/alpha/ipc_priv.h new file mode 100644 index 0000000000..67883be101 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/ipc_priv.h @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/powerpc/ipc_priv.h> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h new file mode 100644 index 0000000000..3eaa422b12 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -0,0 +1,101 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2010-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + +/* The tgkill syscall was introduced for alpha 2.6.0-test1 which unfortunately + cannot be distinguished from 2.6.0. */ +#if __LINUX_KERNEL_VERSION >= 132609 +# define __ASSUME_TGKILL 1 +#endif + +/* Starting with version 2.6.4, the stat64 syscalls are available. */ +#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__ +# define __ASSUME_STAT64_SYSCALL 1 +#endif + +#define __ASSUME_UTIMES 1 + +/* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists. */ +#if __LINUX_KERNEL_VERSION >= 0x020609 +# define __ASSUME_IEEE_RAISE_EXCEPTION 1 +#endif + +/* Support for the O_CLOEXEC flag was added for alpha in 2.6.23. */ +#if __LINUX_KERNEL_VERSION >= 0x020617 +# define __ASSUME_O_CLOEXEC 1 +#endif + +/* Support for various CLOEXEC and NONBLOCK flags was added for alpha after + 2.6.33-rc1. */ +#if __LINUX_KERNEL_VERSION >= 0x020621 +# define __ASSUME_SOCK_CLOEXEC 1 +# define __ASSUME_IN_NONBLOCK 1 +#endif + +/* Support for the pipe2, eventfd2, signalfd4 syscalls was added for alpha + after 2.6.33-rc1. */ +#if __LINUX_KERNEL_VERSION >= 0x020621 +# define __ASSUME_PIPE2 1 +# define __ASSUME_EVENTFD2 1 +# define __ASSUME_SIGNALFD4 1 +#endif + +/* Support for accept4 was added for alpha after 2.6.33-rc1. */ +#if __LINUX_KERNEL_VERSION >= 0x020621 +# define __ASSUME_ACCEPT4 1 +#endif + +#include_next <kernel-features.h> + +#undef __ASSUME_ST_INO_64_BIT + +/* pselect/ppoll were introduced on alpha just after 2.6.22-rc1. */ +#if __LINUX_KERNEL_VERSION < 0x020617 +# undef __ASSUME_PSELECT +# undef __ASSUME_PPOLL +#endif + +/* The *at syscalls were introduced on alpha just after 2.6.22-rc1. */ +#if __LINUX_KERNEL_VERSION < 0x020617 +# undef __ASSUME_ATFCTS +#endif + +/* Support for inter-process robust mutexes was added on alpha just + after 2.6.22-rc1. */ +#if __LINUX_KERNEL_VERSION < 0x020617 +# undef __ASSUME_SET_ROBUST_LIST +#endif + +/* Support for utimensat was added on alpha after 2.6.22-rc1. */ +#if __LINUX_KERNEL_VERSION < 0x020617 +# undef __ASSUME_UTIMENSAT +#endif + +/* Support for fallocate was added for alpha after 2.6.33-rc1. */ +#if __LINUX_KERNEL_VERSION < 0x020621 +# undef __ASSUME_FALLOCATE +#endif + +/* There never has been support for fstat64. */ +#undef __ASSUME_STATFS64 +#define __ASSUME_STATFS64 0 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h b/ports/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h new file mode 100644 index 0000000000..4c35d969cf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h @@ -0,0 +1,15 @@ +/* This is the sigaction struction from the Linux 2.1.20 kernel. */ + +struct old_kernel_sigaction { + __sighandler_t k_sa_handler; + unsigned long sa_mask; + unsigned int sa_flags; +}; + +/* This is the sigaction structure from the Linux 2.1.68 kernel. */ + +struct kernel_sigaction { + __sighandler_t k_sa_handler; + unsigned int sa_flags; + sigset_t sa_mask; +}; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/ports/sysdeps/unix/sysv/linux/alpha/kernel_stat.h new file mode 100644 index 0000000000..a1d012ab01 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/kernel_stat.h @@ -0,0 +1,88 @@ +/* Definition of `struct stat' used in the kernel. */ +struct kernel_stat + { + unsigned int st_dev; + unsigned int st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + unsigned int st_rdev; + long int st_size; + unsigned long int st_atime; + unsigned long int st_mtime; + unsigned long int st_ctime; + unsigned int st_blksize; + int st_blocks; + unsigned int st_flags; + unsigned int st_gen; + }; + +/* Definition of `struct stat64' used in the kernel. */ +struct kernel_stat64 + { + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_rdev; + long st_size; + unsigned long st_blocks; + + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int st_blksize; + unsigned int st_nlink; + unsigned int __pad0; + + unsigned long st_atime; + unsigned long st_atimensec; + unsigned long st_mtime; + unsigned long st_mtimensec; + unsigned long st_ctime; + unsigned long st_ctimensec; + long __unused[3]; + }; + +/* Definition of `struct stat' used by glibc 2.0. */ +struct glibc2_stat + { + __dev_t st_dev; + __ino_t st_ino; + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + __off_t st_size; + __time_t st_atime; + __time_t st_mtime; + __time_t st_ctime; + unsigned int st_blksize; + int st_blocks; + unsigned int st_flags; + unsigned int st_gen; + }; + +/* Definition of `struct stat' used by glibc 2.1. */ +struct glibc21_stat + { + __dev_t st_dev; + __ino64_t st_ino; + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + __off_t st_size; + __time_t st_atime; + __time_t st_mtime; + __time_t st_ctime; + __blkcnt64_t st_blocks; + __blksize_t st_blksize; + unsigned int st_flags; + unsigned int st_gen; + int __pad3; + long __unused[4]; + }; + +#define XSTAT_IS_XSTAT64 1 diff --git a/ports/sysdeps/unix/sysv/linux/alpha/kernel_sysinfo.h b/ports/sysdeps/unix/sysv/linux/alpha/kernel_sysinfo.h new file mode 100644 index 0000000000..a3edec2269 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/kernel_sysinfo.h @@ -0,0 +1,6 @@ +/* A copy of the couple of bits we need from <asm/sysinfo.h>. */ + +#define GSI_IEEE_FP_CONTROL 45 + +#define SSI_IEEE_FP_CONTROL 14 +#define SSI_IEEE_RAISE_EXCEPTION 1001 diff --git a/ports/sysdeps/unix/sysv/linux/alpha/kernel_termios.h b/ports/sysdeps/unix/sysv/linux/alpha/kernel_termios.h new file mode 100644 index 0000000000..5b3bb89c48 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/kernel_termios.h @@ -0,0 +1,43 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _KERNEL_TERMIOS_H +#define _KERNEL_TERMIOS_H 1 + +/* The following corresponds to the values from the Linux 2.1.20 kernel. */ + +/* We need the definition of tcflag_t, cc_t, and speed_t. */ +#include <termios.h> + +#define __KERNEL_NCCS 19 + +struct __kernel_termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_cc[__KERNEL_NCCS]; /* control characters */ + cc_t c_line; /* line discipline */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ + }; + +#define _HAVE_C_ISPEED 1 +#define _HAVE_C_OSPEED 1 + +#endif /* kernel_termios.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c b/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c new file mode 100644 index 0000000000..b0f1e81478 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c @@ -0,0 +1,75 @@ +/* lxstat using old-style Unix stat system call. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define __lxstat64 __lxstat64_disable + +#include <errno.h> +#include <stddef.h> +#include <sys/stat.h> +#include <kernel_stat.h> +#include <sysdep.h> +#include <sys/syscall.h> +#include <xstatconv.h> + +#undef __lxstat64 + + +/* Get information about the file NAME in BUF. */ +int +__lxstat (int vers, const char *name, struct stat *buf) +{ + INTERNAL_SYSCALL_DECL (err); + int result; + struct kernel_stat kbuf; + +#if __ASSUME_STAT64_SYSCALL > 0 + if (vers == _STAT_VER_KERNEL64) + { + result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; + } +#elif defined __NR_lstat64 + if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64) + { + int errno_out; + result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); + if (errno_out != ENOSYS) + { + __set_errno (errno_out); + return -1; + } + __libc_missing_axp_stat64 = 1; + } +#endif + + result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat_conv (vers, &kbuf, buf); + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; +} +hidden_def (__lxstat) +weak_alias (__lxstat, _lxstat); +strong_alias (__lxstat, __lxstat64); +hidden_ver (__lxstat, __lxstat64) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/makecontext.S b/ports/sysdeps/unix/sysv/linux/alpha/makecontext.S new file mode 100644 index 0000000000..f849259ff5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/makecontext.S @@ -0,0 +1,163 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <ucontext-offsets.h> + + +ENTRY(__makecontext) + ldgp $29, 0($27) +#ifdef PROF + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at +#endif + .prologue 1 + + /* Compute top of stack, including arguments. */ + ldq $1, UC_STACK+SS_SP($16) + ldq $2, UC_STACK+SS_SIZE($16) + addq $1, $2, $8 + subq $18, 6, $1 + cmovlt $1, 0, $1 + s8addq $1, 0, $2 + subq $8, $2, $8 + + /* Copy all parameters. Switch statement header here. */ + ldah $3, $jumptable($29) !gprelhigh + cmple $18, 6, $1 + mov $18, $2 + cmoveq $1, 7, $2 + s4addq $2, $3, $3 + ldl $4, $jumptable($3) !gprellow + addq $4, $29, $4 + jmp $31, ($4), $args1 + + .section .rodata + .align 2 +$jumptable: + .gprel32 $args0 + .gprel32 $args1 + .gprel32 $args2 + .gprel32 $args3 + .gprel32 $args4 + .gprel32 $args5 + .gprel32 $args6 + .gprel32 $argsN + .text + + /* Here we process arguments 7 through N. This is a straight + stack-to-stack copy. */ + .align 4 +$argsN: + subq $18, 6, $1 + lda $2, 0($8) + lda $3, 3*8($30) + .align 4 +1: + ldq $0, 0($3) + subq $1, 1, $1 + lda $3, 8($3) + stq $0, 0($2) + lda $2, 8($2) + bne $1, 1b + + /* Here we process arguments 6 through 0. This involves + copying into the register save areas of the ucontext. */ + .align 4 +$args6: + ldq $0, 2*8($30) + stq $0, UC_SIGCTX+SC_REGS+21*8($16) + unop + stq $0, UC_SIGCTX+SC_FPREGS+21*8($16) +$args5: + ldq $0, 1*8($30) + stq $0, UC_SIGCTX+SC_REGS+20*8($16) + unop + stq $0, UC_SIGCTX+SC_FPREGS+20*8($16) +$args4: + ldq $0, 0*8($30) + stq $0, UC_SIGCTX+SC_REGS+19*8($16) + unop + stq $0, UC_SIGCTX+SC_FPREGS+19*8($16) +$args3: + unop + stq $21, UC_SIGCTX+SC_REGS+18*8($16) + unop + stt $f21, UC_SIGCTX+SC_FPREGS+18*8($16) +$args2: + unop + stq $20, UC_SIGCTX+SC_REGS+17*8($16) + unop + stt $f20, UC_SIGCTX+SC_FPREGS+17*8($16) +$args1: + unop + stq $19, UC_SIGCTX+SC_REGS+16*8($16) + unop + stt $f19, UC_SIGCTX+SC_FPREGS+16*8($16) +$args0: + + /* Set up the registers ready to invoke __startcontext. + We seed $27 with the target function address, and $9 + with the link from ucp. */ + ldah $0, __startcontext($29) !gprelhigh + ldq $1, UC_LINK($16) + lda $0, __startcontext($0) !gprellow + stq $17, UC_SIGCTX+SC_REGS+27*8($16) + stq $8, UC_SIGCTX+SC_REGS+30*8($16) + stq $0, UC_SIGCTX+SC_PC($16) + stq $1, UC_SIGCTX+SC_REGS+9*8($16) + + /* No return value from makecontext. */ + ret + +END(__makecontext) +weak_alias (__makecontext, makecontext) + +/* This function is where a new makecontext "thread" begins life. + We have already set up $27 for calling the target function, and + we've set $9 to the UC_LINK of the parent context. + + If the function returns, we either jump to the linked context + (if non-null) or exit. */ + + .align 4 + .ent __startcontext +__startcontext: + .frame $31, 0, $31, 0 + .prologue 0 + + jsr $26, ($27), 0 + ldgp $29, 0($26) + mov $9, $16 + beq $9, 1f + +#ifdef PIC + bsr $26, __setcontext !samegp +1: mov $31, $16 + bsr $26, HIDDEN_JUMPTARGET(exit) !samegp +#else + jsr $26, __setcontext + ldgp $29, 0($26) +1: mov $31, $16 + jsr $26, HIDDEN_JUMPTARGET(exit) +#endif + + halt + + .end __startcontext diff --git a/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c b/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c new file mode 100644 index 0000000000..82c734b9a0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c @@ -0,0 +1,34 @@ +/* Copyright (C) 1995-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/msg.h> +#include <ipc_priv.h> +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + + +int +__new_msgctl (int msqid, int cmd, struct msqid_ds *buf) +{ + return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, CHECK_1 (buf)); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nldbl-abi.h b/ports/sysdeps/unix/sysv/linux/alpha/nldbl-abi.h new file mode 100644 index 0000000000..bd985cc59c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nldbl-abi.h @@ -0,0 +1,8 @@ +/* ABI version for long double switch. + This is used by the Versions and math_ldbl_opt.h files in + sysdeps/ieee754/ldbl-opt/. It gives the ABI version where + long double == double was replaced with proper long double + for libm *l functions and libc functions using long double. */ + +#define NLDBL_VERSION GLIBC_2.4 +#define LONG_DOUBLE_COMPAT_VERSION GLIBC_2_4 diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/Makefile b/ports/sysdeps/unix/sysv/linux/alpha/nptl/Makefile new file mode 100644 index 0000000000..8c80840798 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/Makefile @@ -0,0 +1,2 @@ +# pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction +libpthread-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/Versions b/ports/sysdeps/unix/sysv/linux/alpha/nptl/Versions new file mode 100644 index 0000000000..437c4da28b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/Versions @@ -0,0 +1,13 @@ +libpthread { + GLIBC_2.3.3 { + # Changed PTHREAD_STACK_MIN. + pthread_attr_setstack; pthread_attr_setstacksize; + } +} +librt { + GLIBC_2.3.3 { + # Changed timer_t. + timer_create; timer_delete; timer_getoverrun; timer_gettime; + timer_settime; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/aio_cancel.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/aio_cancel.c new file mode 100644 index 0000000000..0d6da82919 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/aio_cancel.c @@ -0,0 +1,33 @@ +#include <shlib-compat.h> + +#define aio_cancel64 XXX +#include <aio.h> +#undef aio_cancel64 +#include <errno.h> + +extern __typeof (aio_cancel) __new_aio_cancel; +extern __typeof (aio_cancel) __old_aio_cancel; + +#define aio_cancel __new_aio_cancel + +#include <sysdeps/pthread/aio_cancel.c> + +#undef aio_cancel +strong_alias (__new_aio_cancel, __new_aio_cancel64); +versioned_symbol (librt, __new_aio_cancel, aio_cancel, GLIBC_2_3); +versioned_symbol (librt, __new_aio_cancel64, aio_cancel64, GLIBC_2_3); + +#if SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_3) + +#undef ECANCELED +#define aio_cancel __old_aio_cancel +#define ECANCELED 125 + +#include <sysdeps/pthread/aio_cancel.c> + +#undef aio_cancel +strong_alias (__old_aio_cancel, __old_aio_cancel64); +compat_symbol (librt, __old_aio_cancel, aio_cancel, GLIBC_2_1); +compat_symbol (librt, __old_aio_cancel64, aio_cancel64, GLIBC_2_1); + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h b/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h new file mode 100644 index 0000000000..5198d8d2e8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/local_lim.h @@ -0,0 +1,99 @@ +/* Minimum guaranteed maximum values for system limits. Linux/Alpha version. + Copyright (C) 1993-1998,2000,2002-2004,2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* The kernel header pollutes the namespace with the NR_OPEN symbol + and defines LINK_MAX although filesystems have different maxima. A + similar thing is true for OPEN_MAX: the limit can be changed at + runtime and therefore the macro must not be defined. Remove this + after including the header if necessary. */ +#ifndef NR_OPEN +# define __undef_NR_OPEN +#endif +#ifndef LINK_MAX +# define __undef_LINK_MAX +#endif +#ifndef OPEN_MAX +# define __undef_OPEN_MAX +#endif +#ifndef ARG_MAX +# define __undef_ARG_MAX +#endif + +/* The kernel sources contain a file with all the needed information. */ +#include <linux/limits.h> + +/* Have to remove NR_OPEN? */ +#ifdef __undef_NR_OPEN +# undef NR_OPEN +# undef __undef_NR_OPEN +#endif +/* Have to remove LINK_MAX? */ +#ifdef __undef_LINK_MAX +# undef LINK_MAX +# undef __undef_LINK_MAX +#endif +/* Have to remove OPEN_MAX? */ +#ifdef __undef_OPEN_MAX +# undef OPEN_MAX +# undef __undef_OPEN_MAX +#endif +/* Have to remove ARG_MAX? */ +#ifdef __undef_ARG_MAX +# undef ARG_MAX +# undef __undef_ARG_MAX +#endif + +/* The number of data keys per process. */ +#define _POSIX_THREAD_KEYS_MAX 128 +/* This is the value this implementation supports. */ +#define PTHREAD_KEYS_MAX 1024 + +/* Controlling the iterations of destructors for thread-specific data. */ +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +/* Number of iterations this implementation does. */ +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS + +/* The number of threads per process. */ +#define _POSIX_THREAD_THREADS_MAX 64 +/* We have no predefined limit on the number of threads. */ +#undef PTHREAD_THREADS_MAX + +/* Maximum amount by which a process can descrease its asynchronous I/O + priority level. */ +#define AIO_PRIO_DELTA_MAX 20 + +/* Minimum size for a thread. We are free to choose a reasonable value. */ +#define PTHREAD_STACK_MIN 24576 + +/* Maximum number of timer expiration overruns. */ +#define DELAYTIMER_MAX 2147483647 + +/* Maximum tty name length. */ +#define TTY_NAME_MAX 32 + +/* Maximum login name length. This is arbitrary. */ +#define LOGIN_NAME_MAX 256 + +/* Maximum host name length. */ +#define HOST_NAME_MAX 64 + +/* Maximum message queue priority level. */ +#define MQ_PRIO_MAX 32768 + +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..98479495a8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h @@ -0,0 +1,170 @@ +/* Machine-specific pthread type layouts. Alpha version. + Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#define __SIZEOF_PTHREAD_ATTR_T 56 +#define __SIZEOF_PTHREAD_MUTEX_T 40 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCK_T 56 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIER_T 32 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + + +/* Thread identifiers. The structure of the attribute type is + deliberately not exposed. */ +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; + + +/* Data structures for mutex handling. The structure of the attribute + type is deliberately not exposed. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock; + unsigned int __count; + int __owner; + unsigned int __nusers; + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; + int __spins; + __pthread_list_t __list; +#define __PTHREAD_MUTEX_HAVE_PREV 1 + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is deliberately not exposed. */ +typedef union +{ + struct + { + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is deliberately not exposed. */ +typedef union +{ + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + int __writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; + } __data; + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/semaphore.h new file mode 100644 index 0000000000..8bb323b498 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/bits/semaphore.h @@ -0,0 +1,33 @@ +/* Machine-specific POSIX semaphore type layouts. Alpha version. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + +# define __SIZEOF_SEM_T 32 + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/alpha/nptl/clone.S new file mode 100644 index 0000000000..675a997e97 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/clone.S @@ -0,0 +1,9 @@ +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone.S> +#else +# define RESET_PID +# include_next <clone.S> +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/createthread.c new file mode 100644 index 0000000000..f1ba82fa1f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/createthread.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE (pd + 1) + +/* Get the real implementation. */ +#include <nptl/sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c new file mode 100644 index 0000000000..a521d705c2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sched.h> +#include <signal.h> +#include <sysdep.h> +#include <tls.h> + + +#define ARCH_FORK() \ + INLINE_SYSCALL (clone, 5, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \ + NULL, NULL, &THREAD_SELF->tid, NULL) + +#include <sysdeps/unix/sysv/linux/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/ld.abilist new file mode 100644 index 0000000000..23ff7fa799 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/ld.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + __libc_memalign F + _r_debug D 0x28 + calloc F + free F + malloc F + realloc F +GLIBC_2.1 + GLIBC_2.1 A + __libc_stack_end D 0x8 + _dl_mcount F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A + __stack_chk_guard D 0x8 diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..f4ca37f44b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.0 + GLIBC_2.0 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libanl.abilist new file mode 100644 index 0000000000..c9755d8a33 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist new file mode 100644 index 0000000000..6d333aa522 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist @@ -0,0 +1,2500 @@ +GCC_3.0 + GCC_3.0 A + _Unwind_Find_FDE F + __deregister_frame_info_bases F + __register_frame_info_bases F + __register_frame_info_table_bases F +GLIBC_2.0 + GLIBC_2.0 A + _IO_adjust_column F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0xa8 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_fsetpos F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_link_in F + _IO_list_all D 0x8 + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sscanf F + _IO_stderr_ D 0x98 + _IO_stdin_ D 0x98 + _IO_stdout_ D 0x98 + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_switch_to_get_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + __adjtimex F + __after_morecore_hook D 0x8 + __argz_count F + __argz_next F + __argz_stringify F + __assert_fail F + __assert_perror_fail F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __clone F + __close F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x8 + __ctype_b D 0x8 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x8 + __ctype_toupper D 0x8 + __curbrk D 0x8 + __daylight D 0x4 + __dcgettext F + __default_morecore F + __deregister_frame F + __deregister_frame_info F + __dgettext F + __divl F + __divlu F + __divq F + __divqu F + __dup2 F + __environ D 0x8 + __errno_location F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __fork F + __fpu_control D 0x4 + __frame_state_for F + __free_hook D 0x8 + __fxstat F + __getdelim F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __ieee_get_fp_control F + __ieee_set_fp_control F + __isinf F + __isinff F + __isinfl F + __isnan F + __isnanf F + __isnanl F + __iswctype F + __ivaliduser F + __libc_calloc F + __libc_free F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __malloc_hook D 0x8 + __malloc_initialize_hook D 0x8 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x8 + __mempcpy F + __monstartup F + __morecore D 0x8 + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __overflow F + __pipe F + __printf_fp F + __profile_frequency F + __progname D 0x8 + __progname_full D 0x8 + __rcmd_errstr D 0x8 + __read F + __realloc_hook D 0x8 + __register_frame F + __register_frame_info F + __register_frame_info_table F + __register_frame_table F + __reml F + __remlu F + __remq F + __remqu F + __res_randomid F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __sigpause F + __sigsetjmp F + __stpcpy F + __stpncpy F + __strcasecmp F + __strdup F + __strerror_r F + __strtod_internal F + __strtof_internal F + __strtok_r F + __strtol_internal F + __strtold_internal F + __strtoll_internal F + __strtoul_internal F + __strtoull_internal F + __sysv_signal F + __timezone D 0x8 + __tzname D 0x10 + __uflow F + __underflow F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcstod_internal F + __wcstof_internal F + __wcstol_internal F + __wcstold_internal F + __wcstoll_internal F + __wcstoul_internal F + __wcstoull_internal F + __write F + __xmknod F + __xpg_basename F + __xstat F + _bus_base F + _bus_base_sparse F + _environ D 0x8 + _exit F + _hae_shift F + _inb F + _inl F + _inw F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x8 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0x18 + _obstack D 0x8 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _outb F + _outl F + _outw F + _res D 0x238 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x418 + _sys_nerr D 0x4 + _sys_siglist D 0x100 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authnone_create F + authunix_create F + authunix_create_default F + basename F + bcmp F + bcopy F + bdflush F + bind F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bus_base F + bus_base_sparse F + bzero F + calloc F + callrpc F + canonicalize_file_name F + catclose F + catgets F + catopen F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + delete_module F + dgettext F + difftime F + dirfd F + dirname F + div F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + environ D 0x8 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x8 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + fgetc F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpwent F + fgetpwent_r F + fgets F + fgetspent F + fgetspent_r F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fnmatch F + fopen F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fread F + free F + freeaddrinfo F + freopen F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fsetpos F + fstatfs F + fsync F + ftell F + ftime F + ftok F + ftruncate F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + funlockfile F + fwrite F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcwd F + getdelim F + getdirentries F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getw F + getwd F + glob F + glob_pattern_p F + globfree F + gmtime F + gmtime_r F + group_member F + gsignal F + gtty F + h_errlist D 0x28 + h_nerr D 0x4 + hae_shift F + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + inb F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + inl F + innetgr F + insque F + inw F + ioctl F + ioperm F + iopl F + iruserok F + isalnum F + isalpha F + isascii F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x8 + loc2 D 0x8 + localeconv F + localtime F + localtime_r F + lockf F + locs D 0x8 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + madvise F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x8 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + memset F + mkdir F + mkfifo F + mkstemp F + mktemp F + mktime F + mlock F + mlockall F + mmap F + modf F + modff F + modfl F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + nfsservctl F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + obstack_alloc_failed_handler D 0x8 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open_memstream F + opendir F + openlog F + optarg D 0x8 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + outb F + outl F + outw F + parse_printf_format F + pathconf F + pause F + pciconfig_read F + pciconfig_write F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + prctl F + printf F + profil F + program_invocation_name D 0x8 + program_invocation_short_name D 0x8 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putpwent F + puts F + putspent F + pututline F + putw F + pvalloc F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rcmd F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x8 + read F + readdir F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + res_init F + revoke F + rewind F + rewinddir F + rexec F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x20 + rpmatch F + rresvport F + ruserok F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethae F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigreturn F + sigsetmask F + sigstack F + sigsuspend F + sigvec F + sigwait F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + stderr D 0x8 + stdin D 0x8 + stdout D 0x8 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcat F + strchr F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtouq F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreqset F + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0x18 + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + swab F + swapoff F + swapon F + symlink F + sync F + sys_errlist D 0x418 + sys_nerr D 0x4 + sys_sigabbrev D 0x100 + sys_siglist D 0x100 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x8 + tmpfile F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x10 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + uname F + ungetc F + unlink F + unsetenv F + updwtmp F + uselib F + usleep F + ustat F + utime F + utimes F + utmpname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + vfork F + vfprintf F + vfscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + wait F + wait3 F + wait4 F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscat F + wcschr F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcslen F + wcsncat F + wcsncmp F + wcsncpy F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstok F + wcstol F + wcstold F + wcstombs F + wcstoq F + wcstoul F + wcstouq F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmemset F + write F + writev F + xdr_accepted_reply F + xdr_array F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_int F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_string F + xdr_u_char F + xdr_u_int F + xdr_u_long F + xdr_u_short F + xdr_union F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.1 + GLIBC_2.1 A + _IO_2_1_stderr_ D 0xe0 + _IO_2_1_stdin_ D 0xe0 + _IO_2_1_stdout_ D 0xe0 + _IO_do_write F + _IO_fclose F + _IO_fdopen F + _IO_fgetpos64 F + _IO_file_attach F + _IO_file_close_it F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_overflow F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_fopen F + _IO_fsetpos64 F + _IO_getline_info F + _IO_popen F + _IO_proc_close F + _IO_proc_open F + __adjtimex F + __asprintf F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __duplocale F + __freelocale F + __fxstat64 F + __gettimeofday F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __islower_l F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __key_decryptsession_pk_LOCAL D 0x8 + __key_encryptsession_pk_LOCAL D 0x8 + __key_gendes_LOCAL D 0x8 + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_freeres F + __libc_sa_len F + __lxstat64 F + __newlocale F + __poll F + __pread64 F + __pwrite64 F + __rawmemchr F + __select F + __signbit F + __signbitf F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strfmon_l F + __strncasecmp_l F + __strtod_l F + __strtof_l F + __strtol_l F + __strtold_l F + __strtoll_l F + __strtoul_l F + __strtoull_l F + __strxfrm_l F + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_l F + __wcstof_l F + __wcstol_l F + __wcstold_l F + __wcstoll_l F + __wcstoul_l F + __wcstoull_l F + __wcsxfrm_l F + __wctype_l F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _sys_errlist D 0x418 + _sys_nerr D 0x4 + _sys_siglist D 0x200 + addseverity F + adjtime F + adjtimex F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x8 + argp_program_version D 0x8 + argp_program_version_hook D 0x8 + argp_state_help F + argp_usage F + authdes_create F + authdes_getucred F + authdes_pk_create F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + capget F + capset F + cbc_crypt F + clntunix_create F + creat64 F + des_setparity F + ecb_crypt F + endutxent F + fattach F + fclose F + fdetach F + fdopen F + ffsl F + ffsll F + fgetc_unlocked F + fgetpos64 F + fgets_unlocked F + fmtmsg F + fopen F + fopen64 F + fputs_unlocked F + fread_unlocked F + freopen64 F + fseeko F + fseeko64 F + fsetpos64 F + fstatfs64 F + fstatvfs F + fstatvfs64 F + ftello F + ftello64 F + ftruncate64 F + ftw64 F + fwrite_unlocked F + gai_strerror F + getcontext F + getdate F + getdate_err D 0x4 + getdate_r F + getitimer F + getmsg F + getnameinfo F + getnetname F + getpmsg F + getpt F + getrlimit64 F + getrusage F + gettimeofday F + getutxent F + getutxid F + getutxline F + glob F + glob64 F + globfree F + globfree64 F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + host2netname F + iconv F + iconv_close F + iconv_open F + ieee_get_fp_control F + ieee_set_fp_control F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + isastream F + iswblank F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + lockf64 F + lseek64 F + makecontext F + mempcpy F + mmap64 F + netname2host F + netname2user F + nftw F + nftw64 F + ntp_adjtime F + ntp_gettime F + open64 F + passwd2des F + pclose F + popen F + pread F + pread64 F + printf_size F + printf_size_info F + pthread_attr_init F + ptsname F + ptsname_r F + putgrent F + putmsg F + putpmsg F + pututxline F + pwrite F + pwrite64 F + rawmemchr F + readdir64 F + readdir64_r F + rtime F + scandir64 F + select F + sendfile F + setitimer F + setrlimit64 F + settimeofday F + setutxent F + sighold F + sigignore F + sigqueue F + sigrelse F + sigset F + sigtimedwait F + sigwaitinfo F + statfs64 F + statvfs F + statvfs64 F + strcasestr F + strtoimax F + strtoumax F + strverscmp F + svcunix_create F + svcunixfd_create F + swapcontext F + sys_errlist D 0x418 + sys_nerr D 0x4 + sys_sigabbrev D 0x200 + sys_siglist D 0x200 + sysv_signal F + tcgetsid F + tdestroy F + tmpfile F + tmpfile64 F + truncate64 F + umount2 F + unlockpt F + updwtmpx F + user2netname F + utimes F + utmpxname F + versionsort F + versionsort64 F + wait4 F + waitid F + wcscasecmp F + wcsncasecmp F + wcsnlen F + wcstoimax F + wcstoll F + wcstoull F + wcstoumax F + wcswcs F + wordexp F + wordfree F + xdecrypt F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_getcredres F + xdr_int16_t F + xdr_int32_t F + xdr_int8_t F + xdr_netnamestr F + xdr_sizeof F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint8_t F + xdr_unixcred F +GLIBC_2.1.1 + GLIBC_2.1.1 A + _Exit F + __mempcpy_small F + __stpcpy_small F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtok_r_1c F + __strverscmp F + getutmp F + getutmpx F + imaxabs F + imaxdiv F + strchrnul F + xdr_hyper F + xdr_int64_t F + xdr_longlong_t F + xdr_u_hyper F + xdr_u_longlong_t F + xdr_uint64_t F +GLIBC_2.1.2 + GLIBC_2.1.2 A + __vfork F + getaliasbyname_r F + getaliasent_r F + getgrent_r F + getgrgid_r F + getgrnam_r F + gethostbyaddr_r F + gethostbyname2_r F + gethostbyname_r F + gethostent_r F + getnetbyaddr_r F + getnetbyname_r F + getnetent_r F + getprotobyname_r F + getprotobynumber_r F + getprotoent_r F + getpwent_r F + getpwnam_r F + getpwuid_r F + getrpcbyname_r F + getrpcbynumber_r F + getrpcent_r F + getservbyname_r F + getservbyport_r F + getservent_r F + getspent_r F + getspnam_r F +GLIBC_2.1.3 + GLIBC_2.1.3 A + __cxa_atexit F + __cxa_finalize F + __sigsuspend F +GLIBC_2.1.4 + GLIBC_2.1.4 A + pciconfig_iobase F +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fallocate64 F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + _sys_errlist D 0x458 + _sys_nerr D 0x4 + ntp_gettimex F + recvmmsg F + sys_errlist D 0x458 + sys_nerr D 0x4 +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + _sys_errlist D 0x460 + _sys_nerr D 0x4 + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + sys_errlist D 0x460 + sys_nerr D 0x4 + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _IO_adjust_wcolumn F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_seekwmark F + _IO_sputbackwc F + _IO_sungetwc F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_unsave_wmarkers F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0xa8 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __assert F + __ctype32_tolower D 0x8 + __ctype32_toupper D 0x8 + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __endmntent F + __fbufsize F + __flbf F + __fpending F + __fpurge F + __freadable F + __freading F + __fsetlocking F + __fwritable F + __fwriting F + __getmntent_r F + __nl_langinfo_l F + __open64 F + __res_init F + __res_nclose F + __res_ninit F + __res_state F + __setmntent F + __statfs F + __strndup F + __sysconf F + __sysctl F + __wctrans_l F + __woverflow F + __wuflow F + __wunderflow F + __xpg_sigpause F + _flushlbf F + _res_hconf D 0x48 + bind_textdomain_codeset F + dcngettext F + dngettext F + fgetpos F + fgetpos64 F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fmemopen F + fopencookie F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fsetpos F + fsetpos64 F + fwide F + fwprintf F + fwscanf F + getdirentries64 F + getloadavg F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + iruserok_af F + localeconv F + mcheck_check_all F + mcheck_pedantic F + memrchr F + mincore F + mkdtemp F + mkstemp64 F + moncontrol F + msgctl F + ngettext F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + rcmd_af F + rexec_af F + rresvport_af F + ruserok_af F + semctl F + shmctl F + svc_getreq_common F + svc_getreq_poll F + svc_max_pollfd D 0x4 + svc_pollfd D 0x8 + swprintf F + swscanf F + ungetwc F + vfwprintf F + vfwscanf F + vswprintf F + vswscanf F + vwprintf F + vwscanf F + wcschrnul F + wcsftime F + wmempcpy F + wprintf F + wscanf F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F + wordexp F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + _sys_errlist D 0x420 + _sys_nerr D 0x4 + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoul_l F + strxfrm_l F + sys_errlist D 0x420 + sys_nerr D 0x4 + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __register_atfork F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x208 + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + nftw F + nftw64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + strtoll_l F + strtoull_l F + sys_sigabbrev D 0x208 + sys_siglist D 0x208 +GLIBC_2.3.4 + GLIBC_2.3.4 A + _OtsAddX F + _OtsConvertFloatTX F + _OtsConvertFloatXT F + _OtsCvtQUX F + _OtsCvtQX F + _OtsCvtXQ F + _OtsDivX F + _OtsEqlX F + _OtsGeqX F + _OtsGtrX F + _OtsLeqX F + _OtsLssX F + _OtsMulX F + _OtsNeqX F + _OtsNintXQ F + _OtsSubX F + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + getipv4sourcefilter F + getsourcefilter F + regexec F + sched_getaffinity F + sched_setaffinity F + setipv4sourcefilter F + setsourcefilter F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + _IO_fprintf F + _IO_printf F + _IO_sprintf F + _IO_sscanf F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + __asprintf F + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finitel F + __fprintf_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __isinfl F + __isnanl F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __nldbl__IO_fprintf F + __nldbl__IO_printf F + __nldbl__IO_sprintf F + __nldbl__IO_sscanf F + __nldbl__IO_vfprintf F + __nldbl__IO_vfscanf F + __nldbl__IO_vsprintf F + __nldbl___asprintf F + __nldbl___fprintf_chk F + __nldbl___fwprintf_chk F + __nldbl___printf_chk F + __nldbl___printf_fp F + __nldbl___snprintf_chk F + __nldbl___sprintf_chk F + __nldbl___strfmon_l F + __nldbl___swprintf_chk F + __nldbl___syslog_chk F + __nldbl___vfprintf_chk F + __nldbl___vfscanf F + __nldbl___vfwprintf_chk F + __nldbl___vprintf_chk F + __nldbl___vsnprintf F + __nldbl___vsnprintf_chk F + __nldbl___vsprintf_chk F + __nldbl___vsscanf F + __nldbl___vstrfmon F + __nldbl___vstrfmon_l F + __nldbl___vswprintf_chk F + __nldbl___vsyslog_chk F + __nldbl___vwprintf_chk F + __nldbl___wprintf_chk F + __nldbl_asprintf F + __nldbl_dprintf F + __nldbl_fprintf F + __nldbl_fscanf F + __nldbl_fwprintf F + __nldbl_fwscanf F + __nldbl_obstack_printf F + __nldbl_obstack_vprintf F + __nldbl_printf F + __nldbl_printf_size F + __nldbl_scanf F + __nldbl_snprintf F + __nldbl_sprintf F + __nldbl_sscanf F + __nldbl_strfmon F + __nldbl_strfmon_l F + __nldbl_swprintf F + __nldbl_swscanf F + __nldbl_syslog F + __nldbl_vasprintf F + __nldbl_vdprintf F + __nldbl_vfprintf F + __nldbl_vfscanf F + __nldbl_vfwprintf F + __nldbl_vfwscanf F + __nldbl_vprintf F + __nldbl_vscanf F + __nldbl_vsnprintf F + __nldbl_vsprintf F + __nldbl_vsscanf F + __nldbl_vswprintf F + __nldbl_vswscanf F + __nldbl_vsyslog F + __nldbl_vwprintf F + __nldbl_vwscanf F + __nldbl_wprintf F + __nldbl_wscanf F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __signbitl F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __stpncpy_chk F + __strfmon_l F + __strtold_internal F + __strtold_l F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstold_internal F + __wcstold_l F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + _sys_errlist D 0x450 + _sys_nerr D 0x4 + asprintf F + copysignl F + dprintf F + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + finitel F + fprintf F + frexpl F + fscanf F + futimesat F + fwprintf F + fwscanf F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + isinfl F + isnanl F + ldexpl F + linkat F + mkdirat F + mkfifoat F + modfl F + obstack_printf F + obstack_vprintf F + open_wmemstream F + openat F + openat64 F + ppoll F + printf F + printf_size F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + readlinkat F + renameat F + scalbnl F + scanf F + snprintf F + sprintf F + sscanf F + strfmon F + strfmon_l F + strtold F + strtold_l F + swprintf F + swscanf F + symlinkat F + sys_errlist D 0x450 + sys_nerr D 0x4 + syslog F + unlinkat F + unshare F + vasprintf F + vdprintf F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vwprintf F + vwscanf F + wcstold F + wcstold_l F + wprintf F + wscanf F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __nldbl___isoc99_fscanf F + __nldbl___isoc99_fwscanf F + __nldbl___isoc99_scanf F + __nldbl___isoc99_sscanf F + __nldbl___isoc99_swscanf F + __nldbl___isoc99_vfscanf F + __nldbl___isoc99_vfwscanf F + __nldbl___isoc99_vscanf F + __nldbl___isoc99_vsscanf F + __nldbl___isoc99_vswscanf F + __nldbl___isoc99_vwscanf F + __nldbl___isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __nldbl___asprintf_chk F + __nldbl___dprintf_chk F + __nldbl___obstack_printf_chk F + __nldbl___obstack_vprintf_chk F + __nldbl___vasprintf_chk F + __nldbl___vdprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libcrypt.abilist new file mode 100644 index 0000000000..1df145f260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libdl.abilist new file mode 100644 index 0000000000..62e6b41edb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libdl.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.1 + GLIBC_2.1 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libm.abilist new file mode 100644 index 0000000000..9c4170dbe4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libm.abilist @@ -0,0 +1,557 @@ +GLIBC_2.0 + GLIBC_2.0 A + _LIB_VERSION D 0x4 + __atan2 F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cbrt F + cbrtf F + cbrtl F + ceil F + ceilf F + ceill F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + logb F + logbf F + logbl F + logf F + logl F + matherr F + modf F + modff F + modfl F + nextafter F + nextafterf F + nextafterl F + pow F + powf F + powl F + remainder F + remainderf F + remainderl F + rint F + rintf F + rintl F + scalb F + scalbf F + scalbl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.1 + GLIBC_2.1 A + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + fdim F + fdimf F + fdiml F + feclearexcept F + fegetenv F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log2 F + log2f F + log2l F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nexttoward F + nexttowardf F + nexttowardl F + pow10 F + pow10f F + pow10l F + remquo F + remquof F + remquol F + round F + roundf F + roundl F + scalbln F + scalblnf F + scalblnl F + sincos F + sincosf F + sincosl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __acoshl_finite F + __acosl_finite F + __asin_finite F + __asinf_finite F + __asinl_finite F + __atan2_finite F + __atan2f_finite F + __atan2l_finite F + __atanh_finite F + __atanhf_finite F + __atanhl_finite F + __cosh_finite F + __coshf_finite F + __coshl_finite F + __exp10_finite F + __exp10f_finite F + __exp10l_finite F + __exp2_finite F + __exp2f_finite F + __exp2l_finite F + __exp_finite F + __expf_finite F + __expl_finite F + __fmod_finite F + __fmodf_finite F + __fmodl_finite F + __gamma_r_finite F + __gammaf_r_finite F + __gammal_r_finite F + __hypot_finite F + __hypotf_finite F + __hypotl_finite F + __j0_finite F + __j0f_finite F + __j0l_finite F + __j1_finite F + __j1f_finite F + __j1l_finite F + __jn_finite F + __jnf_finite F + __jnl_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __lgammal_r_finite F + __log10_finite F + __log10f_finite F + __log10l_finite F + __log2_finite F + __log2f_finite F + __log2l_finite F + __log_finite F + __logf_finite F + __logl_finite F + __pow_finite F + __powf_finite F + __powl_finite F + __remainder_finite F + __remainderf_finite F + __remainderl_finite F + __scalb_finite F + __scalbf_finite F + __scalbl_finite F + __sinh_finite F + __sinhf_finite F + __sinhl_finite F + __y0_finite F + __y0f_finite F + __y0l_finite F + __y1_finite F + __y1f_finite F + __y1l_finite F + __yn_finite F + __ynf_finite F + __ynl_finite F +GLIBC_2.2 + GLIBC_2.2 A + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + feraiseexcept F + fesetenv F + fesetexceptflag F + feupdateenv F +GLIBC_2.3.4 + GLIBC_2.3.4 A + __c1_cabsf F + __c1_cacosf F + __c1_cacoshf F + __c1_cargf F + __c1_casinf F + __c1_casinhf F + __c1_catanf F + __c1_catanhf F + __c1_ccosf F + __c1_ccoshf F + __c1_cexpf F + __c1_cimagf F + __c1_clog10f F + __c1_clogf F + __c1_conjf F + __c1_cpowf F + __c1_cprojf F + __c1_crealf F + __c1_csinf F + __c1_csinhf F + __c1_csqrtf F + __c1_ctanf F + __c1_ctanhf F + cabsf F + cacosf F + cacoshf F + cargf F + casinf F + casinhf F + catanf F + catanhf F + ccosf F + ccoshf F + cexpf F + cimagf F + clog10f F + clogf F + conjf F + cpowf F + cprojf F + crealf F + csinf F + csinhf F + csqrtf F + ctanf F + ctanhf F +GLIBC_2.4 + GLIBC_2.4 A + __clog10l F + __finitel F + __fpclassifyl F + __nldbl_nexttowardf F + __signbitl F + acoshl F + acosl F + asinhl F + asinl F + atan2l F + atanhl F + atanl F + cabsl F + cacoshl F + cacosl F + cargl F + casinhl F + casinl F + catanhl F + catanl F + cbrtl F + ccoshl F + ccosl F + ceill F + cexpl F + cimagl F + clog10l F + clogl F + conjl F + copysignl F + coshl F + cosl F + cpowl F + cprojl F + creall F + csinhl F + csinl F + csqrtl F + ctanhl F + ctanl F + dreml F + erfcl F + erfl F + exp10l F + exp2l F + expl F + expm1l F + fabsl F + fdiml F + finitel F + floorl F + fmal F + fmaxl F + fminl F + fmodl F + frexpl F + gammal F + hypotl F + ilogbl F + j0l F + j1l F + jnl F + ldexpl F + lgammal F + lgammal_r F + llrintl F + llroundl F + log10l F + log1pl F + log2l F + logbl F + logl F + lrintl F + lroundl F + modfl F + nanl F + nearbyintl F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow10l F + powl F + remainderl F + remquol F + rintl F + roundl F + scalbl F + scalblnl F + scalbnl F + significandl F + sincosl F + sinhl F + sinl F + sqrtl F + tanhl F + tanl F + tgammal F + truncl F + y0l F + y1l F + ynl F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libnsl.abilist new file mode 100644 index 0000000000..4241e2d887 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libnsl.abilist @@ -0,0 +1,127 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.1 + GLIBC_2.1 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F +GLIBC_2.2 + GLIBC_2.2 A + xdr_ypall F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist new file mode 100644 index 0000000000..96267302de --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist @@ -0,0 +1,269 @@ +GLIBC_2.0 + GLIBC_2.0 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __lseek F + __open F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_setspecific F + __read F + __send F + __sigaction F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + msync F + nanosleep F + open F + pause F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_once F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_testcancel F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.1 + GLIBC_2.1 A + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + pthread_attr_getguardsize F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setguardsize F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_create F + pthread_getconcurrency F + pthread_mutexattr_gettype F + pthread_mutexattr_settype F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_setconcurrency F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F +GLIBC_2.1.1 + GLIBC_2.1.1 A + sem_close F + sem_open F + sem_unlink F +GLIBC_2.1.2 + GLIBC_2.1.2 A + __vfork F +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + __open64 F + __pread64 F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pwrite64 F + __res_state F + lseek64 F + open64 F + pread F + pread64 F + pthread_attr_getstack F + pthread_attr_setstack F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_condattr_getpshared F + pthread_condattr_setpshared F + pthread_getcpuclockid F + pthread_mutex_timedlock F + pthread_mutexattr_getpshared F + pthread_mutexattr_setpshared F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_yield F + pwrite F + pwrite64 F + sem_timedwait F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_attr_setstack F + pthread_attr_setstacksize F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libresolv.abilist new file mode 100644 index 0000000000..808d0f2f74 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libresolv.abilist @@ -0,0 +1,104 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0xa8 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x450 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x80 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/librt.abilist new file mode 100644 index 0000000000..d710117080 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/librt.abilist @@ -0,0 +1,63 @@ +GLIBC_2.1 + GLIBC_2.1 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + lio_listio F + lio_listio64 F +GLIBC_2.2 + GLIBC_2.2 A + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3 + GLIBC_2.3 A + aio_cancel F + aio_cancel64 F +GLIBC_2.3.3 + GLIBC_2.3.3 A + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libthread_db.abilist new file mode 100644 index 0000000000..f33138067c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libthread_db.abilist @@ -0,0 +1,48 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libutil.abilist new file mode 100644 index 0000000000..7422687e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h new file mode 100644 index 0000000000..ac364dae18 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h @@ -0,0 +1,284 @@ +/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <atomic.h> +#include <sysdep.h> +#include <kernel-features.h> + + +#define __NR_futex 394 +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + + +#define lll_futex_wait(futexp, val, private) \ + lll_futex_timed_wait (futexp, val, NULL, private) + +#define lll_futex_timed_wait(futexp, val, timespec, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (val), (timespec)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \ + }) + +#define lll_futex_wake(futexp, nr, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \ + }) + +#define lll_robust_dead(futexv, private) \ + do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + lll_futex_wake (__futexp, 1, private); \ + } \ + while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ + (nr_wake), (nr_move), (mutex), (val)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (nr_wake), (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + + + + +static inline int __attribute__((always_inline)) +__lll_trylock(int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0; +} +#define lll_trylock(lock) __lll_trylock (&(lock)) + + +static inline int __attribute__((always_inline)) +__lll_cond_trylock(int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; +} +#define lll_cond_trylock(lock) __lll_cond_trylock (&(lock)) + + +static inline int __attribute__((always_inline)) +__lll_robust_trylock(int *futex, int id) +{ + return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0; +} +#define lll_robust_trylock(lock, id) \ + __lll_robust_trylock (&(lock), id) + +extern void __lll_lock_wait_private (int *futex) attribute_hidden; +extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + +static inline void __attribute__((always_inline)) +__lll_lock(int *futex, int private) +{ + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) + { + if (__builtin_constant_p (private) && private == LLL_PRIVATE) + __lll_lock_wait_private (futex); + else + __lll_lock_wait (futex, private); + } +} +#define lll_lock(futex, private) __lll_lock (&(futex), private) + + +static inline int __attribute__ ((always_inline)) +__lll_robust_lock (int *futex, int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_lock_wait (futex, private); + return result; +} +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + + +static inline void __attribute__ ((always_inline)) +__lll_cond_lock (int *futex, int private) +{ + if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0) + __lll_lock_wait (futex, private); +} +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + + +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private) + + +extern int __lll_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + +static inline int __attribute__ ((always_inline)) +__lll_timedlock (int *futex, const struct timespec *abstime, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) + result = __lll_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + + +static inline int __attribute__ ((always_inline)) +__lll_robust_timedlock (int *futex, const struct timespec *abstime, + int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + + +#define __lll_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + + +#define __lll_robust_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + + +#define lll_islocked(futex) \ + (futex != 0) + +/* Initializers for lock. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + + +/* The kernel notifies a process which uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED); \ + } while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/alpha/nptl/pt-vfork.S new file mode 100644 index 0000000000..3719d1b46d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/pt-vfork.S @@ -0,0 +1,42 @@ +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tcb-offsets.h> + +#undef PSEUDO_PREPARE_ARGS +#define PSEUDO_PREPARE_ARGS \ + /* Load the current cached pid value across the vfork. */ \ + rduniq; \ + ldl a2, PID_OFFSET(v0); \ + mov v0, a1; \ + /* Write back its negation, to indicate that the pid value is \ + uninitialized in the the child, and in the window between \ + here and the point at which we restore the value. */ \ + negl a2, t0; \ + stl t0, PID_OFFSET(v0); + +PSEUDO (__vfork, vfork, 0) + + /* If we're back in the parent, restore the saved pid. */ + beq v0, 1f + stl a2, PID_OFFSET(a1) +1: ret + +PSEUDO_END (__vfork) + +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c new file mode 100644 index 0000000000..c342e0a7a0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c @@ -0,0 +1,95 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "pthreadP.h" +#include <lowlevellock.h> + + +unsigned long int __fork_generation attribute_hidden; + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); +} + +int +__pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) +{ + for (;;) + { + int oldval; + int newval; + int tmp; + + /* Pseudo code: + newval = __fork_generation | 1; + oldval = *once_control; + if ((oldval & 2) == 0) + *once_control = newval; + Do this atomically. + */ + newval = __fork_generation | 1; + __asm __volatile ( + "1: ldl_l %0, %2\n" + " and %0, 2, %1\n" + " bne %1, 2f\n" + " mov %3, %1\n" + " stl_c %1, %2\n" + " beq %1, 1b\n" + "2: mb" + : "=&r" (oldval), "=&r" (tmp), "=m" (*once_control) + : "r" (newval), "m" (*once_control)); + + /* Check if the initializer has already been done. */ + if ((oldval & 2) != 0) + return 0; + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) == 0) + break; + + /* Check whether the initializer execution was interrupted by a fork. */ + if (oldval != newval) + break; + + /* Same generation, some other thread was faster. Wait. */ + lll_futex_wait (once_control, oldval, LLL_PRIVATE); + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + /* Add one to *once_control to take the bottom 2 bits from 01 to 10. */ + atomic_increment (once_control); + + /* Wake up all other threads. */ + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); + + return 0; +} +weak_alias (__pthread_once, pthread_once) +hidden_def (__pthread_once) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c new file mode 100644 index 0000000000..befa49723b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c @@ -0,0 +1,5 @@ +/* ??? This is an ass-backwards way to do this. We should simply define + the acquire/release semantics of atomic_exchange_and_add. And even if + we don't do this, we should be using atomic_full_barrier or otherwise. */ +#define __lll_rel_instr "mb" +#include <nptl/sysdeps/unix/sysv/linux/sem_post.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..04c7af472c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h @@ -0,0 +1,176 @@ +/* Copyright (C) 2003, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +# ifdef PROF +# define PSEUDO_PROF \ + .set noat; \ + lda AT, _mcount; \ + jsr AT, (AT), _mcount; \ + .set at +# else +# define PSEUDO_PROF +# endif + +/* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END + besides "ret". */ + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .globl name; \ + .align 4; \ + .type name, @function; \ + .usepv name, std; \ + cfi_startproc; \ +__LABEL(name) \ + ldgp gp, 0(pv); \ + PSEUDO_PROF; \ + PSEUDO_PREPARE_ARGS \ + SINGLE_THREAD_P(t0); \ + bne t0, $pseudo_cancel; \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; \ + bne a3, SYSCALL_ERROR_LABEL; \ +__LABEL($pseudo_ret) \ + .subsection 2; \ + cfi_startproc; \ +__LABEL($pseudo_cancel) \ + subq sp, 64, sp; \ + cfi_def_cfa_offset(64); \ + stq ra, 0(sp); \ + cfi_offset(ra, -64); \ + SAVE_ARGS_##args; \ + CENABLE; \ + LOAD_ARGS_##args; \ + /* Save the CENABLE return value in RA. That register \ + is preserved across syscall and the real return \ + address is saved on the stack. */ \ + mov v0, ra; \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; \ + stq v0, 8(sp); \ + mov ra, a0; \ + bne a3, $multi_error; \ + CDISABLE; \ + ldq ra, 0(sp); \ + ldq v0, 8(sp); \ + addq sp, 64, sp; \ + cfi_remember_state; \ + cfi_restore(ra); \ + cfi_def_cfa_offset(0); \ + ret; \ + cfi_restore_state; \ +__LABEL($multi_error) \ + CDISABLE; \ + ldq ra, 0(sp); \ + ldq v0, 8(sp); \ + addq sp, 64, sp; \ + cfi_restore(ra); \ + cfi_def_cfa_offset(0); \ +__LABEL($syscall_error) \ + SYSCALL_ERROR_HANDLER; \ + cfi_endproc; \ + .previous + +# undef PSEUDO_END +# define PSEUDO_END(sym) \ + cfi_endproc; \ + .subsection 2; \ + .size sym, .-sym + +# define SAVE_ARGS_0 /* Nothing. */ +# define SAVE_ARGS_1 SAVE_ARGS_0; stq a0, 8(sp) +# define SAVE_ARGS_2 SAVE_ARGS_1; stq a1, 16(sp) +# define SAVE_ARGS_3 SAVE_ARGS_2; stq a2, 24(sp) +# define SAVE_ARGS_4 SAVE_ARGS_3; stq a3, 32(sp) +# define SAVE_ARGS_5 SAVE_ARGS_4; stq a4, 40(sp) +# define SAVE_ARGS_6 SAVE_ARGS_5; stq a5, 48(sp) + +# define LOAD_ARGS_0 /* Nothing. */ +# define LOAD_ARGS_1 LOAD_ARGS_0; ldq a0, 8(sp) +# define LOAD_ARGS_2 LOAD_ARGS_1; ldq a1, 16(sp) +# define LOAD_ARGS_3 LOAD_ARGS_2; ldq a2, 24(sp) +# define LOAD_ARGS_4 LOAD_ARGS_3; ldq a3, 32(sp) +# define LOAD_ARGS_5 LOAD_ARGS_4; ldq a4, 40(sp) +# define LOAD_ARGS_6 LOAD_ARGS_5; ldq a5, 48(sp) + +# ifdef IS_IN_libpthread +# define __local_enable_asynccancel __pthread_enable_asynccancel +# define __local_disable_asynccancel __pthread_disable_asynccancel +# define __local_multiple_threads __pthread_multiple_threads +# elif !defined NOT_IN_libc +# define __local_enable_asynccancel __libc_enable_asynccancel +# define __local_disable_asynccancel __libc_disable_asynccancel +# define __local_multiple_threads __libc_multiple_threads +# elif defined IS_IN_librt +# define __local_enable_asynccancel __librt_enable_asynccancel +# define __local_disable_asynccancel __librt_disable_asynccancel +# else +# error Unsupported library +# endif + +# ifdef PIC +# define CENABLE bsr ra, __local_enable_asynccancel !samegp +# define CDISABLE bsr ra, __local_disable_asynccancel !samegp +# else +# define CENABLE jsr ra, __local_enable_asynccancel; ldgp ra, 0(gp) +# define CDISABLE jsr ra, __local_disable_asynccancel; ldgp ra, 0(gp) +# endif + +# if defined IS_IN_libpthread || !defined NOT_IN_libc +# ifndef __ASSEMBLER__ +extern int __local_multiple_threads attribute_hidden; +# define SINGLE_THREAD_P \ + __builtin_expect (__local_multiple_threads == 0, 1) +# elif defined(PIC) +# define SINGLE_THREAD_P(reg) ldl reg, __local_multiple_threads(gp) !gprel +# else +# define SINGLE_THREAD_P(reg) \ + ldah reg, __local_multiple_threads(gp) !gprelhigh; \ + ldl reg, __local_multiple_threads(reg) !gprellow +# endif +# else +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +# else +# define SINGLE_THREAD_P(reg) \ + call_pal PAL_rduniq; \ + ldl reg, MULTIPLE_THREADS_OFFSET($0) +# endif +# endif + +#else + +# define SINGLE_THREAD_P (1) +# define NO_CANCELLATION 1 + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c new file mode 100644 index 0000000000..1ac4c6a6b0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c new file mode 100644 index 0000000000..9bffef3488 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c new file mode 100644 index 0000000000..24533a0c31 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c new file mode 100644 index 0000000000..c1106695e7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c new file mode 100644 index 0000000000..93d4ad9344 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/alpha/nptl/vfork.S new file mode 100644 index 0000000000..9695c6d289 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/nptl/vfork.S @@ -0,0 +1,45 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tcb-offsets.h> + +#undef PSEUDO_PREPARE_ARGS +#define PSEUDO_PREPARE_ARGS \ + /* Load the current cached pid value across the vfork. */ \ + rduniq; \ + ldl a2, PID_OFFSET(v0); \ + mov v0, a1; \ + /* If the cached value is initialized (nonzero), then write \ + back its negation, or INT_MIN, to indicate that the pid \ + value is uninitialized in the the child, and in the window \ + between here and the point at which we restore the value. */ \ + ldah t0, -0x8000; \ + negl a2, t1; \ + cmovne a2, t1, t0; \ + stl t0, PID_OFFSET(v0); + +PSEUDO (__vfork, vfork, 0) + + /* If we're back in the parent, restore the saved pid. */ + beq v0, 1f + stl a2, PID_OFFSET(a1) +1: ret + +PSEUDO_END (__vfork) +libc_hidden_def (__vfork) +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/oldglob.c b/ports/sysdeps/unix/sysv/linux/alpha/oldglob.c new file mode 100644 index 0000000000..11fd4a00c4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/oldglob.c @@ -0,0 +1,99 @@ +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* This file contains only wrappers around the real glob functions. It + became necessary since the glob_t structure changed. */ +#include <sys/types.h> +#include <glob.h> +#include <shlib-compat.h> + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) + +/* This is the old structure. The difference is that the gl_pathc and + gl_offs elements have type `int'. */ +typedef struct + { + int gl_pathc; /* Count of paths matched by the pattern. */ + char **gl_pathv; /* List of matched pathnames. */ + int gl_offs; /* Slots to reserve in `gl_pathv'. */ + int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */ + + /* If the GLOB_ALTDIRFUNC flag is set, the following functions + are used instead of the normal file access functions. */ + void (*gl_closedir) (void *); + struct dirent *(*gl_readdir) (void *); + __ptr_t (*gl_opendir) (const char *); + int (*gl_lstat) (const char *, struct stat *); + int (*gl_stat) (const char *, struct stat *); + } old_glob_t; + + +int +attribute_compat_text_section +__old_glob (const char *pattern, int flags, + int (*errfunc) (const char *, int), + old_glob_t *pglob) +{ + glob_t correct; + int result; + + /* Construct an object of correct type. */ + correct.gl_pathc = pglob->gl_pathc; + correct.gl_pathv = pglob->gl_pathv; + correct.gl_offs = pglob->gl_offs; + correct.gl_flags = pglob->gl_flags; + correct.gl_closedir = pglob->gl_closedir; + correct.gl_readdir = pglob->gl_readdir; + correct.gl_opendir = pglob->gl_opendir; + correct.gl_lstat = pglob->gl_lstat; + correct.gl_stat = pglob->gl_stat; + + result = glob (pattern, flags, errfunc, &correct); + + /* And convert it back. */ + pglob->gl_pathc = correct.gl_pathc; + pglob->gl_pathv = correct.gl_pathv; + pglob->gl_offs = correct.gl_offs; + pglob->gl_flags = correct.gl_flags; + pglob->gl_closedir = correct.gl_closedir; + pglob->gl_readdir = correct.gl_readdir; + pglob->gl_opendir = correct.gl_opendir; + pglob->gl_lstat = correct.gl_lstat; + pglob->gl_stat = correct.gl_stat; + + return result; +} +compat_symbol (libc, __old_glob, glob, GLIBC_2_0); + + +/* Free storage allocated in PGLOB by a previous `glob' call. */ +void +attribute_compat_text_section +__old_globfree (old_glob_t *pglob) +{ + glob_t correct; + + /* We only need these two symbols. */ + correct.gl_pathc = pglob->gl_pathc; + correct.gl_pathv = pglob->gl_pathv; + correct.gl_offs = pglob->gl_offs; + + globfree (&correct); +} +compat_symbol (libc, __old_globfree, globfree, GLIBC_2_0); + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/alpha/pipe.S b/ports/sysdeps/unix/sysv/linux/alpha/pipe.S new file mode 100644 index 0000000000..1e7ec1c199 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/pipe.S @@ -0,0 +1 @@ +#include <sysdeps/unix/alpha/pipe.S> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/register-dump.h b/ports/sysdeps/unix/sysv/linux/alpha/register-dump.h new file mode 100644 index 0000000000..36490f58d1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/register-dump.h @@ -0,0 +1,156 @@ +/* Dump registers. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <string.h> + +/* We will print the register dump in this format: + + V0: XXXXXXXXXXXXXXXX T0: XXXXXXXXXXXXXXXX T1: XXXXXXXXXXXXXXXX + T2: XXXXXXXXXXXXXXXX T3: XXXXXXXXXXXXXXXX T4: XXXXXXXXXXXXXXXX + T5: XXXXXXXXXXXXXXXX T6: XXXXXXXXXXXXXXXX T7: XXXXXXXXXXXXXXXX + S0: XXXXXXXXXXXXXXXX S1: XXXXXXXXXXXXXXXX S2: XXXXXXXXXXXXXXXX + S3: XXXXXXXXXXXXXXXX S4: XXXXXXXXXXXXXXXX S5: XXXXXXXXXXXXXXXX + S6: XXXXXXXXXXXXXXXX A0: XXXXXXXXXXXXXXXX A1: XXXXXXXXXXXXXXXX + A2: XXXXXXXXXXXXXXXX A3: XXXXXXXXXXXXXXXX A4: XXXXXXXXXXXXXXXX + A5: XXXXXXXXXXXXXXXX T8: XXXXXXXXXXXXXXXX T9: XXXXXXXXXXXXXXXX + T10: XXXXXXXXXXXXXXXX T11: XXXXXXXXXXXXXXXX RA: XXXXXXXXXXXXXXXX + T12: XXXXXXXXXXXXXXXX AT: XXXXXXXXXXXXXXXX GP: XXXXXXXXXXXXXXXX + SP: XXXXXXXXXXXXXXXX PC: XXXXXXXXXXXXXXXX + + FP0: XXXXXXXXXXXXXXXX FP1: XXXXXXXXXXXXXXXX FP2: XXXXXXXXXXXXXXXX + FP3: XXXXXXXXXXXXXXXX FP4: XXXXXXXXXXXXXXXX FP5: XXXXXXXXXXXXXXXX + FP6: XXXXXXXXXXXXXXXX FP7: XXXXXXXXXXXXXXXX FP8: XXXXXXXXXXXXXXXX + FP9: XXXXXXXXXXXXXXXX FP10: XXXXXXXXXXXXXXXX FP11: XXXXXXXXXXXXXXXX + FP12: XXXXXXXXXXXXXXXX FP13: XXXXXXXXXXXXXXXX FP14: XXXXXXXXXXXXXXXX + FP15: XXXXXXXXXXXXXXXX FP16: XXXXXXXXXXXXXXXX FP17: XXXXXXXXXXXXXXXX + FP18: XXXXXXXXXXXXXXXX FP19: XXXXXXXXXXXXXXXX FP20: XXXXXXXXXXXXXXXX + FP21: XXXXXXXXXXXXXXXX FP22: XXXXXXXXXXXXXXXX FP23: XXXXXXXXXXXXXXXX + FP24: XXXXXXXXXXXXXXXX FP25: XXXXXXXXXXXXXXXX FP26: XXXXXXXXXXXXXXXX + FP27: XXXXXXXXXXXXXXXX FP28: XXXXXXXXXXXXXXXX FP29: XXXXXXXXXXXXXXXX + FP30: XXXXXXXXXXXXXXXX FPCR: XXXXXXXXXXXXXXXX + + TA0: XXXXXXXXXXXXXXXX TA1: XXXXXXXXXXXXXXXX TA2: XXXXXXXXXXXXXXXX +*/ + +#define NREGS (32+32+3) + +static const char __attribute__((aligned(8))) regnames[NREGS][8] = +{ + " V0: ", " T0: ", " T1: ", + " T2: ", " T3: ", " T4: ", + " T5: ", " T6: ", " T7: ", + " S0: ", " S1: ", " S2: ", + " S3: ", " S4: ", " S5: ", + " S6: ", " A0: ", " A1: ", + " A2: ", " A3: ", " A4: ", + " A5: ", " T8: ", " T9: ", + " T10: ", " T11: ", " RA: ", + " T12: ", " AT: ", " GP: ", + " SP: ", " PC: ", + + " FP0: ", " FP1: ", " FP2: ", + " FP3: ", " FP4: ", " FP5: ", + " FP6: ", " FP7: ", " FP8: ", + " FP9: ", " FP10: ", " FP11: ", + " FP12: ", " FP13: ", " FP14: ", + " FP15: ", " FP16: ", " FP17: ", + " FP18: ", " FP19: ", " FP20: ", + " FP21: ", " FP22: ", " FP23: ", + " FP24: ", " FP25: ", " FP26: ", + " FP27: ", " FP28: ", " FP29: ", + " FP30: ", " FPCR: ", + + " TA0: ", " TA1: ", " TA2: " +}; + +#define O(FIELD, LF) offsetof(struct sigcontext, FIELD) + LF + +static const int offsets[NREGS] = +{ + O(sc_regs[0], 0), O(sc_regs[1], 0), O(sc_regs[2], 1), + O(sc_regs[3], 0), O(sc_regs[4], 0), O(sc_regs[5], 1), + O(sc_regs[6], 0), O(sc_regs[7], 0), O(sc_regs[8], 1), + O(sc_regs[9], 0), O(sc_regs[10], 0), O(sc_regs[11], 1), + O(sc_regs[12], 0), O(sc_regs[13], 0), O(sc_regs[14], 1), + O(sc_regs[15], 0), O(sc_regs[16], 0), O(sc_regs[17], 1), + O(sc_regs[18], 0), O(sc_regs[19], 0), O(sc_regs[20], 1), + O(sc_regs[21], 0), O(sc_regs[22], 0), O(sc_regs[23], 1), + O(sc_regs[24], 0), O(sc_regs[25], 0), O(sc_regs[26], 1), + O(sc_regs[27], 0), O(sc_regs[28], 0), O(sc_regs[29], 1), + O(sc_regs[30], 0), O(sc_pc, 2), + + O(sc_fpregs[0], 0), O(sc_fpregs[1], 0), O(sc_fpregs[2], 1), + O(sc_fpregs[3], 0), O(sc_fpregs[4], 0), O(sc_fpregs[5], 1), + O(sc_fpregs[6], 0), O(sc_fpregs[7], 0), O(sc_fpregs[8], 1), + O(sc_fpregs[9], 0), O(sc_fpregs[10], 0), O(sc_fpregs[11], 1), + O(sc_fpregs[12], 0), O(sc_fpregs[13], 0), O(sc_fpregs[14], 1), + O(sc_fpregs[15], 0), O(sc_fpregs[16], 0), O(sc_fpregs[17], 1), + O(sc_fpregs[18], 0), O(sc_fpregs[19], 0), O(sc_fpregs[20], 1), + O(sc_fpregs[21], 0), O(sc_fpregs[22], 0), O(sc_fpregs[23], 1), + O(sc_fpregs[24], 0), O(sc_fpregs[25], 0), O(sc_fpregs[26], 1), + O(sc_fpregs[27], 0), O(sc_fpregs[28], 0), O(sc_fpregs[29], 1), + O(sc_fpregs[30], 0), O(sc_fpcr, 2), + + O(sc_traparg_a0, 0), O(sc_traparg_a1, 0), O(sc_traparg_a2, 1) +}; + +#undef O + +static void +register_dump (int fd, struct sigcontext *ctx) +{ + char buf[NREGS*(8+16) + 25 + 80]; + char *p = buf; + size_t i; + + p = stpcpy (p, "Register dump:\n\n"); + + for (i = 0; i < NREGS; ++i) + { + int this_offset, this_lf; + unsigned long val; + signed long j; + + this_offset = offsets[i]; + this_lf = this_offset & 7; + + val = *(unsigned long *)(((size_t)ctx + this_offset) & -8); + + memcpy (p, regnames[i], 8); + p += 8; + + for (j = 60; j >= 0; j -= 4) + { + unsigned long x = (val >> j) & 15; + x += x < 10 ? '0' : 'a' - 10; + *p++ = x; + } + + if (this_lf > 0) + { + if (this_lf > 1) + *p++ = '\n'; + *p++ = '\n'; + } + } + + write (fd, buf, p - buf); +} + +#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S b/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S new file mode 100644 index 0000000000..42062b0847 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S @@ -0,0 +1,110 @@ +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson <rth@cygnus.com>, 1998 + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* On Alpha we desparately want to avoid having to issue an imb. Ordinarily + the kernel would have to issue one after setting up the signal return + stack, but the Linux rt_sigaction syscall is prepared to accept a pointer + to the sigreturn syscall, instead of inlining it on the stack. + + This just about halves signal delivery time. */ + + .text + +ENTRY(__syscall_rt_sigaction) + cfi_startproc + ldgp gp,0(pv) +#ifdef PROF + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at +#endif + .prologue 1 + + beq a1, 0f + ldl t0, 8(a1) # sa_flags + + ldah a4, __syscall_sigreturn(gp) !gprelhigh + ldah t1, __syscall_rt_sigreturn(gp) !gprelhigh + lda a4, __syscall_sigreturn(a4) !gprellow + lda t1, __syscall_rt_sigreturn(t1) !gprellow + and t0, 0x40, t0 # SA_SIGINFO + cmovne t0, t1, a4 + +0: ldi v0, __NR_rt_sigaction + callsys + bne a3, SYSCALL_ERROR_LABEL + ret + cfi_endproc +PSEUDO_END(__syscall_rt_sigaction) + +/* To enable unwinding through the signal frame without special hackery + elsewhere, describe the entire struct sigcontext with unwind info. + + In order to minimize the size of the encoding, we set the CFA to the + end of the sigcontext, which makes all of the registers have small + negative offsets from that. */ + + .macro SIGCONTEXT_REGS_I base, from=0 + cfi_offset (\from, \base + (4 + \from) * 8) + .if 30-\from + SIGCONTEXT_REGS_I \base, "(\from+1)" + .endif + .endm + + .macro SIGCONTEXT_REGS_F base, from=32 + cfi_offset (\from, \base + (4 + 1 + \from) * 8) + .if 62-\from + SIGCONTEXT_REGS_F \base, "(\from+1)" + .endif + .endm + + .macro SIGCONTEXT_REGS base + SIGCONTEXT_REGS_I \base + SIGCONTEXT_REGS_F \base + cfi_offset (63, \base + (4 + 32 + 1 + 32) * 8) + cfi_offset (64, \base + 2 * 8) + .endm + + .align 4 + + cfi_startproc + cfi_return_column (64) + .cfi_signal_frame + SIGCONTEXT_REGS -648 + + cfi_def_cfa_offset (648) +__syscall_sigreturn: + mov sp, a0 + ldi v0, __NR_sigreturn + callsys + .size __syscall_sigreturn, .-__syscall_sigreturn + .type __syscall_sigreturn, @function + + .align 4 + cfi_def_cfa_offset (176 + 648) +__syscall_rt_sigreturn: + mov sp,a0 + ldi v0,__NR_rt_sigreturn + callsys + .size __syscall_rt_sigreturn, .-__syscall_rt_sigreturn + .type __syscall_rt_sigreturn, @function + + cfi_endproc diff --git a/ports/sysdeps/unix/sysv/linux/alpha/semctl.c b/ports/sysdeps/unix/sysv/linux/alpha/semctl.c new file mode 100644 index 0000000000..0e59ee27af --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/semctl.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1995-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stdarg.h> +#include <sys/sem.h> +#include <ipc_priv.h> +#include <sysdep.h> +#include <sys/syscall.h> + + +/* Define a `union semun' suitable for Linux here. */ +union semun +{ + int val; /* value for SETVAL */ + struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ + unsigned short int *array; /* array for GETALL & SETALL */ + struct seminfo *__buf; /* buffer for IPC_INFO */ +}; + +#include <bp-checks.h> +#include <bp-semctl.h> + + +int +__new_semctl (int semid, int semnum, int cmd, ...) +{ + union semun arg; + va_list ap; + + va_start (ap, cmd); + + /* Get the argument. */ + arg = va_arg (ap, union semun); + + va_end (ap); + + return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64, + CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/setcontext.S b/ports/sysdeps/unix/sysv/linux/alpha/setcontext.S new file mode 100644 index 0000000000..16a0b871e5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/setcontext.S @@ -0,0 +1,34 @@ +/* Install given context. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <ucontext-offsets.h> + + +/* In case the user fiddled it, copy the "official" signal mask + from the ucontext_t into the sigcontext structure. */ +#undef PSEUDO_PREPARE_ARGS +#define PSEUDO_PREPARE_ARGS \ + ldq $0, UC_SIGMASK($16); \ + stq $0, UC_SIGCTX+SC_MASK($16); \ + lda $16, UC_SIGCTX($16); + +PSEUDO(__setcontext, sigreturn, 1) + ret +PSEUDO_END(__setcontext) +weak_alias (__setcontext, setcontext) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/setfpucw.c b/ports/sysdeps/unix/sysv/linux/alpha/setfpucw.c new file mode 100644 index 0000000000..becc11f94c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/setfpucw.c @@ -0,0 +1,79 @@ +/* Set FP exception mask and rounding mode. + Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <fpu_control.h> +#include <asm/fpu.h> + +extern void __ieee_set_fp_control (unsigned long); +libc_hidden_proto(__ieee_set_fp_control) + +extern unsigned long __ieee_get_fp_control (void); +libc_hidden_proto(__ieee_get_fp_control) + +static inline unsigned long +rdfpcr (void) +{ + unsigned long fpcr; + asm ("excb; mf_fpcr %0" : "=f"(fpcr)); + return fpcr; +} + + +static inline void +wrfpcr (unsigned long fpcr) +{ + asm volatile ("mt_fpcr %0; excb" : : "f"(fpcr)); +} + + +void +__setfpucw (fpu_control_t fpu_control) +{ + unsigned long fpcr = 0, fpcw = 0; + + if (!fpu_control) + fpu_control = _FPU_DEFAULT; + + /* first, set dynamic rounding mode: */ + + fpcr = rdfpcr(); + fpcr &= ~FPCR_DYN_MASK; + switch (fpu_control & 0xc00) + { + case _FPU_RC_NEAREST: fpcr |= FPCR_DYN_NORMAL; break; + case _FPU_RC_DOWN: fpcr |= FPCR_DYN_MINUS; break; + case _FPU_RC_UP: fpcr |= FPCR_DYN_PLUS; break; + case _FPU_RC_ZERO: fpcr |= FPCR_DYN_CHOPPED; break; + } + wrfpcr(fpcr); + + /* now tell kernel about traps that we like to hear about: */ + + fpcw = __ieee_get_fp_control(); + fpcw &= ~IEEE_TRAP_ENABLE_MASK; + + if (!(fpu_control & _FPU_MASK_IM)) fpcw |= IEEE_TRAP_ENABLE_INV; + if (!(fpu_control & _FPU_MASK_DM)) fpcw |= IEEE_TRAP_ENABLE_UNF; + if (!(fpu_control & _FPU_MASK_ZM)) fpcw |= IEEE_TRAP_ENABLE_DZE; + if (!(fpu_control & _FPU_MASK_OM)) fpcw |= IEEE_TRAP_ENABLE_OVF; + if (!(fpu_control & _FPU_MASK_PM)) fpcw |= IEEE_TRAP_ENABLE_INE; + + __fpu_control = fpu_control; /* update global copy */ + + __ieee_set_fp_control(fpcw); +} diff --git a/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c b/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c new file mode 100644 index 0000000000..fb825a80de --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c @@ -0,0 +1,35 @@ +/* Copyright (C) 1995-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/shm.h> +#include <ipc_priv.h> +#include <sysdep.h> +#include <sys/syscall.h> +#include <bits/wordsize.h> +#include <bp-checks.h> + + +int +__new_shmctl (int shmid, int cmd, struct shmid_ds *buf) +{ + return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, CHECK_1 (buf)); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_2); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c b/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c new file mode 100644 index 0000000000..2dcb133442 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sys/cdefs.h> +#include <stddef.h> + +/* + * In order to get the hidden arguments for rt_sigaction set up + * properly, we need to call the assembly version. Detect this in the + * INLINE_SYSCALL macro, and fail to expand inline in that case. + */ + +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + (__NR_##name == __NR_rt_sigaction \ + ? __syscall_rt_sigaction(args) \ + : INLINE_SYSCALL1(name, nr, args)) + +struct kernel_sigaction; +extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, + struct kernel_sigaction *__unbounded, size_t); + +#include <sysdeps/unix/sysv/linux/sigaction.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h new file mode 100644 index 0000000000..6f85582a61 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h @@ -0,0 +1,24 @@ +/* Copyright (C) 1999, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define SIGCONTEXT int _code, struct sigcontext * +#define SIGCONTEXT_EXTRA_ARGS _code, +#define GET_PC(ctx) ((void *) (ctx)->sc_pc) +#define GET_FRAME(ctx) ((void *) (ctx)->sc_regs[15]) +#define GET_STACK(ctx) ((void *) (ctx)->sc_regs[30]) +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sigprocmask.c b/ports/sysdeps/unix/sysv/linux/alpha/sigprocmask.c new file mode 100644 index 0000000000..b7a9e5bf9a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sigprocmask.c @@ -0,0 +1,57 @@ +/* Copyright (C) 1993, 1995, 1997, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger (davidm@azstarnet.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sysdep.h> +#include <signal.h> + +/* When there is kernel support for more than 64 signals, we'll have to + switch to a new system call convention here. */ + +int +__sigprocmask (int how, const sigset_t *set, sigset_t *oset) +{ + unsigned long int setval; + long result; + + if (set) + setval = set->__val[0]; + else + { + setval = 0; + how = SIG_BLOCK; /* ensure blocked mask doesn't get changed */ + } + + result = INLINE_SYSCALL (osf_sigprocmask, 2, how, setval); + if (result == -1) + /* If there are ever more than 63 signals, we need to recode this + in assembler since we wouldn't be able to distinguish a mask of + all 1s from -1, but for now, we're doing just fine... */ + return result; + + if (oset) + { + oset->__val[0] = result; + result = _SIGSET_NWORDS; + while (--result > 0) + oset->__val[result] = 0; + } + return 0; +} + +weak_alias (__sigprocmask, sigprocmask); diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sigsuspend.S b/ports/sysdeps/unix/sysv/linux/alpha/sigsuspend.S new file mode 100644 index 0000000000..fff6fb6beb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sigsuspend.S @@ -0,0 +1,45 @@ +/* Copyright (C) 1993,1995,1996,1997,2002,2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger <davidm@cs.arizona.edu>, 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* sigsuspend is a special syscall since it needs to dereference the + sigset. This will have to change when we have more than 64 signals. */ + +#ifndef NO_CANCELLATION +#include <sysdep.h> + +#undef PSEUDO_PREPARE_ARGS +#define PSEUDO_PREPARE_ARGS ldq a0, 0(a0); + +PSEUDO(__sigsuspend_nocancel, sigsuspend, 1) + ret +/* Use END, not PSEUDO_END, so that we don't issue two $syscall_error + symbols; we'll jump into __sigsuspend for the error case. */ +END(__sigsuspend_nocancel) +#endif /* NO_CANCELLATION */ + +#include <sysdep-cancel.h> + +#undef PSEUDO_PREPARE_ARGS +#define PSEUDO_PREPARE_ARGS ldq a0, 0(a0); + +PSEUDO(__sigsuspend, sigsuspend, 1) + ret +PSEUDO_END(__sigsuspend) +libc_hidden_def (__sigsuspend) +weak_alias (__sigsuspend, sigsuspend) +strong_alias (__sigsuspend, __libc_sigsuspend) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sizes.h b/ports/sysdeps/unix/sysv/linux/alpha/sizes.h new file mode 100644 index 0000000000..e44054c6e5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sizes.h @@ -0,0 +1,23 @@ +/* Copyright (C) 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIZES_H +#define _SIZES_H 1 + +#define PTR_SIZE_STR "8" + +#endif /* sizes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/statfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/statfs64.c new file mode 100644 index 0000000000..fe39cc4685 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/statfs64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/statfs64.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/statvfs.c b/ports/sysdeps/unix/sysv/linux/alpha/statvfs.c new file mode 100644 index 0000000000..78069e96f4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/statvfs.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/statvfs.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c new file mode 100644 index 0000000000..c80e17751d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/statvfs64.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/swapcontext.S b/ports/sysdeps/unix/sysv/linux/alpha/swapcontext.S new file mode 100644 index 0000000000..99ed0f8d43 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/swapcontext.S @@ -0,0 +1,50 @@ +/* Save current context and install the given one. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <ucontext-offsets.h> + +ENTRY(__swapcontext) + +#ifdef PROF + ldgp $29, 0($27) + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at + .prologue 1 +#elif defined PIC + .prologue 0 +#else + ldgp $29, 0($27) + .prologue 1 +#endif + +#ifdef PIC + unop + bsr $0, __getcontext_x !samegp + mov $17, $16 + br $31, __setcontext !samegp +#else + jsr $0, __getcontext_x + mov $17, $16 + jmp $31, __setcontext +#endif + +END(__swapcontext) +weak_alias (__swapcontext, swapcontext) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/acct.h new file mode 100644 index 0000000000..9645029662 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sys/acct.h @@ -0,0 +1,65 @@ +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_ACCT_H + +#define _SYS_ACCT_H 1 +#include <features.h> + +#define __need_time_t +#include <time.h> + + +__BEGIN_DECLS + +#define ACCT_COMM 16 + +struct acct + { + char ac_comm[ACCT_COMM]; /* Accounting command name. */ + time_t ac_utime; /* Accounting user time. */ + time_t ac_stime; /* Accounting system time. */ + time_t ac_etime; /* Accounting elapsed time. */ + time_t ac_btime; /* Beginning time. */ + unsigned int ac_uid; /* Accounting user ID. */ + unsigned int ac_gid; /* Accounting group ID. */ + unsigned int ac_tty; /* Controlling tty. */ + /* Please note that the value of the `ac_tty' field, a device number, + is encoded differently in the kernel and for the libc dev_t type. */ + char ac_flag; /* Accounting flag. */ + long int ac_minflt; /* Accounting minor pagefaults. */ + long int ac_majflt; /* Accounting major pagefaults. */ + long int ac_exitcode; /* Accounting process exitcode. */ + }; + +enum + { + AFORK = 0001, /* Has executed fork, but no exec. */ + ASU = 0002, /* Used super-user privileges. */ + ACORE = 0004, /* Dumped core. */ + AXSIG = 0010 /* Killed by a signal. */ + }; + +#define AHZ 100 + + +/* Switch process accounting on and off. */ +extern int acct (const char *__filename) __THROW; + +__END_DECLS + +#endif /* sys/acct.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/io.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/io.h new file mode 100644 index 0000000000..a612a417a3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sys/io.h @@ -0,0 +1,94 @@ +/* Copyright (C) 1996, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IO_H + +#define _SYS_IO_H 1 +#include <features.h> + +__BEGIN_DECLS + +/* If TURN_ON is TRUE, request for permission to do direct i/o on the + port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O + permission off for that range. This call requires root privileges. + + Portability note: not all Linux platforms support this call. Most + platforms based on the PC I/O architecture probably will, however. + E.g., Linux/Alpha for Alpha PCs supports this. */ +extern int ioperm (unsigned long int __from, unsigned long int __num, + int __turn_on) __THROW; + +/* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to + access any I/O port is granted. This call requires root + privileges. */ +extern int iopl (int __level) __THROW; + +/* Return the physical address of the DENSE I/O memory or NULL if none + is available (e.g. on a jensen). */ +extern unsigned long int _bus_base (void) __THROW __attribute__ ((const)); +extern unsigned long int bus_base (void) __THROW __attribute__ ((const)); + +/* Return the physical address of the SPARSE I/O memory. */ +extern unsigned long _bus_base_sparse (void) __THROW __attribute__ ((const)); +extern unsigned long bus_base_sparse (void) __THROW __attribute__ ((const)); + +/* Return the HAE shift used by the SPARSE I/O memory. */ +extern int _hae_shift (void) __THROW __attribute__ ((const)); +extern int hae_shift (void) __THROW __attribute__ ((const)); + +/* Previous three are deprecated in favour of the following, which + knows about multiple PCI "hoses". Provide the PCI bus and dfn + numbers just as to pciconfig_read/write. */ + +enum __pciconfig_iobase_which +{ + IOBASE_HOSE = 0, /* Return hose index. */ + IOBASE_SPARSE_MEM = 1, /* Return physical memory addresses. */ + IOBASE_DENSE_MEM = 2, + IOBASE_SPARSE_IO = 3, + IOBASE_DENSE_IO = 4 +}; + +extern long pciconfig_iobase(enum __pciconfig_iobase_which __which, + unsigned long int __bus, + unsigned long int __dfn) + __THROW __attribute__ ((const)); + +/* Access PCI space protected from machine checks. */ +extern int pciconfig_read (unsigned long int __bus, + unsigned long int __dfn, + unsigned long int __off, + unsigned long int __len, + unsigned char *__buf) __THROW; + +extern int pciconfig_write (unsigned long int __bus, + unsigned long int __dfn, + unsigned long int __off, + unsigned long int __len, + unsigned char *__buf) __THROW; + +/* Userspace declarations. */ +extern unsigned int inb (unsigned long __port) __THROW; +extern unsigned int inw (unsigned long __port) __THROW; +extern unsigned int inl (unsigned long __port) __THROW; +extern void outb (unsigned char __b, unsigned long __port) __THROW; +extern void outw (unsigned short __w, unsigned long __port) __THROW; +extern void outl (unsigned int __l, unsigned long __port) __THROW; + +__END_DECLS + +#endif /* _SYS_IO_H */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/procfs.h new file mode 100644 index 0000000000..1b3769da6a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sys/procfs.h @@ -0,0 +1,127 @@ +/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somehow modelled after the file of the same name on SysVr4 + systems. It provides a definition of the core file format for ELF + used on Linux. */ + +#include <features.h> +#include <signal.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/ucontext.h> +#include <sys/user.h> + +__BEGIN_DECLS + +/* + * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long. + * I have no idea why that is so. For now, we just leave it at 33 + * (32 general regs + processor status word). + */ +#define ELF_NGREG 33 +#define ELF_NFPREG 32 + +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef double elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + gdb doesn't really use excluded. Fields present but not used are + marked with "XXX". */ +struct elf_prstatus + { +#if 0 + long int pr_flags; /* XXX Process flags. */ + short int pr_why; /* XXX Reason for process halt. */ + short int pr_what; /* XXX More detailed reason. */ +#endif + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ +#if 0 + struct sigaltstack pr_altstack; /* Alternate stack info. */ + struct sigaction pr_action; /* Signal action for current sig. */ +#endif + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ +#if 0 + long int pr_instr; /* Current instruction. */ +#endif + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned int pr_uid; + unsigned int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef gregset_t prgregset_t; +typedef fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore habe only ine PID type. */ +typedef __pid_t lwpid_t; + + +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h new file mode 100644 index 0000000000..1f66987583 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h @@ -0,0 +1,60 @@ +/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +#include <bits/sigcontext.h> + + +/* Type for general register. */ +typedef long int greg_t; + +/* Number of general registers. */ +#define NGREG 33 + +/* Container for all general registers. */ +typedef greg_t gregset_t[NGREG]; + +/* Type for floating-point register. */ +typedef long int fpreg_t; + +/* Number of general registers. */ +#define NFPREG 32 + +/* Container for all general registers. */ +typedef fpreg_t fpregset_t[NFPREG]; + + +/* A machine context is exactly a sigcontext. */ +typedef struct sigcontext mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_link; + unsigned long __uc_osf_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + } ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h b/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h new file mode 100644 index 0000000000..1eb2ede76e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +/* The whole purpose of this file is for gdb/strace and gdb/strace + only. Don't read too much into it. Don't use it for anything other + than gdb/strace unless you know what you are doing. */ + +#include <asm/reg.h> + +struct user +{ + unsigned long int regs[EF_SIZE / 8 + 32]; /* integer and fp regs */ + size_t u_tsize; /* text size (pages) */ + size_t u_dsize; /* data size (pages) */ + size_t u_ssize; /* stack size (pages) */ + unsigned long int start_code; /* text starting address */ + unsigned long int start_data; /* data starting address */ + unsigned long int start_stack; /* stack starting address */ + long int signal; /* signal causing core dump */ + struct regs *u_ar0; /* help gdb find registers */ + unsigned long int magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ +}; + +#define PAGE_SHIFT 13 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_DATA_START_ADDR (u.start_data) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + +#endif /* sys/user.h */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/syscall.S b/ports/sysdeps/unix/sysv/linux/alpha/syscall.S new file mode 100644 index 0000000000..830b10acb6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/syscall.S @@ -0,0 +1,77 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger <davidm@azstarnet.com>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* + * This is for COMPATIBILITY with Linux/x86 only. Linux/Alpha system + * calls return an error indication in a3. This allows arbitrary 64bit + * values to be returned in v0 (because negative values are not + * mistaken as error numbers). However, C allows only one value to + * be returned, so the interface below folds the error indication passed in + * a3 back into v0: it sets v0 to -errno if an error occurs. Thus, + * no negative 64bit numbers can be returned. To avoid this problem, + * use assembly stubs wherever possible/convenient. + * + * Usage: + * + * long syscall(syscall_number, arg1, arg2, arg3, arg4, arg5, arg6) + * + * syscall_number = the index of the system call we're invoking + * arg1-arg6 = up to 6 integer arguments to the system call + * + * We need to do some arg shifting: the kernel expects the + * syscall number in v0 and the first six args in a0-a5. + * + */ + + +LEAF(__syscall, 0) +#ifdef PROF + ldgp gp, 0(pv) + .set noat + lda AT, _mcount + jsr AT, (AT), _mcount + .set at + .prologue 1 +#else + .prologue 0 +#endif + + mov a0, v0 /* Syscall number -> v0 */ + mov a1, a0 /* arg1-arg5 -> a0-a4 */ + mov a2, a1 + mov a3, a2 + mov a4, a3 + mov a5, a4 + ldq a5,0(sp) /* arg6 -> a5 */ + + call_pal PAL_callsys /* Invoke system call */ + bne a3, $error + ret + +$error: +#ifndef PROF + br gp, 2f +2: ldgp gp, 0(gp) +#endif + SYSCALL_ERROR_HANDLER + +END(__syscall) + +weak_alias (__syscall, syscall) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list b/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list new file mode 100644 index 0000000000..de368801af --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -0,0 +1,70 @@ +# File name Caller Syscall name # args Strong name Weak names + +oldmsgctl EXTRA msgctl i:iip __old_msgctl msgctl@GLIBC_2.0 +msgget - msgget i:ii __msgget msgget +msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv +msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +shmat - osf_shmat i:ipi __shmat shmat +oldshmctl EXTRA shmctl i:iip __old_shmctl shmctl@GLIBC_2.0 +shmdt - shmdt i:s __shmdt shmdt +shmget - shmget i:iii __shmget shmget +semop - semop i:ipi __semop semop +semtimedop - semtimedop i:ipip semtimedop +semget - semget i:iii __semget semget +oldsemctl EXTRA semctl i:iiii __old_semctl semctl@GLIBC_2.0 + +sigstack - sigstack 2 sigstack +vfork - vfork 0 __vfork vfork + +getpriority - getpriority i:ii __getpriority getpriority + +# proper socket implementations: +accept - accept Ci:iBN __libc_accept __accept accept +bind - bind i:ipi __bind bind +connect - connect Ci:ipi __libc_connect __connect connect +getpeername - getpeername i:ipp __getpeername getpeername +getsockname - getsockname i:ipp __getsockname getsockname +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt +listen - listen i:ii __listen listen +recv - recv Ci:ibni __libc_recv __recv recv +recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom +recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg +send - send Ci:ibni __libc_send __send send +sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg +sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt +shutdown - shutdown i:ii __shutdown shutdown +socket - socket i:iii __socket socket +socketpair - socketpair i:iiif __socketpair socketpair + +ptrace - ptrace 4 __ptrace ptrace + +# access pci space protected from machine checks: +pciconfig_read EXTRA pciconfig_read 5 pciconfig_read +pciconfig_write EXTRA pciconfig_write 5 pciconfig_write +pciconfig_iobase EXTRA pciconfig_iobase 3 __pciconfig_iobase pciconfig_iobase + +# support old timeval32 entry points +osf_select - osf_select C:5 __select_tv32 __select@GLIBC_2.0 select@GLIBC_2.0 +osf_gettimeofday - osf_gettimeofday 2 __gettimeofday_tv32 __gettimeofday@GLIBC_2.0 gettimeofday@GLIBC_2.0 +osf_settimeofday - osf_settimeofday 2 __settimeofday_tv32 settimeofday@GLIBC_2.0 +osf_getitimer - osf_getitimer 2 __getitimer_tv32 getitimer@GLIBC_2.0 +osf_setitimer - osf_setitimer 3 __setitimer_tv32 setitimer@GLIBC_2.0 +osf_utimes - osf_utimes 2 __utimes_tv32 utimes@GLIBC_2.0 +osf_getrusage - osf_getrusage 2 __getrusage_tv32 getrusage@GLIBC_2.0 +osf_wait4 - osf_wait4 4 __wait4_tv32 wait4@GLIBC_2.0 + +# support new timeval64 entry points +select - select C:5 __GI___select select@@GLIBC_2.1 __select@@GLIBC_2.1 +gettimeofday - gettimeofday 2 __GI___gettimeofday gettimeofday@@GLIBC_2.1 __gettimeofday@@GLIBC_2.1 +settimeofday - settimeofday 2 __settimeofday settimeofday@@GLIBC_2.1 +getitimer - getitimer 2 __getitimer getitimer@@GLIBC_2.1 +setitimer - setitimer 3 __setitimer setitimer@@GLIBC_2.1 +utimes - utimes 2 __utimes utimes@@GLIBC_2.1 +getrusage - getrusage 2 __getrusage getrusage@@GLIBC_2.1 +wait4 - wait4 4 __wait4 wait4@@GLIBC_2.1 + +# avoid 64-bit aliases on 32-bit statfs syscalls +fstatfs - fstatfs i:ip __fstatfs fstatfs +statfs - statfs i:sp __statfs statfs + diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c b/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c new file mode 100644 index 0000000000..603157e3ac --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c @@ -0,0 +1,127 @@ +/* Copyright (C) 2004, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <stdbool.h> +#include <stdlib.h> +#include <unistd.h> + + +static long int linux_sysconf (int name); + +#define CSHAPE(totalsize, linesize, assoc) \ + ((totalsize & ~0xff) | (linesize << 4) | assoc) + +extern long __libc_alpha_cache_shape[4]; + +/* Get the value of the system variable NAME. */ +long int +__sysconf (int name) +{ + long shape, index; + + /* We only handle the cache information here (for now). */ + if (name < _SC_LEVEL1_ICACHE_SIZE || name > _SC_LEVEL4_CACHE_LINESIZE) + return linux_sysconf (name); + + /* No Alpha has L4 caches. */ + if (name >= _SC_LEVEL4_CACHE_SIZE) + return -1; + + index = (name - _SC_LEVEL1_ICACHE_SIZE) / 3; + shape = __libc_alpha_cache_shape[index]; + if (shape == -2) + { + long shape_l1i, shape_l1d, shape_l2, shape_l3 = -1; + + /* ??? In the cases below for which we do not know L1 cache sizes, + we could do timings to measure sizes. But for the Bcache, it's + generally big enough that (without additional help) TLB effects + get in the way. We'd either need to be able to allocate large + pages or have the kernel do the timings from KSEG. Fortunately, + kernels beginning with 2.6.5 will pass us this info in auxvec. */ + + switch (__builtin_alpha_implver ()) + { + case 0: /* EV4 */ + /* EV4/LCA45 had 8k L1 caches; EV45 had 16k L1 caches. */ + /* EV4/EV45 had 128k to 16M 32-byte direct Bcache. LCA45 + had 64k to 8M 8-byte direct Bcache. Can't tell. */ + shape_l1i = shape_l1d = shape_l2 = CSHAPE (0, 5, 1); + break; + + case 1: /* EV5 */ + if (__builtin_alpha_amask (1 << 8)) + { + /* MAX insns not present; either EV5 or EV56. */ + shape_l1i = shape_l1d = CSHAPE(8*1024, 5, 1); + /* ??? L2 and L3 *can* be configured as 32-byte line. */ + shape_l2 = CSHAPE (96*1024, 6, 3); + /* EV5/EV56 has 1M to 16M Bcache. */ + shape_l3 = CSHAPE (0, 6, 1); + } + else + { + /* MAX insns present; either PCA56 or PCA57. */ + /* PCA56 had 16k 64-byte cache; PCA57 had 32k Icache. */ + /* PCA56 had 8k 64-byte cache; PCA57 had 16k Dcache. */ + /* PCA5[67] had 512k to 4M Bcache. */ + shape_l1i = shape_l1d = shape_l2 = CSHAPE (0, 6, 1); + } + break; + + case 2: /* EV6 */ + shape_l1i = shape_l1d = CSHAPE(64*1024, 6, 2); + /* EV6/EV67/EV68* had 1M to 16M Bcache. */ + shape_l2 = CSHAPE (0, 6, 1); + break; + + case 3: /* EV7 */ + shape_l1i = shape_l1d = CSHAPE(64*1024, 6, 2); + shape_l2 = CSHAPE(7*1024*1024/4, 6, 7); + break; + + default: + shape_l1i = shape_l1d = shape_l2 = 0; + break; + } + + __libc_alpha_cache_shape[0] = shape_l1i; + __libc_alpha_cache_shape[1] = shape_l1d; + __libc_alpha_cache_shape[2] = shape_l2; + __libc_alpha_cache_shape[3] = shape_l3; + shape = __libc_alpha_cache_shape[index]; + } + + if (shape <= 0) + return shape; + + switch ((name - _SC_LEVEL1_ICACHE_SIZE) % 3) + { + case 0: /* total size */ + return shape & -0x100; + case 1: /* associativity */ + return shape & 0xf; + default: /* line size */ + return 1L << ((shape >> 4) & 0xf); + } +} + +/* Now the generic Linux version. */ +#undef __sysconf +#define __sysconf static linux_sysconf +#include <sysdeps/unix/sysv/linux/sysconf.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h b/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h new file mode 100644 index 0000000000..329fdbd082 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -0,0 +1,95 @@ +/* Copyright (C) 1992-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_ALPHA_SYSDEP_H +#define _LINUX_ALPHA_SYSDEP_H 1 + +#ifdef __ASSEMBLER__ +#include <asm/pal.h> +#include <alpha/regdef.h> +#endif + +/* There is some commonality. */ +#include <sysdeps/unix/alpha/sysdep.h> + +#include <tls.h> + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +/* Define some aliases to make automatic syscall generation work + properly. The SYS_* variants are for the benefit of the files in + sysdeps/unix. */ +#define __NR_getpid __NR_getxpid +#define __NR_getuid __NR_getxuid +#define __NR_getgid __NR_getxgid +#define SYS_getpid __NR_getxpid +#define SYS_getuid __NR_getxuid +#define SYS_getgid __NR_getxgid + +/* + * Some syscalls no Linux program should know about: + */ +#define __NR_osf_sigprocmask 48 +#define __NR_osf_shmat 209 +#define __NR_osf_getsysinfo 256 +#define __NR_osf_setsysinfo 257 + +/* Help old kernel headers where particular syscalls are not available. */ +#ifndef __NR_semtimedop +# define __NR_semtimedop 423 +#endif + +/* This is a kludge to make syscalls.list find these under the names + pread and pwrite, since some kernel headers define those names + and some define the *64 names for the same system calls. */ +#if !defined __NR_pread && defined __NR_pread64 +# define __NR_pread __NR_pread64 +#endif +#if !defined __NR_pwrite && defined __NR_pwrite64 +# define __NR_pwrite __NR_pwrite64 +#endif + +/* + * In order to get the hidden arguments for rt_sigaction set up + * properly, we need to call the assembly version. This shouldn't + * happen except for inside sigaction.c, where we handle this + * specially. Catch other uses and error. + */ + +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ +({ \ + extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1] \ + __attribute__((unused)); \ + INLINE_SYSCALL1(name, nr, args); \ +}) + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err_out, nr, args...) \ +({ \ + extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1] \ + __attribute__((unused)); \ + INTERNAL_SYSCALL1(name, err_out, nr, args); \ +}) + +#endif /* _LINUX_ALPHA_SYSDEP_H */ diff --git a/ports/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym b/ports/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym new file mode 100644 index 0000000000..f95ff75636 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym @@ -0,0 +1,18 @@ +#include <stddef.h> +#include <sys/ucontext.h> + +-- +UC_LINK offsetof (ucontext_t, uc_link) +UC_OSF_SIGMASK offsetof (ucontext_t, __uc_osf_sigmask) +UC_STACK offsetof (ucontext_t, uc_stack) +UC_SIGCTX offsetof (ucontext_t, uc_mcontext) +UC_SIGMASK offsetof (ucontext_t, uc_sigmask) +SC_REGS offsetof (struct sigcontext, sc_regs) +SC_FPREGS offsetof (struct sigcontext, sc_fpregs) +SC_PC offsetof (struct sigcontext, sc_pc) +SC_PS offsetof (struct sigcontext, sc_ps) +SC_FPCRS offsetof (struct sigcontext, sc_fpcr) +SC_MASK offsetof (struct sigcontext, sc_mask) +SC_FPCR offsetof (struct sigcontext, sc_fpcr) +SS_SP offsetof (stack_t, ss_sp) +SS_SIZE offsetof (stack_t, ss_size) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/wordexp.c b/ports/sysdeps/unix/sysv/linux/alpha/wordexp.c new file mode 100644 index 0000000000..32aefe579b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/wordexp.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c> diff --git a/ports/sysdeps/unix/sysv/linux/alpha/xstat.c b/ports/sysdeps/unix/sysv/linux/alpha/xstat.c new file mode 100644 index 0000000000..a25431cfc3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/xstat.c @@ -0,0 +1,75 @@ +/* xstat using old-style Unix stat system call. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define __xstat64 __xstat64_disable + +#include <errno.h> +#include <stddef.h> +#include <sys/stat.h> +#include <kernel_stat.h> +#include <sysdep.h> +#include <sys/syscall.h> +#include <xstatconv.h> + +#undef __xstat64 + + +/* Get information about the file NAME in BUF. */ +int +__xstat (int vers, const char *name, struct stat *buf) +{ + INTERNAL_SYSCALL_DECL (err); + int result; + struct kernel_stat kbuf; + +#if __ASSUME_STAT64_SYSCALL > 0 + if (vers == _STAT_VER_KERNEL64) + { + result = INTERNAL_SYSCALL (stat64, err, 2, name, buf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; + } +#elif defined __NR_stat64 + if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64) + { + int errno_out; + result = INTERNAL_SYSCALL (stat64, err, 2, name, buf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return result; + errno_out = INTERNAL_SYSCALL_ERRNO (result, err); + if (errno_out != ENOSYS) + { + __set_errno (errno_out); + return -1; + } + __libc_missing_axp_stat64 = 1; + } +#endif + + result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf); + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat_conv (vers, &kbuf, buf); + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; +} +hidden_def (__xstat) +weak_alias (__xstat, _xstat); +strong_alias (__xstat, __xstat64); +hidden_ver (__xstat, __xstat64) diff --git a/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c b/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c new file mode 100644 index 0000000000..d1dc64fedd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c @@ -0,0 +1,127 @@ +/* Convert between the kernel's `struct stat' format, and libc's. + Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <string.h> +#include <sys/stat.h> +#include <kernel_stat.h> +#include <xstatconv.h> +#include <sys/syscall.h> + + +#ifdef __NR_stat64 +# if __ASSUME_STAT64_SYSCALL == 0 +int __libc_missing_axp_stat64; +# endif +#endif + +int +__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) +{ + switch (vers) + { + case _STAT_VER_KERNEL: + *(struct kernel_stat *) ubuf = *kbuf; + break; + + case _STAT_VER_GLIBC2: + { + struct glibc2_stat *buf = ubuf; + + buf->st_dev = kbuf->st_dev; + buf->st_ino = kbuf->st_ino; + buf->st_mode = kbuf->st_mode; + buf->st_nlink = kbuf->st_nlink; + buf->st_uid = kbuf->st_uid; + buf->st_gid = kbuf->st_gid; + buf->st_rdev = kbuf->st_rdev; + buf->st_size = kbuf->st_size; + buf->st_atime = kbuf->st_atime; + buf->st_mtime = kbuf->st_mtime; + buf->st_ctime = kbuf->st_ctime; + buf->st_blksize = kbuf->st_blksize; + buf->st_blocks = kbuf->st_blocks; + buf->st_flags = kbuf->st_flags; + buf->st_gen = kbuf->st_gen; + } + break; + + case _STAT_VER_GLIBC2_1: + { + struct glibc21_stat *buf = ubuf; + + buf->st_dev = kbuf->st_dev; + buf->st_ino = kbuf->st_ino; + buf->st_mode = kbuf->st_mode; + buf->st_nlink = kbuf->st_nlink; + buf->st_uid = kbuf->st_uid; + buf->st_gid = kbuf->st_gid; + buf->st_rdev = kbuf->st_rdev; + buf->st_size = kbuf->st_size; + buf->st_atime = kbuf->st_atime; + buf->st_mtime = kbuf->st_mtime; + buf->st_ctime = kbuf->st_ctime; + buf->st_blocks = kbuf->st_blocks; + buf->st_blksize = kbuf->st_blksize; + buf->st_flags = kbuf->st_flags; + buf->st_gen = kbuf->st_gen; + buf->__pad3 = 0; + buf->__unused[0] = 0; + buf->__unused[1] = 0; + buf->__unused[2] = 0; + buf->__unused[3] = 0; + } + break; + + case _STAT_VER_GLIBC2_3_4: + { + struct stat64 *buf = ubuf; + + buf->st_dev = kbuf->st_dev; + buf->st_ino = kbuf->st_ino; + buf->st_rdev = kbuf->st_rdev; + buf->st_size = kbuf->st_size; + buf->st_blocks = kbuf->st_blocks; + + buf->st_mode = kbuf->st_mode; + buf->st_uid = kbuf->st_uid; + buf->st_gid = kbuf->st_gid; + buf->st_blksize = kbuf->st_blksize; + buf->st_nlink = kbuf->st_nlink; + buf->__pad0 = 0; + + buf->st_atime = kbuf->st_atime; + buf->st_atimensec = 0; + buf->st_mtime = kbuf->st_mtime; + buf->st_mtimensec = 0; + buf->st_ctime = kbuf->st_ctime; + buf->st_ctimensec = 0; + + buf->__unused[0] = 0; + buf->__unused[1] = 0; + buf->__unused[2] = 0; + } + break; + + default: + __set_errno (EINVAL); + return -1; + } + + return 0; +} diff --git a/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h b/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h new file mode 100644 index 0000000000..ea4cbb0274 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h @@ -0,0 +1,28 @@ +/* Convert between the kernel's `struct stat' format, and libc's. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <kernel-features.h> +#include <sys/syscall.h> + +#ifdef __NR_stat64 +# if __ASSUME_STAT64_SYSCALL == 0 +extern int __libc_missing_axp_stat64 attribute_hidden; +# endif +#endif +extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) + attribute_hidden; diff --git a/ports/sysdeps/unix/sysv/linux/am33/Makefile b/ports/sysdeps/unix/sysv/linux/am33/Makefile new file mode 100644 index 0000000000..ece39e8a4c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),misc) +sysdep_routines += setfsgid setfsuid +endif diff --git a/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h new file mode 100644 index 0000000000..33b8bcd37e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h @@ -0,0 +1,180 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995, 1996, 1997, 1998, 2000, Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + + +#include <sys/types.h> + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 0100 /* not fcntl */ +#define O_EXCL 0200 /* not fcntl */ +#define O_NOCTTY 0400 /* not fcntl */ +#define O_TRUNC 01000 /* not fcntl */ +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 010000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 + +#ifdef __USE_GNU +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_DIRECTORY 0200000 /* Must be a directory. */ +# define O_NOFOLLOW 0400000 /* Do not follow links. */ +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +#ifdef __USE_LARGEFILE64 +# define O_LARGEFILE 0100000 +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 5 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#endif +#define F_GETLK64 12 /* Get record locking info. */ +#define F_SETLK64 13 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 14 /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_XOPEN2K +# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ +# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 0 /* Read lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ + +/* For old implementation of bsd flock(). */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation. */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h b/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h new file mode 100644 index 0000000000..763b060e66 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h @@ -0,0 +1,96 @@ +/* Definitions for POSIX memory map interface. Linux/AM33 version. + Copyright (C) 1997, 2000, 2001, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x0800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x2000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 4 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/am33/brk.c b/ports/sysdeps/unix/sysv/linux/am33/brk.c new file mode 100644 index 0000000000..a06495cf29 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/brk.c @@ -0,0 +1,45 @@ +/* brk system call for Linux/am33. + Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/brk.c. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sysdep.h> + +/* This must be initialized data because commons can't have aliases. */ +void *__curbrk = 0; + +int +__brk (void *addr) +{ + void *newbrk; + + newbrk = INLINE_SYSCALL (brk, 1, __ptrvalue (addr)); + + __curbrk = newbrk; + + if (newbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/am33/chown.c b/ports/sysdeps/unix/sysv/linux/am33/chown.c new file mode 100644 index 0000000000..819923eb49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/chown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/chown.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/clone.S b/ports/sysdeps/unix/sysv/linux/am33/clone.S new file mode 100644 index 0000000000..e014c4ace9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/clone.S @@ -0,0 +1,80 @@ +/* Copyright 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/clone.S. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after its all over. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> +#include <asm-syntax.h> +#include <bp-sym.h> + +/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ + + .text +ENTRY (BP_SYM (__clone)) + /* Sanity check arguments. */ + cmp 0,d0 /* no NULL function pointers */ + beq L(error_inval) + cmp 0,d1 /* no NULL stack pointers */ + beq L(error_inval) + + /* Allocate room for a function call in the new stack, and + store fn and arg in it. They will be read back in + thread_start. */ + mov d1,a0 + sub 12,a0 + mov d0,(a0) + mov (16,sp),d1 + mov d1,(4,a0) + + /* Do the system call */ + mov a0,d1 + mov (12,sp),a0 + mov SYS_ify(clone),d0 + syscall 0 + + cmp 0,d0 + beq thread_start + blt L(to_SYSCALL_ERROR_LABEL) + +L(pseudo_end): + ret + +L(error_inval): + mov -EINVAL,d0 +L(to_SYSCALL_ERROR_LABEL): + jmp SYSCALL_ERROR_LABEL + +thread_start: + mov 0,a3 /* terminate the stack frame */ + mov (4,sp),d0 + mov (sp),a0 + calls (a0) +#ifdef PIC +L(here): + mov pc,a2 + add _GLOBAL_OFFSET_TABLE_-(L(here) - .),a2 +#endif + call JUMPTARGET (_exit),[],0 + +PSEUDO_END (BP_SYM (__clone)) + +weak_alias (BP_SYM (__clone), BP_SYM (clone)) diff --git a/ports/sysdeps/unix/sysv/linux/am33/configure b/ports/sysdeps/unix/sysv/linux/am33/configure new file mode 100755 index 0000000000..d4490122b4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/configure @@ -0,0 +1,4 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for am33/sysdeps/unix/sysv/linux/am33 + +arch_minimum_kernel=2.4.0 diff --git a/ports/sysdeps/unix/sysv/linux/am33/configure.in b/ports/sysdeps/unix/sysv/linux/am33/configure.in new file mode 100644 index 0000000000..a94c370cf1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/configure.in @@ -0,0 +1,4 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for am33/sysdeps/unix/sysv/linux/am33 + +arch_minimum_kernel=2.4.0 diff --git a/ports/sysdeps/unix/sysv/linux/am33/fchown.c b/ports/sysdeps/unix/sysv/linux/am33/fchown.c new file mode 100644 index 0000000000..3a69ecc9e7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/fchown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/fcntl.c b/ports/sysdeps/unix/sysv/linux/am33/fcntl.c new file mode 100644 index 0000000000..ea951bc4f9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/fcntl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/fxstat.c b/ports/sysdeps/unix/sysv/linux/am33/fxstat.c new file mode 100644 index 0000000000..4f219f0b9d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/fxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getegid.c b/ports/sysdeps/unix/sysv/linux/am33/getegid.c new file mode 100644 index 0000000000..37b4b4a530 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getegid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/geteuid.c b/ports/sysdeps/unix/sysv/linux/am33/geteuid.c new file mode 100644 index 0000000000..ebcb555b5e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/geteuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/geteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getgid.c b/ports/sysdeps/unix/sysv/linux/am33/getgid.c new file mode 100644 index 0000000000..0a4d6061f0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getgroups.c b/ports/sysdeps/unix/sysv/linux/am33/getgroups.c new file mode 100644 index 0000000000..20a7166103 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getgroups.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getgroups.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getmsg.c b/ports/sysdeps/unix/sysv/linux/am33/getmsg.c new file mode 100644 index 0000000000..3a1fa08525 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getmsg.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getresgid.c b/ports/sysdeps/unix/sysv/linux/am33/getresgid.c new file mode 100644 index 0000000000..b703a414cc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getresgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getresuid.c b/ports/sysdeps/unix/sysv/linux/am33/getresuid.c new file mode 100644 index 0000000000..0b14cefe34 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getresuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c b/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c new file mode 100644 index 0000000000..fc06dbd641 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/getuid.c b/ports/sysdeps/unix/sysv/linux/am33/getuid.c new file mode 100644 index 0000000000..d682c79a49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/getuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/lchown.c b/ports/sysdeps/unix/sysv/linux/am33/lchown.c new file mode 100644 index 0000000000..c89de99ba2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/lchown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysdep-cancel.h new file mode 100644 index 0000000000..5f3dab5c40 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysdep-cancel.h @@ -0,0 +1,158 @@ +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tls.h> +#include <pt-machine.h> +#ifndef __ASSEMBLER__ +# include <linuxthreads/internals.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .text ; \ + ENTRY (name) \ + PUSHARGS_##args \ + DOARGS_##args \ + SINGLE_THREAD_P; \ + bne L(pseudo_cancel); \ + mov SYS_ify (syscall_name),d0; \ + syscall 0 \ + POPARGS_##args ; \ + cmp -126,d0; \ + bls L(pseudo_end); \ + jmp SYSCALL_ERROR_LABEL; \ + L(pseudo_cancel): \ + add -(16+STACK_SPACE (args)),sp; \ + SAVE_ARGS_##args \ + CENABLE \ + mov d0,r0; \ + LOAD_ARGS_##args \ + mov SYS_ify (syscall_name),d0; \ + syscall 0; \ + mov d0,(12,sp); \ + mov r0,d0; \ + CDISABLE \ + mov (12,sp),d0; \ + add +16+STACK_SPACE (args),sp \ + POPARGS_##args ; \ + cmp -126,d0; \ + bls L(pseudo_end); \ + jmp SYSCALL_ERROR_LABEL; \ + L(pseudo_end): \ + mov d0,a0 + +/* Reserve up to 2 stack slots for a0 and d1, but fewer than that if + we don't have that many arguments. */ +# define STACK_SPACE(n) (((((n) < 3) * (2 - (n))) + 2) * 4) + +# define SAVE_ARGS_0 +# define SAVE_ARGS_1 mov a0,(20,sp) ; +# define SAVE_ARGS_2 SAVE_ARGS_1 mov d1,(24,sp) ; +# define SAVE_ARGS_3 SAVE_ARGS_2 +# define SAVE_ARGS_4 SAVE_ARGS_3 +# define SAVE_ARGS_5 SAVE_ARGS_4 +# define SAVE_ARGS_6 SAVE_ARGS_5 + +# define LOAD_ARGS_0 +# define LOAD_ARGS_1 mov (20,sp),a0 ; +# define LOAD_ARGS_2 LOAD_ARGS_1 mov (24,sp),d1 ; +# define LOAD_ARGS_3 LOAD_ARGS_2 +# define LOAD_ARGS_4 LOAD_ARGS_3 +# define LOAD_ARGS_5 LOAD_ARGS_4 +# define LOAD_ARGS_6 LOAD_ARGS_5 + +# ifdef IS_IN_libpthread +# define CENABLE call __pthread_enable_asynccancel,[],0; +# define CDISABLE call __pthread_disable_asynccancel,[],0; +# elif defined IS_IN_librt +# ifdef PIC +# define CENABLE movm [a2],(sp); \ + 1: mov pc,a2; \ + add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \ + call +__librt_enable_asynccancel@PLT,[],0; \ + movm (sp),[a2]; +# define CENABLE movm [a2],(sp); \ + 1: mov pc,a2; \ + add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \ + call +__librt_disable_asynccancel@PLT,[],0; \ + movm (sp),[a2]; +# else +# define CENABLE call +__librt_enable_asynccancel,[],0; +# define CDISABLE call +__librt_disable_asynccancel,[],0; +# endif +# else +# define CENABLE call +__libc_enable_asynccancel,[],0; +# define CDISABLE call +__libc_disable_asynccancel,[],0; +# endif + +#if !defined NOT_IN_libc +# define __local_multiple_threads __libc_multiple_threads +#elif defined IS_IN_libpthread +# define __local_multiple_threads __pthread_multiple_threads +#else +# define __local_multiple_threads __librt_multiple_threads +#endif + +# ifndef __ASSEMBLER__ +# if defined FLOATING_STACKS && USE___THREAD && defined PIC +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + p_header.data.multiple_threads) == 0, 1) +# else +extern int __local_multiple_threads +# if !defined NOT_IN_libc || defined IS_IN_libpthread + attribute_hidden; +# else + ; +# endif +# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) +# endif +# else +# if !defined PIC +# define SINGLE_THREAD_P \ + mov (+__local_multiple_threads),d0; \ + cmp 0,d0 +# elif !defined NOT_IN_libc || defined IS_IN_libpthread +# define SINGLE_THREAD_P \ + movm [a2],(sp); \ + 1: mov pc,a2; \ + add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \ + mov (+__local_multiple_threads@GOTOFF,a2),d0; \ + movm (sp),[a2]; \ + cmp 0,d0 +# else +# define SINGLE_THREAD_P \ + movm [a2],(sp); \ + 1: mov pc,a2; \ + add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \ + mov (+__local_multiple_threads@GOT,a2),a2; \ + mov (a2),d0; \ + movm (sp),[a2]; \ + cmp 0,d0 +# endif +# endif + +#elif !defined __ASSEMBLER__ + +/* This code should never be used but we define it anyhow. */ +# define SINGLE_THREAD_P (1) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/am33/lockf64.c b/ports/sysdeps/unix/sysv/linux/am33/lockf64.c new file mode 100644 index 0000000000..a88f5a784a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/lockf64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/lxstat.c b/ports/sysdeps/unix/sysv/linux/am33/lxstat.c new file mode 100644 index 0000000000..0efa0aea49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/lxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/profil-counter.h b/ports/sysdeps/unix/sysv/linux/am33/profil-counter.h new file mode 100644 index 0000000000..f4b7eaae76 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/profil-counter.h @@ -0,0 +1,26 @@ +/* Low-level statistical profiling support function. Linux/am33 version. + Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <signal.h> +#include <sigcontextinfo.h> + +static void +profil_counter (int signo, SIGCONTEXT scp) +{ + profil_count ((void *) GET_PC (scp)); +} diff --git a/ports/sysdeps/unix/sysv/linux/am33/putmsg.c b/ports/sysdeps/unix/sysv/linux/am33/putmsg.c new file mode 100644 index 0000000000..ebc1680ca7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/putmsg.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/putmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setegid.c b/ports/sysdeps/unix/sysv/linux/am33/setegid.c new file mode 100644 index 0000000000..2e3a54c893 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setegid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/seteuid.c b/ports/sysdeps/unix/sysv/linux/am33/seteuid.c new file mode 100644 index 0000000000..18e41d08c1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/seteuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/seteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setfsgid.c b/ports/sysdeps/unix/sysv/linux/am33/setfsgid.c new file mode 100644 index 0000000000..0886712569 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setfsgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setfsgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setfsuid.c b/ports/sysdeps/unix/sysv/linux/am33/setfsuid.c new file mode 100644 index 0000000000..a9f22eb8ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setfsuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setfsuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setgid.c b/ports/sysdeps/unix/sysv/linux/am33/setgid.c new file mode 100644 index 0000000000..377021d9ec --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setgroups.c b/ports/sysdeps/unix/sysv/linux/am33/setgroups.c new file mode 100644 index 0000000000..cb9a7708e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setgroups.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setgroups.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setregid.c b/ports/sysdeps/unix/sysv/linux/am33/setregid.c new file mode 100644 index 0000000000..99c57ad20f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setregid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setregid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setresgid.c b/ports/sysdeps/unix/sysv/linux/am33/setresgid.c new file mode 100644 index 0000000000..daca1a4833 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setresgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setresuid.c b/ports/sysdeps/unix/sysv/linux/am33/setresuid.c new file mode 100644 index 0000000000..3aeabe9ad7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setresuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setreuid.c b/ports/sysdeps/unix/sysv/linux/am33/setreuid.c new file mode 100644 index 0000000000..8ad61226e9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setreuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setreuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setrlimit.c b/ports/sysdeps/unix/sysv/linux/am33/setrlimit.c new file mode 100644 index 0000000000..bfaef74c38 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/setuid.c b/ports/sysdeps/unix/sysv/linux/am33/setuid.c new file mode 100644 index 0000000000..de394379be --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/setuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/am33/socket.S b/ports/sysdeps/unix/sysv/linux/am33/socket.S new file mode 100644 index 0000000000..b4d3caab8a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/socket.S @@ -0,0 +1,72 @@ +/* Copyright 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/socket.S. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <socketcall.h> + +#define P(a, b) P2(a, b) +#define P2(a, b) a##b + + .text +/* The socket-oriented system calls are handled unusally in Linux. + They are all gated through the single `socketcall' system call number. + `socketcall' takes two arguments: the first is the subcode, specifying + which socket function is being called; and the second is a pointer to + the arguments to the specific function. + + The .S files for the other calls just #define socket and #include this. */ + +#ifndef __socket +#ifndef NO_WEAK_ALIAS +#define __socket P(__,socket) +#else +#define __socket socket +#endif +#endif + +.globl __socket +ENTRY (__socket) + + mov d0,(4,sp) + mov d1,(8,sp) + + mov SYS_ify(socketcall),d0 /* System call number in d0. */ + + /* Use ## so `socket' is a separate token that might be #define'd. */ + mov P(SOCKOP_,socket),a0 /* Subcode is first arg to syscall. */ + mov sp,d1 + add 4,d1 /* Address of args is 2nd arg. */ + + /* Do the system call trap. */ + syscall 0 + + /* d0 is < 0 if there was an error. */ + cmp -126,d0 + bls L(pseudo_end) + jmp SYSCALL_ERROR_LABEL + + /* Successful; return the syscall's value. */ +L(pseudo_end): + ret + +PSEUDO_END (__socket) + +#ifndef NO_WEAK_ALIAS +weak_alias (__socket, socket) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/am33/syscall.S b/ports/sysdeps/unix/sysv/linux/am33/syscall.S new file mode 100644 index 0000000000..63fa6ddcd4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/syscall.S @@ -0,0 +1,42 @@ +/* Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/syscall.S. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* Please consult the file sysdeps/unix/sysv/linux/am33/sysdep.h for + more information about the value -126 used below.*/ + + .text +ENTRY (syscall) + movm [d2,d3,a2,a3],(sp) /* Save register contents. */ + mov d1,a0 + mov (28,sp),d1 + mov (32,sp),a3 + mov (36,sp),a2 + mov (40,sp),d3 + mov (44,sp),d2 + syscall 0 /* Do the system call. */ + movm (sp),[d2,d3,a2,a3] /* Restore register contents. */ + cmp -126,d0 /* Check for error. */ + bls L(pseudo_end) + jmp SYSCALL_ERROR_LABEL /* Jump to error handler if error. */ +L(pseudo_end): + ret /* Return to caller. */ + +PSEUDO_END (syscall) diff --git a/ports/sysdeps/unix/sysv/linux/am33/sysdep.S b/ports/sysdeps/unix/sysv/linux/am33/sysdep.S new file mode 100644 index 0000000000..877fd1e082 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/sysdep.S @@ -0,0 +1,41 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 2001, 2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/sysdep.S. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* The following code is only used in the shared library when we + compile the reentrant version. Otherwise each system call defines + each own version. */ + +#ifndef PIC + +#undef CALL_MCOUNT +#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %eax. */ + + .text +ENTRY (__syscall_error) + mov d0,d1 + clr d0 + sub d1,d0 + +#define __syscall_error __syscall_error_1 +#include <../../../am33/sysdep.S> + +#endif /* !PIC */ diff --git a/ports/sysdeps/unix/sysv/linux/am33/sysdep.h b/ports/sysdeps/unix/sysv/linux/am33/sysdep.h new file mode 100644 index 0000000000..68f93f8003 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/sysdep.h @@ -0,0 +1,316 @@ +/* Copyright 2001, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com>. + Based on ../i386/sysdep.h. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_AM33_SYSDEP_H +#define _LINUX_AM33_SYSDEP_H 1 + +/* There is some commonality. */ +#include "../../../am33/sysdep.h" + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +/* ELF-like local names start with `.L'. */ +#undef L +#define L(name) .L##name + +#ifdef __ASSEMBLER__ + +/* Linux uses a negative return value to indicate syscall errors, + unlike most Unices, which use the condition codes' carry flag. + + Since version 2.1 the return value of a system call might be + negative even if the call succeeded. E.g., the `lseek' system call + might return a large offset. Therefore we must not anymore test + for < 0, but test for a real error by making sure the value in %eax + is a real error number. Linus said he will make sure the no syscall + returns a value in -1 .. -4095 as a valid result so we can savely + test with -4095. */ + +/* We don't want the label for the error handle to be global when we define + it here. */ +#ifdef PIC +# define SYSCALL_ERROR_LABEL 0f +#else +# define SYSCALL_ERROR_LABEL syscall_error +#endif + +#undef PSEUDO +#define PSEUDO(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args); \ + cmp -126,d0; \ + bls L(pseudo_end); \ + jmp SYSCALL_ERROR_LABEL; \ + L(pseudo_end): \ + mov d0,a0; + +#undef PSEUDO_END +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER \ + END (name) + +#undef PSEUDO_NOERROR +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args) + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + +#define ret_NOERRNO ret + +/* The function has to return the error code. */ +#undef PSEUDO_ERRVAL +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args); \ + clr d1; \ + sub d0,d1,d0 + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) \ + END (name) + +#define ret_ERRVAL ret + +#ifndef PIC +#define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ +#else +/* Store (- d0) into errno through the GOT. */ +#ifdef _LIBC_REENTRANT +#define SYSCALL_ERROR_HANDLER \ +0:movm [d2,a2],(sp); \ + add -12,sp; \ +1:mov pc,a2; \ + add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \ + clr d2; \ + sub d0,d2; \ + call __errno_location@PLT,[],0; \ + mov d2,(a0); \ + add 12,sp; \ + movm (sp),[d2,a2]; \ + mov -1,d0; \ + mov d0,a0; \ + jmp L(pseudo_end); +/* A quick note: it is assumed that the call to `__errno_location' does + not modify the stack! */ +#else +#define SYSCALL_ERROR_HANDLER \ +0:mov pc,a0; \ + add _GLOBAL_OFFSET_TABLE_-(0b-.),a0; \ + clr d1; \ + sub d0,d1; \ + mov (errno@GOT,a0),a1; \ + mov d1,(a0); \ + mov -1,d0; \ + mov d0,a0; \ + jmp L(pseudo_end); +#endif /* _LIBC_REENTRANT */ +#endif /* PIC */ + +/* Linux takes system call arguments in registers: + + syscall number d0 call-clobbered + arg 1 a0 call-clobbered + arg 2 d1 call-clobbered + arg 3 a3 call-saved + arg 4 a2 call-saved + arg 5 d3 call-saved + arg 6 d2 call-saved + + The stack layout upon entering the function is: + + (24,sp) Arg# 6 + (20,sp) Arg# 5 + (16,sp) Arg# 4 + (12,sp) Arg# 3 + d1 Arg# 2 + d0 Arg# 1 + (sp) Return address + + (Of course a function with say 3 arguments does not have entries for + arguments 4, 5 and 6.) */ + +#undef DO_CALL +#define DO_CALL(syscall_name, args) \ + PUSHARGS_##args \ + DOARGS_##args \ + mov SYS_ify (syscall_name),d0; \ + syscall 0 \ + POPARGS_##args + +#define PUSHARGS_0 /* No arguments to push. */ +#define _DOARGS_0(N) /* No arguments to frob. */ +#define DOARGS_0 /* No arguments to frob. */ +#define POPARGS_0 /* No arguments to pop. */ + +#define PUSHARGS_1 /* No arguments to push. */ +#define _DOARGS_1(N) _DOARGS_0 (N-4) mov d0,a0; +#define DOARGS_1 _DOARGS_1 (4) +#define POPARGS_1 /* No arguments to pop. */ + +#define PUSHARGS_2 /* No arguments to push. */ +#define _DOARGS_2(N) _DOARGS_1 (N-4) /* Argument already in d1. */ +#define DOARGS_2 _DOARGS_2 (8) +#define POPARGS_2 /* No arguments to pop. */ + +#define PUSHARGS_3 movm [a3],(sp); +#define _DOARGS_3(N) _DOARGS_2 (N-4) mov (N,sp),a3; +#define DOARGS_3 _DOARGS_3 (16) +#define POPARGS_3 ; movm (sp),[a3] + +#define PUSHARGS_4 movm [a2,a3],(sp); +#define _DOARGS_4(N) _DOARGS_3 (N-4) mov (N,sp),a2; +#define DOARGS_4 _DOARGS_4 (24) +#define POPARGS_4 ; movm (sp),[a2,a3] + +#define PUSHARGS_5 movm [d3,a2,a3],(sp); +#define _DOARGS_5(N) _DOARGS_4 (N-4) mov (N,sp),d3; +#define DOARGS_5 _DOARGS_5 (32) +#define POPARGS_5 ; movm (sp),[d3,a2,a3] + +#define PUSHARGS_6 movm [d2,d3,a2,a3],(sp); +#define _DOARGS_6(N) _DOARGS_5 (N-4) mov (N,sp),d2; +#define DOARGS_6 _DOARGS_6 (40) +#define POPARGS_6 ; movm (sp),[d2,d3,a2,a3] + +#else /* !__ASSEMBLER__ */ + +/* Define a macro which expands inline into the wrapper code for a system + call. */ +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ \ + unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args); \ + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \ + resultvar = 0xffffffff; \ + } \ + (int) resultvar; }) + +#define INTERNAL_SYSCALL(name, err, nr, args...) \ +({ \ + register long __sc0 asm ("d0") = __NR_##name; \ + inline_syscall##nr(name, ## args); \ + __sc0; \ +}) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) do { } while (0) + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned int) (val) >= (unsigned long)-125) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) + +#define inline_syscall0(name,dummy...) \ +__asm__ __volatile__ ("syscall 0" \ + : "+d" (__sc0) \ + : : "memory") + +#define inline_syscall1(name,arg1) \ +register long __sc1 asm ("a0") = (long) (arg1); \ +inline_syscall0 (name); \ +__asm__ __volatile__ ("" : : "r" (__sc1)) + +#define inline_syscall2(name,arg1,arg2) \ +register long __sc2 asm ("d1") = (long) (arg2); \ +inline_syscall1 (name,(arg1)); \ +__asm__ __volatile__ ("" : : "r" (__sc2)) + +/* We can't tell whether a3 is going to be eliminated in the enclosing + function, so we have to assume it isn't. We first load the value + of any arguments into their registers, except for a3 itself, that + may be needed to load the value of the other arguments. Then, we + save a3's value in some other register, and load the argument value + into a3. We have to force both a3 and its copy to be live in + different registers at the same time, to avoid having the copy + spilled and the value reloaded into the same register, in which + case we'd be unable to get the value of a3 back, should the stack + slot reference be (offset,a3). */ +#define inline_syscall3(name,arg1,arg2,arg3) \ +long __sc3v = (long) (arg3); \ +register long __sc1 asm ("a0") = (long) (arg1); \ +register long __sc2 asm ("d1") = (long) (arg2); \ +register long __sc3 asm ("a3") = __sc3; \ +register long __sc3c; \ +__asm__ __volatile__ ("mov %1,%0" : "=&r" (__sc3c) : "r" (__sc3)); \ +__sc3 = __sc3v; \ +__asm__ __volatile__ ("" : : "r" (__sc3c), "r" (__sc3)); \ +inline_syscall0 (name); \ +__sc3 = __sc3c; \ +__asm__ __volatile__ ("" : : "r" (__sc3), "r" (__sc2), "r" (__sc1)) + +#ifdef PIC +/* Since a2 is the PIC register, it requires similar handling as a3 + when we're generating PIC, as a2's value may be needed to load + arguments whose values live in global variables. The difference is + that we don't need to require its value to be live in a register; + it may well be in a stack slot, as long as we save it before + clobbering a3 and restore it after restoring a3. */ +#define inline_syscall4(name,arg1,arg2,arg3,arg4) \ +long __sc4v = (long) (arg4); \ +long __sc3v = (long) (arg3); \ +register long __sc1 asm ("a0") = (long) (arg1); \ +register long __sc2 asm ("d1") = (long) (arg2); \ +register long __sc3 asm ("a3") = __sc3; \ +register long __sc3c; \ +register long __sc4 asm ("a2") = __sc4; \ +long __sc4c = __sc4; \ +__sc4 = __sc4v; \ +__asm__ __volatile__ ("mov %1,%0" : "=&r" (__sc3c) : "r" (__sc3)); \ +__sc3 = __sc3v; \ +__asm__ __volatile__ ("" : : "r" (__sc3c), "r" (__sc3), "r" (__sc4)); \ +inline_syscall0 (name); \ +__sc3 = __sc3c; \ +__sc4 = __sc4c; \ +__asm__ __volatile__ ("" : : "r" (__sc4), "r" (__sc3), \ + "r" (__sc2), "r" (__sc1)) +#else +#define inline_syscall4(name,arg1,arg2,arg3,arg4) \ +register long __sc4 asm ("a2") = (long) (arg4); \ +inline_syscall3 (name,(arg1),(arg2),(arg3)); \ +__asm__ __volatile__ ("" : : "r" (__sc4)) +#endif + +#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \ +register long __sc5 asm ("d3") = (long) (arg5); \ +inline_syscall4 (name,(arg1),(arg2),(arg3),(arg4)); \ +__asm__ __volatile__ ("" : : "r" (__sc5)) + +#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ +register long __sc6 asm ("d2") = (long) (arg6); \ +inline_syscall5 (name,(arg1),(arg2),(arg3),(arg4),(arg5)); \ +__asm__ __volatile__ ("" : : "r" (__sc6)) + +#endif /* __ASSEMBLER__ */ + +#endif /* linux/am33/sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/am33/xstat.c b/ports/sysdeps/unix/sysv/linux/am33/xstat.c new file mode 100644 index 0000000000..e9869f5508 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/am33/xstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/xstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/Makefile b/ports/sysdeps/unix/sysv/linux/arm/Makefile new file mode 100644 index 0000000000..d9eb10c9ae --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/Makefile @@ -0,0 +1,93 @@ +ifeq ($(subdir),csu) +# In order for unwinding to fail when it falls out of main, we need a +# cantunwind marker. There's one in start.S. To make sure we reach it, add +# unwind tables for __libc_start_main. +CFLAGS-libc-start.c += -fexceptions + +sysdep_routines += aeabi_read_tp libc-aeabi_read_tp +static-only-routines += aeabi_read_tp +shared-only-routines += libc-aeabi_read_tp +endif + +ifeq ($(subdir),elf) +sysdep-rtld-routines += aeabi_read_tp +endif + +ifeq ($(subdir),misc) +sysdep_routines += ioperm +sysdep_headers += sys/elf.h sys/io.h +endif + +ifeq ($(subdir),signal) +sysdep_routines += sigrestorer +endif + +ifeq ($(subdir),resource) +sysdep_routines += oldgetrlimit64 +endif + +ifeq ($(subdir),stdlib) +gen-as-const-headers += ucontext_i.sym +endif + +# Add a syscall function to each library that needs one. + +ifeq ($(subdir),rt) +librt-sysdep_routines += libc-do-syscall +librt-shared-only-routines += libc-do-syscall +endif + +ifeq ($(subdir),nptl) +libpthread-sysdep_routines += libc-do-syscall +libpthread-shared-only-routines += libc-do-syscall +endif + +ifeq ($(subdir),resolv) +libanl-sysdep_routines += libc-do-syscall +libanl-shared-only-routines += libc-do-syscall +endif + +ifeq ($(subdir),csu) +sysdep_routines += libc-do-syscall +endif + +ifeq ($(subdir),nscd) +nscd-modules += libc-do-syscall +endif + +ifeq ($(subdir),nss) +libnss_db-sysdep_routines += libc-do-syscall +libnss_db-shared-only-routines += libc-do-syscall +endif + +ifeq ($(subdir),posix) +LDFLAGS-tst-rfc3484 += $(common-objpfx)csu/libc-do-syscall.o +LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o +LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o +endif + +define default-abi-prog +echo '#ifdef __ARM_PCS_VFP'; +echo 'hard'; +echo '#else'; +echo 'soft'; +echo '#endif' +endef +default-abi := $(strip $(shell \ + ($(default-abi-prog)) | $(CC) $(CFLAGS) $(CPPFLAGS) -E -P -)) +ifeq ($(default-abi),hard) +# OK. +else +ifneq ($(default-abi),soft) +Unknown ABI, must be "hard" or "soft". +endif +endif + +abi-includes := +abi-variants := soft hard +abi-soft-options := -U__ARM_PCS_VFP +abi-soft-condition := !defined __ARM_PCS_VFP +abi-soft-ld-soname := ld-linux.so.3 +abi-hard-options := -D__ARM_PCS_VFP +abi-hard-condition := defined __ARM_PCS_VFP +abi-hard-ld-soname := ld-linux-armhf.so.3 diff --git a/ports/sysdeps/unix/sysv/linux/arm/Versions b/ports/sysdeps/unix/sysv/linux/arm/Versions new file mode 100644 index 0000000000..1d9e964640 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/Versions @@ -0,0 +1,40 @@ +libc { + GLIBC_2.0 { + # Exception handling support functions from libgcc + __register_frame; __register_frame_table; __deregister_frame; + __frame_state_for; __register_frame_info_table; + } + GLIBC_2.1 { + ioperm; iopl; + inb; inw; inl; + outb; outw; outl; + } + GLIBC_2.2 { + # functions used in other libraries + __xstat64; __fxstat64; __lxstat64; + + # a* + alphasort64; + + # g* + glob64; + + # New rlimit interface + getrlimit; setrlimit; getrlimit64; + + # r* + readdir64; readdir64_r; + + # s* + scandir64; + + # v* + versionsort64; + } + GLIBC_2.3.3 { + posix_fadvise64; posix_fallocate64; + } + GLIBC_2.11 { + fallocate64; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S new file mode 100644 index 0000000000..8ec41521ca --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S @@ -0,0 +1,90 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + .section .rodata.str1.1,"aMS",%progbits,1 + .type longjmp_msg,%object +longjmp_msg: + .string "longjmp causes uninitialized stack frame" + .size longjmp_msg, .-longjmp_msg + .text + +#define __longjmp ____longjmp_chk + +#ifdef PIC +# define CALL_FAIL \ + ldr sl, .L_GOT; \ + cfi_undefined (sl); \ +.L_GOT_OFF: \ + add sl, pc, sl; \ + ldr r0, .Lstr; \ + add r0, sl, r0; \ + B PLTJMP(HIDDEN_JUMPTARGET(__fortify_fail)); \ +.L_GOT: \ + .word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8); \ +.Lstr: \ + .word longjmp_msg(GOTOFF); +#else +# define CALL_FAIL \ + ldr r0, .Lstr; \ + B HIDDEN_JUMPTARGET(__fortify_fail); \ +.Lstr: \ + .word longjmp_msg; +#endif + +#define CHECK_SP(reg) \ + cfi_remember_state; \ + cmp sp, reg; \ + bls .Lok; \ + str r7, [sp, #-4]!; \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (r7, 0); \ + mov r5, r0; \ + cfi_undefined (r5); \ + mov r7, #SYS_ify(sigaltstack); \ + mov r0, #0; \ + sub sp, sp, #12; /* == sizeof (stack_t) */ \ + cfi_adjust_cfa_offset (12); \ + cfi_remember_state; \ + mov r1, sp; \ + swi #0; \ + cmp r0, #0; \ + bne .Lok2; \ + ldr r1, [sp, #4]; \ + tst r1, #1; \ + beq .Lfail; \ + ldr r2, [sp, #0]; \ + ldr r3, [sp, #8]; \ + add r2, r2, r3; \ + sub r2, r2, reg; \ + cmp r2, r3; \ + bhi .Lok2; \ +.Lfail: \ + add sp, sp, #12; \ + cfi_adjust_cfa_offset (-12); \ + ldr r7, [sp], #4; \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (r7); \ + CALL_FAIL \ + cfi_restore_state; \ +.Lok2: \ + mov r0, r5; \ + cfi_restore_state; \ +.Lok: + +#include <__longjmp.S> diff --git a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S new file mode 100644 index 0000000000..d42e4051d0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S @@ -0,0 +1,46 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file with other + programs, and to distribute those programs without any restriction + coming from the use of this file. (The GNU Lesser General Public + License restrictions do apply in other respects; for example, they + cover modification of the file, and distribution when not linked + into another program.) + + Note that people who make modified versions of this file are not + obligated to grant this special exception for their modified + versions; it is their choice whether to do so. The GNU Lesser + General Public License gives permission to release a modified + version without this exception; this exception also makes it + possible to release a modified version which carries forward this + exception. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* GCC will emit calls to this routine under -mtp=soft. Linux has an + equivalent helper function (which clobbers fewer registers than + a normal function call) in a high page of memory; tail call to the + helper. */ + + .hidden __aeabi_read_tp +ENTRY (__aeabi_read_tp) + mov r0, #0xffff0fff + sub pc, r0, #31 +END (__aeabi_read_tp) diff --git a/ports/sysdeps/unix/sysv/linux/arm/alphasort64.c b/ports/sysdeps/unix/sysv/linux/arm/alphasort64.c new file mode 100644 index 0000000000..0b5ae47d2f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/alphasort64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/alphasort64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h new file mode 100644 index 0000000000..ef49d5fa2b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h @@ -0,0 +1,321 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009, 2010, 2011 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + +#include <sys/types.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 0100 /* not fcntl */ +#define O_EXCL 0200 /* not fcntl */ +#define O_NOCTTY 0400 /* not fcntl */ +#define O_TRUNC 01000 /* not fcntl */ +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 04010000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 + +#ifdef __USE_XOPEN2K8 +# define O_DIRECTORY 040000 /* Must be a directory. */ +# define O_NOFOLLOW 0100000 /* Do not follow links. */ +# define O_CLOEXEC 02000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 0200000 /* Direct disk access. */ +# define O_NOATIME 01000000 /* Do not set atime. */ +# define O_PATH 010000000 /* Resolve pathname but do not open file. */ +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 010000 /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +#ifdef __USE_LARGEFILE64 +# define O_LARGEFILE 0400000 +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 5 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#endif +#define F_GETLK64 12 /* Get record locking info. */ +#define F_SETLK64 13 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 14 /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 0 /* Read lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ + +/* For old implementation of bsd flock(). */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation. */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/arm/bits/hwcap.h b/ports/sysdeps/unix/sysv/linux/arm/bits/hwcap.h new file mode 100644 index 0000000000..ddfed85053 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/bits/hwcap.h @@ -0,0 +1,42 @@ +/* Defines for bits in AT_HWCAP. ARM Linux version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_AUXV_H +# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." +#endif + +/* The following must match the kernel's <asm/hwcap.h>. */ +#define HWCAP_ARM_SWP 1 +#define HWCAP_ARM_HALF 2 +#define HWCAP_ARM_THUMB 4 +#define HWCAP_ARM_26BIT 8 +#define HWCAP_ARM_FAST_MULT 16 +#define HWCAP_ARM_FPA 32 +#define HWCAP_ARM_VFP 64 +#define HWCAP_ARM_EDSP 128 +#define HWCAP_ARM_JAVA 256 +#define HWCAP_ARM_IWMMXT 512 +#define HWCAP_ARM_CRUNCH 1024 +#define HWCAP_ARM_THUMBEE 2048 +#define HWCAP_ARM_NEON 4096 +#define HWCAP_ARM_VFPv3 8192 +#define HWCAP_ARM_VFPv3D16 16384 +#define HWCAP_ARM_TLS 32768 +#define HWCAP_ARM_VFPv4 65536 +#define HWCAP_ARM_IDIVA 131072 +#define HWCAP_ARM_IDIVT 262144 diff --git a/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h b/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h new file mode 100644 index 0000000000..09b9c4561f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h @@ -0,0 +1,112 @@ +/* Definitions for POSIX memory map interface. Linux/ARM version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x02000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ +# define MAP_STACK 0x20000 /* Allocation is for a stack. */ +# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 4 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ +# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, + overrides the coredump filter bits. */ +# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/bits/shm.h b/ports/sysdeps/unix/sysv/linux/arm/bits/shm.h new file mode 100644 index 0000000000..03785249bb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/bits/shm.h @@ -0,0 +1,104 @@ +/* Copyright (C) 1995,1996,1997,2000,2002,2004,2008,2009 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." +#endif + +#include <bits/types.h> + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ +#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ + +/* Flags for `shmat'. */ +#define SHM_RDONLY 010000 /* attach read-only else read-write */ +#define SHM_RND 020000 /* round attach address to SHMLBA */ +#define SHM_REMAP 040000 /* take-over region on attach */ +#define SHM_EXEC 0100000 /* execution access */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + +__BEGIN_DECLS + +/* Segment low boundary address multiple. */ +#define SHMLBA (__getpagesize () << 2) +extern int __getpagesize (void) __THROW __attribute__ ((__const__)); + + +/* Type to count number of attaches. */ +typedef unsigned long int shmatt_t; + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __unused1; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __unused2; + __time_t shm_ctime; /* time of last change by shmctl() */ + unsigned long int __unused3; + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __unused4; + unsigned long int __unused5; + }; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +# define SHM_STAT 13 +# define SHM_INFO 14 + +/* shm_mode upper byte flags */ +# define SHM_DEST 01000 /* segment will be destroyed on last detach */ +# define SHM_LOCKED 02000 /* segment will not be swapped */ +# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ +# define SHM_NORESERVE 010000 /* don't check for reservations */ + +struct shminfo + { + unsigned long int shmmax; + unsigned long int shmmin; + unsigned long int shmmni; + unsigned long int shmseg; + unsigned long int shmall; + unsigned long int __unused1; + unsigned long int __unused2; + unsigned long int __unused3; + unsigned long int __unused4; + }; + +struct shm_info + { + int used_ids; + unsigned long int shm_tot; /* total allocated shm */ + unsigned long int shm_rss; /* total resident shm */ + unsigned long int shm_swp; /* total swapped shm */ + unsigned long int swap_attempts; + unsigned long int swap_successes; + }; + +#endif /* __USE_MISC */ + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/arm/brk.c b/ports/sysdeps/unix/sysv/linux/arm/brk.c new file mode 100644 index 0000000000..805ce9d9a7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/brk.c @@ -0,0 +1,41 @@ +/* brk system call for Linux/ARM. + Copyright (C) 1995, 1996, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sysdep.h> + +/* This must be initialized data because commons can't have aliases. */ +void *__curbrk = 0; + +int +__brk (void *addr) +{ + void *newbrk; + + __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); + + if (newbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S new file mode 100644 index 0000000000..ec042fff9e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S @@ -0,0 +1,104 @@ +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Pat Beirne <patb@corelcomputer.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after its all over. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 + +/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, + pid_t *ptid, struct user_desc *tls, pid_t *ctid); */ + + .text +ENTRY(__clone) + @ sanity check args + cmp r0, #0 + cmpne r1, #0 + moveq r0, #-EINVAL + beq PLTJMP(syscall_error) + + @ insert the args onto the new stack + str r3, [r1, #-4]! + str r0, [r1, #-4]! + + @ do the system call + @ get flags + mov r0, r2 +#ifdef RESET_PID + mov ip, r2 +#endif + @ new sp is already in r1 + stmfd sp!, {r4, r7} + cfi_adjust_cfa_offset (8) + cfi_rel_offset (r4, 0) + cfi_rel_offset (r7, 4) + ldr r2, [sp, #8] + ldr r3, [sp, #12] + ldr r4, [sp, #16] + ldr r7, =SYS_ify(clone) + swi 0x0 + cfi_endproc + cmp r0, #0 + beq 1f + ldmfd sp!, {r4, r7} + blt PLTJMP(C_SYMBOL_NAME(__syscall_error)) + RETINSTR(, lr) + + cfi_startproc +PSEUDO_END (__clone) + +1: + .fnstart + .cantunwind +#ifdef RESET_PID + tst ip, #CLONE_THREAD + bne 3f + mov r0, #0xffff0fff + mov lr, pc + sub pc, r0, #31 + mov r1, r0 + tst ip, #CLONE_VM + movne r0, #-1 + ldr r7, =SYS_ify(getpid) + swieq 0x0 + str r0, [r1, #PID_OFFSET] + str r0, [r1, #TID_OFFSET] +3: +#endif + @ pick the function arg and call address off the stack and execute + ldr r0, [sp, #4] +#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__) + ldr ip, [sp], #8 + mov lr, pc + bx ip +#else + mov lr, pc + ldr pc, [sp], #8 +#endif + + @ and we are done, passing the return value through r0 + b PLTJMP(HIDDEN_JUMPTARGET(_exit)) + + .fnend + +weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/arm/configure b/ports/sysdeps/unix/sysv/linux/arm/configure new file mode 100644 index 0000000000..5b5f4c993a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/configure @@ -0,0 +1,6 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/arm. + +arch_minimum_kernel=2.6.16 +libc_cv_gcc_unwind_find_fde=no +CFLAGS=${CFLAGS% -fno-unwind-tables} diff --git a/ports/sysdeps/unix/sysv/linux/arm/configure.in b/ports/sysdeps/unix/sysv/linux/arm/configure.in new file mode 100644 index 0000000000..b57c4e37b8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/configure.in @@ -0,0 +1,6 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/arm. + +arch_minimum_kernel=2.6.16 +libc_cv_gcc_unwind_find_fde=no +CFLAGS=${CFLAGS% -fno-unwind-tables} diff --git a/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.c b/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.c new file mode 100644 index 0000000000..227492ef90 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.c @@ -0,0 +1,65 @@ +/* Data for Linux/ARM version of processor capability information. + Copyright (C) 2001-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Philip Blundell <philb@gnu.org>, 2001. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* This information must be kept in sync with the _DL_HWCAP_COUNT and + _DL_PLATFORM_COUNT definitions in procinfo.h. + + If anything should be added here check whether the size of each string + is still ok with the given array size. + + All the #ifdefs in the definitions ar equite irritating but + necessary if we want to avoid duplicating the information. There + are three different modes: + + - PROCINFO_DECL is defined. This means we are only interested in + declarations. + + - PROCINFO_DECL is not defined: + + + if SHARED is defined the file is included in an array + initializer. The .element = { ... } syntax is needed. + + + if SHARED is not defined a normal array initialization is + needed. + */ + +#ifndef PROCINFO_CLASS +#define PROCINFO_CLASS +#endif + +#if !defined PROCINFO_DECL && defined SHARED + ._dl_arm_cap_flags +#else +PROCINFO_CLASS const char _dl_arm_cap_flags[19][10] +#endif +#ifndef PROCINFO_DECL += { + "swp", "half", "thumb", "26bit", "fastmult", "fpa", "vfp", "edsp", + "java", "iwmmxt", "crunch", "thumbee", "neon", "vfpv3", "vfpv3d16", + "tls", "vfpv4", "idiva", "idivt", + } +#endif +#if !defined SHARED || defined PROCINFO_DECL +; +#else +, +#endif + +#undef PROCINFO_DECL +#undef PROCINFO_CLASS diff --git a/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h new file mode 100644 index 0000000000..bea7100e13 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h @@ -0,0 +1,74 @@ +/* Linux/ARM version of processor capability information handling macros. + Copyright (C) 2001-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Philip Blundell <philb@gnu.org>, 2001. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _DL_PROCINFO_H +#define _DL_PROCINFO_H 1 + +#include <ldsodefs.h> +#include <sysdep.h> + +#define _DL_HWCAP_COUNT 19 + +/* The kernel provides platform data but it is not interesting. */ +#define _DL_HWCAP_PLATFORM 0 + + +static inline int +__attribute__ ((unused)) +_dl_procinfo (int word) +{ + int i; + + _dl_printf ("AT_HWCAP: "); + + for (i = 0; i < _DL_HWCAP_COUNT; ++i) + if (word & (1 << i)) + _dl_printf (" %s", GLRO(dl_arm_cap_flags)[i]); + + _dl_printf ("\n"); + + return 0; +} + +static inline const char * +__attribute__ ((unused)) +_dl_hwcap_string (int idx) +{ + return GLRO(dl_arm_cap_flags)[idx]; +}; + +#define HWCAP_IMPORTANT (HWCAP_ARM_VFP | HWCAP_ARM_NEON) + +static inline int +__attribute__ ((unused)) +_dl_string_hwcap (const char *str) +{ + int i; + + for (i = 0; i < _DL_HWCAP_COUNT; i++) + { + if (strcmp (str, GLRO(dl_arm_cap_flags)[i]) == 0) + return i; + } + return -1; +}; + +#define _dl_string_platform(str) (-1) + +#endif /* dl-procinfo.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/fchown.c b/ports/sysdeps/unix/sysv/linux/arm/fchown.c new file mode 100644 index 0000000000..3a69ecc9e7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/fchown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/fcntl.c b/ports/sysdeps/unix/sysv/linux/arm/fcntl.c new file mode 100644 index 0000000000..ea951bc4f9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/fcntl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/ftruncate64.c b/ports/sysdeps/unix/sysv/linux/arm/ftruncate64.c new file mode 100644 index 0000000000..9838182c39 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/ftruncate64.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Truncate the file FD refers to to LENGTH bytes. */ +int +__ftruncate64 (int fd, off64_t length) +{ + unsigned int low = length & 0xffffffff; + unsigned int high = length >> 32; + int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0, + __LONG_LONG_PAIR (high, low)); + return result; +} +weak_alias (__ftruncate64, ftruncate64) diff --git a/ports/sysdeps/unix/sysv/linux/arm/fxstat.c b/ports/sysdeps/unix/sysv/linux/arm/fxstat.c new file mode 100644 index 0000000000..4f219f0b9d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/fxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/fxstatat.c b/ports/sysdeps/unix/sysv/linux/arm/fxstatat.c new file mode 100644 index 0000000000..0f8b3135d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/fxstatat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstatat.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getcontext.S b/ports/sysdeps/unix/sysv/linux/arm/getcontext.S new file mode 100644 index 0000000000..116d6e8f35 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getcontext.S @@ -0,0 +1,113 @@ +/* Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <rtld-global-offsets.h> + +#include "ucontext_i.h" + + .syntax unified + .text + +/* int getcontext (ucontext_t *ucp) */ + +ENTRY(__getcontext) + /* No need to save r0-r3, d0-d7, or d16-d31. */ + add r1, r0, #MCONTEXT_ARM_R4 + stmia r1, {r4-r11} + + /* Save R13 separately as Thumb can't STM it. */ + str r13, [r0, #MCONTEXT_ARM_SP] + str r14, [r0, #MCONTEXT_ARM_LR] + /* Return to LR */ + str r14, [r0, #MCONTEXT_ARM_PC] + /* Return zero */ + mov r2, #0 + str r2, [r0, #MCONTEXT_ARM_R0] + + /* Save ucontext_t * across the next call. */ + mov r4, r0 + + /* __sigprocmask(SIG_BLOCK, NULL, &(ucontext->uc_sigmask)) */ + mov r0, #SIG_BLOCK + mov r1, #0 + add r2, r4, #UCONTEXT_SIGMASK + bl PLTJMP(__sigprocmask) + + /* Store FP regs. Much of the FP code is copied from arm/setjmp.S. */ + +#ifdef PIC + ldr r2, 1f + ldr r1, Lrtld_global_ro +0: add r2, pc, r2 + ldr r2, [r2, r1] + ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] +#else + ldr r2, Lhwcap + ldr r2, [r2, #0] +#endif + + add r0, r4, #UCONTEXT_REGSPACE + + tst r2, #HWCAP_ARM_VFP + beq Lno_vfp + + /* Store the VFP registers. + Don't use VFP instructions directly because this code + is used in non-VFP multilibs. */ + /* Following instruction is vstmia r0!, {d8-d15}. */ + stc p11, cr8, [r0], #64 + /* Store the floating-point status register. */ + /* Following instruction is vmrs r1, fpscr. */ + mrc p10, 7, r1, cr1, cr0, 0 + str r1, [r0], #4 +Lno_vfp: + + tst r2, #HWCAP_ARM_IWMMXT + beq Lno_iwmmxt + + /* Save the call-preserved iWMMXt registers. */ + /* Following instructions are wstrd wr10, [r0], #8 (etc.) */ + stcl p1, cr10, [r0], #8 + stcl p1, cr11, [r0], #8 + stcl p1, cr12, [r0], #8 + stcl p1, cr13, [r0], #8 + stcl p1, cr14, [r0], #8 + stcl p1, cr15, [r0], #8 +Lno_iwmmxt: + + /* Restore the clobbered R4 and LR. */ + ldr r14, [r4, #MCONTEXT_ARM_LR] + ldr r4, [r4, #MCONTEXT_ARM_R4] + + mov r0, #0 + + DO_RET(r14) + +END(__getcontext) + +#ifdef PIC +1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 +Lrtld_global_ro: + .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) +#else +Lhwcap: + .long C_SYMBOL_NAME(_dl_hwcap) +#endif + + +weak_alias(__getcontext, getcontext) diff --git a/ports/sysdeps/unix/sysv/linux/arm/getdents64.c b/ports/sysdeps/unix/sysv/linux/arm/getdents64.c new file mode 100644 index 0000000000..0c75fb5a06 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getdents64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getdents64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getegid.c b/ports/sysdeps/unix/sysv/linux/arm/getegid.c new file mode 100644 index 0000000000..37b4b4a530 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getegid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/geteuid.c b/ports/sysdeps/unix/sysv/linux/arm/geteuid.c new file mode 100644 index 0000000000..ebcb555b5e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/geteuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/geteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getgid.c b/ports/sysdeps/unix/sysv/linux/arm/getgid.c new file mode 100644 index 0000000000..0a4d6061f0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getgroups.c b/ports/sysdeps/unix/sysv/linux/arm/getgroups.c new file mode 100644 index 0000000000..102ea24e14 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getgroups.c @@ -0,0 +1,2 @@ +/* We also have to rewrite the kernel gid_t to the user land type. */ +#include <sysdeps/unix/sysv/linux/i386/getgroups.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getresgid.c b/ports/sysdeps/unix/sysv/linux/arm/getresgid.c new file mode 100644 index 0000000000..b703a414cc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getresgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getresuid.c b/ports/sysdeps/unix/sysv/linux/arm/getresuid.c new file mode 100644 index 0000000000..0b14cefe34 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getresuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c b/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c new file mode 100644 index 0000000000..fc06dbd641 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getrlimit64.c b/ports/sysdeps/unix/sysv/linux/arm/getrlimit64.c new file mode 100644 index 0000000000..fef018f471 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/getuid.c b/ports/sysdeps/unix/sysv/linux/arm/getuid.c new file mode 100644 index 0000000000..d682c79a49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/getuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/glob64.c b/ports/sysdeps/unix/sysv/linux/arm/glob64.c new file mode 100644 index 0000000000..82a9a296a7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/glob64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/glob64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/internal_accept4.S b/ports/sysdeps/unix/sysv/linux/arm/internal_accept4.S new file mode 100644 index 0000000000..eeb5f50a26 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/internal_accept4.S @@ -0,0 +1,6 @@ +/* Tag_ABI_align8_preserved: This code preserves 8-byte + alignment in any callee. */ + .eabi_attribute 25, 1 +/* Tag_ABI_align8_needed: This code may require 8-byte alignment from + the caller. */ + .eabi_attribute 24, 1 diff --git a/ports/sysdeps/unix/sysv/linux/arm/internal_recvmmsg.S b/ports/sysdeps/unix/sysv/linux/arm/internal_recvmmsg.S new file mode 100644 index 0000000000..eeb5f50a26 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/internal_recvmmsg.S @@ -0,0 +1,6 @@ +/* Tag_ABI_align8_preserved: This code preserves 8-byte + alignment in any callee. */ + .eabi_attribute 25, 1 +/* Tag_ABI_align8_needed: This code may require 8-byte alignment from + the caller. */ + .eabi_attribute 24, 1 diff --git a/ports/sysdeps/unix/sysv/linux/arm/internal_sendmmsg.S b/ports/sysdeps/unix/sysv/linux/arm/internal_sendmmsg.S new file mode 100644 index 0000000000..eeb5f50a26 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/internal_sendmmsg.S @@ -0,0 +1,6 @@ +/* Tag_ABI_align8_preserved: This code preserves 8-byte + alignment in any callee. */ + .eabi_attribute 25, 1 +/* Tag_ABI_align8_needed: This code may require 8-byte alignment from + the caller. */ + .eabi_attribute 24, 1 diff --git a/ports/sysdeps/unix/sysv/linux/arm/ioperm.c b/ports/sysdeps/unix/sysv/linux/arm/ioperm.c new file mode 100644 index 0000000000..edb29461a3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/ioperm.c @@ -0,0 +1,280 @@ +/* Copyright (C) 1998, 1999, 2003, 2005, 2008, 2011 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Phil Blundell, based on the Alpha version by + David Mosberger. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* I/O port access on the ARM is something of a fiction. What we do is to + map an appropriate area of /dev/mem into user space so that a program + can blast away at the hardware in such a way as to generate I/O cycles + on the bus. To insulate user code from dependencies on particular + hardware we don't allow calls to inb() and friends to be inlined, but + force them to come through code in here every time. Performance-critical + registers tend to be memory mapped these days so this should be no big + problem. */ + +/* Once upon a time this file used mprotect to enable and disable + access to particular areas of I/O space. Unfortunately the + mprotect syscall also has the side effect of enabling caching for + the area affected (this is a kernel limitation). So we now just + enable all the ports all of the time. */ + +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <sys/types.h> +#include <sys/mman.h> + +#include <linux/version.h> +#include <sys/sysctl.h> + +#define PATH_ARM_SYSTYPE "/etc/arm_systype" +#define PATH_CPUINFO "/proc/cpuinfo" + +#define MAX_PORT 0x10000 + +static struct { + unsigned long int base; + unsigned long int io_base; + unsigned int shift; + unsigned int initdone; /* since all the above could be 0 */ +} io; + +#define IO_BASE_FOOTBRIDGE 0x7c000000 +#define IO_SHIFT_FOOTBRIDGE 0 + +static struct platform { + const char *name; + unsigned long int io_base; + unsigned int shift; +} platform[] = { + /* All currently supported platforms are in fact the same. :-) */ + {"Chalice-CATS", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE}, + {"DEC-EBSA285", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE}, + {"Corel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE}, + {"Rebel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE}, +}; + +#define IO_ADDR(port) (io.base + ((port) << io.shift)) + +/* + * Initialize I/O system. There are several ways to get the information + * we need. Each is tried in turn until one succeeds. + * + * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*). This is the preferred method + * but not all kernels support it. + * + * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE. + * - If it matches one of the entries in the table above, use the + * corresponding values. + * - If it begins with a number, assume this is a previously + * unsupported system and the values encode, in order, + * "<io_base>,<port_shift>". + * + * 3. Lookup the "system type" field in /proc/cpuinfo. Again, if it + * matches an entry in the platform[] table, use the corresponding + * values. + */ + +/* The Linux kernel headers renamed this constant between 2.5.26 and + 2.5.27. It was backported to 2.4 between 2.4.22 and 2.4.23. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,23) +# define BUS_ISA CTL_BUS_ISA +#endif + +static int +init_iosys (void) +{ + char systype[256]; + int i, n; + static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; + static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; + size_t len = sizeof(io.base); + + if (! __sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) + && ! __sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0)) + { + io.initdone = 1; + return 0; + } + + n = __readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1); + if (n > 0) + { + systype[n] = '\0'; + if (isdigit (systype[0])) + { + if (sscanf (systype, "%li,%i", &io.io_base, &io.shift) == 2) + { + io.initdone = 1; + return 0; + } + /* else we're likely going to fail with the system match below */ + } + } + else + { + FILE * fp; + + fp = fopen (PATH_CPUINFO, "rce"); + if (! fp) + return -1; + while ((n = fscanf (fp, "Hardware\t: %256[^\n]\n", systype)) + != EOF) + { + if (n == 1) + break; + else + fgets_unlocked (systype, 256, fp); + } + fclose (fp); + + if (n == EOF) + { + /* this can happen if the format of /proc/cpuinfo changes... */ + fprintf (stderr, + "ioperm: Unable to determine system type.\n" + "\t(May need " PATH_ARM_SYSTYPE " symlink?)\n"); + __set_errno (ENODEV); + return -1; + } + } + + /* translate systype name into i/o system: */ + for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i) + { + if (strcmp (platform[i].name, systype) == 0) + { + io.shift = platform[i].shift; + io.io_base = platform[i].io_base; + io.initdone = 1; + return 0; + } + } + + /* systype is not a known platform name... */ + __set_errno (ENODEV); + return -1; +} + +int +_ioperm (unsigned long int from, unsigned long int num, int turn_on) +{ + if (! io.initdone && init_iosys () < 0) + return -1; + + /* this test isn't as silly as it may look like; consider overflows! */ + if (from >= MAX_PORT || from + num > MAX_PORT) + { + __set_errno (EINVAL); + return -1; + } + + if (turn_on) + { + if (! io.base) + { + int fd; + + fd = __open ("/dev/mem", O_RDWR); + if (fd < 0) + return -1; + + io.base = + (unsigned long int) __mmap (0, MAX_PORT << io.shift, + PROT_READ | PROT_WRITE, + MAP_SHARED, fd, io.io_base); + __close (fd); + if ((long) io.base == -1) + return -1; + } + } + + return 0; +} + + +int +_iopl (unsigned int level) +{ + if (level > 3) + { + __set_errno (EINVAL); + return -1; + } + if (level) + { + return _ioperm (0, MAX_PORT, 1); + } + return 0; +} + + +void +_outb (unsigned char b, unsigned long int port) +{ + *((volatile unsigned char *)(IO_ADDR (port))) = b; +} + + +void +_outw (unsigned short b, unsigned long int port) +{ + *((volatile unsigned short *)(IO_ADDR (port))) = b; +} + + +void +_outl (unsigned int b, unsigned long int port) +{ + *((volatile unsigned long *)(IO_ADDR (port))) = b; +} + + +unsigned int +_inb (unsigned long int port) +{ + return *((volatile unsigned char *)(IO_ADDR (port))); +} + + +unsigned int +_inw (unsigned long int port) +{ + return *((volatile unsigned short *)(IO_ADDR (port))); +} + + +unsigned int +_inl (unsigned long int port) +{ + return *((volatile unsigned long *)(IO_ADDR (port))); +} + +weak_alias (_ioperm, ioperm); +weak_alias (_iopl, iopl); +weak_alias (_inb, inb); +weak_alias (_inw, inw); +weak_alias (_inl, inl); +weak_alias (_outb, outb); +weak_alias (_outw, outw); +weak_alias (_outl, outl); diff --git a/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h b/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h new file mode 100644 index 0000000000..74d549a996 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -0,0 +1,64 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2006-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* The utimes syscall was added before 2.6.1. */ +#if __LINUX_KERNEL_VERSION >= 132609 +# define __ASSUME_UTIMES 1 +#endif + +/* On ARM the mmap2/stat64/lstat64/fstat64 syscalls were introduced in + 2.3.35. */ +#if __LINUX_KERNEL_VERSION >= 131875 +# define __ASSUME_MMAP2_SYSCALL 1 +# define __ASSUME_STAT64_SYSCALL 1 +#endif + +/* Arm got fcntl64 in 2.4.4. */ +#if __LINUX_KERNEL_VERSION >= 132100 +# define __ASSUME_FCNTL64 1 +#endif + +/* The vfork syscall on arm was definitely available in 2.4. */ +#if __LINUX_KERNEL_VERSION >= 132097 +# define __ASSUME_VFORK_SYSCALL 1 +#endif + +/* The signal frame layout changed in 2.6.18. */ +#if __LINUX_KERNEL_VERSION >= 132626 +# define __ASSUME_SIGFRAME_V2 1 +#endif + +/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */ +#if __LINUX_KERNEL_VERSION >= 0x02061b +# define __ASSUME_EVENTFD2 1 +# define __ASSUME_SIGNALFD4 1 +#endif + +/* Support for the accept4 syscall was added in 2.6.36. */ +#if __LINUX_KERNEL_VERSION >= 0x020624 +# define __ASSUME_ACCEPT4 1 +#endif + +#include_next <kernel-features.h> + +/* Support for pselect6, ppoll and epoll_pwait was added in 2.6.32. */ +#if __LINUX_KERNEL_VERSION < 0x020620 +# undef __ASSUME_PSELECT +# undef __ASSUME_PPOLL +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/lchown.c b/ports/sysdeps/unix/sysv/linux/arm/lchown.c new file mode 100644 index 0000000000..c89de99ba2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/lchown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h new file mode 100644 index 0000000000..8980bb1996 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h @@ -0,0 +1,61 @@ +/* Run-time dynamic linker data structures for loaded ELF shared objects. + Copyright (C) 2010, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _ARM_LINUX_LDSODEFS_H +#define _ARM_LINUX_LDSODEFS_H 1 + +#include_next <ldsodefs.h> + +#undef VALID_ELF_HEADER +#undef VALID_ELF_OSABI +#undef MORE_ELF_HEADER_DATA + +#define EXTRA_OSABI ELFOSABI_ARM_AEABI + +#define VALID_ELF_HEADER(hdr,exp,size) \ + (memcmp (hdr, exp, size) == 0 \ + || memcmp (hdr, expected2, size) == 0 \ + || memcmp (hdr, expected3, size) == 0) +#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \ + || osabi == EXTRA_OSABI \ + || osabi == ELFOSABI_LINUX) +#define MORE_ELF_HEADER_DATA \ + static const unsigned char expected2[EI_PAD] = \ + { \ + [EI_MAG0] = ELFMAG0, \ + [EI_MAG1] = ELFMAG1, \ + [EI_MAG2] = ELFMAG2, \ + [EI_MAG3] = ELFMAG3, \ + [EI_CLASS] = ELFW(CLASS), \ + [EI_DATA] = byteorder, \ + [EI_VERSION] = EV_CURRENT, \ + [EI_OSABI] = ELFOSABI_LINUX \ + }; \ + static const unsigned char expected3[EI_PAD] = \ + { \ + [EI_MAG0] = ELFMAG0, \ + [EI_MAG1] = ELFMAG1, \ + [EI_MAG2] = ELFMAG2, \ + [EI_MAG3] = ELFMAG3, \ + [EI_CLASS] = ELFW(CLASS), \ + [EI_DATA] = byteorder, \ + [EI_VERSION] = EV_CURRENT, \ + [EI_OSABI] = EXTRA_OSABI \ + } + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/libc-aeabi_read_tp.S b/ports/sysdeps/unix/sysv/linux/arm/libc-aeabi_read_tp.S new file mode 100644 index 0000000000..6132afc151 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/libc-aeabi_read_tp.S @@ -0,0 +1 @@ +#include <aeabi_read_tp.S> diff --git a/ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S b/ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S new file mode 100644 index 0000000000..0ec81734f8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S @@ -0,0 +1,48 @@ +/* Copyright (C) 2010-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* Out-of-line syscall stub. We expect the system call number in ip + and return the raw result in r0. No registers are clobbered. + We could avoid using the stack for this, but the goal is accurate + unwind information - and while there is a reserved prefix in the + ARM unwind tables for register to register moves, the actual opcodes + are not defined. */ + +#if defined(__thumb__) + .thumb + .syntax unified + .hidden __libc_do_syscall + +#undef CALL_MCOUNT +#define CALL_MCOUNT + +ENTRY (__libc_do_syscall) + .fnstart + push {r7, lr} + .save {r7, lr} + cfi_adjust_cfa_offset (8) + cfi_rel_offset (r7, 0) + cfi_rel_offset (lr, 4) + mov r7, ip + swi 0x0 + pop {r7, pc} + .fnend +END (__libc_do_syscall) + +#endif /* __thumb__ */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/lockf64.c b/ports/sysdeps/unix/sysv/linux/arm/lockf64.c new file mode 100644 index 0000000000..a88f5a784a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/lockf64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/lxstat.c b/ports/sysdeps/unix/sysv/linux/arm/lxstat.c new file mode 100644 index 0000000000..2371cd9719 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/lxstat.c @@ -0,0 +1,2 @@ +#include <sysdeps/unix/sysv/linux/i386/lxstat.c> + diff --git a/ports/sysdeps/unix/sysv/linux/arm/makecontext.c b/ports/sysdeps/unix/sysv/linux/arm/makecontext.c new file mode 100644 index 0000000000..d6ae6f0d76 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/makecontext.c @@ -0,0 +1,73 @@ +/* Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdarg.h> +#include <ucontext.h> + +/* Number of arguments that go in registers. */ +#define NREG_ARGS 4 + +/* Take a context previously prepared via getcontext() and set to + call func() with the given int only args. */ +void +__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) +{ + extern void __startcontext (void); + unsigned long *funcstack; + va_list vl; + unsigned long *regptr; + unsigned int reg; + int misaligned; + + /* Start at the top of stack. */ + funcstack = (unsigned long *) (ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); + + /* Ensure the stack stays eight byte aligned. */ + misaligned = ((unsigned long) funcstack & 4) != 0; + + if ((argc > NREG_ARGS) && (argc & 1) != 0) + misaligned = !misaligned; + + if (misaligned) + funcstack -= 1; + + va_start (vl, argc); + + /* Reserve space for the on-stack arguments. */ + if (argc > NREG_ARGS) + funcstack -= (argc - NREG_ARGS); + + ucp->uc_mcontext.arm_sp = (unsigned long) funcstack; + ucp->uc_mcontext.arm_pc = (unsigned long) func; + + /* Exit to startcontext() with the next context in R4 */ + ucp->uc_mcontext.arm_r4 = (unsigned long) ucp->uc_link; + ucp->uc_mcontext.arm_lr = (unsigned long) __startcontext; + + /* The first four arguments go into registers. */ + regptr = &(ucp->uc_mcontext.arm_r0); + + for (reg = 0; (reg < argc) && (reg < NREG_ARGS); reg++) + *regptr++ = va_arg (vl, unsigned long); + + /* And the remainder on the stack. */ + for (; reg < argc; reg++) + *funcstack++ = va_arg (vl, unsigned long); + + va_end (vl); +} +weak_alias (__makecontext, makecontext) diff --git a/ports/sysdeps/unix/sysv/linux/arm/mmap.S b/ports/sysdeps/unix/sysv/linux/arm/mmap.S new file mode 100644 index 0000000000..3276a3b475 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/mmap.S @@ -0,0 +1,63 @@ +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define EINVAL 22 + + .text + +ENTRY (__mmap) + /* shuffle args */ + str r5, [sp, #-4]! + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r5, 0) + ldr r5, [sp, #8] + str r4, [sp, #-4]! + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r4, 0) + cfi_remember_state + ldr r4, [sp, #8] + + /* convert offset to pages */ + movs ip, r5, lsl #20 + bne .Linval + mov r5, r5, lsr #12 + + /* do the syscall */ + DO_CALL (mmap2, 0) + + /* restore registers */ +2: + ldr r4, [sp], #4 + cfi_adjust_cfa_offset (-4) + cfi_restore (r4) + ldr r5, [sp], #4 + cfi_adjust_cfa_offset (-4) + cfi_restore (r5) + + cmn r0, $4096 + RETINSTR(cc, lr) + b PLTJMP(syscall_error) + + cfi_restore_state +.Linval: + mov r0, #-EINVAL + b 2b +PSEUDO_END (__mmap) + +weak_alias (__mmap, mmap) diff --git a/ports/sysdeps/unix/sysv/linux/arm/mmap64.S b/ports/sysdeps/unix/sysv/linux/arm/mmap64.S new file mode 100644 index 0000000000..be4dd52de4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/mmap64.S @@ -0,0 +1,68 @@ +/* Copyright (C) 2000, 2003, 2005, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define EINVAL 22 + +#ifdef __ARMEB__ +# define LOW_OFFSET 8 + 4 +/* The initial + 4 is for the stack postdecrement. */ +# define HIGH_OFFSET 4 + 8 + 0 +#else +# define LOW_OFFSET 8 + 0 +# define HIGH_OFFSET 4 + 8 + 4 +#endif + + /* The mmap2 system call takes six arguments, all in registers. */ + .text +ENTRY (__mmap64) + ldr ip, [sp, $LOW_OFFSET] + str r5, [sp, #-4]! + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r5, 0) + ldr r5, [sp, $HIGH_OFFSET] + str r4, [sp, #-4]! + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r4, 0) + cfi_remember_state + movs r4, ip, lsl $20 @ check that offset is page-aligned + mov ip, ip, lsr $12 + moveqs r4, r5, lsr $12 @ check for overflow + bne .Linval + ldr r4, [sp, $8] @ load fd + orr r5, ip, r5, lsl $20 @ compose page offset + DO_CALL (mmap2, 0) + cmn r0, $4096 + ldmfd sp!, {r4, r5} + cfi_adjust_cfa_offset (-8) + cfi_restore (r4) + cfi_restore (r5) + RETINSTR(cc, lr) + b PLTJMP(syscall_error) + + cfi_restore_state +.Linval: + mov r0, $-EINVAL + ldmfd sp!, {r4, r5} + cfi_adjust_cfa_offset (-8) + cfi_restore (r4) + cfi_restore (r5) + b PLTJMP(syscall_error) +PSEUDO_END (__mmap64) + +weak_alias (__mmap64, mmap64) diff --git a/ports/sysdeps/unix/sysv/linux/arm/msgctl.c b/ports/sysdeps/unix/sysv/linux/arm/msgctl.c new file mode 100644 index 0000000000..38aedadf49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/msgctl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/alpha/msgctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/Makefile b/ports/sysdeps/unix/sysv/linux/arm/nptl/Makefile new file mode 100644 index 0000000000..ef8076cf3f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/Makefile @@ -0,0 +1,17 @@ +ifeq ($(subdir),rt) +librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 +librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 +endif + +ifeq ($(subdir),nptl) +libpthread-sysdep_routines += nptl-aeabi_unwind_cpp_pr1 +libpthread-shared-only-routines += nptl-aeabi_unwind_cpp_pr1 + +# This test relies on compiling part of the binary with EH information, +# part without, and unwinding through. The .ARM.exidx tables have +# start addresses for EH regions, but no end addresses. Every +# region an exception needs to propogate through must have unwind +# information, or a previous function's unwind table may be used +# by mistake. +tests := $(filter-out tst-cleanupx4,$(tests)) +endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions b/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions new file mode 100644 index 0000000000..435c9212c4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions @@ -0,0 +1,8 @@ +libc { + GLIBC_PRIVATE { + # A copy of sigaction lives in NPTL, and needs these. + __default_sa_restorer; __default_rt_sa_restorer; + __default_sa_restorer_v1; __default_rt_sa_restorer_v1; + __default_sa_restorer_v2; __default_rt_sa_restorer_v2; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h new file mode 100644 index 0000000000..4e810a28d6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h @@ -0,0 +1,130 @@ +/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdint.h> +#include <sysdep.h> + + +typedef int8_t atomic8_t; +typedef uint8_t uatomic8_t; +typedef int_fast8_t atomic_fast8_t; +typedef uint_fast8_t uatomic_fast8_t; + +typedef int32_t atomic32_t; +typedef uint32_t uatomic32_t; +typedef int_fast32_t atomic_fast32_t; +typedef uint_fast32_t uatomic_fast32_t; + +typedef intptr_t atomicptr_t; +typedef uintptr_t uatomicptr_t; +typedef intmax_t atomic_max_t; +typedef uintmax_t uatomic_max_t; + +void __arm_link_error (void); + +/* Use the atomic builtins provided by GCC in case the backend provides + a pattern to do this efficiently. */ + +#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define atomic_full_barrier() __sync_synchronize () +#elif defined __thumb2__ +#define atomic_full_barrier() \ + __asm__ __volatile__ \ + ("movw\tip, #0x0fa0\n\t" \ + "movt\tip, #0xffff\n\t" \ + "blx\tip" \ + : : : "ip", "lr", "cc", "memory"); +#else +#define atomic_full_barrier() \ + __asm__ __volatile__ \ + ("mov\tip, #0xffff0fff\n\t" \ + "mov\tlr, pc\n\t" \ + "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)" \ + : : : "ip", "lr", "cc", "memory"); +#endif + +/* Atomic compare and exchange. This sequence relies on the kernel to + provide a compare and exchange operation which is atomic on the + current architecture, either via cleverness on pre-ARMv6 or via + ldrex / strex on ARMv6. */ + +#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) + +#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) + +#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + __sync_val_compare_and_swap ((mem), (oldval), (newval)) + +/* It doesn't matter what register is used for a_oldval2, but we must + specify one to work around GCC PR rtl-optimization/21223. Otherwise + it may cause a_oldval or a_tmp to be moved to a different register. */ + +#elif defined __thumb2__ +/* Thumb-2 has ldrex/strex. However it does not have barrier instructions, + so we still need to use the kernel helper. */ +#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + ({ register __typeof (oldval) a_oldval asm ("r0"); \ + register __typeof (oldval) a_newval asm ("r1") = (newval); \ + register __typeof (mem) a_ptr asm ("r2") = (mem); \ + register __typeof (oldval) a_tmp asm ("r3"); \ + register __typeof (oldval) a_oldval2 asm ("r4") = (oldval); \ + __asm__ __volatile__ \ + ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \ + "cmp\t%[tmp], %[old2]\n\t" \ + "bne\t1f\n\t" \ + "mov\t%[old], %[old2]\n\t" \ + "movw\t%[tmp], #0x0fc0\n\t" \ + "movt\t%[tmp], #0xffff\n\t" \ + "blx\t%[tmp]\n\t" \ + "bcc\t0b\n\t" \ + "mov\t%[tmp], %[old2]\n\t" \ + "1:" \ + : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \ + : [new] "r" (a_newval), [ptr] "r" (a_ptr), \ + [old2] "r" (a_oldval2) \ + : "ip", "lr", "cc", "memory"); \ + a_tmp; }) +#else +#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ + ({ register __typeof (oldval) a_oldval asm ("r0"); \ + register __typeof (oldval) a_newval asm ("r1") = (newval); \ + register __typeof (mem) a_ptr asm ("r2") = (mem); \ + register __typeof (oldval) a_tmp asm ("r3"); \ + register __typeof (oldval) a_oldval2 asm ("r4") = (oldval); \ + __asm__ __volatile__ \ + ("0:\tldr\t%[tmp],[%[ptr]]\n\t" \ + "cmp\t%[tmp], %[old2]\n\t" \ + "bne\t1f\n\t" \ + "mov\t%[old], %[old2]\n\t" \ + "mov\t%[tmp], #0xffff0fff\n\t" \ + "mov\tlr, pc\n\t" \ + "add\tpc, %[tmp], #(0xffff0fc0 - 0xffff0fff)\n\t" \ + "bcc\t0b\n\t" \ + "mov\t%[tmp], %[old2]\n\t" \ + "1:" \ + : [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \ + : [new] "r" (a_newval), [ptr] "r" (a_ptr), \ + [old2] "r" (a_oldval2) \ + : "ip", "lr", "cc", "memory"); \ + a_tmp; }) +#endif + +#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ + ({ __arm_link_error (); oldval; }) diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..5e4402088c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h @@ -0,0 +1,184 @@ +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#include <endian.h> + +#define __SIZEOF_PTHREAD_ATTR_T 36 +#define __SIZEOF_PTHREAD_MUTEX_T 24 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_COND_COMPAT_T 12 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCK_T 32 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIER_T 20 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + + +/* Thread identifiers. The structure of the attribute type is not + exposed on purpose. */ +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + + +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; + + +/* Data structures for mutex handling. The structure of the attribute + type is not exposed on purpose. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock; + unsigned int __count; + int __owner; + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; + unsigned int __nusers; + __extension__ union + { + int __spins; + __pthread_slist_t __list; + }; + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + long int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is not exposed on purpose. */ +typedef union +{ + struct + { + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + long int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is not exposed on purpose. */ +typedef union +{ + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned char __pad1; + unsigned char __pad2; + unsigned char __shared; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; +#else + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; + unsigned char __shared; + unsigned char __pad1; + unsigned char __pad2; +#endif + int __writer; + } __data; + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h new file mode 100644 index 0000000000..3ed1424d79 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/semaphore.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2002, 2005, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + + +#define __SIZEOF_SEM_T 16 + + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/clone.S new file mode 100644 index 0000000000..23750b3f88 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/clone.S @@ -0,0 +1,3 @@ +#define RESET_PID +#include <tcb-offsets.h> +#include "../clone.S" diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/configure b/ports/sysdeps/unix/sysv/linux/arm/nptl/configure new file mode 100644 index 0000000000..518269913a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/configure @@ -0,0 +1,4 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + +libc_cv_gcc_exceptions=yes +exceptions=-fexceptions diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/configure.in b/ports/sysdeps/unix/sysv/linux/arm/nptl/configure.in new file mode 100644 index 0000000000..22f6f4b8f2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/configure.in @@ -0,0 +1,8 @@ +dnl configure fragment for NPTL and ARM/Linux EABI. +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. + +dnl The normal configure check for gcc -fexecptions fails because it can't +dnl find __aeabi_unwind_cpp_pr0. Work around this here; our GCC definitely +dnl has -fexceptions. +libc_cv_gcc_exceptions=yes +exceptions=-fexceptions diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/createthread.c new file mode 100644 index 0000000000..e057a98eaf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/createthread.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE (pd + 1) + +/* Get the real implementation. */ +#include <nptl/sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/fork.c new file mode 100644 index 0000000000..6218250d39 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/fork.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Phil Blundell <pb@nexus.co.uk>, 2005 + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sched.h> +#include <signal.h> +#include <sysdep.h> +#include <tls.h> + + +#define ARCH_FORK() \ + INLINE_SYSCALL (clone, 5, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \ + NULL, NULL, NULL, &THREAD_SELF->tid) + +#include <nptl/sysdeps/unix/sysv/linux/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/ld.abilist new file mode 100644 index 0000000000..8eac745dd1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/ld.abilist @@ -0,0 +1,12 @@ +GLIBC_2.4 + GLIBC_2.4 A + __libc_memalign F + __libc_stack_end D 0x4 + __stack_chk_guard D 0x4 + __tls_get_addr F + _dl_mcount F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..9c795c6e96 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.4 + GLIBC_2.4 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libanl.abilist new file mode 100644 index 0000000000..e10833ed25 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.4 + GLIBC_2.4 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist new file mode 100644 index 0000000000..1f496fb61c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist @@ -0,0 +1,2134 @@ +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + _sys_errlist D 0x21c + _sys_nerr D 0x4 + ntp_gettimex F + recvmmsg F + sys_errlist D 0x21c + sys_nerr D 0x4 +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.4 + GLIBC_2.4 A + _Exit F + _IO_2_1_stderr_ D 0xa0 + _IO_2_1_stdin_ D 0xa0 + _IO_2_1_stdout_ D 0xa0 + _IO_adjust_column F + _IO_adjust_wcolumn F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_getline_info F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_seekwmark F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sputbackwc F + _IO_sscanf F + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_sungetwc F + _IO_switch_to_get_mode F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_unsave_wmarkers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __adjtimex F + __aeabi_MB_CUR_MAX F + __aeabi_assert F + __aeabi_atexit F + __aeabi_errno_addr F + __aeabi_localeconv F + __aeabi_memclr F + __aeabi_memclr4 F + __aeabi_memclr8 F + __aeabi_memcpy F + __aeabi_memcpy4 F + __aeabi_memcpy8 F + __aeabi_memmove F + __aeabi_memmove4 F + __aeabi_memmove8 F + __aeabi_memset F + __aeabi_memset4 F + __aeabi_memset8 F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __asprintf F + __assert F + __assert_fail F + __assert_perror_fail F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __chk_fail F + __clone F + __close F + __cmsg_nxthdr F + __confstr_chk F + __connect F + __ctype_b_loc F + __ctype_get_mb_cur_max F + __ctype_tolower_loc F + __ctype_toupper_loc F + __curbrk D 0x4 + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __daylight D 0x4 + __dcgettext F + __default_morecore F + __dgettext F + __dup2 F + __duplocale F + __endmntent F + __environ D 0x4 + __errno_location F + __fbufsize F + __fcntl F + __ffs F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finite F + __finitef F + __finitel F + __flbf F + __fork F + __fpending F + __fprintf_chk F + __fpu_control D 0x4 + __fpurge F + __freadable F + __freading F + __free_hook D 0x4 + __freelocale F + __fsetlocking F + __fwprintf_chk F + __fwritable F + __fwriting F + __fxstat F + __fxstat64 F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdelim F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getmntent_r F + __getpagesize F + __getpgid F + __getpid F + __gets_chk F + __gettimeofday F + __getwd_chk F + __gmtime_r F + __gnu_Unwind_Find_exidx F + __h_errno_location F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isctype F + __isdigit_l F + __isgraph_l F + __isinf F + __isinff F + __isinfl F + __islower_l F + __isnan F + __isnanf F + __isnanl F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __ivaliduser F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_calloc F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_free F + __libc_freeres F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_sa_len F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __lxstat64 F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __memalign_hook D 0x4 + __memcpy_chk F + __memmove_chk F + __mempcpy F + __mempcpy_chk F + __mempcpy_small F + __memset_chk F + __monstartup F + __morecore D 0x4 + __nanosleep F + __newlocale F + __nl_langinfo_l F + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hostname_digits_dots F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __open64 F + __overflow F + __pipe F + __poll F + __pread64 F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __ptsname_r_chk F + __pwrite64 F + __rawmemchr F + __rcmd_errstr D 0x4 + __read F + __read_chk F + __readlink_chk F + __realloc_hook D 0x4 + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __register_atfork F + __res_init F + __res_nclose F + __res_ninit F + __res_randomid F + __res_state F + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setmntent F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __signbit F + __signbitf F + __sigpause F + __sigsetjmp F + __sigsuspend F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __statfs F + __stpcpy F + __stpcpy_chk F + __stpcpy_small F + __stpncpy F + __stpncpy_chk F + __strcasecmp F + __strcasecmp_l F + __strcasestr F + __strcat_chk F + __strcoll_l F + __strcpy_chk F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strdup F + __strerror_r F + __strfmon_l F + __strftime_l F + __strncasecmp_l F + __strncat_chk F + __strncpy_chk F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_internal F + __strtod_l F + __strtof_internal F + __strtof_l F + __strtok_r F + __strtok_r_1c F + __strtol_internal F + __strtol_l F + __strtold_internal F + __strtold_l F + __strtoll_internal F + __strtoll_l F + __strtoul_internal F + __strtoul_l F + __strtoull_internal F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __swprintf_chk F + __sysconf F + __sysctl F + __syslog_chk F + __sysv_signal F + __timezone D 0x4 + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __ttyname_r_chk F + __tzname D 0x8 + __uflow F + __underflow F + __uselocale F + __vfork F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wait F + __waitpid F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscasecmp_l F + __wcscat_chk F + __wcscoll_l F + __wcscpy_chk F + __wcsftime_l F + __wcsncasecmp_l F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstod_internal F + __wcstod_l F + __wcstof_internal F + __wcstof_l F + __wcstol_internal F + __wcstol_l F + __wcstold_internal F + __wcstold_l F + __wcstoll_internal F + __wcstoll_l F + __wcstombs_chk F + __wcstoul_internal F + __wcstoul_l F + __wcstoull_internal F + __wcstoull_l F + __wcsxfrm_l F + __wctomb_chk F + __wctrans_l F + __wctype_l F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __woverflow F + __wprintf_chk F + __write F + __wuflow F + __wunderflow F + __xmknod F + __xmknodat F + __xpg_basename F + __xpg_sigpause F + __xpg_strerror_r F + __xstat F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _environ D 0x4 + _exit F + _flushlbf F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x200 + _res_hconf D 0x30 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x210 + _sys_nerr D 0x4 + _sys_siglist D 0x104 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + addseverity F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atof F + atoi F + atol F + atoll F + authdes_create F + authdes_getucred F + authdes_pk_create F + authnone_create F + authunix_create F + authunix_create_default F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + basename F + bcmp F + bcopy F + bdflush F + bind F + bind_textdomain_codeset F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + calloc F + callrpc F + canonicalize_file_name F + capget F + capset F + catclose F + catgets F + catopen F + cbc_crypt F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clntunix_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + creat64 F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + dcngettext F + delete_module F + des_setparity F + dgettext F + difftime F + dirfd F + dirname F + div F + dl_iterate_phdr F + dngettext F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + duplocale F + dysize F + eaccess F + ecb_crypt F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + endutxent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + epoll_create F + epoll_ctl F + epoll_wait F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + faccessat F + fattach F + fchdir F + fchflags F + fchmod F + fchmodat F + fchown F + fchownat F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdetach F + fdopen F + fdopendir F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + ffsl F + ffsll F + fgetc F + fgetc_unlocked F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpos64 F + fgetpwent F + fgetpwent_r F + fgets F + fgets_unlocked F + fgetspent F + fgetspent_r F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fgetxattr F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flistxattr F + flock F + flockfile F + fmemopen F + fmtmsg F + fnmatch F + fopen F + fopen64 F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread F + fread_unlocked F + free F + freeaddrinfo F + freeifaddrs F + freelocale F + fremovexattr F + freopen F + freopen64 F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fsetxattr F + fstatfs F + fstatfs64 F + fstatvfs F + fstatvfs64 F + fsync F + ftell F + ftello F + ftello64 F + ftime F + ftok F + ftruncate F + ftruncate64 F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + ftw64 F + funlockfile F + futimes F + futimesat F + fwide F + fwprintf F + fwrite F + fwrite_unlocked F + fwscanf F + gai_strerror F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcontext F + getcwd F + getdate F + getdate_err D 0x4 + getdate_r F + getdelim F + getdirentries F + getdirentries64 F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgrouplist F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getifaddrs F + getipv4sourcefilter F + getitimer F + getline F + getloadavg F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getmsg F + getnameinfo F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getnetname F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getpmsg F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpt F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrlimit64 F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getsourcefilter F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getw F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + getwd F + getxattr F + glob F + glob64 F + glob_pattern_p F + globfree F + globfree64 F + gmtime F + gmtime_r F + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + host2netname F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + inb F + index F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + inl F + innetgr F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + insque F + inw F + ioctl F + ioperm F + iopl F + iruserok F + iruserok_af F + isalnum F + isalnum_l F + isalpha F + isalpha_l F + isascii F + isastream F + isatty F + isblank F + isblank_l F + iscntrl F + iscntrl_l F + isctype F + isdigit F + isdigit_l F + isfdtype F + isgraph F + isgraph_l F + isinf F + isinff F + isinfl F + islower F + islower_l F + isnan F + isnanf F + isnanl F + isprint F + isprint_l F + ispunct F + ispunct_l F + isspace F + isspace_l F + isupper F + isupper_l F + iswalnum F + iswalnum_l F + iswalpha F + iswalpha_l F + iswblank F + iswblank_l F + iswcntrl F + iswcntrl_l F + iswctype F + iswctype_l F + iswdigit F + iswdigit_l F + iswgraph F + iswgraph_l F + iswlower F + iswlower_l F + iswprint F + iswprint_l F + iswpunct F + iswpunct_l F + iswspace F + iswspace_l F + iswupper F + iswupper_l F + iswxdigit F + iswxdigit_l F + isxdigit F + isxdigit_l F + jrand48 F + jrand48_r F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + kill F + killpg F + klogctl F + l64a F + labs F + lchmod F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + lgetxattr F + link F + linkat F + listen F + listxattr F + llabs F + lldiv F + llistxattr F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + lockf64 F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lremovexattr F + lsearch F + lseek F + lseek64 F + lsetxattr F + lutimes F + madvise F + makecontext F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcheck_check_all F + mcheck_pedantic F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + mempcpy F + memrchr F + memset F + mincore F + mkdir F + mkdirat F + mkdtemp F + mkfifo F + mkfifoat F + mkstemp F + mkstemp64 F + mktemp F + mktime F + mlock F + mlockall F + mmap F + mmap64 F + modf F + modff F + modfl F + moncontrol F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + netname2host F + netname2user F + newlocale F + nfsservctl F + nftw F + nftw64 F + ngettext F + nice F + nl_langinfo F + nl_langinfo_l F + nrand48 F + nrand48_r F + ntohl F + ntohs F + ntp_adjtime F + ntp_gettime F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open64 F + open_memstream F + open_wmemstream F + openat F + openat64 F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + outb F + outl F + outw F + parse_printf_format F + passwd2des F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pivot_root F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_openpt F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + ppoll F + prctl F + pread F + pread64 F + printf F + printf_size F + printf_size_info F + profil F + profil_counter F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + ptsname F + ptsname_r F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putgrent F + putmsg F + putpmsg F + putpwent F + puts F + putspent F + pututline F + pututxline F + putw F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pvalloc F + pwrite F + pwrite64 F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rawmemchr F + rcmd F + rcmd_af F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readahead F + readdir F + readdir64 F + readdir64_r F + readdir_r F + readlink F + readlinkat F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remap_file_pages F + remove F + removexattr F + remque F + rename F + renameat F + revoke F + rewind F + rewinddir F + rexec F + rexec_af F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + rresvport_af F + rtime F + ruserok F + ruserok_af F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scandir64 F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getaffinity F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setaffinity F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + semtimedop F + send F + sendfile F + sendfile64 F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setipv4sourcefilter F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrlimit64 F + setrpcent F + setservent F + setsid F + setsockopt F + setsourcefilter F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setutxent F + setvbuf F + setxattr F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + sighold F + sigignore F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigqueue F + sigrelse F + sigreturn F + sigset F + sigsetmask F + sigstack F + sigsuspend F + sigtimedwait F + sigvec F + sigwait F + sigwaitinfo F + sleep F + snprintf F + sockatmark F + socket F + socketpair F + sprintf F + sprofil F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + statfs64 F + statvfs F + statvfs64 F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcasecmp_l F + strcasestr F + strcat F + strchr F + strchrnul F + strcmp F + strcoll F + strcoll_l F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfmon_l F + strfry F + strftime F + strftime_l F + strlen F + strncasecmp F + strncasecmp_l F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strptime_l F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtod_l F + strtof F + strtof_l F + strtoimax F + strtok F + strtok_r F + strtol F + strtol_l F + strtold F + strtold_l F + strtoll F + strtoll_l F + strtoq F + strtoul F + strtoul_l F + strtoull F + strtoull_l F + strtoumax F + strtouq F + strverscmp F + strxfrm F + strxfrm_l F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreq_common F + svc_getreq_poll F + svc_getreqset F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + svcunix_create F + svcunixfd_create F + swab F + swapcontext F + swapoff F + swapon F + swprintf F + swscanf F + symlink F + symlinkat F + sync F + sys_errlist D 0x210 + sys_nerr D 0x4 + sys_sigabbrev D 0x104 + sys_siglist D 0x104 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + sysv_signal F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcgetsid F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + tdestroy F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x4 + tmpfile F + tmpfile64 F + tmpnam F + tmpnam_r F + toascii F + tolower F + tolower_l F + toupper F + toupper_l F + towctrans F + towctrans_l F + towlower F + towlower_l F + towupper F + towupper_l F + tr_break F + truncate F + truncate64 F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + umount2 F + uname F + ungetc F + ungetwc F + unlink F + unlinkat F + unlockpt F + unsetenv F + unshare F + updwtmp F + updwtmpx F + uselib F + uselocale F + user2netname F + usleep F + ustat F + utime F + utimes F + utmpname F + utmpxname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + versionsort F + versionsort64 F + vfork F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + vwprintf F + vwscanf F + wait F + wait3 F + wait4 F + waitid F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscasecmp F + wcscasecmp_l F + wcscat F + wcschr F + wcschrnul F + wcscmp F + wcscoll F + wcscoll_l F + wcscpy F + wcscspn F + wcsdup F + wcsftime F + wcsftime_l F + wcslen F + wcsncasecmp F + wcsncasecmp_l F + wcsncat F + wcsncmp F + wcsncpy F + wcsnlen F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstod_l F + wcstof F + wcstof_l F + wcstoimax F + wcstok F + wcstol F + wcstol_l F + wcstold F + wcstold_l F + wcstoll F + wcstoll_l F + wcstombs F + wcstoq F + wcstoul F + wcstoul_l F + wcstoull F + wcstoull_l F + wcstoumax F + wcstouq F + wcswcs F + wcswidth F + wcsxfrm F + wcsxfrm_l F + wctob F + wctomb F + wctrans F + wctrans_l F + wctype F + wctype_l F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmempcpy F + wmemset F + wordexp F + wordfree F + wprintf F + write F + writev F + wscanf F + xdecrypt F + xdr_accepted_reply F + xdr_array F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_getcredres F + xdr_hyper F + xdr_int F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_longlong_t F + xdr_netnamestr F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_quad_t F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_sizeof F + xdr_string F + xdr_u_char F + xdr_u_hyper F + xdr_u_int F + xdr_u_long F + xdr_u_longlong_t F + xdr_u_quad_t F + xdr_u_short F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_union F + xdr_unixcred F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __gnu_mcount_nc F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libcrypt.abilist new file mode 100644 index 0000000000..8c874edffe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.4 + GLIBC_2.4 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libdl.abilist new file mode 100644 index 0000000000..7f3ebed31d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libdl.abilist @@ -0,0 +1,11 @@ +GLIBC_2.4 + GLIBC_2.4 A + dladdr F + dladdr1 F + dlclose F + dlerror F + dlinfo F + dlmopen F + dlopen F + dlsym F + dlvsym F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libm.abilist new file mode 100644 index 0000000000..cee34728d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libm.abilist @@ -0,0 +1,370 @@ +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __asin_finite F + __asinf_finite F + __atan2_finite F + __atan2f_finite F + __atanh_finite F + __atanhf_finite F + __cosh_finite F + __coshf_finite F + __exp10_finite F + __exp10f_finite F + __exp2_finite F + __exp2f_finite F + __exp_finite F + __expf_finite F + __fmod_finite F + __fmodf_finite F + __gamma_r_finite F + __gammaf_r_finite F + __hypot_finite F + __hypotf_finite F + __j0_finite F + __j0f_finite F + __j1_finite F + __j1f_finite F + __jn_finite F + __jnf_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __log10_finite F + __log10f_finite F + __log2_finite F + __log2f_finite F + __log_finite F + __logf_finite F + __pow_finite F + __powf_finite F + __remainder_finite F + __remainderf_finite F + __scalb_finite F + __scalbf_finite F + __sinh_finite F + __sinhf_finite F + __sqrt_finite F + __sqrtf_finite F + __y0_finite F + __y0f_finite F + __y1_finite F + __y1f_finite F + __yn_finite F + __ynf_finite F +GLIBC_2.4 + GLIBC_2.4 A + _LIB_VERSION D 0x4 + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + cbrt F + cbrtf F + cbrtl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + ceil F + ceilf F + ceill F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + log2 F + log2f F + log2l F + logb F + logbf F + logbl F + logf F + logl F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + matherr F + modf F + modff F + modfl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nextafter F + nextafterf F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow F + pow10 F + pow10f F + pow10l F + powf F + powl F + remainder F + remainderf F + remainderl F + remquo F + remquof F + remquol F + rint F + rintf F + rintl F + round F + roundf F + roundl F + scalb F + scalbf F + scalbl F + scalbln F + scalblnf F + scalblnl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sincos F + sincosf F + sincosl F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libnsl.abilist new file mode 100644 index 0000000000..1d2670c444 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libnsl.abilist @@ -0,0 +1,123 @@ +GLIBC_2.4 + GLIBC_2.4 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + __yp_check F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_obj_p F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypall F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist new file mode 100644 index 0000000000..6c0bbde672 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist @@ -0,0 +1,229 @@ +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.4 + GLIBC_2.4 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __lseek F + __nanosleep F + __open F + __open64 F + __pread64 F + __pthread_cleanup_routine F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pthread_setspecific F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + __pwrite64 F + __read F + __res_state F + __send F + __sigaction F + __vfork F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + lseek64 F + msync F + nanosleep F + open F + open64 F + pause F + pread F + pread64 F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getaffinity_np F + pthread_attr_getdetachstate F + pthread_attr_getguardsize F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setaffinity_np F + pthread_attr_setdetachstate F + pthread_attr_setguardsize F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_getpshared F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_getclock F + pthread_condattr_getpshared F + pthread_condattr_init F + pthread_condattr_setclock F + pthread_condattr_setpshared F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getaffinity_np F + pthread_getattr_np F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_consistent_np F + pthread_mutex_destroy F + pthread_mutex_getprioceiling F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_setprioceiling F + pthread_mutex_timedlock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getpshared F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_gettype F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setpshared F + pthread_mutexattr_setrobust_np F + pthread_mutexattr_settype F + pthread_once F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_self F + pthread_setaffinity_np F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setconcurrency F + pthread_setschedparam F + pthread_setschedprio F + pthread_setspecific F + pthread_sigmask F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_testcancel F + pthread_timedjoin_np F + pthread_tryjoin_np F + pthread_yield F + pwrite F + pwrite64 F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libresolv.abilist new file mode 100644 index 0000000000..e781f2f822 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libresolv.abilist @@ -0,0 +1,95 @@ +GLIBC_2.4 + GLIBC_2.4 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_expand F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_rcode F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_hostalias F + __res_isourserver F + __res_mailok F + __res_mkquery F + __res_nameinquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_ownok F + __res_queriesmatch F + __res_query F + __res_querydomain F + __res_search F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/librt.abilist new file mode 100644 index 0000000000..466df4d93b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/librt.abilist @@ -0,0 +1,44 @@ +GLIBC_2.4 + GLIBC_2.4 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libthread_db.abilist new file mode 100644 index 0000000000..523772441b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libthread_db.abilist @@ -0,0 +1,42 @@ +GLIBC_2.4 + GLIBC_2.4 A + td_init F + td_log F + td_symbol_list F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tls_get_addr F + td_thr_tlsbase F + td_thr_tsd F + td_thr_validate F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libutil.abilist new file mode 100644 index 0000000000..6cb71966a1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.4 + GLIBC_2.4 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c new file mode 100644 index 0000000000..f3f0474dd7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c @@ -0,0 +1,132 @@ +/* low level locking for pthread library. Generic futex-using version. + Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sysdep.h> +#include <lowlevellock.h> +#include <sys/time.h> + +void +__lll_lock_wait_private (int *futex) +{ + do + { + int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); + if (oldval != 0) + lll_futex_wait (futex, 2, LLL_PRIVATE); + } + while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0); +} + + +/* These functions don't get included in libc.so */ +#ifdef IS_IN_libpthread +void +__lll_lock_wait (int *futex, int private) +{ + do + { + int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); + if (oldval != 0) + lll_futex_wait (futex, 2, private); + } + while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0); +} + + +int +__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private) +{ + struct timespec rt; + + /* Reject invalid timeouts. */ + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) + return EINVAL; + + /* Upgrade the lock. */ + if (atomic_exchange_acq (futex, 2) == 0) + return 0; + + do + { + struct timeval tv; + + /* Get the current time. */ + (void) __gettimeofday (&tv, NULL); + + /* Compute relative timeout. */ + rt.tv_sec = abstime->tv_sec - tv.tv_sec; + rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) + { + rt.tv_nsec += 1000000000; + --rt.tv_sec; + } + + /* Already timed out? */ + if (rt.tv_sec < 0) + return ETIMEDOUT; + + // XYZ: Lost the lock to check whether it was private. + lll_futex_timed_wait (futex, 2, &rt, private); + } + while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0); + + return 0; +} + + +int +__lll_timedwait_tid (int *tidp, const struct timespec *abstime) +{ + int tid; + + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) + return EINVAL; + + /* Repeat until thread terminated. */ + while ((tid = *tidp) != 0) + { + struct timeval tv; + struct timespec rt; + + /* Get the current time. */ + (void) __gettimeofday (&tv, NULL); + + /* Compute relative timeout. */ + rt.tv_sec = abstime->tv_sec - tv.tv_sec; + rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) + { + rt.tv_nsec += 1000000000; + --rt.tv_sec; + } + + /* Already timed out? */ + if (rt.tv_sec < 0) + return ETIMEDOUT; + + /* Wait until thread terminates. */ + // XYZ: Lost the lock to check whether it was private. + if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT) + return ETIMEDOUT; + } + + return 0; +} +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h new file mode 100644 index 0000000000..b9fa69ce37 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h @@ -0,0 +1,281 @@ +/* Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <atomic.h> +#include <sysdep.h> +#include <kernel-features.h> + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + + +#define lll_futex_wait(futexp, val, private) \ + lll_futex_timed_wait(futexp, val, NULL, private) + +#define lll_futex_timed_wait(futexp, val, timespec, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (val), (timespec)); \ + __ret; \ + }) + +#define lll_futex_wake(futexp, nr, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ + __ret; \ + }) + +#define lll_robust_dead(futexv, private) \ + do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + lll_futex_wake (__futexp, 1, private); \ + } \ + while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ + (nr_wake), (nr_move), (mutex), (val)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (nr_wake), (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + + +#define lll_trylock(lock) \ + atomic_compare_and_exchange_val_acq(&(lock), 1, 0) + +#define lll_cond_trylock(lock) \ + atomic_compare_and_exchange_val_acq(&(lock), 2, 0) + +#define __lll_robust_trylock(futex, id) \ + (atomic_compare_and_exchange_val_acq (futex, id, 0) != 0) +#define lll_robust_trylock(lock, id) \ + __lll_robust_trylock (&(lock), id) + +extern void __lll_lock_wait_private (int *futex) attribute_hidden; +extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + +#define __lll_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, \ + 1, 0), 0)) \ + { \ + if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \ + __lll_lock_wait_private (__futex); \ + else \ + __lll_lock_wait (__futex, private); \ + } \ + })) +#define lll_lock(futex, private) __lll_lock (&(futex), private) + + +#define __lll_robust_lock(futex, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_lock_wait (__futex, private); \ + __val; \ + }) +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + + +#define __lll_cond_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0)) \ + __lll_lock_wait (__futex, private); \ + })) +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + + +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private) + + +extern int __lll_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + +#define __lll_timedlock(futex, abstime, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0)) \ + __val = __lll_timedlock_wait (__futex, abstime, private); \ + __val; \ + }) +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + + +#define __lll_robust_timedlock(futex, abstime, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_timedlock_wait (__futex, abstime, private); \ + __val; \ + }) +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + + +#define __lll_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + + +#define __lll_robust_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + + +#define lll_islocked(futex) \ + (futex != 0) + + +/* Our internal lock implementation is identical to the binary-compatible + mutex implementation. */ + +/* Initializers for lock. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + +/* The states of a lock are: + 0 - untaken + 1 - taken by one user + >1 - taken by more users */ + +/* The kernel notifies a process which uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED);\ + } while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/nptl-aeabi_unwind_cpp_pr1.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/nptl-aeabi_unwind_cpp_pr1.c new file mode 100644 index 0000000000..7b83522437 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/nptl-aeabi_unwind_cpp_pr1.c @@ -0,0 +1 @@ +#include <aeabi_unwind_cpp_pr1.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S new file mode 100644 index 0000000000..b079df6e96 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S @@ -0,0 +1,41 @@ +/* Copyright (C) 2005, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tcb-offsets.h> + +/* Save the PID value. */ +#define SAVE_PID \ + str lr, [sp, #-4]!; /* Save LR. */ \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (lr, 0); \ + mov r0, #0xffff0fff; /* Point to the high page. */ \ + mov lr, pc; /* Save our return address. */ \ + sub pc, r0, #31; /* Jump to the TLS entry. */ \ + ldr lr, [sp], #4; /* Restore LR. */ \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (lr); \ + mov r2, r0; /* Save the TLS addr in r2. */ \ + ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \ + rsb r0, r3, #0; /* Negate it. */ \ + str r0, [r2, #PID_OFFSET] /* Store the temporary PID. */ + +/* Restore the old PID value in the parent. */ +#define RESTORE_PID \ + cmp r0, #0; /* If we are the parent... */ \ + strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */ + +#include "../vfork.S" diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c new file mode 100644 index 0000000000..0c03f1c816 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/pthread_once.c @@ -0,0 +1,89 @@ +/* Copyright (C) 2004-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "pthreadP.h" +#include <lowlevellock.h> + +unsigned long int __fork_generation attribute_hidden; + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); +} + +int +__pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) +{ + for (;;) + { + int oldval; + int newval; + + /* Pseudo code: + newval = __fork_generation | 1; + oldval = *once_control; + if ((oldval & 2) == 0) + *once_control = newval; + Do this atomically. + */ + do + { + newval = __fork_generation | 1; + oldval = *once_control; + if (oldval & 2) + break; + } while (atomic_compare_and_exchange_val_acq (once_control, newval, oldval) != oldval); + + /* Check if the initializer has already been done. */ + if ((oldval & 2) != 0) + return 0; + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) == 0) + break; + + /* Check whether the initializer execution was interrupted by a fork. */ + if (oldval != newval) + break; + + /* Same generation, some other thread was faster. Wait. */ + lll_futex_wait (once_control, oldval, LLL_PRIVATE); + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + /* Say that the initialisation is done. */ + *once_control = __fork_generation | 2; + + /* Wake up all other threads. */ + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); + + return 0; +} +weak_alias (__pthread_once, pthread_once) +hidden_def (__pthread_once) diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/rt-aeabi_unwind_cpp_pr1.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/rt-aeabi_unwind_cpp_pr1.c new file mode 100644 index 0000000000..7b83522437 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/rt-aeabi_unwind_cpp_pr1.c @@ -0,0 +1 @@ +#include <aeabi_unwind_cpp_pr1.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..c26bec3dca --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h @@ -0,0 +1,251 @@ +/* Copyright (C) 2003, 2004, 2005, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +/* NOTE: We do mark syscalls with unwind annotations, for the benefit of + cancellation; but they're really only accurate at the point of the + syscall. The ARM unwind directives are not rich enough without adding + a custom personality function. */ + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .section ".text"; \ + PSEUDO_PROLOGUE; \ + .type __##syscall_name##_nocancel,%function; \ + .globl __##syscall_name##_nocancel; \ + __##syscall_name##_nocancel: \ + .cfi_sections .debug_frame; \ + cfi_startproc; \ + DO_CALL (syscall_name, args); \ + cmn r0, $4096; \ + PSEUDO_RET; \ + cfi_endproc; \ + .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ + ENTRY (name); \ + SINGLE_THREAD_P; \ + DOARGS_##args; \ + bne .Lpseudo_cancel; \ + cfi_remember_state; \ + ldr r7, =SYS_ify (syscall_name); \ + swi 0x0; \ + UNDOARGS_##args; \ + cmn r0, $4096; \ + PSEUDO_RET; \ + cfi_restore_state; \ + .Lpseudo_cancel: \ + .fnstart; /* matched by the .fnend in UNDOARGS below. */ \ + DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \ + CENABLE; \ + mov ip, r0; /* put mask in safe place. */ \ + UNDOCARGS_##args; /* restore syscall args. */ \ + ldr r7, =SYS_ify (syscall_name); \ + swi 0x0; /* do the call. */ \ + mov r7, r0; /* save syscall return value. */ \ + mov r0, ip; /* get mask back. */ \ + CDISABLE; \ + mov r0, r7; /* retrieve return value. */ \ + RESTORE_LR_##args; \ + UNDOARGS_##args; \ + cmn r0, $4096 + +/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for + six arguments, and four bytes for fewer. In order to preserve doubleword + alignment, sometimes we must save an extra register. */ + +# define RESTART_UNWIND \ + .fnend; \ + .fnstart; \ + .save {r7}; \ + .save {lr} + +# define DOCARGS_0 \ + .save {r7}; \ + str lr, [sp, #-4]!; \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (lr, 0); \ + .save {lr} +# define UNDOCARGS_0 +# define RESTORE_LR_0 \ + ldr lr, [sp], #4; \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (lr) + +# define DOCARGS_1 \ + .save {r7}; \ + stmfd sp!, {r0, r1, lr}; \ + cfi_adjust_cfa_offset (12); \ + cfi_rel_offset (lr, 8); \ + .save {lr}; \ + .pad #8 +# define UNDOCARGS_1 \ + ldr r0, [sp], #8; \ + cfi_adjust_cfa_offset (-8); \ + RESTART_UNWIND +# define RESTORE_LR_1 \ + RESTORE_LR_0 + +# define DOCARGS_2 \ + .save {r7}; \ + stmfd sp!, {r0, r1, lr}; \ + cfi_adjust_cfa_offset (12); \ + cfi_rel_offset (lr, 8); \ + .save {lr}; \ + .pad #8 +# define UNDOCARGS_2 \ + ldmfd sp!, {r0, r1}; \ + cfi_adjust_cfa_offset (-8); \ + RESTART_UNWIND +# define RESTORE_LR_2 \ + RESTORE_LR_0 + +# define DOCARGS_3 \ + .save {r7}; \ + stmfd sp!, {r0, r1, r2, r3, lr}; \ + cfi_adjust_cfa_offset (20); \ + cfi_rel_offset (lr, 16); \ + .save {lr}; \ + .pad #16 +# define UNDOCARGS_3 \ + ldmfd sp!, {r0, r1, r2, r3}; \ + cfi_adjust_cfa_offset (-16); \ + RESTART_UNWIND +# define RESTORE_LR_3 \ + RESTORE_LR_0 + +# define DOCARGS_4 \ + .save {r7}; \ + stmfd sp!, {r0, r1, r2, r3, lr}; \ + cfi_adjust_cfa_offset (20); \ + cfi_rel_offset (lr, 16); \ + .save {lr}; \ + .pad #16 +# define UNDOCARGS_4 \ + ldmfd sp!, {r0, r1, r2, r3}; \ + cfi_adjust_cfa_offset (-16); \ + RESTART_UNWIND +# define RESTORE_LR_4 \ + RESTORE_LR_0 + +/* r4 is only stmfd'ed for correct stack alignment. */ +# define DOCARGS_5 \ + .save {r4, r7}; \ + stmfd sp!, {r0, r1, r2, r3, r4, lr}; \ + cfi_adjust_cfa_offset (24); \ + cfi_rel_offset (lr, 20); \ + .save {lr}; \ + .pad #20 +# define UNDOCARGS_5 \ + ldmfd sp!, {r0, r1, r2, r3}; \ + cfi_adjust_cfa_offset (-16); \ + .fnend; \ + .fnstart; \ + .save {r4, r7}; \ + .save {lr}; \ + .pad #4 +# define RESTORE_LR_5 \ + ldmfd sp!, {r4, lr}; \ + cfi_adjust_cfa_offset (-8); \ + /* r4 will be marked as restored later. */ \ + cfi_restore (lr) + +# define DOCARGS_6 \ + .save {r4, r5, r7}; \ + stmfd sp!, {r0, r1, r2, r3, lr}; \ + cfi_adjust_cfa_offset (20); \ + cfi_rel_offset (lr, 16); \ + .save {lr}; \ + .pad #16 +# define UNDOCARGS_6 \ + ldmfd sp!, {r0, r1, r2, r3}; \ + cfi_adjust_cfa_offset (-16); \ + .fnend; \ + .fnstart; \ + .save {r4, r5, r7}; \ + .save {lr}; +# define RESTORE_LR_6 \ + RESTORE_LR_0 + +# ifdef IS_IN_libpthread +# define CENABLE bl PLTJMP(__pthread_enable_asynccancel) +# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel) +# define __local_multiple_threads __pthread_multiple_threads +# elif !defined NOT_IN_libc +# define CENABLE bl PLTJMP(__libc_enable_asynccancel) +# define CDISABLE bl PLTJMP(__libc_disable_asynccancel) +# define __local_multiple_threads __libc_multiple_threads +# elif defined IS_IN_librt +# define CENABLE bl PLTJMP(__librt_enable_asynccancel) +# define CDISABLE bl PLTJMP(__librt_disable_asynccancel) +# else +# error Unsupported library +# endif + +# if defined IS_IN_libpthread || !defined NOT_IN_libc +# ifndef __ASSEMBLER__ +extern int __local_multiple_threads attribute_hidden; +# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) +# else +# define SINGLE_THREAD_P \ + ldr ip, 1b; \ +2: \ + ldr ip, [pc, ip]; \ + teq ip, #0; +# define PSEUDO_PROLOGUE \ + 1: .word __local_multiple_threads - 2f - 8; +# endif +# else +/* There is no __local_multiple_threads for librt, so use the TCB. */ +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +# else +# define PSEUDO_PROLOGUE +# define SINGLE_THREAD_P \ + stmfd sp!, {r0, lr}; \ + cfi_adjust_cfa_offset (8); \ + cfi_rel_offset (lr, 4); \ + bl __aeabi_read_tp; \ + ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \ + ldmfd sp!, {r0, lr}; \ + cfi_adjust_cfa_offset (-8); \ + cfi_restore (lr); \ + teq ip, #0 +# define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P +# endif +# endif + +#elif !defined __ASSEMBLER__ + +/* For rtld, et cetera. */ +# define SINGLE_THREAD_P 1 +# define NO_CANCELLATION 1 + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c new file mode 100644 index 0000000000..29e2c2b00b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c @@ -0,0 +1,158 @@ +/* Copyright (C) 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <dlfcn.h> +#include <stdio.h> +#include <unwind.h> +#include <pthreadP.h> + +static void *libgcc_s_handle; +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); +static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); +static _Unwind_Reason_Code (*libgcc_s_forcedunwind) + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); +static _Unwind_Word (*libgcc_s_getcfa) (struct _Unwind_Context *); + +void +__attribute_noinline__ +pthread_cancel_init (void) +{ + void *resume, *personality, *forcedunwind, *getcfa; + void *handle; + + if (__builtin_expect (libgcc_s_handle != NULL, 1)) + { + /* Force gcc to reload all values. */ + asm volatile ("" ::: "memory"); + return; + } + + handle = __libc_dlopen ("libgcc_s.so.1"); + + if (handle == NULL + || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL + || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL + || (forcedunwind = __libc_dlsym (handle, "_Unwind_ForcedUnwind")) + == NULL + || (getcfa = __libc_dlsym (handle, "_Unwind_GetCFA")) == NULL +#ifdef ARCH_CANCEL_INIT + || ARCH_CANCEL_INIT (handle) +#endif + ) + __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n"); + + libgcc_s_resume = resume; + libgcc_s_personality = personality; + libgcc_s_forcedunwind = forcedunwind; + libgcc_s_getcfa = getcfa; + /* Make sure libgcc_s_getcfa is written last. Otherwise, + pthread_cancel_init might return early even when the pointer the + caller is interested in is not initialized yet. */ + atomic_write_barrier (); + libgcc_s_handle = handle; +} + +void +__libc_freeres_fn_section +__unwind_freeres (void) +{ + void *handle = libgcc_s_handle; + if (handle != NULL) + { + libgcc_s_handle = NULL; + __libc_dlclose (handle); + } +} + +/* It's vitally important that _Unwind_Resume not have a stack frame; the + ARM unwinder relies on register state at entrance. So we write this in + assembly. */ + +asm ( +" .globl _Unwind_Resume\n" +" .type _Unwind_Resume, %function\n" +"_Unwind_Resume:\n" +" .cfi_sections .debug_frame\n" +" " CFI_STARTPROC "\n" +" stmfd sp!, {r4, r5, r6, lr}\n" +" " CFI_ADJUST_CFA_OFFSET (16)" \n" +" " CFI_REL_OFFSET (r4, 0) "\n" +" " CFI_REL_OFFSET (r5, 4) "\n" +" " CFI_REL_OFFSET (r6, 8) "\n" +" " CFI_REL_OFFSET (lr, 12) "\n" +" " CFI_REMEMBER_STATE "\n" +" ldr r4, 1f\n" +" ldr r5, 2f\n" +"3: add r4, pc, r4\n" +" ldr r3, [r4, r5]\n" +" mov r6, r0\n" +" cmp r3, #0\n" +" beq 4f\n" +"5: mov r0, r6\n" +" ldmfd sp!, {r4, r5, r6, lr}\n" +" " CFI_ADJUST_CFA_OFFSET (-16) "\n" +" " CFI_RESTORE (r4) "\n" +" " CFI_RESTORE (r5) "\n" +" " CFI_RESTORE (r6) "\n" +" " CFI_RESTORE (lr) "\n" +" bx r3\n" +" " CFI_RESTORE_STATE "\n" +"4: bl pthread_cancel_init\n" +" ldr r3, [r4, r5]\n" +" b 5b\n" +" " CFI_ENDPROC "\n" +" .align 2\n" +#ifdef __thumb2__ +"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n" +#else +"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n" +#endif +"2: .word libgcc_s_resume(GOTOFF)\n" +" .size _Unwind_Resume, .-_Unwind_Resume\n" +); + +_Unwind_Reason_Code +__gcc_personality_v0 (_Unwind_State state, + struct _Unwind_Exception *ue_header, + struct _Unwind_Context *context) +{ + if (__builtin_expect (libgcc_s_personality == NULL, 0)) + pthread_cancel_init (); + + return libgcc_s_personality (state, ue_header, context); +} + +_Unwind_Reason_Code +_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, + void *stop_argument) +{ + if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0)) + pthread_cancel_init (); + + return libgcc_s_forcedunwind (exc, stop, stop_argument); +} + +_Unwind_Word +_Unwind_GetCFA (struct _Unwind_Context *context) +{ + if (__builtin_expect (libgcc_s_getcfa == NULL, 0)) + pthread_cancel_init (); + + return libgcc_s_getcfa (context); +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c new file mode 100644 index 0000000000..285b99b5ed --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c @@ -0,0 +1,101 @@ +/* Copyright (C) 2003, 2005, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <dlfcn.h> +#include <stdio.h> +#include <unwind.h> + +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); +static _Unwind_Reason_Code (*libgcc_s_personality) + (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); + +static void init (void) __attribute_used__; + +static void +init (void) +{ + void *resume, *personality; + void *handle; + + handle = __libc_dlopen ("libgcc_s.so.1"); + + if (handle == NULL + || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL + || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL) + __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n"); + + libgcc_s_resume = resume; + libgcc_s_personality = personality; +} + +/* It's vitally important that _Unwind_Resume not have a stack frame; the + ARM unwinder relies on register state at entrance. So we write this in + assembly. */ + +asm ( +" .globl _Unwind_Resume\n" +" .type _Unwind_Resume, %function\n" +"_Unwind_Resume:\n" +" .cfi_sections .debug_frame\n" +" " CFI_STARTPROC "\n" +" stmfd sp!, {r4, r5, r6, lr}\n" +" " CFI_ADJUST_CFA_OFFSET (16)" \n" +" " CFI_REL_OFFSET (r4, 0) "\n" +" " CFI_REL_OFFSET (r5, 4) "\n" +" " CFI_REL_OFFSET (r6, 8) "\n" +" " CFI_REL_OFFSET (lr, 12) "\n" +" " CFI_REMEMBER_STATE "\n" +" ldr r4, 1f\n" +" ldr r5, 2f\n" +"3: add r4, pc, r4\n" +" ldr r3, [r4, r5]\n" +" mov r6, r0\n" +" cmp r3, #0\n" +" beq 4f\n" +"5: mov r0, r6\n" +" ldmfd sp!, {r4, r5, r6, lr}\n" +" " CFI_ADJUST_CFA_OFFSET (-16) "\n" +" " CFI_RESTORE (r4) "\n" +" " CFI_RESTORE (r5) "\n" +" " CFI_RESTORE (r6) "\n" +" " CFI_RESTORE (lr) "\n" +" bx r3\n" +" " CFI_RESTORE_STATE "\n" +"4: bl init\n" +" ldr r3, [r4, r5]\n" +" b 5b\n" +" " CFI_ENDPROC "\n" +" .align 2\n" +#ifdef __thumb2__ +"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n" +#else +"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n" +#endif +"2: .word libgcc_s_resume(GOTOFF)\n" +" .size _Unwind_Resume, .-_Unwind_Resume\n" +); + +_Unwind_Reason_Code +__gcc_personality_v0 (_Unwind_State state, + struct _Unwind_Exception *ue_header, + struct _Unwind_Context *context) +{ + if (__builtin_expect (libgcc_s_personality == NULL, 0)) + init (); + return libgcc_s_personality (state, ue_header, context); +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind.h new file mode 100644 index 0000000000..9b6bed8e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind.h @@ -0,0 +1,278 @@ +/* Header file for the ARM EABI unwinder + Copyright (C) 2003, 2004, 2005, 2009 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Language-independent unwinder header public defines. This contains both + ABI defined objects, and GNU support routines. */ + +#ifndef UNWIND_ARM_H +#define UNWIND_ARM_H + +#define __ARM_EABI_UNWINDER__ 1 + +#ifdef __cplusplus +extern "C" { +#endif + typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); + typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); + typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); + typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); + typedef _Unwind_Word _uw; + typedef unsigned _uw64 __attribute__((mode(__DI__))); + typedef unsigned _uw16 __attribute__((mode(__HI__))); + typedef unsigned _uw8 __attribute__((mode(__QI__))); + + typedef enum + { + _URC_OK = 0, /* operation completed successfully */ + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8, + _URC_FAILURE = 9 /* unspecified failure of some kind */ + } + _Unwind_Reason_Code; + + typedef enum + { + _US_VIRTUAL_UNWIND_FRAME = 0, + _US_UNWIND_FRAME_STARTING = 1, + _US_UNWIND_FRAME_RESUME = 2, + _US_ACTION_MASK = 3, + _US_FORCE_UNWIND = 8, + _US_END_OF_STACK = 16 + } + _Unwind_State; + + /* Provided only for for compatibility with existing code. */ + typedef int _Unwind_Action; +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 +#define _URC_NO_REASON _URC_OK + + typedef struct _Unwind_Control_Block _Unwind_Control_Block; + typedef struct _Unwind_Context _Unwind_Context; + typedef _uw _Unwind_EHT_Header; + + + /* UCB: */ + + struct _Unwind_Control_Block + { +#ifdef _LIBC + /* For the benefit of code which assumes this is a scalar. All + glibc ever does is clear it. */ + _uw64 exception_class; +#else + char exception_class[8]; +#endif + void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); + /* Unwinder cache, private fields for the unwinder's use */ + struct + { + _uw reserved1; /* Forced unwind stop fn, 0 if not forced */ + _uw reserved2; /* Personality routine address */ + _uw reserved3; /* Saved callsite address */ + _uw reserved4; /* Forced unwind stop arg */ + _uw reserved5; + } + unwinder_cache; + /* Propagation barrier cache (valid after phase 1): */ + struct + { + _uw sp; + _uw bitpattern[5]; + } + barrier_cache; + /* Cleanup cache (preserved over cleanup): */ + struct + { + _uw bitpattern[4]; + } + cleanup_cache; + /* Pr cache (for pr's benefit): */ + struct + { + _uw fnstart; /* function start address */ + _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */ + _uw additional; /* additional data */ + _uw reserved1; + } + pr_cache; + long long int :0; /* Force alignment to 8-byte boundary */ + }; + + /* Virtual Register Set*/ + + typedef enum + { + _UVRSC_CORE = 0, /* integer register */ + _UVRSC_VFP = 1, /* vfp */ + _UVRSC_FPA = 2, /* fpa */ + _UVRSC_WMMXD = 3, /* Intel WMMX data register */ + _UVRSC_WMMXC = 4 /* Intel WMMX control register */ + } + _Unwind_VRS_RegClass; + + typedef enum + { + _UVRSD_UINT32 = 0, + _UVRSD_VFPX = 1, + _UVRSD_FPAX = 2, + _UVRSD_UINT64 = 3, + _UVRSD_FLOAT = 4, + _UVRSD_DOUBLE = 5 + } + _Unwind_VRS_DataRepresentation; + + typedef enum + { + _UVRSR_OK = 0, + _UVRSR_NOT_IMPLEMENTED = 1, + _UVRSR_FAILED = 2 + } + _Unwind_VRS_Result; + + /* Frame unwinding state. */ + typedef struct + { + /* The current word (bytes packed msb first). */ + _uw data; + /* Pointer to the next word of data. */ + _uw *next; + /* The number of bytes left in this word. */ + _uw8 bytes_left; + /* The number of words pointed to by ptr. */ + _uw8 words_left; + } + __gnu_unwind_state; + + typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State, + _Unwind_Control_Block *, _Unwind_Context *); + + _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation, + void *); + + _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation, + void *); + + _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation); + + + /* Support functions for the PR. */ +#define _Unwind_Exception _Unwind_Control_Block + typedef char _Unwind_Exception_Class[8]; + + void * _Unwind_GetLanguageSpecificData (_Unwind_Context *); + _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *); + + /* These two should never be used. */ + _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *); + _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *); + + /* Interface functions: */ + _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp); + void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp); + _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp); + + typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + _Unwind_Control_Block *, struct _Unwind_Context *, void *); + _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *, + _Unwind_Stop_Fn, void *); + _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); + void _Unwind_Complete(_Unwind_Control_Block *ucbp); + void _Unwind_DeleteException (_Unwind_Exception *); + + _Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *, + _Unwind_Context *); + _Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *, + __gnu_unwind_state *); + + /* Decode an R_ARM_TARGET2 relocation. */ + static inline _Unwind_Word + _Unwind_decode_target2 (_Unwind_Word ptr) + { + _Unwind_Word tmp; + + tmp = *(_Unwind_Word *) ptr; + /* Zero values are always NULL. */ + if (!tmp) + return 0; + +#if defined(linux) || defined(__NetBSD__) + /* Pc-relative indirect. */ + tmp += ptr; + tmp = *(_Unwind_Word *) tmp; +#elif defined(__symbian__) + /* Absolute pointer. Nothing more to do. */ +#else + /* Pc-relative pointer. */ + tmp += ptr; +#endif + return tmp; + } + + static inline _Unwind_Word + _Unwind_GetGR (_Unwind_Context *context, int regno) + { + _uw val; + _Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); + return val; + } + + /* Return the address of the instruction, not the actual IP value. */ +#define _Unwind_GetIP(context) \ + (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1) + + static inline void + _Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val) + { + _Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); + } + + /* The dwarf unwinder doesn't understand arm/thumb state. We assume the + landing pad uses the same instruction set as the call site. */ +#define _Unwind_SetIP(context, val) \ + _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1)) + +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) + (struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* defined UNWIND_ARM_H */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S new file mode 100644 index 0000000000..235380198b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S @@ -0,0 +1,42 @@ +/* Copyright (C) 2005, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tcb-offsets.h> + +/* Save the PID value. */ +#define SAVE_PID \ + str lr, [sp, #-4]!; /* Save LR. */ \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (lr, 0); \ + mov r0, #0xffff0fff; /* Point to the high page. */ \ + mov lr, pc; /* Save our return address. */ \ + sub pc, r0, #31; /* Jump to the TLS entry. */ \ + ldr lr, [sp], #4; /* Restore LR. */ \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (lr); \ + mov r2, r0; /* Save the TLS addr in r2. */ \ + ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \ + rsbs r0, r3, #0; /* Negate it. */ \ + moveq r0, #0x80000000; /* Use 0x80000000 if it was 0. */ \ + str r0, [r2, #PID_OFFSET] /* Store the temporary PID. */ + +/* Restore the old PID value in the parent. */ +#define RESTORE_PID \ + cmp r0, #0; /* If we are the parent... */ \ + strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */ + +#include "../vfork.S" diff --git a/ports/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c b/ports/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c new file mode 100644 index 0000000000..6e25b021ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/oldgetrlimit.c @@ -0,0 +1 @@ +/* Empty. */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c b/ports/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c new file mode 100644 index 0000000000..4c27e957bf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c b/ports/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c new file mode 100644 index 0000000000..6e25b021ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/oldsetrlimit.c @@ -0,0 +1 @@ +/* Empty. */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/posix_fadvise.c b/ports/sysdeps/unix/sysv/linux/arm/posix_fadvise.c new file mode 100644 index 0000000000..7412600ddc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/posix_fadvise.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <fcntl.h> + +int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +posix_fadvise (int fd, off_t offset, off_t len, int advise) +{ + /* ARM only has a syscall for fadvise64_64. */ + return __posix_fadvise64_l64 (fd, offset, len, advise); +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/posix_fadvise64.c b/ports/sysdeps/unix/sysv/linux/arm/posix_fadvise64.c new file mode 100644 index 0000000000..75b06abf2e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/posix_fadvise64.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + +int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); +int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) +{ + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise, + __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset), + __LONG_LONG_PAIR ((long)(len >> 32), (long)len)); + if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) + return 0; + return INTERNAL_SYSCALL_ERRNO (ret, err); +} + +#include <shlib-compat.h> + +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) + +int +attribute_compat_text_section +__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise) +{ + return __posix_fadvise64_l64 (fd, offset, len, advise); +} + +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); +#else +strong_alias (__posix_fadvise64_l64, posix_fadvise64); +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/pread.c b/ports/sysdeps/unix/sysv/linux/arm/pread.c new file mode 100644 index 0000000000..4efe349e93 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/pread.c @@ -0,0 +1,60 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2005 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +ssize_t +__libc_pread (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); + + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pread, __pread) +weak_alias (__libc_pread, pread) diff --git a/ports/sysdeps/unix/sysv/linux/arm/pread64.c b/ports/sysdeps/unix/sysv/linux/arm/pread64.c new file mode 100644 index 0000000000..59bd9cfe0b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/pread64.c @@ -0,0 +1,62 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2005 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +ssize_t +__libc_pread64 (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off64_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); + + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pread64, __pread64) +weak_alias (__libc_pread64, pread64) diff --git a/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h b/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h new file mode 100644 index 0000000000..f305674379 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h @@ -0,0 +1,31 @@ +/* Low-level statistical profiling support function. Linux/ARM version. + Copyright (C) 1996-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <signal.h> +#include <sigcontextinfo.h> + +void +profil_counter (int signo, const SIGCONTEXT scp) +{ + profil_count ((void *) GET_PC (scp)); + + /* This is a hack to prevent the compiler from implementing the + above function call as a sibcall. The sibcall would overwrite + the signal context. */ + asm volatile (""); +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/pwrite.c b/ports/sysdeps/unix/sysv/linux/arm/pwrite.c new file mode 100644 index 0000000000..43788e5420 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/pwrite.c @@ -0,0 +1,60 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2005 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +ssize_t +__libc_pwrite (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); + + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pwrite, __pwrite) +weak_alias (__libc_pwrite, pwrite) diff --git a/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c b/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c new file mode 100644 index 0000000000..c7bfdaf9f3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c @@ -0,0 +1,63 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2005 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +ssize_t +__libc_pwrite64 (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off64_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); + + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* In the ARM EABI, 64-bit values are aligned to even/odd register + pairs for syscalls. */ + result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pwrite64, __pwrite64) +libc_hidden_weak (__pwrite64) +weak_alias (__libc_pwrite64, pwrite64) diff --git a/ports/sysdeps/unix/sysv/linux/arm/readahead.c b/ports/sysdeps/unix/sysv/linux/arm/readahead.c new file mode 100644 index 0000000000..647a3d7aff --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/readahead.c @@ -0,0 +1,37 @@ +/* Provide kernel hint to read ahead. + Copyright (C) 2002-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sys/types.h> +#include <endian.h> + +#include <sysdep.h> +#include <sys/syscall.h> + + +ssize_t +__readahead (int fd, off64_t offset, size_t count) +{ + return INLINE_SYSCALL (readahead, 5, fd, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff)), + count); +} + +weak_alias (__readahead, readahead) diff --git a/ports/sysdeps/unix/sysv/linux/arm/readdir64.c b/ports/sysdeps/unix/sysv/linux/arm/readdir64.c new file mode 100644 index 0000000000..2ea26dd409 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/readdir64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/readdir64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/readdir64_r.c b/ports/sysdeps/unix/sysv/linux/arm/readdir64_r.c new file mode 100644 index 0000000000..9f54f897e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/readdir64_r.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/register-dump.h b/ports/sysdeps/unix/sysv/linux/arm/register-dump.h new file mode 100644 index 0000000000..3d72b84228 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/register-dump.h @@ -0,0 +1,136 @@ +/* Dump registers. + Copyright (C) 1998-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Philip Blundell <pb@nexus.co.uk>, 1998. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <_itoa.h> +#include <sys/ucontext.h> + +/* We will print the register dump in this format: + + R0: XXXXXXXX R1: XXXXXXXX R2: XXXXXXXX R3: XXXXXXXX + R4: XXXXXXXX R5: XXXXXXXX R6: XXXXXXXX R7: XXXXXXXX + R8: XXXXXXXX R9: XXXXXXXX SL: XXXXXXXX FP: XXXXXXXX + IP: XXXXXXXX SP: XXXXXXXX LR: XXXXXXXX PC: XXXXXXXX + + CPSR: XXXXXXXX + + Trap: XXXXXXXX Error: XXXXXXXX OldMask: XXXXXXXX + Addr: XXXXXXXX + + */ + +static void +hexvalue (unsigned long int value, char *buf, size_t len) +{ + char *cp = _itoa_word (value, buf + len, 16, 0); + while (cp > buf) + *--cp = '0'; +} + +static void +register_dump (int fd, const struct ucontext *ctx) +{ + char regs[21][8]; + struct iovec iov[97]; + size_t nr = 0; + +#define ADD_STRING(str) \ + iov[nr].iov_base = (char *) str; \ + iov[nr].iov_len = strlen (str); \ + ++nr +#define ADD_MEM(str, len) \ + iov[nr].iov_base = str; \ + iov[nr].iov_len = len; \ + ++nr + + /* Generate strings of register contents. */ + hexvalue (ctx->uc_mcontext.arm_r0, regs[0], 8); + hexvalue (ctx->uc_mcontext.arm_r1, regs[1], 8); + hexvalue (ctx->uc_mcontext.arm_r2, regs[2], 8); + hexvalue (ctx->uc_mcontext.arm_r3, regs[3], 8); + hexvalue (ctx->uc_mcontext.arm_r4, regs[4], 8); + hexvalue (ctx->uc_mcontext.arm_r5, regs[5], 8); + hexvalue (ctx->uc_mcontext.arm_r6, regs[6], 8); + hexvalue (ctx->uc_mcontext.arm_r7, regs[7], 8); + hexvalue (ctx->uc_mcontext.arm_r8, regs[8], 8); + hexvalue (ctx->uc_mcontext.arm_r9, regs[9], 8); + hexvalue (ctx->uc_mcontext.arm_r10, regs[10], 8); + hexvalue (ctx->uc_mcontext.arm_fp, regs[11], 8); + hexvalue (ctx->uc_mcontext.arm_ip, regs[12], 8); + hexvalue (ctx->uc_mcontext.arm_sp, regs[13], 8); + hexvalue (ctx->uc_mcontext.arm_lr, regs[14], 8); + hexvalue (ctx->uc_mcontext.arm_pc, regs[15], 8); + hexvalue (ctx->uc_mcontext.arm_cpsr, regs[16], 8); + hexvalue (ctx->uc_mcontext.trap_no, regs[17], 8); + hexvalue (ctx->uc_mcontext.error_code, regs[18], 8); + hexvalue (ctx->uc_mcontext.oldmask, regs[19], 8); + hexvalue (ctx->uc_mcontext.fault_address, regs[20], 8); + + /* Generate the output. */ + ADD_STRING ("Register dump:\n\n R0: "); + ADD_MEM (regs[0], 8); + ADD_STRING (" R1: "); + ADD_MEM (regs[1], 8); + ADD_STRING (" R2: "); + ADD_MEM (regs[2], 8); + ADD_STRING (" R3: "); + ADD_MEM (regs[3], 8); + ADD_STRING ("\n R4: "); + ADD_MEM (regs[4], 8); + ADD_STRING (" R5: "); + ADD_MEM (regs[5], 8); + ADD_STRING (" R6: "); + ADD_MEM (regs[6], 8); + ADD_STRING (" R7: "); + ADD_MEM (regs[7], 8); + ADD_STRING ("\n R8: "); + ADD_MEM (regs[8], 8); + ADD_STRING (" R9: "); + ADD_MEM (regs[9], 8); + ADD_STRING (" SL: "); + ADD_MEM (regs[10], 8); + ADD_STRING (" FP: "); + ADD_MEM (regs[11], 8); + ADD_STRING ("\n IP: "); + ADD_MEM (regs[12], 8); + ADD_STRING (" SP: "); + ADD_MEM (regs[13], 8); + ADD_STRING (" LR: "); + ADD_MEM (regs[14], 8); + ADD_STRING (" PC: "); + ADD_MEM (regs[15], 8); + ADD_STRING ("\n\n CPSR: "); + ADD_MEM (regs[16], 8); + ADD_STRING ("\n\n Trap: "); + ADD_MEM (regs[17], 8); + ADD_STRING (" Error: "); + ADD_MEM (regs[18], 8); + ADD_STRING (" OldMask: "); + ADD_MEM (regs[19], 8); + ADD_STRING ("\n Addr: "); + ADD_MEM (regs[20], 8); + + ADD_STRING ("\n"); + + /* Write the stuff out. */ + writev (fd, iov, nr); +} + + +#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/ports/sysdeps/unix/sysv/linux/arm/scandir64.c b/ports/sysdeps/unix/sysv/linux/arm/scandir64.c new file mode 100644 index 0000000000..506fd8877c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/scandir64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/scandir64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/semctl.c b/ports/sysdeps/unix/sysv/linux/arm/semctl.c new file mode 100644 index 0000000000..145162909c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/semctl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/alpha/semctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S new file mode 100644 index 0000000000..d163fc4a4c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S @@ -0,0 +1,101 @@ +/* Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <rtld-global-offsets.h> + +#include "ucontext_i.h" + + .syntax unified + .text + +/* int setcontext (const ucontext_t *ucp) */ + +ENTRY(__setcontext) + mov r4, r0 + add r0, r0, #UCONTEXT_REGSPACE + + /* Restore the VFP registers. Copied from arm/__longjmp.S. */ +#ifdef PIC + ldr r2, 1f + ldr r1, Lrtld_global_ro +0: add r2, pc, r2 + ldr r2, [r2, r1] + ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] +#else + ldr r2, Lhwcap + ldr r2, [r2, #0] +#endif + + tst r2, #HWCAP_ARM_VFP + beq Lno_vfp_sc + + /* Following instruction is vldmia r0!, {d8-d15}. */ + ldc p11, cr8, [r0], #64 + /* Restore the floating-point status register. */ + ldr r1, [r0], #4 + /* Following instruction is fmxr fpscr, r1. */ + mcr p10, 7, r1, cr1, cr0, 0 +Lno_vfp_sc: + tst r2, #HWCAP_ARM_IWMMXT + beq Lno_iwmmxt_sc + + /* Restore the call-preserved iWMMXt registers. */ + /* Following instructions are wldrd wr10, [r0], #8 (etc.) */ + ldcl p1, cr10, [r0], #8 + ldcl p1, cr11, [r0], #8 + ldcl p1, cr12, [r0], #8 + ldcl p1, cr13, [r0], #8 + ldcl p1, cr14, [r0], #8 + ldcl p1, cr15, [r0], #8 +Lno_iwmmxt_sc: + + /* Now bring back the signal status. */ + mov r0, #SIG_SETMASK + add r1, r4, #UCONTEXT_SIGMASK + mov r2, #0 + bl PLTJMP(__sigprocmask) + + /* Loading r0-r3 makes makecontext easier. */ + add r14, r4, #MCONTEXT_ARM_R0 + ldmia r14, {r0-r12} + ldr r13, [r14, #(MCONTEXT_ARM_SP - MCONTEXT_ARM_R0)] + add r14, r14, #(MCONTEXT_ARM_LR - MCONTEXT_ARM_R0) + ldmia r14, {r14, pc} + +END(setcontext) +weak_alias(__setcontext, setcontext) + + /* Called when a makecontext() context returns. Start the + context in R4 or fall through to exit(). */ +ENTRY(__startcontext) + movs r0, r4 + bne PLTJMP(__setcontext) + + @ New context was 0 - exit + b PLTJMP(HIDDEN_JUMPTARGET(_exit)) +END(__startcontext) + +#ifdef PIC +1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8 +Lrtld_global_ro: + .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) +#else +Lhwcap: + .long C_SYMBOL_NAME(_dl_hwcap) +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/arm/setegid.c b/ports/sysdeps/unix/sysv/linux/arm/setegid.c new file mode 100644 index 0000000000..2e3a54c893 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setegid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/seteuid.c b/ports/sysdeps/unix/sysv/linux/arm/seteuid.c new file mode 100644 index 0000000000..18e41d08c1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/seteuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/seteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setfsgid.c b/ports/sysdeps/unix/sysv/linux/arm/setfsgid.c new file mode 100644 index 0000000000..0886712569 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setfsgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setfsgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setfsuid.c b/ports/sysdeps/unix/sysv/linux/arm/setfsuid.c new file mode 100644 index 0000000000..a9f22eb8ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setfsuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setfsuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setgid.c b/ports/sysdeps/unix/sysv/linux/arm/setgid.c new file mode 100644 index 0000000000..377021d9ec --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setgroups.c b/ports/sysdeps/unix/sysv/linux/arm/setgroups.c new file mode 100644 index 0000000000..0e7086278f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setgroups.c @@ -0,0 +1,2 @@ +/* We also have to rewrite the kernel gid_t to the user land type. */ +#include <sysdeps/unix/sysv/linux/i386/setgroups.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setregid.c b/ports/sysdeps/unix/sysv/linux/arm/setregid.c new file mode 100644 index 0000000000..99c57ad20f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setregid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setregid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setresgid.c b/ports/sysdeps/unix/sysv/linux/arm/setresgid.c new file mode 100644 index 0000000000..daca1a4833 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setresgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setresuid.c b/ports/sysdeps/unix/sysv/linux/arm/setresuid.c new file mode 100644 index 0000000000..3aeabe9ad7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setresuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setreuid.c b/ports/sysdeps/unix/sysv/linux/arm/setreuid.c new file mode 100644 index 0000000000..8ad61226e9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setreuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setreuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setrlimit.c b/ports/sysdeps/unix/sysv/linux/arm/setrlimit.c new file mode 100644 index 0000000000..bfaef74c38 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/setuid.c b/ports/sysdeps/unix/sysv/linux/arm/setuid.c new file mode 100644 index 0000000000..de394379be --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/setuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/shmctl.c b/ports/sysdeps/unix/sysv/linux/arm/shmctl.c new file mode 100644 index 0000000000..c121e99917 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/shmctl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/alpha/shmctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/sigaction.c b/ports/sysdeps/unix/sysv/linux/arm/sigaction.c new file mode 100644 index 0000000000..fe036c1bdc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sigaction.c @@ -0,0 +1,110 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <signal.h> +#include <string.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <kernel-features.h> + +/* The difference here is that the sigaction structure used in the + kernel is not the same as we use in the libc. Therefore we must + translate it here. */ +#include <kernel_sigaction.h> + +#define SA_RESTORER 0x04000000 + +extern void __default_sa_restorer_v1(void); +extern void __default_sa_restorer_v2(void); +extern void __default_rt_sa_restorer_v1(void); +extern void __default_rt_sa_restorer_v2(void); +#ifdef __ASSUME_SIGFRAME_V2 +# define __default_sa_restorer __default_sa_restorer_v2 +# define __default_rt_sa_restorer __default_rt_sa_restorer_v2 +#else +# include <ldsodefs.h> +# define __default_sa_restorer (GLRO(dl_osversion) >= 0x020612 \ + ? __default_sa_restorer_v2 \ + : __default_sa_restorer_v1) +# define __default_rt_sa_restorer (GLRO(dl_osversion) >= 0x020612 \ + ? __default_rt_sa_restorer_v2 \ + : __default_rt_sa_restorer_v1) +#endif + +/* When RT signals are in use we need to use a different return stub. */ +#define choose_restorer(flags) \ + (flags & SA_SIGINFO) ? __default_rt_sa_restorer \ + : __default_sa_restorer + +/* If ACT is not NULL, change the action for SIG to *ACT. + If OACT is not NULL, put the old action for SIG in *OACT. */ +int +__libc_sigaction (sig, act, oact) + int sig; + const struct sigaction *act; + struct sigaction *oact; +{ + int result; + + struct kernel_sigaction kact, koact; + + if (act) + { + kact.k_sa_handler = act->sa_handler; + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + kact.sa_flags = act->sa_flags; +#ifdef HAVE_SA_RESTORER + if (kact.sa_flags & SA_RESTORER) + kact.sa_restorer = act->sa_restorer; + else + { + kact.sa_restorer = choose_restorer (kact.sa_flags); + kact.sa_flags |= SA_RESTORER; + } +#endif + } + + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + result = INLINE_SYSCALL (rt_sigaction, 4, sig, + act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); + + if (oact && result >= 0) + { + oact->sa_handler = koact.k_sa_handler; + memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); + oact->sa_flags = koact.sa_flags; +#ifdef HAVE_SA_RESTORER + oact->sa_restorer = koact.sa_restorer; +#endif + } + return result; +} +libc_hidden_def (__libc_sigaction) + +#ifdef WRAPPER_INCLUDE +# include WRAPPER_INCLUDE +#endif + +#ifndef LIBC_SIGACTION +weak_alias (__libc_sigaction, __sigaction) +libc_hidden_weak (__sigaction) +weak_alias (__libc_sigaction, sigaction) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h new file mode 100644 index 0000000000..12a7e73b56 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h @@ -0,0 +1,49 @@ +/* Copyright (C) 1999, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Philip Blundell <philb@gnu.org>, 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/ucontext.h> +#include "kernel-features.h" + +#define SIGCONTEXT siginfo_t *_si, struct ucontext * +#define SIGCONTEXT_EXTRA_ARGS _si, + +/* The sigcontext structure changed between 2.0 and 2.1 kernels. On any + modern system we should be able to assume that the "new" format will be + in use. */ + +#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.arm_pc) +#define GET_FRAME(ctx) ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.arm_fp) +#define GET_STACK(ctx) ((void *) (ctx)->uc_mcontext.arm_sp) + +#define ADVANCE_STACK_FRAME(frm) \ + ((struct layout *)frm - 1) + +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) + +/* There is no reliable way to get the sigcontext unless we use a + three-argument signal handler. */ +#define __sigaction(sig, act, oact) ({ \ + (act)->sa_flags |= SA_SIGINFO; \ + (__sigaction) (sig, act, oact); \ +}) + +#define sigaction(sig, act, oact) ({ \ + (act)->sa_flags |= SA_SIGINFO; \ + (sigaction) (sig, act, oact); \ +}) diff --git a/ports/sysdeps/unix/sysv/linux/arm/sigrestorer.S b/ports/sysdeps/unix/sysv/linux/arm/sigrestorer.S new file mode 100644 index 0000000000..63d83b8a65 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sigrestorer.S @@ -0,0 +1,117 @@ +/* Copyright (C) 1999-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* If no SA_RESTORER function was specified by the application we use + one of these. This avoids the need for the kernel to synthesise a return + instruction on the stack, which would involve expensive cache flushes. + + Nowadays (2.6 series, and somewhat earlier) the kernel uses a high page + for signal trampolines, so the cache flushes are not an issue. But since + we do not have a vDSO, continue to use these so that we can provide + unwind information. + + Start the unwind tables at least one instruction before the signal + trampoline, because the unwinder will assume we are returning after + a call site. + + Because the signal frame layout changed in 2.6.18, we provide two + copies of these functions with different unwind information. */ + +/* Used in ENTRY. */ +#undef cfi_startproc +#define cfi_startproc \ + .cfi_startproc simple; \ + .cfi_signal_frame + +/* The CFA is not computed / used correctly here; this is neither trivial to + do, nor is it needed. */ +#define CFI \ + cfi_def_cfa (sp, 0); \ + cfi_offset (r0, OFFSET + 0 * 4); \ + cfi_offset (r1, OFFSET + 1 * 4); \ + cfi_offset (r2, OFFSET + 2 * 4); \ + cfi_offset (r3, OFFSET + 3 * 4); \ + cfi_offset (r4, OFFSET + 4 * 4); \ + cfi_offset (r5, OFFSET + 5 * 4); \ + cfi_offset (r6, OFFSET + 6 * 4); \ + cfi_offset (r7, OFFSET + 7 * 4); \ + cfi_offset (r8, OFFSET + 8 * 4); \ + cfi_offset (r9, OFFSET + 9 * 4); \ + cfi_offset (r10, OFFSET + 10 * 4); \ + cfi_offset (r11, OFFSET + 11 * 4); \ + cfi_offset (r12, OFFSET + 12 * 4); \ + cfi_offset (r13, OFFSET + 13 * 4); \ + cfi_offset (r14, OFFSET + 14 * 4); \ + cfi_offset (r15, OFFSET + 15 * 4) + +#ifndef __ASSUME_SIGFRAME_V2 +#define OFFSET 12 + .fnstart + .save {r0-r15} + .pad #OFFSET + nop +ENTRY(__default_sa_restorer_v1) + CFI + mov r7, $SYS_ify(sigreturn) + swi 0x0 + .fnend +END(__default_sa_restorer_v1) +#undef OFFSET +#endif /* __ASSUME_SIGFRAME_V2 */ + +#define OFFSET 32 + .fnstart + .save {r0-r15} + .pad #OFFSET + nop +ENTRY(__default_sa_restorer_v2) + CFI + mov r7, $SYS_ify(sigreturn) + swi 0x0 + .fnend +END(__default_sa_restorer_v2) +#undef OFFSET + +#ifndef __ASSUME_SIGFRAME_V2 +#define OFFSET 168 + .fnstart + .save {r0-r15} + .pad #OFFSET + nop +ENTRY(__default_rt_sa_restorer_v1) + CFI + mov r7, $SYS_ify(rt_sigreturn) + swi 0x0 + .fnend +END(__default_rt_sa_restorer_v1) +#undef OFFSET +#endif /* __ASSUME_SIGFRAME_V2 */ + +#define OFFSET 160 + .fnstart + .save {r0-r15} + .pad #OFFSET + nop +ENTRY(__default_rt_sa_restorer_v2) + CFI + mov r7, $SYS_ify(rt_sigreturn) + swi 0x0 + .fnend +END(__default_rt_sa_restorer_v2) +#undef OFFSET diff --git a/ports/sysdeps/unix/sysv/linux/arm/swapcontext.S b/ports/sysdeps/unix/sysv/linux/arm/swapcontext.S new file mode 100644 index 0000000000..09492d0000 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/swapcontext.S @@ -0,0 +1,63 @@ +/* Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include "ucontext_i.h" + + .syntax unified + .text + +/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */ + +ENTRY(swapcontext) + + /* Have getcontext() do most of the work then fix up + LR afterwards. Save R3 to keep the stack aligned. */ + push {r0,r1,r3,r14} + cfi_adjust_cfa_offset (16) + cfi_rel_offset (r0,0) + cfi_rel_offset (r1,4) + cfi_rel_offset (r3,8) + cfi_rel_offset (r14,12) + + bl __getcontext + mov r4, r0 + + pop {r0,r1,r3,r14} + cfi_adjust_cfa_offset (-16) + cfi_restore (r0) + cfi_restore (r1) + cfi_restore (r3) + cfi_restore (r14) + + /* Exit if getcontext() failed. */ + cmp r4, #0 + itt ne + movne r0, r4 + RETINSTR(ne, r14) + + /* Fix up LR and the PC. */ + str r13,[r0, #MCONTEXT_ARM_SP] + str r14,[r0, #MCONTEXT_ARM_LR] + str r14,[r0, #MCONTEXT_ARM_PC] + + /* And swap using swapcontext(). */ + mov r0, r1 + b __setcontext + +END(swapcontext) diff --git a/ports/sysdeps/unix/sysv/linux/arm/sys/elf.h b/ports/sysdeps/unix/sysv/linux/arm/sys/elf.h new file mode 100644 index 0000000000..158d3183f7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sys/elf.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_ELF_H +#define _SYS_ELF_H 1 + +#warning "This header is obsolete; use <sys/procfs.h> instead." + +#include <sys/procfs.h> + +#endif /* sys/elf.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/sys/io.h b/ports/sysdeps/unix/sysv/linux/arm/sys/io.h new file mode 100644 index 0000000000..a6243dd6c9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sys/io.h @@ -0,0 +1,47 @@ +/* Copyright (C) 1996, 1998, 1999, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IO_H + +#define _SYS_IO_H 1 +#include <features.h> + +__BEGIN_DECLS + +/* If TURN_ON is TRUE, request for permission to do direct i/o on the + port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O + permission off for that range. This call requires root privileges. */ +extern int ioperm (unsigned long int __from, unsigned long int __num, + int __turn_on) __THROW; + +/* Set the I/O privilege level to LEVEL. If LEVEL is nonzero, + permission to access any I/O port is granted. This call requires + root privileges. */ +extern int iopl (int __level) __THROW; + +/* The functions that actually perform reads and writes. */ +extern unsigned char inb (unsigned long int __port) __THROW; +extern unsigned short int inw (unsigned long int __port) __THROW; +extern unsigned long int inl (unsigned long int __port) __THROW; + +extern void outb (unsigned char __value, unsigned long int __port) __THROW; +extern void outw (unsigned short __value, unsigned long int __port) __THROW; +extern void outl (unsigned long __value, unsigned long int __port) __THROW; + +__END_DECLS + +#endif /* _SYS_IO_H */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/arm/sys/procfs.h new file mode 100644 index 0000000000..4a10017ced --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sys/procfs.h @@ -0,0 +1,122 @@ +/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somewhat modelled after the file of the same name on SVR4 + systems. It provides a definition of the core file format for ELF + used on Linux. It doesn't have anything to do with the /proc file + system, even though Linux has one. + + Anyway, the whole purpose of this file is for GDB and GDB only. + Don't read too much into it. Don't use it for anything other than + GDB unless you know what you are doing. */ + +#include <features.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/user.h> + +__BEGIN_DECLS + +/* Type for a general-purpose register. */ +typedef unsigned long elf_greg_t; + +/* And the whole bunch of them. We could have used `struct + user_regs' directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +/* Register set for the floating-point registers. */ +typedef struct user_fpregs elf_fpregset_t; + +/* Signal info. */ +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with Linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + GDB doesn't really use excluded. */ + +struct elf_prstatus + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args. */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned short int pr_uid; + unsigned short int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + +/* The rest of this file provides the types for emulation of the + Solaris <proc_service.h> interfaces that should be implemented by + users of libthread_db. */ + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore have only one PID type. */ +typedef __pid_t lwpid_t; + +/* Process status and info. In the end we do provide typedefs for them. */ +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/arm/sys/ucontext.h new file mode 100644 index 0000000000..546e42a533 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sys/ucontext.h @@ -0,0 +1,112 @@ +/* Copyright (C) 1998, 1999, 2001, 2006, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* System V/ARM ABI compliant context switching support. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +/* We need the signal context definitions even if they are not used + included in <signal.h>. */ +#include <bits/sigcontext.h> + +typedef int greg_t; + +/* Number of general registers. */ +#define NGREG 18 + +/* Container for all general registers. */ +typedef greg_t gregset_t[NGREG]; + +/* Number of each register is the `gregset_t' array. */ +enum +{ + REG_R0 = 0, +#define REG_R0 REG_R0 + REG_R1 = 1, +#define REG_R1 REG_R1 + REG_R2 = 2, +#define REG_R2 REG_R2 + REG_R3 = 3, +#define REG_R3 REG_R3 + REG_R4 = 4, +#define REG_R4 REG_R4 + REG_R5 = 5, +#define REG_R5 REG_R5 + REG_R6 = 6, +#define REG_R6 REG_R6 + REG_R7 = 7, +#define REG_R7 REG_R7 + REG_R8 = 8, +#define REG_R8 REG_R8 + REG_R9 = 9, +#define REG_R9 REG_R9 + REG_R10 = 10, +#define REG_R10 REG_R10 + REG_R11 = 11, +#define REG_R11 REG_R11 + REG_R12 = 12, +#define REG_R12 REG_R12 + REG_R13 = 13, +#define REG_R13 REG_R13 + REG_R14 = 14, +#define REG_R14 REG_R14 + REG_R15 = 15 +#define REG_R15 REG_R15 +}; + +struct _libc_fpstate +{ + struct + { + unsigned int sign1:1; + unsigned int unused:15; + unsigned int sign2:1; + unsigned int exponent:14; + unsigned int j:1; + unsigned int mantissa1:31; + unsigned int mantissa0:32; + } fpregs[8]; + unsigned int fpsr:32; + unsigned int fpcr:32; + unsigned char ftype[8]; + unsigned int init_flag; +}; +/* Structure to describe FPU registers. */ +typedef struct _libc_fpstate fpregset_t; + +/* Context to describe whole processor state. This only describes + the core registers; coprocessor registers get saved elsewhere + (e.g. in uc_regspace, or somewhere unspecified on the stack + during non-RT signal handlers). */ +typedef struct sigcontext mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + unsigned long uc_regspace[128] __attribute__((__aligned__(8))); + } ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/sys/user.h b/ports/sysdeps/unix/sysv/linux/arm/sys/user.h new file mode 100644 index 0000000000..84f517be43 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sys/user.h @@ -0,0 +1,71 @@ +/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +/* The whole purpose of this file is for GDB and GDB only. Don't read + too much into it. Don't use it for anything other than GDB unless + you know what you are doing. */ + +struct user_fpregs +{ + struct fp_reg + { + unsigned int sign1:1; + unsigned int unused:15; + unsigned int sign2:1; + unsigned int exponent:14; + unsigned int j:1; + unsigned int mantissa1:31; + unsigned int mantissa0:32; + } fpregs[8]; + unsigned int fpsr:32; + unsigned int fpcr:32; + unsigned char ftype[8]; + unsigned int init_flag; +}; + +struct user_regs +{ + unsigned long int uregs[18]; +}; + +struct user +{ + struct user_regs regs; /* General registers */ + int u_fpvalid; /* True if math co-processor being used. */ + + unsigned long int u_tsize; /* Text segment size (pages). */ + unsigned long int u_dsize; /* Data segment size (pages). */ + unsigned long int u_ssize; /* Stack segment size (pages). */ + + unsigned long start_code; /* Starting virtual address of text. */ + unsigned long start_stack; /* Starting virtual address of stack. */ + + long int signal; /* Signal that caused the core dump. */ + int reserved; /* No longer used */ + struct user_regs *u_ar0; /* help gdb to find the general registers. */ + + unsigned long magic; /* uniquely identify a core file */ + char u_comm[32]; /* User command that was responsible */ + int u_debugreg[8]; + struct user_fpregs u_fp; /* Floating point registers */ + struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */ +}; + +#endif /* sys/user.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/syscall.S b/ports/sysdeps/unix/sysv/linux/arm/syscall.S new file mode 100644 index 0000000000..3faf919d85 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/syscall.S @@ -0,0 +1,47 @@ +/* Copyright (C) 2005, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* In the EABI syscall interface, we don't need a special syscall to + implement syscall(). It won't work reliably with 64-bit arguments + (but that is true on many modern platforms). */ + +ENTRY (syscall) + mov ip, sp + stmfd sp!, {r4, r5, r6, r7} + cfi_adjust_cfa_offset (16) + cfi_rel_offset (r4, 0) + cfi_rel_offset (r5, 4) + cfi_rel_offset (r6, 8) + cfi_rel_offset (r7, 12) + mov r7, r0 + mov r0, r1 + mov r1, r2 + mov r2, r3 + ldmfd ip, {r3, r4, r5, r6} + swi 0x0 + ldmfd sp!, {r4, r5, r6, r7} + cfi_adjust_cfa_offset (-16) + cfi_restore (r4) + cfi_restore (r5) + cfi_restore (r6) + cfi_restore (r7) + cmn r0, #4096 + RETINSTR(cc, lr) + b PLTJMP(syscall_error) +PSEUDO_END (syscall) diff --git a/ports/sysdeps/unix/sysv/linux/arm/syscalls.list b/ports/sysdeps/unix/sysv/linux/arm/syscalls.list new file mode 100644 index 0000000000..ba8cdd7e65 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -0,0 +1,38 @@ +# File name Caller Syscall name # args Strong name Weak names + +chown - chown32 i:sii __chown chown + +prlimit64 EXTRA prlimit64 i:iipp prlimit64 + +fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark + +# Semaphore and shm system calls. msgctl, shmctl, and semctl have C +# wrappers (to set __IPC_64). +msgget - msgget i:ii __msgget msgget +msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv +msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +shmat - shmat i:ipi __shmat shmat +shmdt - shmdt i:s __shmdt shmdt +shmget - shmget i:iii __shmget shmget +semop - semop i:ipi __semop semop +semtimedop - semtimedop i:ipip semtimedop +semget - semget i:iii __semget semget + +# proper socket implementations: +accept - accept Ci:iBN __libc_accept __accept accept +bind - bind i:ipi __bind bind +connect - connect Ci:ipi __libc_connect __connect connect +getpeername - getpeername i:ipp __getpeername getpeername +getsockname - getsockname i:ipp __getsockname getsockname +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt +listen - listen i:ii __listen listen +recv - recv Ci:ibni __libc_recv __recv recv +recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom +recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg +send - send Ci:ibni __libc_send __send send +sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg +sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt +shutdown - shutdown i:ii __shutdown shutdown +socket - socket i:iii __socket socket +socketpair - socketpair i:iiif __socketpair socketpair diff --git a/ports/sysdeps/unix/sysv/linux/arm/sysdep.S b/ports/sysdeps/unix/sysv/linux/arm/sysdep.S new file mode 100644 index 0000000000..41bedfae8d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sysdep.S @@ -0,0 +1,34 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 2005, 2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + .text + +/* The syscall stubs jump here when they detect an error. + The code for Linux is almost identical to the canonical Unix + code, except that the error number in R0 is negated. */ + +#undef CALL_MCOUNT +#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers R0. */ + +ENTRY (__syscall_error) + rsb r0, r0, $0 + +#define __syscall_error __syscall_error_1 +#include <sysdeps/unix/arm/sysdep.S> diff --git a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h new file mode 100644 index 0000000000..30fa599e05 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -0,0 +1,412 @@ +/* Copyright (C) 1992-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995. + ARM changes by Philip Blundell, <pjb27@cam.ac.uk>, May 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_ARM_SYSDEP_H +#define _LINUX_ARM_SYSDEP_H 1 + +/* There is some commonality. */ +#include <sysdeps/unix/arm/sysdep.h> + +/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ +#include <dl-sysdep.h> + +#include <tls.h> + +/* In order to get __set_errno() definition in INLINE_SYSCALL. */ +#ifndef __ASSEMBLER__ +#include <errno.h> +#endif + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) (__NR_##syscall_name) + +#define _SYS_AUXV_H 1 +#include <bits/hwcap.h> + +#ifdef __ASSEMBLER__ + +/* Linux uses a negative return value to indicate syscall errors, + unlike most Unices, which use the condition codes' carry flag. + + Since version 2.1 the return value of a system call might be + negative even if the call succeeded. E.g., the `lseek' system call + might return a large offset. Therefore we must not anymore test + for < 0, but test for a real error by making sure the value in R0 + is a real error number. Linus said he will make sure the no syscall + returns a value in -1 .. -4095 as a valid result so we can safely + test with -4095. */ + +#undef PSEUDO +#define PSEUDO(name, syscall_name, args) \ + .text; \ + ENTRY (name); \ + DO_CALL (syscall_name, args); \ + cmn r0, $4096; + +#define PSEUDO_RET \ + RETINSTR(cc, lr); \ + b PLTJMP(SYSCALL_ERROR) +#undef ret +#define ret PSEUDO_RET + +#undef PSEUDO_END +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER; \ + END (name) + +#undef PSEUDO_NOERRNO +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .text; \ + ENTRY (name); \ + DO_CALL (syscall_name, args); + +#define PSEUDO_RET_NOERRNO \ + DO_RET (lr); + +#undef ret_NOERRNO +#define ret_NOERRNO PSEUDO_RET_NOERRNO + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + +/* The function has to return the error code. */ +#undef PSEUDO_ERRVAL +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args); \ + rsb r0, r0, #0 + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) \ + END (name) + +#define ret_ERRVAL PSEUDO_RET_NOERRNO + +#if NOT_IN_libc +# define SYSCALL_ERROR __local_syscall_error +# if RTLD_PRIVATE_ERRNO +# define SYSCALL_ERROR_HANDLER \ +__local_syscall_error: \ + ldr r1, 1f; \ + rsb r0, r0, #0; \ +0: str r0, [pc, r1]; \ + mvn r0, #0; \ + DO_RET(lr); \ +1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8; +# else +# if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__) +# define POP_PC \ + ldr lr, [sp], #4; \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (lr); \ + bx lr +# else +# define POP_PC \ + ldr pc, [sp], #4 +# endif +# define SYSCALL_ERROR_HANDLER \ +__local_syscall_error: \ + str lr, [sp, #-4]!; \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (lr, 0); \ + str r0, [sp, #-4]!; \ + cfi_adjust_cfa_offset (4); \ + bl PLTJMP(C_SYMBOL_NAME(__errno_location)); \ + ldr r1, [sp], #4; \ + cfi_adjust_cfa_offset (-4); \ + rsb r1, r1, #0; \ + str r1, [r0]; \ + mvn r0, #0; \ + POP_PC; +# endif +#else +# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ +# define SYSCALL_ERROR __syscall_error +#endif + +/* The ARM EABI user interface passes the syscall number in r7, instead + of in the swi. This is more efficient, because the kernel does not need + to fetch the swi from memory to find out the number; which can be painful + with separate I-cache and D-cache. Make sure to use 0 for the SWI + argument; otherwise the (optional) compatibility code for APCS binaries + may be invoked. */ + +/* Linux takes system call args in registers: + arg 1 r0 + arg 2 r1 + arg 3 r2 + arg 4 r3 + arg 5 r4 (this is different from the APCS convention) + arg 6 r5 + arg 7 r6 + + The compiler is going to form a call by coming here, through PSEUDO, with + arguments + syscall number in the DO_CALL macro + arg 1 r0 + arg 2 r1 + arg 3 r2 + arg 4 r3 + arg 5 [sp] + arg 6 [sp+4] + arg 7 [sp+8] + + We need to shuffle values between R4..R6 and the stack so that the + caller's v1..v3 and stack frame are not corrupted, and the kernel + sees the right arguments. + +*/ + +/* We must save and restore r7 (call-saved) for the syscall number. + We never make function calls from inside here (only potentially + signal handlers), so we do not bother with doubleword alignment. + + Just like the APCS syscall convention, the EABI syscall convention uses + r0 through r6 for up to seven syscall arguments. None are ever passed to + the kernel on the stack, although incoming arguments are on the stack for + syscalls with five or more arguments. + + The assembler will convert the literal pool load to a move for most + syscalls. */ + +#undef DO_CALL +#define DO_CALL(syscall_name, args) \ + DOARGS_##args; \ + ldr r7, =SYS_ify (syscall_name); \ + swi 0x0; \ + UNDOARGS_##args + +#undef DOARGS_0 +#define DOARGS_0 \ + .fnstart; \ + str r7, [sp, #-4]!; \ + cfi_adjust_cfa_offset (4); \ + cfi_rel_offset (r7, 0); \ + .save { r7 } +#undef DOARGS_1 +#define DOARGS_1 DOARGS_0 +#undef DOARGS_2 +#define DOARGS_2 DOARGS_0 +#undef DOARGS_3 +#define DOARGS_3 DOARGS_0 +#undef DOARGS_4 +#define DOARGS_4 DOARGS_0 +#undef DOARGS_5 +#define DOARGS_5 \ + .fnstart; \ + stmfd sp!, {r4, r7}; \ + cfi_adjust_cfa_offset (8); \ + cfi_rel_offset (r4, 0); \ + cfi_rel_offset (r7, 4); \ + .save { r4, r7 }; \ + ldr r4, [sp, #8] +#undef DOARGS_6 +#define DOARGS_6 \ + .fnstart; \ + mov ip, sp; \ + stmfd sp!, {r4, r5, r7}; \ + cfi_adjust_cfa_offset (12); \ + cfi_rel_offset (r4, 0); \ + cfi_rel_offset (r5, 4); \ + cfi_rel_offset (r7, 8); \ + .save { r4, r5, r7 }; \ + ldmia ip, {r4, r5} +#undef DOARGS_7 +#define DOARGS_7 \ + .fnstart; \ + mov ip, sp; \ + stmfd sp!, {r4, r5, r6, r7}; \ + cfi_adjust_cfa_offset (16); \ + cfi_rel_offset (r4, 0); \ + cfi_rel_offset (r5, 4); \ + cfi_rel_offset (r6, 8); \ + cfi_rel_offset (r7, 12); \ + .save { r4, r5, r6, r7 }; \ + ldmia ip, {r4, r5, r6} + +#undef UNDOARGS_0 +#define UNDOARGS_0 \ + ldr r7, [sp], #4; \ + cfi_adjust_cfa_offset (-4); \ + cfi_restore (r7); \ + .fnend +#undef UNDOARGS_1 +#define UNDOARGS_1 UNDOARGS_0 +#undef UNDOARGS_2 +#define UNDOARGS_2 UNDOARGS_0 +#undef UNDOARGS_3 +#define UNDOARGS_3 UNDOARGS_0 +#undef UNDOARGS_4 +#define UNDOARGS_4 UNDOARGS_0 +#undef UNDOARGS_5 +#define UNDOARGS_5 \ + ldmfd sp!, {r4, r7}; \ + cfi_adjust_cfa_offset (-8); \ + cfi_restore (r4); \ + cfi_restore (r7); \ + .fnend +#undef UNDOARGS_6 +#define UNDOARGS_6 \ + ldmfd sp!, {r4, r5, r7}; \ + cfi_adjust_cfa_offset (-12); \ + cfi_restore (r4); \ + cfi_restore (r5); \ + cfi_restore (r7); \ + .fnend +#undef UNDOARGS_7 +#define UNDOARGS_7 \ + ldmfd sp!, {r4, r5, r6, r7}; \ + cfi_adjust_cfa_offset (-16); \ + cfi_restore (r4); \ + cfi_restore (r5); \ + cfi_restore (r6); \ + cfi_restore (r7); \ + .fnend + +#else /* not __ASSEMBLER__ */ + +/* Define a macro which expands into the inline wrapper code for a system + call. */ +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args); \ + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0)) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \ + _sys_result = (unsigned int) -1; \ + } \ + (int) _sys_result; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) do { } while (0) + +#if defined(__thumb__) +/* We can not expose the use of r7 to the compiler. GCC (as + of 4.5) uses r7 as the hard frame pointer for Thumb - although + for Thumb-2 it isn't obviously a better choice than r11. + And GCC does not support asms that conflict with the frame + pointer. + + This would be easier if syscall numbers never exceeded 255, + but they do. For the moment the LOAD_ARGS_7 is sacrificed. + We can't use push/pop inside the asm because that breaks + unwinding (i.e. thread cancellation) for this frame. We can't + locally save and restore r7, because we do not know if this + function uses r7 or if it is our caller's r7; if it is our caller's, + then unwinding will fail higher up the stack. So we move the + syscall out of line and provide its own unwind information. */ +# undef INTERNAL_SYSCALL_RAW +# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ + ({ \ + register int _a1 asm ("a1"); \ + int _nametmp = name; \ + LOAD_ARGS_##nr (args) \ + register int _name asm ("ip") = _nametmp; \ + asm volatile ("bl __libc_do_syscall" \ + : "=r" (_a1) \ + : "r" (_name) ASM_ARGS_##nr \ + : "memory", "lr"); \ + _a1; }) +#else /* ARM */ +# undef INTERNAL_SYSCALL_RAW +# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ + ({ \ + register int _a1 asm ("r0"), _nr asm ("r7"); \ + LOAD_ARGS_##nr (args) \ + _nr = name; \ + asm volatile ("swi 0x0 @ syscall " #name \ + : "=r" (_a1) \ + : "r" (_nr) ASM_ARGS_##nr \ + : "memory"); \ + _a1; }) +#endif + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) + +#undef INTERNAL_SYSCALL_ARM +#define INTERNAL_SYSCALL_ARM(name, err, nr, args...) \ + INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args) + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned int) (val) >= 0xfffff001u) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) + +#define LOAD_ARGS_0() +#define ASM_ARGS_0 +#define LOAD_ARGS_1(a1) \ + int _a1tmp = (int) (a1); \ + LOAD_ARGS_0 () \ + _a1 = _a1tmp; +#define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1) +#define LOAD_ARGS_2(a1, a2) \ + int _a2tmp = (int) (a2); \ + LOAD_ARGS_1 (a1) \ + register int _a2 asm ("a2") = _a2tmp; +#define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2) +#define LOAD_ARGS_3(a1, a2, a3) \ + int _a3tmp = (int) (a3); \ + LOAD_ARGS_2 (a1, a2) \ + register int _a3 asm ("a3") = _a3tmp; +#define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3) +#define LOAD_ARGS_4(a1, a2, a3, a4) \ + int _a4tmp = (int) (a4); \ + LOAD_ARGS_3 (a1, a2, a3) \ + register int _a4 asm ("a4") = _a4tmp; +#define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4) +#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \ + int _v1tmp = (int) (a5); \ + LOAD_ARGS_4 (a1, a2, a3, a4) \ + register int _v1 asm ("v1") = _v1tmp; +#define ASM_ARGS_5 ASM_ARGS_4, "r" (_v1) +#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \ + int _v2tmp = (int) (a6); \ + LOAD_ARGS_5 (a1, a2, a3, a4, a5) \ + register int _v2 asm ("v2") = _v2tmp; +#define ASM_ARGS_6 ASM_ARGS_5, "r" (_v2) +#ifndef __thumb__ +# define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \ + int _v3tmp = (int) (a7); \ + LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) \ + register int _v3 asm ("v3") = _v3tmp; +# define ASM_ARGS_7 ASM_ARGS_6, "r" (_v3) +#endif + +/* For EABI, non-constant syscalls are actually pretty easy... */ +#undef INTERNAL_SYSCALL_NCS +#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ + INTERNAL_SYSCALL_RAW (number, err, nr, args) + +#endif /* __ASSEMBLER__ */ + +/* Pointer mangling is not yet supported for ARM. */ +#define PTR_MANGLE(var) (void) (var) +#define PTR_DEMANGLE(var) (void) (var) + +#endif /* linux/arm/sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/truncate64.c b/ports/sysdeps/unix/sysv/linux/arm/truncate64.c new file mode 100644 index 0000000000..3fad93f50e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/truncate64.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <endian.h> +#include <errno.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +/* Truncate the file FD refers to to LENGTH bytes. */ +int +truncate64 (const char *path, off64_t length) +{ + unsigned int low = length & 0xffffffff; + unsigned int high = length >> 32; + int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0, + __LONG_LONG_PAIR (high, low)); + return result; +} diff --git a/ports/sysdeps/unix/sysv/linux/arm/ucontext_i.sym b/ports/sysdeps/unix/sysv/linux/arm/ucontext_i.sym new file mode 100644 index 0000000000..306292f1f8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/ucontext_i.sym @@ -0,0 +1,30 @@ +#include <inttypes.h> +#include <signal.h> +#include <stddef.h> +#include <sys/ucontext.h> + +SIG_BLOCK +SIG_SETMASK + +-- Offsets of the fields in the ucontext_t structure. +#define ucontext(member) offsetof (ucontext_t, member) +#define mcontext(member) ucontext (uc_mcontext.member) + +UCONTEXT_FLAGS ucontext (uc_flags) +UCONTEXT_LINK ucontext (uc_link) +UCONTEXT_STACK ucontext (uc_stack) +UCONTEXT_MCONTEXT ucontext (uc_mcontext) +UCONTEXT_SIGMASK ucontext (uc_sigmask) + +UCONTEXT_REGSPACE ucontext (uc_regspace) + +MCONTEXT_TRAP_NO mcontext (trap_no) +MCONTEXT_ERROR_CODE mcontext (error_code) +MCONTEXT_OLDMASK mcontext (oldmask) +MCONTEXT_ARM_R0 mcontext (arm_r0) +MCONTEXT_ARM_R4 mcontext (arm_r4) +MCONTEXT_ARM_SP mcontext (arm_sp) +MCONTEXT_ARM_LR mcontext (arm_lr) +MCONTEXT_ARM_PC mcontext (arm_pc) +MCONTEXT_ARM_CPSR mcontext (arm_cpsr) +MCONTEXT_FAULT_ADDRESS mcontext (fault_address) diff --git a/ports/sysdeps/unix/sysv/linux/arm/umount.c b/ports/sysdeps/unix/sysv/linux/arm/umount.c new file mode 100644 index 0000000000..d9d671f88d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/umount.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Huggins-Daines <dhd@debian.org>, 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Since we don't have an oldumount system call, do what the kernel + does down here. */ + +extern long int __umount2 (const char *name, int flags); + +long int +__umount (const char *name) +{ + return __umount2 (name, 0); +} + +weak_alias (__umount, umount); diff --git a/ports/sysdeps/unix/sysv/linux/arm/versionsort64.c b/ports/sysdeps/unix/sysv/linux/arm/versionsort64.c new file mode 100644 index 0000000000..144b691e56 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/versionsort64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/versionsort64.c> diff --git a/ports/sysdeps/unix/sysv/linux/arm/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/vfork.S new file mode 100644 index 0000000000..abd46c1c3b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/vfork.S @@ -0,0 +1,60 @@ +/* Copyright (C) 1999-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Philip Blundell <philb@gnu.org>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + +ENTRY (__vfork) +#ifdef SAVE_PID + SAVE_PID +#endif + /* The DO_CALL macro saves r7 on the stack, to enable generation + of ARM unwind info. Since the stack is initially shared between + parent and child of vfork, that saved value could be corrupted. + To avoid this problem, we save r7 into ip as well, and restore + from there. */ + mov ip, r7 + cfi_register (r7, ip) + .fnstart + str r7, [sp, #-4]! + cfi_adjust_cfa_offset (4) + .save { r7 } + ldr r7, =SYS_ify (vfork) + swi 0x0 + .fnend + add sp, sp, #4 + cfi_adjust_cfa_offset (-4) + mov r7, ip + cfi_restore (r7); +#ifdef RESTORE_PID + RESTORE_PID +#endif + cmn a1, #4096 + RETINSTR(cc, lr) + + b PLTJMP(SYSCALL_ERROR) +PSEUDO_END (__vfork) +libc_hidden_def (__vfork) + +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/arm/xstat.c b/ports/sysdeps/unix/sysv/linux/arm/xstat.c new file mode 100644 index 0000000000..e9869f5508 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/arm/xstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/xstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/generic/Makefile b/ports/sysdeps/unix/sysv/linux/generic/Makefile new file mode 100644 index 0000000000..c1daee2396 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),misc) +sysdep_routines += epoll_create epoll_wait inotify_init +endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c b/ports/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c new file mode 100644 index 0000000000..619785d7e8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <jmpbuf-offsets.h> +#include <sysdep.h> +#include <setjmp.h> +#include <signal.h> +#include <stdio.h> +#include <stackinfo.h> + +#ifdef _STACK_GROWS_DOWN +#define called_from(this, saved) ((this) < (saved)) +#else +#define called_from(this, saved) ((this) > (saved)) +#endif + +extern void ____longjmp_chk (__jmp_buf __env, int __val) + __attribute__ ((__noreturn__)); + +void ____longjmp_chk (__jmp_buf env, int val) +{ + void *this_frame = __builtin_frame_address (0); + void *saved_frame = JB_FRAME_ADDRESS (env); + INTERNAL_SYSCALL_DECL (err); + stack_t ss; + + /* If "env" is from a frame that called us, we're all set. */ + if (called_from(this_frame, saved_frame)) + __longjmp (env, val); + + /* If we can't get the current stack state, give up and do the longjmp. */ + if (INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &ss) != 0) + __longjmp (env, val); + + /* If we we are executing on the alternate stack and within the + bounds, do the longjmp. */ + if (ss.ss_flags == SS_ONSTACK && + (this_frame >= ss.ss_sp && this_frame < (ss.ss_sp + ss.ss_size))) + __longjmp (env, val); + + __fortify_fail ("longjmp causes uninitialized stack frame"); +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/access.c b/ports/sysdeps/unix/sysv/linux/generic/access.c new file mode 100644 index 0000000000..177f0ed211 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/access.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> +#include <sysdep-cancel.h> + +/* Test for access to FILE. */ +int +__access (const char *file, int type) +{ + return INLINE_SYSCALL (faccessat, 3, AT_FDCWD, file, type); +} +weak_alias (__access, access) diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/generic/bits/fcntl.h new file mode 100644 index 0000000000..a8f20bd0b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/fcntl.h @@ -0,0 +1,339 @@ +/* O_*, F_*, FD_* bit values for the generic Linux ABI. + Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + +#include <sys/types.h> +#include <bits/wordsize.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on a few file systems. */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 0100 /* not fcntl */ +#define O_EXCL 0200 /* not fcntl */ +#define O_NOCTTY 0400 /* not fcntl */ +#define O_TRUNC 01000 /* not fcntl */ +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 04010000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 + +#ifdef __USE_XOPEN2K8 +# define O_DIRECTORY 0200000 /* Must be a directory. */ +# define O_NOFOLLOW 0400000 /* Do not follow links. */ +# define O_CLOEXEC 02000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_NOATIME 01000000 /* Do not set atime. */ +# define O_PATH 010000000 /* Resolve pathname but do not open file. */ +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 010000 /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +#ifdef __USE_LARGEFILE64 +# if __WORDSIZE == 64 +# define O_LARGEFILE 0 +# else +# define O_LARGEFILE 0100000 +# endif +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#if __WORDSIZE == 64 +# define F_GETLK 5 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +/* Not necessary, we always have 64-bit offsets. */ +# define F_GETLK64 5 /* Get record locking info. */ +# define F_SETLK64 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 7 /* Set record locking info (blocking). */ +#else +# ifndef __USE_FILE_OFFSET64 +# define F_GETLK 5 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +# else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +# endif +# define F_GETLK64 12 /* Get record locking info. */ +# define F_SETLK64 13 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 14 /* Set record locking info (blocking). */ +#endif + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 0 /* Read lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ + +/* For old implementation of bsd flock(). */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation. */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif /* use GNU */ + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h b/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h new file mode 100644 index 0000000000..bf12ba9b53 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h @@ -0,0 +1,83 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MSG_H +# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." +#endif + +#include <bits/types.h> +#include <bits/wordsize.h> + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ +#ifdef __USE_GNU +# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ +#endif + +/* Types used in the structure definition. */ +typedef unsigned long int msgqnum_t; +typedef unsigned long int msglen_t; + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ + __time_t msg_stime; /* time of last msgsnd command */ +#if __WORDSIZE == 32 + unsigned long int __unused1; +#endif + __time_t msg_rtime; /* time of last msgrcv command */ +#if __WORDSIZE == 32 + unsigned long int __unused2; +#endif + __time_t msg_ctime; /* time of last change */ +#if __WORDSIZE == 32 + unsigned long int __unused3; +#endif + unsigned long int __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused4; + unsigned long int __unused5; +}; + +#ifdef __USE_MISC + +# define msg_cbytes __msg_cbytes + +/* ipcs ctl commands */ +# define MSG_STAT 11 +# define MSG_INFO 12 + +/* buffer for msgctl calls IPC_INFO, MSG_INFO */ +struct msginfo + { + int msgpool; + int msgmap; + int msgmax; + int msgmnb; + int msgmni; + int msgssz; + int msgtql; + unsigned short int msgseg; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/sem.h b/ports/sysdeps/unix/sysv/linux/generic/bits/sem.h new file mode 100644 index 0000000000..003961717f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/sem.h @@ -0,0 +1,92 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SEM_H +# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." +#endif + +#include <sys/types.h> +#include <bits/wordsize.h> + +/* Flags for `semop'. */ +#define SEM_UNDO 0x1000 /* undo the operation on exit */ + +/* Commands for `semctl'. */ +#define GETPID 11 /* get sempid */ +#define GETVAL 12 /* get semval */ +#define GETALL 13 /* get all semval's */ +#define GETNCNT 14 /* get semncnt */ +#define GETZCNT 15 /* get semzcnt */ +#define SETVAL 16 /* set semval */ +#define SETALL 17 /* set all semval's */ + + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ +#if __WORDSIZE == 32 + unsigned long int __unused1; +#endif + __time_t sem_ctime; /* last time changed by semctl() */ +#if __WORDSIZE == 32 + unsigned long int __unused2; +#endif + unsigned long int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused3; + unsigned long int __unused4; +}; + +/* The user should define a union like the following to use it for arguments + for `semctl'. + + union semun + { + int val; <= value for SETVAL + struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET + unsigned short int *array; <= array for GETALL & SETALL + struct seminfo *__buf; <= buffer for IPC_INFO + }; + + Previous versions of this file used to define this union but this is + incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether + one must define the union or not. */ +#define _SEM_SEMUN_UNDEFINED 1 + +#ifdef __USE_MISC + +/* ipcs ctl cmds */ +# define SEM_STAT 18 +# define SEM_INFO 19 + +struct seminfo +{ + int semmap; + int semmni; + int semmns; + int semmnu; + int semmsl; + int semopm; + int semume; + int semusz; + int semvmx; + int semaem; +}; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/shm.h b/ports/sysdeps/unix/sysv/linux/generic/bits/shm.h new file mode 100644 index 0000000000..a22dd14ff7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/shm.h @@ -0,0 +1,111 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." +#endif + +#include <bits/types.h> +#include <bits/wordsize.h> + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ +#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ + +/* Flags for `shmat'. */ +#define SHM_RDONLY 010000 /* attach read-only else read-write */ +#define SHM_RND 020000 /* round attach address to SHMLBA */ +#define SHM_REMAP 040000 /* take-over region on attach */ +#define SHM_EXEC 0100000 /* execution access */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + +__BEGIN_DECLS + +/* Segment low boundary address multiple. */ +#define SHMLBA (__getpagesize ()) +extern int __getpagesize (void) __THROW __attribute__ ((__const__)); + + +/* Type to count number of attaches. */ +typedef unsigned long int shmatt_t; + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time_t shm_atime; /* time of last shmat() */ +#if __WORDSIZE == 32 + unsigned long int __unused1; +#endif + __time_t shm_dtime; /* time of last shmdt() */ +#if __WORDSIZE == 32 + unsigned long int __unused2; +#endif + __time_t shm_ctime; /* time of last change by shmctl() */ +#if __WORDSIZE == 32 + unsigned long int __unused3; +#endif + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __unused4; + unsigned long int __unused5; + }; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +# define SHM_STAT 13 +# define SHM_INFO 14 + +/* shm_mode upper byte flags */ +# define SHM_DEST 01000 /* segment will be destroyed on last detach */ +# define SHM_LOCKED 02000 /* segment will not be swapped */ +# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ +# define SHM_NORESERVE 010000 /* don't check for reservations */ + +struct shminfo + { + unsigned long int shmmax; + unsigned long int shmmin; + unsigned long int shmmni; + unsigned long int shmseg; + unsigned long int shmall; + unsigned long int __unused1; + unsigned long int __unused2; + unsigned long int __unused3; + unsigned long int __unused4; + }; + +struct shm_info + { + int used_ids; + unsigned long int shm_tot; /* total allocated shm */ + unsigned long int shm_rss; /* total resident shm */ + unsigned long int shm_swp; /* total swapped shm */ + unsigned long int swap_attempts; + unsigned long int swap_successes; + }; + +#endif /* __USE_MISC */ + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h b/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h new file mode 100644 index 0000000000..5de1bd0514 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/stat.h @@ -0,0 +1,171 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include <endian.h> +#include <bits/wordsize.h> + +/* 64-bit libc uses the kernel's 'struct stat', accessed via the + stat() syscall; 32-bit libc uses the kernel's 'struct stat64' + and accesses it via the stat64() syscall. All the various + APIs offered by libc use the kernel shape for their struct stat + structure; the only difference is that 32-bit programs not + using __USE_FILE_OFFSET64 only see the low 32 bits of some + of the fields (specifically st_ino, st_size, and st_blocks). */ +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 0 +#define _STAT_VER _STAT_VER_KERNEL + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__(8))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__(8))); type name +#endif + +struct stat + { + __dev_t st_dev; /* Device. */ + __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ +#ifdef __USE_MISC + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + int __unused[2]; + }; + +#undef __field64 + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +#ifdef __USE_MISC + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + int __unused[2]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */ diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h new file mode 100644 index 0000000000..bf479e875e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/statfs.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_STATFS_H +# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." +#endif + +#include <endian.h> +#include <bits/types.h> +#include <bits/wordsize.h> + +/* 64-bit libc uses the kernel's 'struct statfs', accessed via the + statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' + and accesses it via the statfs64() syscall. All the various + APIs offered by libc use the kernel shape for their struct statfs + structure; the only difference is that 32-bit programs not + using __USE_FILE_OFFSET64 only see the low 32 bits of some + of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ + +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__(8))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__(8))); type name +#endif + +struct statfs + { + __SWORD_TYPE f_type; + __SWORD_TYPE f_bsize; + __field64(__fsblkcnt_t, __fsblkcnt64_t, f_blocks); + __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bfree); + __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bavail); + __field64(__fsfilcnt_t, __fsfilcnt64_t, f_files); + __field64(__fsfilcnt_t, __fsfilcnt64_t, f_ffree); + __fsid_t f_fsid; + __SWORD_TYPE f_namelen; + __SWORD_TYPE f_frsize; + __SWORD_TYPE f_flags; + __SWORD_TYPE f_spare[4]; + } __attribute__((__aligned__(8))); + +#undef __field64 + +#ifdef __USE_LARGEFILE64 +struct statfs64 + { + __SWORD_TYPE f_type; + __SWORD_TYPE f_bsize; + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; + __fsid_t f_fsid; + __SWORD_TYPE f_namelen; + __SWORD_TYPE f_frsize; + __SWORD_TYPE f_flags; + __SWORD_TYPE f_spare[4]; + } __attribute__((__aligned__(8))); +#endif + +/* Tell code we have these members. */ +#define _STATFS_F_NAMELEN +#define _STATFS_F_FRSIZE +#define _STATFS_F_FLAGS diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h new file mode 100644 index 0000000000..948edeb96b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -0,0 +1,69 @@ +/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. + Copyright (C) 2011-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_TYPES_H +# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See <bits/types.h> for the meaning of these macros. This file exists so + that <bits/types.h> need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __U32_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __SWBLK_T_TYPE __SLONGWORD_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __S32_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/generic/brk.c b/ports/sysdeps/unix/sysv/linux/generic/brk.c new file mode 100644 index 0000000000..006c3da079 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/brk.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sysdep.h> + +/* This must be initialized data because commons can't have aliases. */ +void *__curbrk = 0; + +/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt + to work around different old braindamage in the old Linux ELF dynamic + linker. */ +weak_alias (__curbrk, ___brk_addr) + +int +__brk (void *addr) +{ + INTERNAL_SYSCALL_DECL (err); + + __curbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + if (__curbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/generic/chmod.c b/ports/sysdeps/unix/sysv/linux/generic/chmod.c new file mode 100644 index 0000000000..e3a791d96d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/chmod.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <sys/types.h> + +/* Change the protections of FILE to MODE. */ +int +__chmod (const char *file, mode_t mode) +{ + return INLINE_SYSCALL (fchmodat, 3, AT_FDCWD, file, mode); +} +weak_alias (__chmod, chmod) diff --git a/ports/sysdeps/unix/sysv/linux/generic/chown.c b/ports/sysdeps/unix/sysv/linux/generic/chown.c new file mode 100644 index 0000000000..f3e78362c4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/chown.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/types.h> + +/* Change the owner and group of FILE. */ +int +__chown (const char *file, uid_t owner, gid_t group) +{ + return INLINE_SYSCALL (fchownat, 5, AT_FDCWD, file, owner, group, 0); +} +libc_hidden_def (__chown) +weak_alias (__chown, chown) diff --git a/ports/sysdeps/unix/sysv/linux/generic/creat.c b/ports/sysdeps/unix/sysv/linux/generic/creat.c new file mode 100644 index 0000000000..db79e3b2f7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/creat.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <fcntl.h> +#include <sys/types.h> +#include <sysdep-cancel.h> + +#undef creat + +/* Create FILE with protections MODE. */ +int +__libc_creat (const char *file, mode_t mode) +{ + return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode); +} +weak_alias (__libc_creat, creat) + +/* __open handles cancellation. */ +LIBC_CANCEL_HANDLED (); + +#if __WORDSIZE == 64 +weak_alias (__libc_creat, creat64) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/dl-origin.c b/ports/sysdeps/unix/sysv/linux/generic/dl-origin.c new file mode 100644 index 0000000000..4502f15d01 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/dl-origin.c @@ -0,0 +1,81 @@ +/* Find path of executable. + Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/param.h> +#include <ldsodefs.h> +#include <sysdep.h> + +#include <dl-dst.h> + +/* On Linux >= 2.1 systems which have the dcache implementation we can get + the path of the application from the /proc/self/exe symlink. Try this + first and fall back on the generic method if necessary. */ + +const char * +_dl_get_origin (void) +{ + char linkval[PATH_MAX]; + char *result; + int len; + INTERNAL_SYSCALL_DECL (err); + + len = INTERNAL_SYSCALL (readlinkat, err, 4, AT_FDCWD, "/proc/self/exe", + linkval, sizeof (linkval)); + if (! INTERNAL_SYSCALL_ERROR_P (len, err) && len > 0 && linkval[0] != '[') + { + /* We can use this value. */ + assert (linkval[0] == '/'); + while (len > 1 && linkval[len - 1] != '/') + --len; + result = (char *) malloc (len + 1); + if (result == NULL) + result = (char *) -1; + else if (len == 1) + memcpy (result, "/", 2); + else + *((char *) __mempcpy (result, linkval, len - 1)) = '\0'; + } + else + { + result = (char *) -1; + /* We use the environment variable LD_ORIGIN_PATH. If it is set make + a copy and strip out trailing slashes. */ + if (GLRO(dl_origin_path) != NULL) + { + size_t len = strlen (GLRO(dl_origin_path)); + result = (char *) malloc (len + 1); + if (result == NULL) + result = (char *) -1; + else + { + char *cp = __mempcpy (result, GLRO(dl_origin_path), len); + while (cp > result + 1 && cp[-1] == '/') + --cp; + *cp = '\0'; + } + } + } + + return result; +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/dup2.c b/ports/sysdeps/unix/sysv/linux/generic/dup2.c new file mode 100644 index 0000000000..6dbcb94e6d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/dup2.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <limits.h> +#include <unistd.h> + +/* Duplicate FD to FD2, closing the old FD2 and making FD2 be + open the same file as FD is. Return FD2 or -1. */ +int +__dup2 (int fd, int fd2) +{ + /* For the degenerate case, check if the fd is valid (by trying to + get the file status flags) and return it, or else return EBADF. */ + if (fd == fd2) + return __libc_fcntl (fd, F_GETFL, 0) < 0 ? -1 : fd; + + return INLINE_SYSCALL (dup3, 3, fd, fd2, 0); +} +libc_hidden_def (__dup2) +weak_alias (__dup2, dup2) diff --git a/ports/sysdeps/unix/sysv/linux/generic/epoll_create.c b/ports/sysdeps/unix/sysv/linux/generic/epoll_create.c new file mode 100644 index 0000000000..2e0aff4382 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/epoll_create.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <errno.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/epoll.h> + +libc_hidden_proto (epoll_create) + +int +epoll_create (int size) +{ + if (size <= 0) + { + __set_errno (EINVAL); + return -1; + } + + return INLINE_SYSCALL (epoll_create1, 1, 0); +} +libc_hidden_def (epoll_create) diff --git a/ports/sysdeps/unix/sysv/linux/generic/epoll_wait.c b/ports/sysdeps/unix/sysv/linux/generic/epoll_wait.c new file mode 100644 index 0000000000..112777a863 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/epoll_wait.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/epoll.h> + +int +epoll_wait (int epfd, struct epoll_event *events, int maxevents, int timeout) +{ + return epoll_pwait (epfd, events, maxevents, timeout, NULL); +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/futimesat.c b/ports/sysdeps/unix/sysv/linux/generic/futimesat.c new file mode 100644 index 0000000000..46ce0cc8ba --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/futimesat.c @@ -0,0 +1,52 @@ +/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <utime.h> +#include <sys/time.h> +#include <sysdep.h> +#include <kernel-features.h> + + +/* Change the access time of FILE relative to FD to TVP[0] and + the modification time of FILE to TVP[1]. */ +int +futimesat (int fd, const char *file, const struct timeval tvp[2]) +{ + struct timespec tsp[2]; + int result; + + if (tvp) + { + if (tvp[0].tv_usec >= 1000000 || tvp[0].tv_usec < 0 || + tvp[1].tv_usec >= 1000000 || tvp[1].tv_usec < 0) + { + __set_errno (EINVAL); + return -1; + } + TIMEVAL_TO_TIMESPEC (&tvp[0], &tsp[0]); + TIMEVAL_TO_TIMESPEC (&tvp[1], &tsp[1]); + } + + result = INLINE_SYSCALL (utimensat, 4, fd, file, tvp ? tsp : NULL, 0); + return result; +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/getdents.c b/ports/sysdeps/unix/sysv/linux/generic/getdents.c new file mode 100644 index 0000000000..14dbbc71a0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/getdents.c @@ -0,0 +1 @@ +/* Defined in getdents64.c */ diff --git a/ports/sysdeps/unix/sysv/linux/generic/getdents64.c b/ports/sysdeps/unix/sysv/linux/generic/getdents64.c new file mode 100644 index 0000000000..abbb729fa9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/getdents64.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <stdint.h> +#include <unistd.h> +#include <sys/types.h> +#include <bits/wordsize.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* The kernel struct linux_dirent64 matches the 'struct getdents64' type. */ +ssize_t +__getdents64 (int fd, char *buf, size_t nbytes) +{ + return INLINE_SYSCALL (getdents64, 3, fd, buf, nbytes); +} + +#if __WORDSIZE == 64 +strong_alias (__getdents64, __getdents) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/inotify_init.c b/ports/sysdeps/unix/sysv/linux/generic/inotify_init.c new file mode 100644 index 0000000000..0b529b9946 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/inotify_init.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <errno.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/inotify.h> + +libc_hidden_proto (inotify_init) + +int +inotify_init (void) +{ + return INLINE_SYSCALL (inotify_init1, 1, 0); +} +libc_hidden_def (inotify_init) diff --git a/ports/sysdeps/unix/sysv/linux/generic/kernel_stat.h b/ports/sysdeps/unix/sysv/linux/generic/kernel_stat.h new file mode 100644 index 0000000000..6ae827fdfe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/kernel_stat.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <bits/wordsize.h> + +#define STAT_IS_KERNEL_STAT 1 + +/* We provide separate 32-bit API versions that check for EOVERFLOW. */ +#if __WORDSIZE == 64 +# define XSTAT_IS_XSTAT64 1 +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/lchown.c b/ports/sysdeps/unix/sysv/linux/generic/lchown.c new file mode 100644 index 0000000000..f0907208b6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/lchown.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/types.h> + +/* Change the owner and group of FILE. */ +int +__lchown (const char *file, uid_t owner, gid_t group) +{ + return INLINE_SYSCALL (fchownat, 5, AT_FDCWD, file, owner, group, + AT_SYMLINK_NOFOLLOW); +} +weak_alias (__lchown, lchown) diff --git a/ports/sysdeps/unix/sysv/linux/generic/link.c b/ports/sysdeps/unix/sysv/linux/generic/link.c new file mode 100644 index 0000000000..49fffb4f12 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/link.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> + +/* Make a link to FROM called TO. */ +int +__link (const char *from, const char *to) +{ + return INLINE_SYSCALL (linkat, 5, AT_FDCWD, from, AT_FDCWD, to, 0); +} + +weak_alias (__link, link) diff --git a/ports/sysdeps/unix/sysv/linux/generic/lxstat.c b/ports/sysdeps/unix/sysv/linux/generic/lxstat.c new file mode 100644 index 0000000000..1336a910c0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/lxstat.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Ignore prototype to avoid error if we alias __lxstat and __lxstat64. */ +#define __lxstat64 __lxstat64_disable + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Get information about the file NAME in BUF. */ +int +__lxstat (int vers, const char *name, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + return INLINE_SYSCALL (newfstatat, 4, AT_FDCWD, name, buf, + AT_SYMLINK_NOFOLLOW); + errno = EINVAL; + return -1; +} + +hidden_def (__lxstat) +weak_alias (__lxstat, _lxstat); +#ifdef XSTAT_IS_XSTAT64 +#undef __lxstat64 +strong_alias (__lxstat, __lxstat64); +hidden_ver (__lxstat, __lxstat64) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/mkdir.c b/ports/sysdeps/unix/sysv/linux/generic/mkdir.c new file mode 100644 index 0000000000..5ad64c1104 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/mkdir.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <sysdep.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <sys/types.h> + + +/* Create a directory named PATH with protections MODE. */ +int +__mkdir (const char *path, mode_t mode) +{ + return INLINE_SYSCALL (mkdirat, 3, AT_FDCWD, path, mode); +} +weak_alias (__mkdir, mkdir) diff --git a/ports/sysdeps/unix/sysv/linux/generic/not-cancel.h b/ports/sysdeps/unix/sysv/linux/generic/not-cancel.h new file mode 100644 index 0000000000..512252a8d0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/not-cancel.h @@ -0,0 +1,34 @@ +/* Uncancelable versions of cancelable interfaces. Linux asm-generic version. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2012. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_GENERIC_NOT_CANCEL_H +#define _LINUX_GENERIC_NOT_CANCEL_H + +#include <sysdeps/unix/sysv/linux/not-cancel.h> +#include <fcntl.h> + +/* Uncancelable open with openat. */ +#undef open_not_cancel +#define open_not_cancel(name, flags, mode) \ + INLINE_SYSCALL (openat, 4, AT_FDCWD, (const char *) (name), (flags), (mode)) +#undef open_not_cancel_2 +#define open_not_cancel_2(name, flags) \ + INLINE_SYSCALL (openat, 3, AT_FDCWD, (const char *) (name), (flags)) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/nptl/not-cancel.h b/ports/sysdeps/unix/sysv/linux/generic/nptl/not-cancel.h new file mode 100644 index 0000000000..e6a0d135c8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/nptl/not-cancel.h @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h> diff --git a/ports/sysdeps/unix/sysv/linux/generic/open.c b/ports/sysdeps/unix/sysv/linux/generic/open.c new file mode 100644 index 0000000000..2f895033bf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/open.c @@ -0,0 +1,71 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <stdarg.h> +#include <stdio.h> +#include <sysdep-cancel.h> + +/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, + a third argument is the file protection. */ +int +__libc_open (const char *file, int oflag, ...) +{ + int mode = 0; + + if (oflag & O_CREAT) + { + va_list arg; + va_start (arg, oflag); + mode = va_arg (arg, int); + va_end (arg); + } + + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +libc_hidden_def (__libc_open) + +weak_alias (__libc_open, __open) +libc_hidden_weak (__open) +weak_alias (__libc_open, open) + +int +__open_nocancel (const char *file, int oflag, ...) +{ + int mode = 0; + + if (oflag & O_CREAT) + { + va_list arg; + va_start (arg, oflag); + mode = va_arg (arg, int); + va_end (arg); + } + + return INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode); +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/open64.c b/ports/sysdeps/unix/sysv/linux/generic/open64.c new file mode 100644 index 0000000000..4597a79831 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/open64.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <stdarg.h> +#include <stdio.h> +#include <sysdep-cancel.h> + +/* Open FILE with access OFLAG. If OFLAG includes O_CREAT, + a third argument is the file protection. */ +int +__libc_open64 (const char *file, int oflag, ...) +{ + int mode = 0; + + if (oflag & O_CREAT) + { + va_list arg; + va_start (arg, oflag); + mode = va_arg (arg, int); + va_end (arg); + } + + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (openat, 4, AT_FDCWD, file, + oflag | O_LARGEFILE, mode); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = INLINE_SYSCALL (openat, 4, AT_FDCWD, file, + oflag | O_LARGEFILE, mode); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +weak_alias (__libc_open64, __open64) +libc_hidden_weak (__open64) +weak_alias (__libc_open64, open64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/pause.c b/ports/sysdeps/unix/sysv/linux/generic/pause.c new file mode 100644 index 0000000000..805b5d4bce --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/pause.c @@ -0,0 +1,63 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <signal.h> +#include <unistd.h> +#include <sysdep-cancel.h> + +/* Suspend the process until a signal arrives. + This always returns -1 and sets errno to EINTR. */ + +static int +__syscall_pause (void) +{ + sigset_t set; + + int rc = + INLINE_SYSCALL (rt_sigprocmask, 4, SIG_BLOCK, NULL, &set, _NSIG / 8); + if (rc == 0) + rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8); + + return rc; +} + +int +__libc_pause (void) +{ + if (SINGLE_THREAD_P) + return __syscall_pause (); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = __syscall_pause (); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +weak_alias (__libc_pause, pause) + +#ifndef NO_CANCELLATION +# include <not-cancel.h> + +int +__pause_nocancel (void) +{ + return __syscall_pause (); +} +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/pipe.c b/ports/sysdeps/unix/sysv/linux/generic/pipe.c new file mode 100644 index 0000000000..ca5c533355 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/pipe.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <stddef.h> + +/* Create a one-way communication channel (__pipe). + If successful, two file descriptors are stored in PIPEDES; + bytes written on PIPEDES[1] can be read from PIPEDES[0]. + Returns 0 if successful, -1 if not. */ +int +__pipe (int __pipedes[2]) +{ + return INLINE_SYSCALL (pipe2, 2, __pipedes, 0); +} +libc_hidden_def (__pipe) +weak_alias (__pipe, pipe) diff --git a/ports/sysdeps/unix/sysv/linux/generic/poll.c b/ports/sysdeps/unix/sysv/linux/generic/poll.c new file mode 100644 index 0000000000..d1dcd8a866 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/poll.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/poll.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +int +__poll (struct pollfd *fds, nfds_t nfds, int timeout) +{ + struct timespec timeout_ts; + struct timespec *timeout_ts_p = NULL; + + if (timeout >= 0) + { + timeout_ts.tv_sec = timeout / 1000; + timeout_ts.tv_nsec = (timeout % 1000) * 1000000; + timeout_ts_p = &timeout_ts; + } + + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout_ts_p, NULL, 0); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout_ts_p, NULL, 0); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +libc_hidden_def (__poll) +weak_alias (__poll, poll) +strong_alias (__poll, __libc_poll) diff --git a/ports/sysdeps/unix/sysv/linux/generic/readlink.c b/ports/sysdeps/unix/sysv/linux/generic/readlink.c new file mode 100644 index 0000000000..09cbf2b9a1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/readlink.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> + +/* Read the contents of the symbolic link PATH into no more than + LEN bytes of BUF. The contents are not null-terminated. + Returns the number of characters read, or -1 for errors. */ +ssize_t +__readlink (const char *path, char *buf, size_t len) +{ + return INLINE_SYSCALL (readlinkat, 4, AT_FDCWD, path, buf, len); +} +weak_alias (__readlink, readlink) diff --git a/ports/sysdeps/unix/sysv/linux/generic/readlink_chk.c b/ports/sysdeps/unix/sysv/linux/generic/readlink_chk.c new file mode 100644 index 0000000000..e1724aafeb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/readlink_chk.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <unistd.h> +#include <fcntl.h> +#include <sys/param.h> +#ifdef HAVE_INLINED_SYSCALLS +# include <errno.h> +# include <sysdep.h> +#endif + + +ssize_t +__readlink_chk (const char *path, void *buf, size_t len, size_t buflen) +{ + if (len > buflen) + __chk_fail (); + +#ifdef HAVE_INLINED_SYSCALLS + return INLINE_SYSCALL (readlinkat, 4, AT_FDCWD, path, buf, len); +#else + return __readlink (path, buf, len); +#endif +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/recv.c b/ports/sysdeps/unix/sysv/linux/generic/recv.c new file mode 100644 index 0000000000..ebff889979 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/recv.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdlib.h> +#include <sys/types.h> +#include <sysdep-cancel.h> +#include <libc-symbols.h> + +ssize_t +__libc_recv (int sockfd, void *buffer, size_t len, int flags) +{ + ssize_t result; + + if (SINGLE_THREAD_P) + result = INLINE_SYSCALL (recvfrom, 6, sockfd, buffer, len, flags, + NULL, NULL); + else + { + int oldtype = LIBC_CANCEL_ASYNC (); + + result = INLINE_SYSCALL (recvfrom, 6, sockfd, buffer, len, flags, + NULL, NULL); + + LIBC_CANCEL_RESET (oldtype); + } + + return result; +} +strong_alias (__libc_recv, __recv) +weak_alias (__libc_recv, recv) diff --git a/ports/sysdeps/unix/sysv/linux/generic/rename.c b/ports/sysdeps/unix/sysv/linux/generic/rename.c new file mode 100644 index 0000000000..50056e4ebe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/rename.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> +#include <sysdep.h> + +/* Rename the file OLD to NEW. */ +int +rename (const char *old, const char *new) +{ + return INLINE_SYSCALL (renameat, 4, AT_FDCWD, old, AT_FDCWD, new); +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/rmdir.c b/ports/sysdeps/unix/sysv/linux/generic/rmdir.c new file mode 100644 index 0000000000..97e0681628 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/rmdir.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> + + +/* Remove the directory PATH. */ +int +__rmdir (const char *path) +{ + return INLINE_SYSCALL (unlinkat, 3, AT_FDCWD, path, AT_REMOVEDIR); +} +weak_alias (__rmdir, rmdir) diff --git a/ports/sysdeps/unix/sysv/linux/generic/select.c b/ports/sysdeps/unix/sysv/linux/generic/select.c new file mode 100644 index 0000000000..143ebc9a07 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/select.c @@ -0,0 +1,74 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/time.h> +#include <sys/types.h> +#include <sys/select.h> +#include <errno.h> +#include <sysdep-cancel.h> + +/* Check the first NFDS descriptors each in READFDS (if not NULL) for read + readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS + (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out + after waiting the interval specified therein. Returns the number of ready + descriptors, or -1 for errors. */ + +int +__select(int nfds, fd_set *readfds, + fd_set *writefds, fd_set *exceptfds, + struct timeval *timeout) +{ + int result; + struct timespec ts, *tsp = NULL; + + if (timeout) + { + TIMEVAL_TO_TIMESPEC (timeout, &ts); + tsp = &ts; + } + + if (SINGLE_THREAD_P) + { + result = INLINE_SYSCALL (pselect6, 6, nfds, readfds, writefds, exceptfds, + tsp, NULL); + } + else + { + int oldtype = LIBC_CANCEL_ASYNC (); + + result = INLINE_SYSCALL (pselect6, 6, nfds, readfds, writefds, exceptfds, + tsp, NULL); + + LIBC_CANCEL_RESET (oldtype); + } + + if (timeout) + { + /* Linux by default will update the timeout after a pselect6 syscall + (though the pselect() glibc call suppresses this behavior). + Since select() on Linux has the same behavior as the pselect6 + syscall, we update the timeout here. */ + TIMESPEC_TO_TIMEVAL (timeout, &ts); + } + + return result; +} +libc_hidden_def (__select) + +weak_alias (__select, select) +weak_alias (__select, __libc_select) diff --git a/ports/sysdeps/unix/sysv/linux/generic/send.c b/ports/sysdeps/unix/sysv/linux/generic/send.c new file mode 100644 index 0000000000..28af554ed2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/send.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdlib.h> +#include <sys/types.h> +#include <sysdep-cancel.h> +#include <libc-symbols.h> + +ssize_t +__libc_send (int sockfd, const void *buffer, size_t len, int flags) +{ + ssize_t result; + + if (SINGLE_THREAD_P) + result = INLINE_SYSCALL (sendto, 6, sockfd, buffer, len, flags, NULL, 0); + else + { + int oldtype = LIBC_CANCEL_ASYNC (); + + result = INLINE_SYSCALL (sendto, 6, sockfd, buffer, len, flags, NULL, 0); + + LIBC_CANCEL_RESET (oldtype); + } + + return result; +} +strong_alias (__libc_send, __send) +weak_alias (__libc_send, send) diff --git a/ports/sysdeps/unix/sysv/linux/generic/symlink.c b/ports/sysdeps/unix/sysv/linux/generic/symlink.c new file mode 100644 index 0000000000..3d947c5e72 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/symlink.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> + +/* Make a link to FROM called TO. */ +int +__symlink (const char *from, const char *to) +{ + return INLINE_SYSCALL (symlinkat, 3, from, AT_FDCWD, to); +} +weak_alias (__symlink, symlink) diff --git a/ports/sysdeps/unix/sysv/linux/generic/syscalls.list b/ports/sysdeps/unix/sysv/linux/generic/syscalls.list new file mode 100644 index 0000000000..4b2e74762f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -0,0 +1,32 @@ +# File name Caller Syscall name # args Strong name Weak names + +# SysV APIs +msgget - msgget i:ii __msgget msgget +msgctl - msgctl i:iip __msgctl msgctl +msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv +msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +semget - semget i:iii __semget semget +semctl - semctl i:iiii __semctl semctl +semtimedop - semtimedop i:ipip semtimedop +semop - semop i:ipi __semop semop +shmget - shmget i:iii __shmget shmget +shmctl - shmctl i:iip __shmctl shmctl +shmat - shmat i:ipi __shmat shmat +shmdt - shmdt i:s __shmdt shmdt + +# Socket APIs +socket - socket i:iii __socket socket +socketpair - socketpair i:iiif __socketpair socketpair +bind - bind i:ipi __bind bind +listen - listen i:ii __listen listen +accept - accept Ci:iBN __libc_accept __accept accept +connect - connect Ci:ipi __libc_connect __connect connect +getsockname - getsockname i:ipp __getsockname getsockname +getpeername - getpeername i:ipp __getpeername getpeername +sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto +recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom +setsockopt - setsockopt i:iiibn __setsockopt setsockopt +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt +shutdown - shutdown i:ii __shutdown shutdown +sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg +recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg diff --git a/ports/sysdeps/unix/sysv/linux/generic/sysctl.c b/ports/sysdeps/unix/sysv/linux/generic/sysctl.c new file mode 100644 index 0000000000..0bdb78660b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/sysctl.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* This deprecated syscall is no longer used (replaced with /proc/sys). */ +int +sysctl (int *name, int nlen, void *oldval, size_t *oldlenp, + void *newval, size_t newlen) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (sysctl) +#include <stub-tag.h> diff --git a/ports/sysdeps/unix/sysv/linux/generic/sysdep.h b/ports/sysdeps/unix/sysv/linux/generic/sysdep.h new file mode 100644 index 0000000000..842a196386 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/sysdep.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <bits/wordsize.h> +#include <kernel-features.h> + +/* Provide the common name to allow more code reuse. */ +#define __NR__llseek __NR_llseek + +#if __WORDSIZE == 64 +/* By defining the older names, glibc will build syscall wrappers for + both pread and pread64; sysdeps/unix/sysv/linux/wordsize-64/pread64.c + will suppress generating any separate code for pread64.c. */ +#define __NR_pread __NR_pread64 +#define __NR_pwrite __NR_pwrite64 +#endif + +/* Provide a dummy argument that can be used to force register + alignment for register pairs if required by the syscall ABI. */ +#ifdef __ASSUME_ALIGNED_REGISTER_PAIRS +#define __ALIGNMENT_ARG 0, +#define __ALIGNMENT_COUNT(a,b) b +#else +#define __ALIGNMENT_ARG +#define __ALIGNMENT_COUNT(a,b) a +#endif diff --git a/ports/sysdeps/unix/sysv/linux/generic/umount.c b/ports/sysdeps/unix/sysv/linux/generic/umount.c new file mode 100644 index 0000000000..c799b22ba6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/umount.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Since the generic Linux syscall ABI doesn't have an oldumount system call, + do what the kernel does down here. */ + +extern long int __umount2 (const char *name, int flags); + +long int +__umount (const char *name) +{ + return __umount2 (name, 0); +} + +weak_alias (__umount, umount); diff --git a/ports/sysdeps/unix/sysv/linux/generic/unlink.c b/ports/sysdeps/unix/sysv/linux/generic/unlink.c new file mode 100644 index 0000000000..3969867f29 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/unlink.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#include <fcntl.h> + + +/* Remove the link named NAME. */ +int +__unlink (const char *name) +{ + return INLINE_SYSCALL (unlinkat, 3, AT_FDCWD, name, 0); +} +weak_alias (__unlink, unlink) diff --git a/ports/sysdeps/unix/sysv/linux/generic/ustat.c b/ports/sysdeps/unix/sysv/linux/generic/ustat.c new file mode 100644 index 0000000000..7611e82f0f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/ustat.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/ustat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* This deprecated syscall is no longer used (replaced with fstat). */ +int +ustat (dev_t dev, struct ustat *ubuf) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (ustat) +#include <stub-tag.h> diff --git a/ports/sysdeps/unix/sysv/linux/generic/utimes.c b/ports/sysdeps/unix/sysv/linux/generic/utimes.c new file mode 100644 index 0000000000..9ecef48c71 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/utimes.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <utime.h> +#include <fcntl.h> +#include <sys/time.h> +#include <sysdep.h> + + +/* Change the access time of FILE to TVP[0] and + the modification time of FILE to TVP[1]. */ +int +__utimes (const char *file, const struct timeval tvp[2]) +{ + struct timespec ts[2]; + struct timespec *tsp = NULL; + + if (tvp) + { + TIMEVAL_TO_TIMESPEC (&tvp[0], &ts[0]); + TIMEVAL_TO_TIMESPEC (&tvp[1], &ts[1]); + tsp = &ts[0]; + } + + return INLINE_SYSCALL (utimensat, 4, AT_FDCWD, file, tsp, 0); +} + +weak_alias (__utimes, utimes) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions new file mode 100644 index 0000000000..cdc6022015 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions @@ -0,0 +1,5 @@ +libc { + GLIBC_2.15 { + fallocate64; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c new file mode 100644 index 0000000000..b66190bc08 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c @@ -0,0 +1,87 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#include <sysdep-cancel.h> /* Must come before <fcntl.h>. */ +#include <fcntl.h> +#include <stdarg.h> + +#include <sys/syscall.h> +#include <kernel-features.h> + + +static int +do_fcntl (int fd, int cmd, void *arg) +{ + if (cmd != F_GETOWN) + return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg); + + INTERNAL_SYSCALL_DECL (err); + struct f_owner_ex fex; + int res = INTERNAL_SYSCALL (fcntl64, err, 3, fd, F_GETOWN_EX, &fex); + if (!INTERNAL_SYSCALL_ERROR_P (res, err)) + return fex.type == F_OWNER_GID ? -fex.pid : fex.pid; + + __set_errno (INTERNAL_SYSCALL_ERRNO (res, err)); + return -1; +} + + +#ifndef NO_CANCELLATION +int +__fcntl_nocancel (int fd, int cmd, ...) +{ + va_list ap; + void *arg; + + va_start (ap, cmd); + arg = va_arg (ap, void *); + va_end (ap); + + return do_fcntl (fd, cmd, arg); +} +#endif + + +int +__libc_fcntl (int fd, int cmd, ...) +{ + va_list ap; + void *arg; + + va_start (ap, cmd); + arg = va_arg (ap, void *); + va_end (ap); + + if (SINGLE_THREAD_P || cmd != F_SETLKW) + return do_fcntl (fd, cmd, arg); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = do_fcntl (fd, cmd, arg); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +libc_hidden_def (__libc_fcntl) + +weak_alias (__libc_fcntl, __fcntl) +libc_hidden_weak (__fcntl) +weak_alias (__libc_fcntl, fcntl) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c new file mode 100644 index 0000000000..21d92d6cb3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/statfs.h> +#include <stddef.h> + +#include "overflow.h" + +/* Return information about the filesystem on which FD resides. */ +int +__fstatfs (int fd, struct statfs *buf) +{ + int rc = INLINE_SYSCALL (fstatfs64, 3, fd, sizeof (*buf), buf); + return rc ?: statfs_overflow (buf); +} +weak_alias (__fstatfs, fstatfs) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c new file mode 100644 index 0000000000..a5b5808ebe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/types.h> +#include <unistd.h> + +/* Truncate the file FD refers to to LENGTH bytes. */ +int +__ftruncate (int fd, off_t length) +{ + return INLINE_SYSCALL (ftruncate64, __ALIGNMENT_COUNT (3, 4), fd, + __ALIGNMENT_ARG + __LONG_LONG_PAIR (length >> 31, length)); +} +weak_alias (__ftruncate, ftruncate) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c new file mode 100644 index 0000000000..4ccfa78b4d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/types.h> +#include <unistd.h> + +/* Truncate the file FD refers to to LENGTH bytes. */ +int +__ftruncate64 (int fd, off64_t length) +{ + unsigned int low = length & 0xffffffff; + unsigned int high = length >> 32; + return INLINE_SYSCALL (ftruncate64, __ALIGNMENT_COUNT (3, 4), fd, + __ALIGNMENT_ARG __LONG_LONG_PAIR (high, low)); +} +weak_alias (__ftruncate64, ftruncate64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c new file mode 100644 index 0000000000..70551bedca --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +#include "overflow.h" + +/* Get information about the file FD in BUF. */ +int +__fxstat (int vers, int fd, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstat64, 2, fd, buf); + return rc ?: stat_overflow (buf); + } + + errno = EINVAL; + return -1; +} + +hidden_def (__fxstat) +weak_alias (__fxstat, _fxstat); diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c new file mode 100644 index 0000000000..790d85c981 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <stddef.h> +#include <stdio.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <kernel-features.h> + +#include "overflow.h" + +/* Get information about the file NAME in BUF. */ +int +__fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, fd, file, buf, flag); + return rc ?: stat_overflow (buf); + } + + errno = EINVAL; + return -1; +} +libc_hidden_def (__fxstatat) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c new file mode 100644 index 0000000000..d7d0f04f43 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c @@ -0,0 +1,115 @@ +/* Copyright (C) 1993, 1995-2003, 2004, 2006, 2007, 2011 + This file is part of the GNU C Library. + Simplified from sysdeps/unix/sysv/linux/getdents.c. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <alloca.h> +#include <assert.h> +#include <errno.h> +#include <dirent.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> +#include <unistd.h> +#include <sys/param.h> +#include <sys/types.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Pack the dirent64 struct down into 32-bit offset/inode fields, and + ensure that no overflow occurs. */ +ssize_t +__getdents (int fd, char *buf, size_t nbytes) +{ + union + { + struct dirent64 k; /* Kernel structure. */ + struct dirent u; + char b[1]; + } *kbuf = (void *) buf, *outp, *inp; + size_t kbytes = nbytes; + off64_t last_offset = -1; + ssize_t retval; + + const size_t size_diff = (offsetof (struct dirent64, d_name) + - offsetof (struct dirent, d_name)); + if (nbytes <= sizeof (struct dirent)) + { + kbytes = nbytes + offsetof (struct dirent64, d_name) + - offsetof (struct dirent, d_name); + kbuf = __alloca(kbytes); + } + + retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes); + if (retval == -1) + return -1; + + /* These two pointers might alias the same memory buffer. + Standard C requires that we always use the same type for them, + so we must use the union type. */ + inp = kbuf; + outp = (void *) buf; + + while (&inp->b < &kbuf->b + retval) + { + const size_t alignment = __alignof__ (struct dirent); + /* Since inp->k.d_reclen is already aligned for the kernel + structure this may compute a value that is bigger + than necessary. */ + size_t old_reclen = inp->k.d_reclen; + size_t new_reclen = ((old_reclen - size_diff + alignment - 1) + & ~(alignment - 1)); + + /* Copy the data out of the old structure into temporary space. + Then copy the name, which may overlap if BUF == KBUF. */ + const uint64_t d_ino = inp->k.d_ino; + const int64_t d_off = inp->k.d_off; + const uint8_t d_type = inp->k.d_type; + + memmove (outp->u.d_name, inp->k.d_name, + old_reclen - offsetof (struct dirent64, d_name)); + + /* Now we have copied the data from INP and access only OUTP. */ + + outp->u.d_ino = d_ino; + outp->u.d_off = d_off; + if ((sizeof (outp->u.d_ino) != sizeof (inp->k.d_ino) + && outp->u.d_ino != d_ino) + || (sizeof (outp->u.d_off) != sizeof (inp->k.d_off) + && outp->u.d_off != d_off)) + { + /* Overflow. If there was at least one entry before this one, + return them without error, otherwise signal overflow. */ + if (last_offset != -1) + { + __lseek64 (fd, last_offset, SEEK_SET); + return outp->b - buf; + } + __set_errno (EOVERFLOW); + return -1; + } + + last_offset = d_off; + outp->u.d_reclen = new_reclen; + outp->u.d_type = d_type; + + inp = (void *) inp + old_reclen; + outp = (void *) outp + new_reclen; + } + + return outp->b - buf; +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c new file mode 100644 index 0000000000..699e602536 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c @@ -0,0 +1,46 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/types.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Seek to OFFSET on FD, starting from WHENCE. */ +extern loff_t __llseek (int fd, loff_t offset, int whence); + +loff_t +__llseek (int fd, loff_t offset, int whence) +{ + loff_t retval; + + return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), + (off_t) (offset & 0xffffffff), + &retval, whence) ?: retval); +} +weak_alias (__llseek, llseek) +strong_alias (__llseek, __libc_lseek64) +strong_alias (__llseek, __lseek64) +weak_alias (__llseek, lseek64) + +/* llseek doesn't have a prototype. Since the second parameter is a + 64bit type, this results in wrong behaviour if no prototype is + provided. */ +link_warning (llseek, "\ +the `llseek' function may be dangerous; use `lseek64' instead.") diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c new file mode 100644 index 0000000000..a9a75e88a0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sys/types.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +#include "overflow.h" + +off_t +__lseek (int fd, off_t offset, int whence) +{ + loff_t res; + int rc = INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 31), + (off_t) offset, &res, whence); + return rc ?: lseek_overflow (res); +} +libc_hidden_def (__lseek) +weak_alias (__lseek, lseek) +strong_alias (__lseek, __libc_lseek) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c new file mode 100644 index 0000000000..db1d885a4d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +#include "overflow.h" + +/* Get information about the file NAME in BUF. */ +int +__lxstat (int vers, const char *name, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, + AT_SYMLINK_NOFOLLOW); + return rc ?: stat_overflow (buf); + } + errno = EINVAL; + return -1; +} +hidden_def (__lxstat) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c new file mode 100644 index 0000000000..5a43dc6f42 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Get information about the file NAME in BUF. */ +int +__lxstat64 (int vers, const char *name, struct stat64 *buf) +{ + if (vers == _STAT_VER_KERNEL) + return INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, + AT_SYMLINK_NOFOLLOW); + errno = EINVAL; + return -1; +} +hidden_def (__lxstat64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c new file mode 100644 index 0000000000..588ad6bd81 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <sys/mman.h> +#include <errno.h> +#include <sysdep.h> + +#ifndef MMAP_PAGE_SHIFT +#define MMAP_PAGE_SHIFT 12 +#endif + +__ptr_t +__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +{ + if (offset & ((1 << MMAP_PAGE_SHIFT) - 1)) + { + __set_errno (EINVAL); + return MAP_FAILED; + } + return (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, fd, + offset >> MMAP_PAGE_SHIFT); +} + +weak_alias (__mmap, mmap) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h new file mode 100644 index 0000000000..59432249e4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h @@ -0,0 +1,60 @@ +/* Overflow tests for stat, statfs, and lseek functions. + Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/stat.h> +#include <sys/statfs.h> + +/* Test for overflows of structures where we ask the kernel to fill them + in with standard 64-bit syscalls but return them through APIs that + only expose the low 32 bits of some fields. */ + +static inline off_t lseek_overflow (loff_t res) +{ + off_t retval = (off_t) res; + if (retval == res) + return retval; + + __set_errno (EOVERFLOW); + return (off_t) -1; +} + +static inline int stat_overflow (struct stat *buf) +{ + if (buf->__st_ino_pad == 0 && buf->__st_size_pad == 0 && + buf->__st_blocks_pad == 0) + return 0; + + __set_errno (EOVERFLOW); + return -1; +} + +/* Note that f_files and f_ffree may validly be a sign-extended -1. */ +static inline int statfs_overflow (struct statfs *buf) +{ + if (buf->__f_blocks_pad == 0 && buf->__f_bfree_pad == 0 && + buf->__f_bavail_pad == 0 && + (buf->__f_files_pad == 0 || + (buf->f_files == -1U && buf->__f_files_pad == -1)) && + (buf->__f_ffree_pad == 0 || + (buf->f_ffree == -1U && buf->__f_ffree_pad == -1))) + return 0; + + __set_errno (EOVERFLOW); + return -1; +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c new file mode 100644 index 0000000000..f8f486cb71 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +posix_fadvise (int fd, off_t offset, off_t len, int advise) +{ + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, + __LONG_LONG_PAIR (offset >> 31, offset), + __LONG_LONG_PAIR (len >> 31, len), + advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c new file mode 100644 index 0000000000..5145755e80 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c @@ -0,0 +1,58 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_pread (int fd, void *buf, size_t count, off_t offset) +{ + assert (sizeof (offset) == 4); + return INLINE_SYSCALL (pread64, __ALIGNMENT_COUNT (5, 6), fd, + buf, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR (offset >> 31, offset)); +} + +ssize_t +__libc_pread (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off_t offset; +{ + if (SINGLE_THREAD_P) + return do_pread (fd, buf, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pread (fd, buf, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +strong_alias (__libc_pread, __pread) +weak_alias (__libc_pread, pread) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c new file mode 100644 index 0000000000..fd3aa1f280 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c @@ -0,0 +1,58 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_pread64 (int fd, void *buf, size_t count, off64_t offset) +{ + return INLINE_SYSCALL (pread64, __ALIGNMENT_COUNT (5, 6), fd, + buf, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +} + + +ssize_t +__libc_pread64 (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off64_t offset; +{ + if (SINGLE_THREAD_P) + return do_pread64 (fd, buf, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pread64 (fd, buf, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c new file mode 100644 index 0000000000..a110c1584d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#include <endian.h> +#include <unistd.h> +#include <sys/uio.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_preadv (int fd, const struct iovec *vector, int count, off_t offset) +{ + assert (sizeof (offset) == 4); + return INLINE_SYSCALL (preadv, __ALIGNMENT_COUNT (5, 6), fd, + vector, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR (offset >> 31, offset)); +} + +ssize_t +__libc_preadv (int fd, const struct iovec *vector, int count, off_t offset) +{ + if (SINGLE_THREAD_P) + return do_preadv (fd, vector, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_preadv (fd, vector, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +strong_alias (__libc_preadv, __preadv) +weak_alias (__libc_preadv, preadv) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c new file mode 100644 index 0000000000..b08a470c5d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c @@ -0,0 +1,56 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> +#include <sys/uio.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) +{ + return INLINE_SYSCALL (preadv, __ALIGNMENT_COUNT (5, 6), fd, + vector, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +} + + +ssize_t +__libc_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) +{ + if (SINGLE_THREAD_P) + return do_preadv64 (fd, vector, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_preadv64 (fd, vector, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_preadv64, __preadv64) +weak_alias (__libc_preadv64, preadv64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c new file mode 100644 index 0000000000..0f226ff79a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c @@ -0,0 +1,59 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_pwrite (int fd, const void *buf, size_t count, off_t offset) +{ + assert (sizeof (offset) == 4); + return INLINE_SYSCALL (pwrite64, __ALIGNMENT_COUNT (5, 6), fd, + buf, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR (offset >> 31, offset)); +} + + +ssize_t +__libc_pwrite (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off_t offset; +{ + if (SINGLE_THREAD_P) + return do_pwrite (fd, buf, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pwrite (fd, buf, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +strong_alias (__libc_pwrite, __pwrite) +weak_alias (__libc_pwrite, pwrite) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c new file mode 100644 index 0000000000..1afc13d245 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c @@ -0,0 +1,59 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) +{ + return INLINE_SYSCALL (pwrite64, __ALIGNMENT_COUNT (5, 6), fd, + buf, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +} + + +ssize_t +__libc_pwrite64 (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off64_t offset; +{ + if (SINGLE_THREAD_P) + return do_pwrite64 (fd, buf, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pwrite64 (fd, buf, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pwrite64, __pwrite64) +libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c new file mode 100644 index 0000000000..cc6bf5dd02 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c @@ -0,0 +1,56 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#include <endian.h> +#include <unistd.h> +#include <sys/uio.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_pwritev (int fd, const struct iovec *vector, int count, off_t offset) +{ + assert (sizeof (offset) == 4); + return INLINE_SYSCALL (pwritev, __ALIGNMENT_COUNT (5, 6), fd, + vector, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR (offset >> 31, offset)); +} + + +ssize_t +__libc_pwritev (int fd, const struct iovec *vector, int count, off_t offset) +{ + if (SINGLE_THREAD_P) + return do_pwritev (fd, vector, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pwritev (fd, vector, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +strong_alias (__libc_pwritev, __pwritev) +weak_alias (__libc_pwritev, pwritev) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c new file mode 100644 index 0000000000..752cbcab83 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <endian.h> +#include <unistd.h> +#include <sys/uio.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + +#include <kernel-features.h> + +static ssize_t +do_pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset) +{ + return INLINE_SYSCALL (pwritev, __ALIGNMENT_COUNT (5, 6), fd, + vector, count, __ALIGNMENT_ARG + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +} + + +ssize_t +__libc_pwritev64 (int fd, const struct iovec *vector, int count, + off64_t offset) +{ + if (SINGLE_THREAD_P) + return do_pwritev64 (fd, vector, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pwritev64 (fd, vector, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pwritev64, pwritev64) +weak_alias (__libc_pwritev64, __pwritev64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c new file mode 100644 index 0000000000..eb4a13ea4c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/sendfile.h> +#include <errno.h> + +/* Send COUNT bytes from file associated with IN_FD starting at OFFSET to + descriptor OUT_FD. */ +ssize_t +sendfile (int out_fd, int in_fd, off_t *offset, size_t count) +{ + __off64_t off64; + int rc; + + if (offset != NULL) + { + if (*offset < 0 || (off_t) (*offset + count) < 0) + { + __set_errno (EINVAL); + return -1; + } + off64 = *offset; + } + + rc = INLINE_SYSCALL (sendfile64, 4, out_fd, in_fd, + offset ? &off64 : NULL, count); + if (offset) + *offset = off64; + return rc; +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c new file mode 100644 index 0000000000..a451a2c5c3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/statfs.h> +#include <stddef.h> + +#include "overflow.h" + +/* Return information about the filesystem on which FILE resides. */ +int +__statfs (const char *file, struct statfs *buf) +{ + int rc = INLINE_SYSCALL (statfs64, 3, file, sizeof (*buf), buf); + return rc ?: statfs_overflow (buf); +} +libc_hidden_def (__statfs) +weak_alias (__statfs, statfs) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list new file mode 100644 index 0000000000..58b4057f4b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list @@ -0,0 +1,7 @@ +# File name Caller Syscall name # args Strong name Weak names + +# rlimit APIs +getrlimit - getrlimit i:ip __getrlimit getrlimit +setrlimit - setrlimit i:ip __setrlimit setrlimit +prlimit64 EXTRA prlimit64 i:iipp prlimit64 +fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c new file mode 100644 index 0000000000..c07f830937 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/types.h> +#include <unistd.h> + +/* Truncate PATH to LENGTH bytes. */ +int +__truncate (const char *path, off_t length) +{ + return INLINE_SYSCALL (truncate64, __ALIGNMENT_COUNT (3, 4), path, + __ALIGNMENT_ARG + __LONG_LONG_PAIR (length >> 31, length)); +} +weak_alias (__truncate, truncate) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c new file mode 100644 index 0000000000..27ddb1bd02 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/types.h> +#include <unistd.h> + +/* Truncate the file PATH to LENGTH bytes. */ +int +truncate64 (const char *path, off64_t length) +{ + unsigned int low = length & 0xffffffff; + unsigned int high = length >> 32; + return INLINE_SYSCALL (truncate64, __ALIGNMENT_COUNT (3, 4), path, + __ALIGNMENT_ARG __LONG_LONG_PAIR (high, low)); +} diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c new file mode 100644 index 0000000000..7431a37b60 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +#include "overflow.h" + +/* Get information about the file NAME in BUF. */ +int +__xstat (int vers, const char *name, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0); + return rc ?: stat_overflow (buf); + } + + errno = EINVAL; + return -1; +} +hidden_def (__xstat) diff --git a/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c new file mode 100644 index 0000000000..b4ad5b6c7c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Get information about the file NAME in BUF. */ +int +__xstat64 (int vers, const char *name, struct stat64 *buf) +{ + if (vers == _STAT_VER_KERNEL) + return INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0); + + errno = EINVAL; + return -1; +} +hidden_def (__xstat64) diff --git a/ports/sysdeps/unix/sysv/linux/generic/xmknod.c b/ports/sysdeps/unix/sysv/linux/generic/xmknod.c new file mode 100644 index 0000000000..924092dfff --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/xmknod.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/sysmacros.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Create a device file named PATH, with permission and special bits MODE + and device number DEV (which can be constructed from major and minor + device numbers with the `makedev' macro above). */ +int +__xmknod (int vers, const char *path, mode_t mode, dev_t *dev) +{ + unsigned long long int k_dev; + + if (vers != _MKNOD_VER) + { + __set_errno (EINVAL); + return -1; + } + + /* We must convert the value to dev_t type used by the kernel. */ + k_dev = (*dev) & ((1ULL << 32) - 1); + if (k_dev != *dev) + { + __set_errno (EINVAL); + return -1; + } + + return INLINE_SYSCALL (mknodat, 4, AT_FDCWD, path, mode, + (unsigned int) k_dev); +} +weak_alias (__xmknod, _xmknod) +libc_hidden_def (__xmknod) diff --git a/ports/sysdeps/unix/sysv/linux/generic/xstat.c b/ports/sysdeps/unix/sysv/linux/generic/xstat.c new file mode 100644 index 0000000000..14cea4aa18 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/generic/xstat.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Ignore prototype to avoid error if we alias __xstat and __xstat64. */ +#define __xstat64 __xstat64_disable + +#include <errno.h> +#include <stddef.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Get information about the file NAME in BUF. */ +int +__xstat (int vers, const char *name, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + return INLINE_SYSCALL (newfstatat, 4, AT_FDCWD, name, buf, 0); + + errno = EINVAL; + return -1; +} + +hidden_def (__xstat) +weak_alias (__xstat, _xstat); +#ifdef XSTAT_IS_XSTAT64 +#undef __xstat64 +strong_alias (__xstat, __xstat64); +hidden_ver (__xstat, __xstat64) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/hppa/Makefile b/ports/sysdeps/unix/sysv/linux/hppa/Makefile new file mode 100644 index 0000000000..4c3a1148ca --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/Makefile @@ -0,0 +1,5 @@ +# Used by *context() functions +ifeq ($(subdir),stdlib) +gen-as-const-headers += ucontext_i.sym +endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/Versions b/ports/sysdeps/unix/sysv/linux/hppa/Versions new file mode 100644 index 0000000000..3bff6ec4fc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/Versions @@ -0,0 +1,36 @@ +libc { + # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk. + # When you get an error from errlist-compat.awk, you need to add a new + # version here. Don't do this blindly, since this means changing the ABI + # for all GNU/Linux configurations. + + GLIBC_2.1 { + #errlist-compat 253 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_2.2 { + # New rlimit interface + getrlimit; setrlimit; getrlimit64; setrlimit64; + } + GLIBC_2.3 { + #errlist-compat 254 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_2.4 { + #errlist-compat 256 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } + GLIBC_2.11 { + fallocate64; + } + GLIBC_2.12 { + #errlist-compat 257 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + } +} +librt { + GLIBC_2.3 { + # AIO functions. + aio_cancel; aio_cancel64; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h new file mode 100644 index 0000000000..457c2e967a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h @@ -0,0 +1,107 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2005. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdint.h> /* Required for type definitions e.g. uint8_t. */ +#include <abort-instr.h> /* Required for ABORT_INSTRUCTIUON. */ +#include <kernel-features.h> /* Required for __ASSUME_LWS_CAS. */ + +/* We need EFAULT, ENONSYS */ +#if !defined EFAULT && !defined ENOSYS +#define EFAULT 14 +#define ENOSYS 251 +#endif + +#ifndef _BITS_ATOMIC_H +#define _BITS_ATOMIC_H 1 + +typedef int8_t atomic8_t; +typedef uint8_t uatomic8_t; +typedef int_fast8_t atomic_fast8_t; +typedef uint_fast8_t uatomic_fast8_t; + +typedef int32_t atomic32_t; +typedef uint32_t uatomic32_t; +typedef int_fast32_t atomic_fast32_t; +typedef uint_fast32_t uatomic_fast32_t; + +typedef intptr_t atomicptr_t; +typedef uintptr_t uatomicptr_t; +typedef intmax_t atomic_max_t; +typedef uintmax_t uatomic_max_t; + +/* prev = *addr; + if (prev == old) + *addr = new; + return prev; */ + +/* Use the kernel atomic light weight syscalls on hppa. */ +#define _LWS "0xb0" +#define _LWS_CAS "0" +/* Note r31 is the link register. */ +#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" +/* String constant for -EAGAIN. */ +#define _ASM_EAGAIN "-11" +/* String constant for -EDEADLOCK. */ +#define _ASM_EDEADLOCK "-45" + +#if __ASSUME_LWS_CAS +/* The only basic operation needed is compare and exchange. */ +# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ + ({ \ + volatile int lws_errno; \ + volatile int lws_ret; \ + asm volatile( \ + "0: \n\t" \ + "copy %2, %%r26 \n\t" \ + "copy %3, %%r25 \n\t" \ + "copy %4, %%r24 \n\t" \ + "ble " _LWS "(%%sr2, %%r0) \n\t" \ + "ldi " _LWS_CAS ", %%r20 \n\t" \ + "ldi " _ASM_EAGAIN ", %%r24 \n\t" \ + "cmpb,=,n %%r24, %%r21, 0b \n\t" \ + "nop \n\t" \ + "ldi " _ASM_EDEADLOCK ", %%r25 \n\t" \ + "cmpb,=,n %%r25, %%r21, 0b \n\t" \ + "nop \n\t" \ + "stw %%r28, %0 \n\t" \ + "stw %%r21, %1 \n\t" \ + : "=m" (lws_ret), "=m" (lws_errno) \ + : "r" (mem), "r" (oldval), "r" (newval) \ + : _LWS_CLOBBER \ + ); \ + \ + if(lws_errno == -EFAULT || lws_errno == -ENOSYS) \ + ABORT_INSTRUCTION; \ + \ + lws_ret; \ + }) + +# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ + ({ \ + int ret; \ + ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval); \ + /* Return 1 if it was already acquired. */ \ + (ret != (int)oldval); \ + }) +#else +# error __ASSUME_LWS_CAS is required to build glibc. +#endif +/* __ASSUME_LWS_CAS */ + +#endif +/* _BITS_ATOMIC_H */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/errno.h new file mode 100644 index 0000000000..2487739e35 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/errno.h @@ -0,0 +1,62 @@ +/* Error constants. Linux/HPPA specific version. + Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _ERRNO_H + +# undef EDOM +# undef EILSEQ +# undef ERANGE +# include <linux/errno.h> + +/* Linux also has no ECANCELED error code. Since it is not used here + we define it to an invalid value. */ +# ifndef ECANCELED +# define ECANCELED ECANCELLED +# endif + +# ifndef EOWNERDEAD +# define EOWNERDEAD 254 +# endif + +# ifndef ENOTRECOVERABLE +# define ENOTRECOVERABLE 255 +# endif + +# ifndef ERFKILL +# define ERFKILL 256 +# endif + +# ifndef __ASSEMBLER__ +/* Function to get address of global `errno' variable. */ +extern int *__errno_location (void) __THROW __attribute__ ((__const__)); + +# if !defined _LIBC || defined _LIBC_REENTRANT +/* When using threads, errno is a per-thread value. */ +# define errno (*__errno_location ()) +# endif +# endif /* !__ASSEMBLER__ */ +#endif /* _ERRNO_H */ + +#if !defined _ERRNO_H && defined __need_Emath +/* This is ugly but the kernel header is not clean enough. We must + define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is + defined. */ +# define EDOM 33 /* Math argument out of domain of function. */ +# define EILSEQ 47 /* Illegal byte sequence. */ +# define ERANGE 34 /* Math result not representable. */ +#endif /* !_ERRNO_H && __need_Emath */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h new file mode 100644 index 0000000000..c0e949eea3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h @@ -0,0 +1,321 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995-1999, 2000, 2002, 2004, 2010, 2011 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + +#include <sys/types.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on a few file systems. */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 00000400 /* not fcntl */ +#define O_EXCL 00002000 /* not fcntl */ +#define O_NOCTTY 00400000 /* not fcntl */ +#define O_TRUNC 00001000 /* not fcntl */ +#define O_APPEND 00000010 +#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define O_NDELAY O_NONBLOCK +#define O_SYNC 00100000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 +#define O_BLKSEEK 00000100 /* HPUX only */ + +#ifdef __USE_XOPEN2K8 +# define O_DIRECTORY 000010000 /* Must be a directory. */ +# define O_NOFOLLOW 000000200 /* Do not follow links. */ +# define O_CLOEXEC 010000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_NOATIME 004000000 /* Do not set atime. */ +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 01000000 /* HPUX only */ +# define O_RSYNC 02000000 /* HPUX only */ +#endif + +#ifdef __USE_LARGEFILE64 +# define O_LARGEFILE 00004000 +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 5 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#endif +#define F_GETLK64 8 /* Get record locking info. */ +#define F_SETLK64 9 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 10 /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_GETOWN 11 /* Get owner of socket (receiver of SIGIO). */ +# define F_SETOWN 12 /* Set owner of socket (receiver of SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 13 /* Set number of signal to be sent. */ +# define F_GETSIG 14 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ + +/* For old implementation of bsd flock(). */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation. */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h new file mode 100644 index 0000000000..7e9ed169fb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IOCTL_H +# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead." +#endif + +/* Use the definitions from the kernel header files. */ +#include <asm/ioctls.h> + +/* Oh well, this is necessary since the kernel data structure is + different from the user-level version. */ +#undef TCGETS +#undef TCSETS +#undef TCSETSW +#undef TCSETSF +#define TCGETS _IOR ('T', 16, char[36]) +#define TCSETS _IOW ('T', 17, char[36]) +#define TCSETSW _IOW ('T', 18, char[36]) +#define TCSETSF _IOW ('T', 19, char[36]) + +#include <linux/sockios.h> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h new file mode 100644 index 0000000000..350fd2b8f3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/ipc.h @@ -0,0 +1,62 @@ +/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IPC_H +# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." +#endif + +#include <bits/types.h> +#include <bits/wordsize.h> + +/* Mode bits for `msgget', `semget', and `shmget'. */ +#define IPC_CREAT 01000 /* Create key if key does not exist. */ +#define IPC_EXCL 02000 /* Fail if key exists. */ +#define IPC_NOWAIT 04000 /* Return error on wait. */ + +/* Control commands for `msgctl', `semctl', and `shmctl'. */ +#define IPC_RMID 0 /* Remove identifier. */ +#define IPC_SET 1 /* Set `ipc_perm' options. */ +#define IPC_STAT 2 /* Get `ipc_perm' options. */ +#ifdef __USE_GNU +# define IPC_INFO 3 /* See ipcs. */ +#endif + +/* Special key values. */ +#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ + + +/* Data structure used to pass permission information to IPC operations. */ +struct ipc_perm + { + __key_t __key; /* Key. */ + __uid_t uid; /* Owner's user ID. */ + __gid_t gid; /* Owner's group ID. */ + __uid_t cuid; /* Creator's user ID. */ + __gid_t cgid; /* Creator's group ID. */ +#if __WORDSIZE == 32 + unsigned short int __pad1; + unsigned short int mode; /* Read/write permission. */ + unsigned short int __pad2; +#else + __mode_t mode; /* Read/write permission. */ + unsigned short int __pad2; +#endif + unsigned short int __seq; /* Sequence number. */ + unsigned int __pad3; + unsigned long long int __unused1; + unsigned long long int __unused2; + }; diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h new file mode 100644 index 0000000000..e269a44e51 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h @@ -0,0 +1,109 @@ +/* Definitions for POSIX memory map interface. Linux/HPPA version. + Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* These are taken from the kernel definitions. */ + +#define PROT_READ 0x1 /* Page can be read */ +#define PROT_WRITE 0x2 /* Page can be written */ +#define PROT_EXEC 0x4 /* Page can be executed */ +#define PROT_NONE 0x0 /* Page can not be accessed */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +#define MAP_SHARED 0x01 /* Share changes */ +#define MAP_PRIVATE 0x02 /* Changes are private */ +#ifdef __USE_MISC +# define MAP_TYPE 0x03 /* Mask for type of mapping */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x04 /* Interpret addr exactly */ +#ifdef __USE_MISC +# define MAP_FILE 0x0 +# define MAP_ANONYMOUS 0x10 /* Don't use a file */ +# define MAP_ANON MAP_ANONYMOUS +# define MAP_VARIABLE 0 +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_DENYWRITE 0x0800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable */ +# define MAP_LOCKED 0x2000 /* Pages are locked */ +# define MAP_NORESERVE 0x4000 /* Don't check for reservations */ +# define MAP_GROWSDOWN 0x8000 /* Stack-like segment */ +# define MAP_POPULATE 0x10000 /* Populate (prefault) pagetables */ +# define MAP_NONBLOCK 0x20000 /* Do not block on IO */ +#endif + +/* Flags to "msync" */ +#define MS_SYNC 1 /* Synchronous memory sync */ +#define MS_ASYNC 2 /* Sync memory asynchronously */ +#define MS_INVALIDATE 4 /* Invalidate the caches */ + +/* Flags to "mlockall" */ +#define MCL_CURRENT 1 /* Lock all current mappings */ +#define MCL_FUTURE 2 /* Lock all future mappings */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to "madvise" */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment */ +# define MADV_RANDOM 1 /* Expect random page references */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references */ +# define MADV_WILLNEED 3 /* Will need these pages */ +# define MADV_DONTNEED 4 /* Dont need these pages */ +# define MADV_SPACEAVAIL 5 /* Insure that resources are reserved */ +# define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */ +# define MADV_VPS_INHERIT 7 /* Inherit parents page size */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 65 /* KSM may merge identical pages */ +# define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */ +#endif + +/* The range 12-64 is reserved for page size specification. */ +#define MADV_4K_PAGES 12 /* Use 4K pages */ +#define MADV_16K_PAGES 14 /* Use 16K pages */ +#define MADV_64K_PAGES 16 /* Use 64K pages */ +#define MADV_256K_PAGES 18 /* Use 256K pages */ +#define MADV_1M_PAGES 20 /* Use 1 Megabyte pages */ +#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */ +#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */ +#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */ + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h new file mode 100644 index 0000000000..d258ab5af7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h @@ -0,0 +1,83 @@ +/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MSG_H +# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." +#endif + +#include <bits/types.h> +#include <bits/wordsize.h> + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ +#ifdef __USE_GNU +# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ +#endif + +/* Types used in the structure definition. */ +typedef unsigned long int msgqnum_t; +typedef unsigned long int msglen_t; + + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ +#if __WORDSIZE == 32 + unsigned int __pad1; +#endif + __time_t msg_stime; /* time of last msgsnd command */ +#if __WORDSIZE == 32 + unsigned int __pad2; +#endif + __time_t msg_rtime; /* time of last msgrcv command */ +#if __WORDSIZE == 32 + unsigned int __pad3; +#endif + __time_t msg_ctime; /* time of last change */ + unsigned long int __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +#ifdef __USE_MISC + +# define msg_cbytes __msg_cbytes + +/* ipcs ctl commands */ +# define MSG_STAT 11 +# define MSG_INFO 12 + +/* buffer for msgctl calls IPC_INFO, MSG_INFO */ +struct msginfo + { + int msgpool; + int msgmap; + int msgmax; + int msgmnb; + int msgmni; + int msgssz; + int msgtql; + unsigned short int msgseg; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/sem.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/sem.h new file mode 100644 index 0000000000..f5b48b9752 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/sem.h @@ -0,0 +1,91 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SEM_H +# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." +#endif + +#include <sys/types.h> +#include <bits/wordsize.h> + +/* Flags for `semop'. */ +#define SEM_UNDO 0x1000 /* undo the operation on exit */ + +/* Commands for `semctl'. */ +#define GETPID 11 /* get sempid */ +#define GETVAL 12 /* get semval */ +#define GETALL 13 /* get all semval's */ +#define GETNCNT 14 /* get semncnt */ +#define GETZCNT 15 /* get semzcnt */ +#define SETVAL 16 /* set semval */ +#define SETALL 17 /* set all semval's */ + + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ +#if __WORDSIZE == 32 + unsigned int __pad1; +#endif + __time_t sem_otime; /* last semop() time */ +#if __WORDSIZE == 32 + unsigned int __pad2; +#endif + __time_t sem_ctime; /* last time changed by semctl() */ + unsigned long int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +/* The user should define a union like the following to use it for arguments + for `semctl'. + + union semun + { + int val; <= value for SETVAL + struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET + unsigned short int *array; <= array for GETALL & SETALL + struct seminfo *__buf; <= buffer for IPC_INFO + }; + + Previous versions of this file used to define this union but this is + incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether + one must define the union or not. */ +#define _SEM_SEMUN_UNDEFINED 1 + +#ifdef __USE_MISC + +/* ipcs ctl cmds */ +# define SEM_STAT 18 +# define SEM_INFO 19 + +struct seminfo +{ + int semmap; + int semmni; + int semmns; + int semmnu; + int semmsl; + int semopm; + int semume; + int semusz; + int semvmx; + int semaem; +}; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/shm.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/shm.h new file mode 100644 index 0000000000..2e43b20f78 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/shm.h @@ -0,0 +1,106 @@ +/* Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." +#endif + +#include <bits/types.h> +#include <bits/wordsize.h> + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ +#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ + +/* Flags for `shmat'. */ +#define SHM_RDONLY 010000 /* attach read-only else read-write */ +#define SHM_RND 020000 /* round attach address to SHMLBA */ +#define SHM_REMAP 040000 /* take-over region on attach */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + +/* Segment low boundary address multiple. */ +#define SHMLBA 0x00400000 /* address needs to be 4 Mb aligned */ + +/* Type to count number of attaches. */ +typedef unsigned long int shmatt_t; + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ +#if __WORDSIZE == 32 + unsigned int __pad1; +#endif + __time_t shm_atime; /* time of last shmat() */ +#if __WORDSIZE == 32 + unsigned int __pad2; +#endif + __time_t shm_dtime; /* time of last shmdt() */ +#if __WORDSIZE == 32 + unsigned int __pad3; +#endif + __time_t shm_ctime; /* time of last change by shmctl() */ +#if __WORDSIZE == 32 + unsigned int __pad4; +#endif + size_t shm_segsz; /* size of segment in bytes */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __unused1; + unsigned long int __unused2; + }; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +# define SHM_STAT 13 +# define SHM_INFO 14 + +/* shm_mode upper byte flags */ +# define SHM_DEST 01000 /* segment will be destroyed on last detach */ +# define SHM_LOCKED 02000 /* segment will not be swapped */ +# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ +# define SHM_NORESERVE 010000 /* don't check for reservations */ + +struct shminfo + { + unsigned long shmmax; + unsigned long shmmin; + unsigned long shmmni; + unsigned long shmseg; + unsigned long shmall; + unsigned long __unused1; + unsigned long __unused2; + unsigned long __unused3; + unsigned long __unused4; + }; + +struct shm_info + { + int used_ids; + unsigned long int shm_tot; /* total allocated shm */ + unsigned long int shm_rss; /* total resident shm */ + unsigned long int shm_swp; /* total swapped shm */ + unsigned long int swap_attempts; + unsigned long int swap_successes; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h new file mode 100644 index 0000000000..2486392dc3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h @@ -0,0 +1,74 @@ +/* Definitions for Linux/HPPA sigaction. + Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." +#endif + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ +#ifdef __USE_POSIX199309 + union + { + /* Used if SA_SIGINFO is not set. */ + __sighandler_t sa_handler; + /* Used if SA_SIGINFO is set. */ + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction +#else + __sighandler_t sa_handler; +#endif + + /* Special flags. */ + unsigned long int sa_flags; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + }; + +/* Bits in `sa_flags'. */ + +#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDWAIT 0x00000080 /* Don't create zombie on child death. */ +#define SA_SIGINFO 0x00000010 /* Invoke signal-catching function with + three arguments instead of one. */ +#if defined __USE_UNIX98 || defined __USE_MISC +# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler. */ +# define SA_NODEFER 0x00000020 /* Don't automatically block the signal + when its handler is being executed. */ +# define SA_RESTART 0x00000040 /* Restart syscall on signal return. */ +#endif +#ifdef __USE_MISC +# define SA_INTERRUPT 0x20000000 /* Historic no-op. */ + +/* Some aliases for the SA_ constants. */ +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND +# define SA_STACK SA_ONSTACK +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 0 /* for blocking signals */ +#define SIG_UNBLOCK 1 /* for unblocking signals */ +#define SIG_SETMASK 2 /* for setting the signal mask */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/signum.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/signum.h new file mode 100644 index 0000000000..0b1f8d83fa --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/signum.h @@ -0,0 +1,81 @@ +/* Signal number definitions. Linux/HPPA version. + Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +#ifdef __USE_UNIX98 +# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ +#endif + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGABRT 6 /* Abort (ANSI). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* BUS error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad system call. */ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGPWR 19 /* Power failure restart (System V). */ +#define SIGVTALRM 20 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 21 /* Profiling alarm clock (4.2 BSD). */ +#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ +#define SIGIO 22 /* I/O now possible (4.2 BSD). */ +#define SIGWINCH 23 /* Window size change (4.3 BSD, Sun). */ +#define SIGSTOP 24 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 25 /* Keyboard stop (POSIX). */ +#define SIGCONT 26 /* Continue (POSIX). */ +#define SIGTTIN 27 /* Background read from tty (POSIX). */ +#define SIGTTOU 28 /* Background write to tty (POSIX). */ +#define SIGURG 29 /* Urgent condition on socket (4.2 BSD). */ +#define SIGLOST 30 /* Operating System Has Lost (HP/UX). */ +#define SIGUNUSED 31 +#define SIGXCPU 33 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 34 /* File size limit exceeded (4.2 BSD). */ +#define SIGSTKFLT 36 /* Stack fault. */ + +#define _NSIG 65 /* Biggest signal number + 1 + (including real-time signals). */ + +#define SIGRTMIN (__libc_current_sigrtmin ()) +#define SIGRTMAX (__libc_current_sigrtmax ()) + +/* These are the hard limits of the kernel. These values should not be + used directly at user level. */ +#define __SIGRTMIN 37 +#define __SIGRTMAX (_NSIG - 1) + +#endif /* <signal.h> included. */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h new file mode 100644 index 0000000000..7870f751ef --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h @@ -0,0 +1,444 @@ +/* System-specific socket constants and types. Linux version. + Copyright (C) 1991-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef __BITS_SOCKET_H +#define __BITS_SOCKET_H + +#ifndef _SYS_SOCKET_H +# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead." +#endif + +#define __need_size_t +#include <stddef.h> + +#include <sys/types.h> + +/* Type for length arguments in socket calls. */ +#ifndef __socklen_t_defined +typedef __socklen_t socklen_t; +# define __socklen_t_defined +#endif + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET + SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ +#define SOCK_DCCP SOCK_DCCP + SOCK_PACKET = 10, /* Linux specific way of getting packets + at the dev level. For writing rarp and + other similar things on the user level. */ +#define SOCK_PACKET SOCK_PACKET + + /* Flags to be ORed into the type parameter of socket and socketpair and + used for the flags parameter of paccept. */ + + SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the + new descriptor(s). */ +#define SOCK_CLOEXEC SOCK_CLOEXEC + SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as + non-blocking. */ +#define SOCK_NONBLOCK SOCK_NONBLOCK +}; + +/* Protocol families. */ +#define PF_UNSPEC 0 /* Unspecified. */ +#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ +#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */ +#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ +#define PF_INET 2 /* IP protocol family. */ +#define PF_AX25 3 /* Amateur Radio AX.25. */ +#define PF_IPX 4 /* Novell Internet Protocol. */ +#define PF_APPLETALK 5 /* Appletalk DDP. */ +#define PF_NETROM 6 /* Amateur radio NetROM. */ +#define PF_BRIDGE 7 /* Multiprotocol bridge. */ +#define PF_ATMPVC 8 /* ATM PVCs. */ +#define PF_X25 9 /* Reserved for X.25 project. */ +#define PF_INET6 10 /* IP version 6. */ +#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ +#define PF_DECnet 12 /* Reserved for DECnet project. */ +#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ +#define PF_SECURITY 14 /* Security callback pseudo AF. */ +#define PF_KEY 15 /* PF_KEY key management API. */ +#define PF_NETLINK 16 +#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ +#define PF_PACKET 17 /* Packet family. */ +#define PF_ASH 18 /* Ash. */ +#define PF_ECONET 19 /* Acorn Econet. */ +#define PF_ATMSVC 20 /* ATM SVCs. */ +#define PF_RDS 21 /* RDS sockets. */ +#define PF_SNA 22 /* Linux SNA Project */ +#define PF_IRDA 23 /* IRDA sockets. */ +#define PF_PPPOX 24 /* PPPoX sockets. */ +#define PF_WANPIPE 25 /* Wanpipe API sockets. */ +#define PF_LLC 26 /* Linux LLC. */ +#define PF_CAN 29 /* Controller Area Network. */ +#define PF_TIPC 30 /* TIPC sockets. */ +#define PF_BLUETOOTH 31 /* Bluetooth sockets. */ +#define PF_IUCV 32 /* IUCV sockets. */ +#define PF_RXRPC 33 /* RxRPC sockets. */ +#define PF_ISDN 34 /* mISDN sockets. */ +#define PF_PHONET 35 /* Phonet sockets. */ +#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ +#define PF_CAIF 37 /* CAIF sockets. */ +#define PF_ALG 38 /* Algorithm sockets. */ +#define PF_NFC 39 /* NFC sockets. */ +#define PF_MAX 40 /* For now.. */ + +/* Address families. */ +#define AF_UNSPEC PF_UNSPEC +#define AF_LOCAL PF_LOCAL +#define AF_UNIX PF_UNIX +#define AF_FILE PF_FILE +#define AF_INET PF_INET +#define AF_AX25 PF_AX25 +#define AF_IPX PF_IPX +#define AF_APPLETALK PF_APPLETALK +#define AF_NETROM PF_NETROM +#define AF_BRIDGE PF_BRIDGE +#define AF_ATMPVC PF_ATMPVC +#define AF_X25 PF_X25 +#define AF_INET6 PF_INET6 +#define AF_ROSE PF_ROSE +#define AF_DECnet PF_DECnet +#define AF_NETBEUI PF_NETBEUI +#define AF_SECURITY PF_SECURITY +#define AF_KEY PF_KEY +#define AF_NETLINK PF_NETLINK +#define AF_ROUTE PF_ROUTE +#define AF_PACKET PF_PACKET +#define AF_ASH PF_ASH +#define AF_ECONET PF_ECONET +#define AF_ATMSVC PF_ATMSVC +#define AF_RDS PF_RDS +#define AF_SNA PF_SNA +#define AF_IRDA PF_IRDA +#define AF_PPPOX PF_PPPOX +#define AF_WANPIPE PF_WANPIPE +#define AF_LLC PF_LLC +#define AF_CAN PF_CAN +#define AF_TIPC PF_TIPC +#define AF_BLUETOOTH PF_BLUETOOTH +#define AF_IUCV PF_IUCV +#define AF_RXRPC PF_RXRPC +#define AF_ISDN PF_ISDN +#define AF_PHONET PF_PHONET +#define AF_IEEE802154 PF_IEEE802154 +#define AF_CAIF PF_CAIF +#define AF_ALG PF_ALG +#define AF_NFC PF_NFC +#define AF_MAX PF_MAX + +/* Socket level values. Others are defined in the appropriate headers. + + XXX These definitions also should go into the appropriate headers as + far as they are available. */ +#define SOL_RAW 255 +#define SOL_DECNET 261 +#define SOL_X25 262 +#define SOL_PACKET 263 +#define SOL_ATM 264 /* ATM layer (cell level). */ +#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ +#define SOL_IRDA 266 + +/* Maximum queue length specifiable by listen. */ +#define SOMAXCONN 128 + +/* Get the definition of the macro to define the common sockaddr members. */ +#include <bits/sockaddr.h> + +/* Structure describing a generic socket address. */ +struct sockaddr + { + __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ + char sa_data[14]; /* Address data. */ + }; + + +/* Structure large enough to hold any socket address (with the historical + exception of AF_UNIX). We reserve 128 bytes. */ +#define __ss_aligntype unsigned long int +#define _SS_SIZE 128 +#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) + +struct sockaddr_storage + { + __SOCKADDR_COMMON (ss_); /* Address family, etc. */ + __ss_aligntype __ss_align; /* Force desired alignment. */ + char __ss_padding[_SS_PADSIZE]; + }; + + +/* Bits in the FLAGS argument to `send', `recv', et al. */ +enum + { + MSG_OOB = 0x01, /* Process out-of-band data. */ +#define MSG_OOB MSG_OOB + MSG_PEEK = 0x02, /* Peek at incoming messages. */ +#define MSG_PEEK MSG_PEEK + MSG_DONTROUTE = 0x04, /* Don't use local routing. */ +#define MSG_DONTROUTE MSG_DONTROUTE +#ifdef __USE_GNU + /* DECnet uses a different name. */ + MSG_TRYHARD = MSG_DONTROUTE, +# define MSG_TRYHARD MSG_DONTROUTE +#endif + MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ +#define MSG_CTRUNC MSG_CTRUNC + MSG_PROXY = 0x10, /* Supply or ask second address. */ +#define MSG_PROXY MSG_PROXY + MSG_TRUNC = 0x20, +#define MSG_TRUNC MSG_TRUNC + MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ +#define MSG_DONTWAIT MSG_DONTWAIT + MSG_EOR = 0x80, /* End of record. */ +#define MSG_EOR MSG_EOR + MSG_WAITALL = 0x100, /* Wait for a full request. */ +#define MSG_WAITALL MSG_WAITALL + MSG_FIN = 0x200, +#define MSG_FIN MSG_FIN + MSG_SYN = 0x400, +#define MSG_SYN MSG_SYN + MSG_CONFIRM = 0x800, /* Confirm path validity. */ +#define MSG_CONFIRM MSG_CONFIRM + MSG_RST = 0x1000, +#define MSG_RST MSG_RST + MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ +#define MSG_ERRQUEUE MSG_ERRQUEUE + MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ +#define MSG_NOSIGNAL MSG_NOSIGNAL + MSG_MORE = 0x8000, /* Sender will send more. */ +#define MSG_MORE MSG_MORE + MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/ +#define MSG_WAITFORONE MSG_WAITFORONE + + MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file + descriptor received through + SCM_RIGHTS. */ +#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC + }; + + +/* Structure describing messages sent by + `sendmsg' and received by `recvmsg'. */ +struct msghdr + { + void *msg_name; /* Address to send to/receive from. */ + socklen_t msg_namelen; /* Length of address data. */ + + struct iovec *msg_iov; /* Vector of data to send/receive into. */ + size_t msg_iovlen; /* Number of elements in the vector. */ + + void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ + size_t msg_controllen; /* Ancillary data buffer length. + !! The type should be socklen_t but the + definition of the kernel is incompatible + with this. */ + + int msg_flags; /* Flags on received message. */ + }; + +#ifdef __USE_GNU +/* For `recvmmsg'. */ +struct mmsghdr + { + struct msghdr msg_hdr; /* Actual message header. */ + unsigned int msg_len; /* Number of received bytes for the entry. */ + }; +#endif + +/* Structure used for storage of ancillary data object information. */ +struct cmsghdr + { + size_t cmsg_len; /* Length of data in cmsg_data plus length + of cmsghdr structure. + !! The type should be socklen_t but the + definition of the kernel is incompatible + with this. */ + int cmsg_level; /* Originating protocol. */ + int cmsg_type; /* Protocol specific type. */ +#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L + __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ +#endif + }; + +/* Ancillary data object manipulation macros. */ +#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L +# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) +#else +# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) +#endif +#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) +#define CMSG_FIRSTHDR(mhdr) \ + ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ + ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) +#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ + & (size_t) ~(sizeof (size_t) - 1)) +#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + + CMSG_ALIGN (sizeof (struct cmsghdr))) +#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) + +extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, + struct cmsghdr *__cmsg) __THROW; +#ifdef __USE_EXTERN_INLINES +# ifndef _EXTERN_INLINE +# define _EXTERN_INLINE __extern_inline +# endif +_EXTERN_INLINE struct cmsghdr * +__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) +{ + if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) + /* The kernel header does this so there may be a reason. */ + return (struct cmsghdr *) 0; + + __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + + CMSG_ALIGN (__cmsg->cmsg_len)); + if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control + + __mhdr->msg_controllen) + || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + /* No more entries. */ + return (struct cmsghdr *) 0; + return __cmsg; +} +#endif /* Use `extern inline'. */ + +/* Socket level message types. This must match the definitions in + <linux/socket.h>. */ +enum + { + SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ +#define SCM_RIGHTS SCM_RIGHTS +#ifdef __USE_GNU + , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ +# define SCM_CREDENTIALS SCM_CREDENTIALS +#endif + }; + +#ifdef __USE_GNU +/* User visible structure for SCM_CREDENTIALS message */ +struct ucred +{ + pid_t pid; /* PID of sending process. */ + uid_t uid; /* UID of sending process. */ + gid_t gid; /* GID of sending process. */ +}; +#endif + +/* Ugly workaround for unclean kernel headers. */ +#if !defined __USE_MISC && !defined __USE_GNU +# ifndef FIOGETOWN +# define __SYS_SOCKET_H_undef_FIOGETOWN +# endif +# ifndef FIOSETOWN +# define __SYS_SOCKET_H_undef_FIOSETOWN +# endif +# ifndef SIOCATMARK +# define __SYS_SOCKET_H_undef_SIOCATMARK +# endif +# ifndef SIOCGPGRP +# define __SYS_SOCKET_H_undef_SIOCGPGRP +# endif +# ifndef SIOCGSTAMP +# define __SYS_SOCKET_H_undef_SIOCGSTAMP +# endif +# ifndef SIOCGSTAMPNS +# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS +# endif +# ifndef SIOCSPGRP +# define __SYS_SOCKET_H_undef_SIOCSPGRP +# endif +#endif + +/* Get socket manipulation related informations from kernel headers. */ +#include <asm/socket.h> + +#if !defined __USE_MISC && !defined __USE_GNU +# ifdef __SYS_SOCKET_H_undef_FIOGETOWN +# undef __SYS_SOCKET_H_undef_FIOGETOWN +# undef FIOGETOWN +# endif +# ifdef __SYS_SOCKET_H_undef_FIOSETOWN +# undef __SYS_SOCKET_H_undef_FIOSETOWN +# undef FIOSETOWN +# endif +# ifdef __SYS_SOCKET_H_undef_SIOCATMARK +# undef __SYS_SOCKET_H_undef_SIOCATMARK +# undef SIOCATMARK +# endif +# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP +# undef __SYS_SOCKET_H_undef_SIOCGPGRP +# undef SIOCGPGRP +# endif +# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP +# undef __SYS_SOCKET_H_undef_SIOCGSTAMP +# undef SIOCGSTAMP +# endif +# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS +# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS +# undef SIOCGSTAMPNS +# endif +# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP +# undef __SYS_SOCKET_H_undef_SIOCSPGRP +# undef SIOCSPGRP +# endif +#endif + +/* Structure used to manipulate the SO_LINGER option. */ +struct linger + { + int l_onoff; /* Nonzero to linger on close. */ + int l_linger; /* Time to linger. */ + }; + + +__BEGIN_DECLS + +#ifdef __USE_GNU +/* Receive up to VLEN messages as described by VMESSAGES from socket FD. + Returns the number of bytes read or -1 for errors. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, + unsigned int __vlen, int __flags, + const struct timespec *__tmo); + +/* Send a VLEN messages as described by VMESSAGES to socket FD. + Return the number of datagrams successfully written or -1 for errors. +This function is a cancellation point and therefore not marked with + __THROW. */ +extern int sendmmsg (int __fd, struct mmsghdr *__vmessages, + unsigned int __vlen, int __flags); +#endif + +__END_DECLS + +#endif /* bits/socket.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/brk.c b/ports/sysdeps/unix/sysv/linux/hppa/brk.c new file mode 100644 index 0000000000..1d6ed40a82 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/brk.c @@ -0,0 +1,41 @@ +/* brk system call for Linux/HPPA. + Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sysdep.h> + +/* This must be initialized data because commons can't have aliases. */ +void *__curbrk = 0; + +int +__brk (void *addr) +{ + void *newbrk; + + __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); + + if (newbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/clone.S b/ports/sysdeps/unix/sysv/linux/hppa/clone.S new file mode 100644 index 0000000000..3924ceb456 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/clone.S @@ -0,0 +1,179 @@ +/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Huggins-Daines <dhd@debian.org>, 2000. + Based on the Alpha version by Richard Henderson <rth@tamu.edu>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after its all over. */ + +#include <asm/unistd.h> +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> + +/* Non-thread code calls __clone with the following parameters: + int clone(int (*fn)(void *arg), + void *child_stack, + int flags, + void *arg) + + NPTL Code will call __clone with the following parameters: + int clone(int (*fn)(void *arg), + void *child_stack, + int flags, + void *arg, + int *parent_tidptr, + struct user_desc *newtls, + int *child_pidptr) + + The code should not mangle the extra input registers. + Syscall expects: Input to __clone: + 4(r25) - function pointer (r26, arg0) + 0(r25) - argument (r23, arg3) + r26 - clone flags. (r24, arg2) + r25+64 - user stack pointer. (r25, arg1) + r24 - parent tid pointer. (stack - 52) + r23 - struct user_desc newtls pointer. (stack - 56) + r22 - child tid pointer. (stack - 60) + r20 - clone syscall number (constant) + + Return: + + On success the thread ID of the child process is returend in + the callers context. + On error return -1, and set errno to the value returned by + the syscall. + */ + + .text +ENTRY(__clone) + /* Prologue */ + stwm %r4, 64(%sp) + stw %sp, -4(%sp) +#ifdef PIC + stw %r19, -32(%sp) +#endif + + /* Sanity check arguments. */ + comib,=,n 0, %arg0, .LerrorSanity /* no NULL function pointers */ + comib,=,n 0, %arg1, .LerrorSanity /* no NULL stack pointers */ + + /* Save the function pointer, arg, and flags on the new stack. */ + stwm %r26, 64(%r25) + stw %r23, -60(%r25) + stw %r24, -56(%r25) + /* Clone arguments are (int flags, void * child_stack) */ + copy %r24, %r26 /* flags are first */ + /* User stack pointer is in the correct register already */ + + /* Load args from stack... */ + ldw -116(%sp), %r24 /* Load parent_tidptr */ + ldw -120(%sp), %r23 /* Load newtls */ + ldw -124(%sp), %r22 /* Load child_tidptr */ + + /* Save the PIC register. */ +#ifdef PIC + copy %r19, %r4 /* parent */ +#endif + + /* Do the system call */ + ble 0x100(%sr2, %r0) + ldi __NR_clone, %r20 + + ldi -4096, %r1 + comclr,>>= %r1, %ret0, %r0 /* Note: unsigned compare. */ + b,n .LerrorRest + + /* Restore the PIC register. */ +#ifdef PIC + copy %r4, %r19 /* parent */ +#endif + + comib,=,n 0, %ret0, .LthreadStart + + /* Successful return from the parent + No need to restore the PIC register, + since we return immediately. */ + + ldw -84(%sp), %rp + bv %r0(%rp) + ldwm -64(%sp), %r4 + +.LerrorRest: + /* Something bad happened -- no child created */ + bl __syscall_error, %rp + sub %r0, %ret0, %arg0 + ldw -84(%sp), %rp + /* Return after setting errno, ret0 is set to -1 by __syscall_error. */ + bv %r0(%rp) + ldwm -64(%sp), %r4 + +.LerrorSanity: + /* Sanity checks failed, return -1, and set errno to EINVAL. */ + bl __syscall_error, %rp + ldi EINVAL, %arg0 + ldw -84(%sp), %rp + bv %r0(%rp) + ldwm -64(%sp), %r4 + +.LthreadStart: +#ifdef RESET_PID +# define CLONE_VM_BIT 23 /* 0x00000100 */ +# define CLONE_THREAD_BIT 15 /* 0x00010000 */ + /* Load original clone flags. + If CLONE_THREAD was passed, don't reset the PID/TID. + If CLONE_VM was passed, we need to store -1 to PID/TID. + If CLONE_VM and CLONE_THREAD were not set store the result + of getpid to PID/TID. */ + ldw -56(%sp), %r26 + bb,<,n %r26, CLONE_THREAD_BIT, 1f + bb,< %r26, CLONE_VM_BIT, 2f + ldi -1, %ret0 + ble 0x100(%sr2, %r0) + ldi __NR_getpid, %r20 +2: + mfctl %cr27, %r26 + stw %ret0, PID_THREAD_OFFSET(%r26) + stw %ret0, TID_THREAD_OFFSET(%r26) +1: +#endif + /* Load up the arguments. */ + ldw -60(%sp), %arg0 + ldw -64(%sp), %r22 + + /* $$dyncall fixes childs PIC register */ + + /* Call the user's function */ +#ifdef PIC + copy %r19, %r4 +#endif + bl $$dyncall, %r31 + copy %r31, %rp +#ifdef PIC + copy %r4, %r19 +#endif + /* The call to _exit needs saved r19. */ + bl _exit, %rp + copy %ret0, %arg0 + + /* We should not return from _exit. + We do not restore r4, or the stack state. */ + iitlbp %r0, (%sr0, %r0) + +PSEUDO_END(__clone) + +weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/fcntl.c b/ports/sysdeps/unix/sysv/linux/hppa/fcntl.c new file mode 100644 index 0000000000..ea951bc4f9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/fcntl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/fxstat.c b/ports/sysdeps/unix/sysv/linux/hppa/fxstat.c new file mode 100644 index 0000000000..4f219f0b9d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/fxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/fxstatat.c b/ports/sysdeps/unix/sysv/linux/hppa/fxstatat.c new file mode 100644 index 0000000000..0f8b3135d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/fxstatat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstatat.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/getcontext.S b/ports/sysdeps/unix/sysv/linux/hppa/getcontext.S new file mode 100644 index 0000000000..c649aeae16 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/getcontext.S @@ -0,0 +1,165 @@ +/* Get current user context. + Copyright (C) 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Helge Deller <deller@gmx.de>, 2008. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include "ucontext_i.h" + + + /* Trampoline function. Non-standard calling ABI. */ + /* Can not use ENTRY(__getcontext_ret) here. */ + .type __getcontext_ret, @function + .hidden __getcontext_ret +__getcontext_ret: + .proc + .callinfo FRAME=0,NO_CALLS + /* r26-r23 contain original r3-r6, but because setcontext + does not reload r3-r6 (it's using them as temporaries) + we must save them elsewhere and swap them back in. */ + copy %r23, %r3 + copy %r24, %r4 + copy %r25, %r5 + copy %r26, %r6 + /* r20 contains original return pointer. */ + bv 0(%r20) + copy %r0, %ret0 + .procend + .size __getcontext_ret, .-__getcontext_ret + + +ENTRY(__getcontext) + /* Save the registers. */ + stw %r0, oR0(%r26) + stw %r1, oR1(%r26) + /* stw %r2, oR2(%r26) - used for trampoline. */ + stw %r3, oR3(%r26) + stw %r4, oR4(%r26) + stw %r5, oR5(%r26) + stw %r6, oR6(%r26) + stw %r7, oR7(%r26) + stw %r8, oR8(%r26) + stw %r9, oR9(%r26) + stw %r10, oR10(%r26) + stw %r11, oR11(%r26) + stw %r12, oR12(%r26) + stw %r13, oR13(%r26) + stw %r14, oR14(%r26) + stw %r15, oR15(%r26) + stw %r16, oR16(%r26) + stw %r17, oR17(%r26) + stw %r18, oR18(%r26) + stw %r19, oR19(%r26) + /* stw %r20, oR20(%r26) - used for trampoline. */ + stw %r21, oR21(%r26) + stw %r22, oR22(%r26) + /* stw %r23, oR23(%r26) - used for trampoline. */ + /* stw %r24, oR24(%r26) - used for trampoline. */ + /* stw %r25, oR25(%r26) - used for trampoline. */ + /* stw %r26, oR26(%r26) - used for trampoline. */ + stw %r27, oR27(%r26) + stw %r28, oR28(%r26) + stw %r29, oR29(%r26) + stw %sp, oR30(%r26) + stw %r31, oR31(%r26) + + stw %r0, oUC_FLAGS(%r26) + /* stw %r0, oUC_LINK(%r26) - Do not overwrite. */ + stw %sp, oSS_SP(%r26) + stw %r0, oSS_FLAGS(%r26) + stw %r0, oSS_SIZE(%r26) + + stw %r0, oSC_FLAGS(%r26) + + stw %r0, oIASQ0(%r26) + stw %r0, oIASQ1(%r26) + stw %r0, oIAOQ0(%r26) + stw %r0, oIAOQ1(%r26) + stw %r0, oSAR(%r26) /* used as flag in swapcontext(). */ + + + /* Store floating-point regs. */ + ldo oFPREGS0(%r26),%r1 + fstds,ma %fr0, 8(%r1) + fstds,ma %fr1, 8(%r1) + fstds,ma %fr2, 8(%r1) + fstds,ma %fr3, 8(%r1) + fstds,ma %fr4, 8(%r1) + fstds,ma %fr5, 8(%r1) + fstds,ma %fr6, 8(%r1) + fstds,ma %fr7, 8(%r1) + fstds,ma %fr8, 8(%r1) + fstds,ma %fr9, 8(%r1) + fstds,ma %fr10, 8(%r1) + fstds,ma %fr11, 8(%r1) + fstds,ma %fr12, 8(%r1) + fstds,ma %fr13, 8(%r1) + fstds,ma %fr14, 8(%r1) + fstds,ma %fr15, 8(%r1) + fstds,ma %fr16, 8(%r1) + fstds,ma %fr17, 8(%r1) + fstds,ma %fr18, 8(%r1) + fstds,ma %fr19, 8(%r1) + fstds,ma %fr20, 8(%r1) + fstds,ma %fr21, 8(%r1) + fstds,ma %fr22, 8(%r1) + fstds,ma %fr23, 8(%r1) + fstds,ma %fr24, 8(%r1) + fstds,ma %fr25, 8(%r1) + fstds,ma %fr26, 8(%r1) + fstds,ma %fr27, 8(%r1) + fstds,ma %fr28, 8(%r1) + fstds,ma %fr29, 8(%r1) + fstds,ma %fr30, 8(%r1) + fstds %fr31, 0(%r1) + + /* Prologue */ + stwm %r4, 64(%sp) +#ifdef PIC + stw %r19, -32(%sp) +#endif + + /* Set up the trampoline registers. + r20, r23, r24, r25, r26 and r2 are clobbered + by call to getcontext() anyway. Reuse them. */ + stw %r2, oR20(%r26) + stw %r3, oR23(%r26) + stw %r4, oR24(%r26) + stw %r5, oR25(%r26) + stw %r6, oR26(%r26) + ldil L%__getcontext_ret, %r1 + ldo R%__getcontext_ret(%r1), %r1 + stw %r1, oR2(%r26) + + /* Save the current signal mask. */ + /* sigprocmask(SIG_BLOCK, NULL, &ucp->uc_sigmask); */ + ldo oSIGMASK(%r26), %r24 + copy %r0, %r25 + bl sigprocmask, %r2 + ldi SIG_BLOCK, %r26 + + /* Epilogue */ + ldw -84(%sp), %r2 +#ifdef PIC + ldw -96(%sp), %r19 +#endif + bv %r0(%r2) + ldwm -64(%sp), %r4 +END(__getcontext) + +weak_alias (__getcontext, getcontext) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/getdents64.c b/ports/sysdeps/unix/sysv/linux/hppa/getdents64.c new file mode 100644 index 0000000000..0c75fb5a06 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/getdents64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getdents64.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/getrlimit64.c b/ports/sysdeps/unix/sysv/linux/hppa/getrlimit64.c new file mode 100644 index 0000000000..fef018f471 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/getrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/internaltypes.h b/ports/sysdeps/unix/sysv/linux/hppa/internaltypes.h new file mode 100644 index 0000000000..6eee0b3ba1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/internaltypes.h @@ -0,0 +1,79 @@ +#include_next <internaltypes.h> +#ifndef _INTERNAL_TYPES_H_HPPA_ +#define _INTERNAL_TYPES_H_HPPA_ 1 +#include <atomic.h> + +/* In GLIBC 2.10 HPPA switched from Linuxthreads to NPTL, and in order +to maintain ABI compatibility with pthread_cond_t, some care had to be +taken. + +The NPTL pthread_cond_t grew in size. When HPPA switched to NPTL, we +dropped the use of ldcw, and switched to the kernel helper routine for +compare-and-swap. This allowed HPPA to use the 4-word 16-byte aligned +lock words, and alignment words to store the additional pthread_cond_t +data. Once organized properly the new NPTL pthread_cond_t was 1 word +smaller than the Linuxthreads version. + +However, we were faced with the case that users may have initialized the +pthread_cond_t with PTHREAD_COND_INITIALIZER. In this case, the first +four words were set to one, and must be cleared before any NPTL code +used these words. + +We didn't want to use LDCW, because it continues to be a source of bugs +when applications memset pthread_cond_t to all zeroes by accident. This +works on all other architectures where lock words are unlocked at zero. +Remember that because of the semantics of LDCW, a locked word is set to +zero, and an unlocked word is set to 1. + +Instead we used atomic_compare_and_exchange_val_acq, but we couldn't use +this on any of the pthread_cond_t words, otherwise it might interfere +with the current operation of the structure. To solve this problem we +used the left over word. + +If the stucture was initialized by a legacy Linuxthread +PTHREAD_COND_INITIALIZER it contained a 1, and this indicates that the +structure requires zeroing for NPTL. The first thread to come upon a +pthread_cond_t with a 1 in the __initializer field, will +compare-and-swap the value, placing a 2 there which will cause all other +threads using the same pthread_cond_t to wait for the completion of the +initialization. Lastly, we use a store (with memory barrier) to change +__initializer from 2 to 0. Note that the store is strongly ordered, but +we use the PA 1.1 compatible form which is ",ma" with zero offset. + +In the future, when the application is recompiled with NPTL +PTHREAD_COND_INITIALIZER it will be a quick compare-and-swap, which +fails because __initializer is zero, and the structure will be used as +is correctly. */ + +#define cond_compat_clear(var) \ +({ \ + int tmp = 0; \ + var->__data.__lock = 0; \ + var->__data.__futex = 0; \ + var->__data.__mutex = NULL; \ + /* Clear __initializer last, to indicate initialization is done. */ \ + __asm__ __volatile__ ("stw,ma %1,0(%0)" \ + : : "r" (&var->__data.__initializer), "r" (tmp) : "memory"); \ +}) + +#define cond_compat_check_and_clear(var) \ +({ \ + int ret; \ + volatile int *value = &var->__data.__initializer; \ + if ((ret = atomic_compare_and_exchange_val_acq(value, 2, 1))) \ + { \ + if (ret == 1) \ + { \ + /* Initialize structure. */ \ + cond_compat_clear (var); \ + } \ + else \ + { \ + /* Yield until structure is initialized. */ \ + while (*value == 2) sched_yield (); \ + } \ + } \ +}) + +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h new file mode 100644 index 0000000000..8dcdfbfabf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h @@ -0,0 +1,38 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +/* There are an infinite number of PA-RISC kernel versions numbered + 2.4.0. But they've not really been released as such. We require + and expect the final version here. */ +#define __ASSUME_32BITUIDS 1 +#define __ASSUME_TRUNCATE64_SYSCALL 1 +#define __ASSUME_MMAP2_SYSCALL 1 +#define __ASSUME_STAT64_SYSCALL 1 +#define __ASSUME_IPC64 1 +#define __ASSUME_ST_INO_64_BIT 1 +#define __ASSUME_FCNTL64 1 +#define __ASSUME_GETDENTS64_SYSCALL 1 + +/* PA-RISC 2.6.9 kernels had the first LWS CAS support */ +#if __LINUX_KERNEL_VERSION >= 0x020609 +# define __ASSUME_LWS_CAS 1 +#endif + +#include_next <kernel-features.h> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h b/ports/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h new file mode 100644 index 0000000000..af048cbe7d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h @@ -0,0 +1,18 @@ +/* We have a separate header file here because we do not support + SA_RESTORER on hppa. */ + +/* This is the sigaction struction from the Linux 2.1.20 kernel. */ +/* Blah. This is bogus. We don't ever use it. */ +struct old_kernel_sigaction { + __sighandler_t k_sa_handler; + unsigned long sa_mask; + unsigned long sa_flags; +}; + +/* This is the sigaction structure from the Linux 2.1.68 kernel. */ + +struct kernel_sigaction { + __sighandler_t k_sa_handler; + unsigned long sa_flags; + sigset_t sa_mask; +}; diff --git a/ports/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/ports/sysdeps/unix/sysv/linux/hppa/kernel_stat.h new file mode 100644 index 0000000000..a85c5be464 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/kernel_stat.h @@ -0,0 +1,31 @@ +/* definition of "struct stat" from the kernel */ +struct kernel_stat { + unsigned long st_dev; /* dev_t is 32 bits on parisc */ + unsigned long st_ino; /* 32 bits */ + unsigned short st_mode; /* 16 bits */ + unsigned short st_nlink; /* 16 bits */ + unsigned short st_reserved1; /* old st_uid */ + unsigned short st_reserved2; /* old st_gid */ + unsigned long st_rdev; + unsigned long st_size; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + long st_blksize; + long st_blocks; + unsigned long __unused1; /* ACL stuff */ + unsigned long __unused2; /* network */ + unsigned long __unused3; /* network */ + unsigned long __unused4; /* cnodes */ + unsigned short __unused5; /* netsite */ + short st_fstype; + unsigned long st_realdev; + unsigned short st_basemode; + unsigned short st_spareshort; + unsigned long st_uid; + unsigned long st_gid; + unsigned long st_spare4[3]; +}; + +#define _HAVE_STAT_NSEC +#define _HAVE_STAT64_NSEC diff --git a/ports/sysdeps/unix/sysv/linux/hppa/lxstat.c b/ports/sysdeps/unix/sysv/linux/hppa/lxstat.c new file mode 100644 index 0000000000..0efa0aea49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/lxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c b/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c new file mode 100644 index 0000000000..11039d69b3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c @@ -0,0 +1,100 @@ +/* Create new context. + Copyright (C) 2008, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Helge Deller <deller@gmx.de>, 2008. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <libintl.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <sysdep.h> +#include <ucontext.h> + +/* POSIX only supports integer arguments. */ + +/* Stack must be 64-byte aligned at all times. */ +#define STACK_ALIGN 64 +/* Size of frame marker in unsigned long words. */ +#define FRAME_SIZE_UL 8 +/* Size of frame marker in bytes. */ +#define FRAME_SIZE_BYTES (8 * sizeof(unsigned long)) +/* Size of X arguments in bytes. */ +#define ARGS(x) (x * sizeof(unsigned long)) + +void +__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) +{ + unsigned long *sp, *osp; + va_list ap; + int i; + + /* Create a 64-byte aligned frame to store args. Use ss_sp if + it is available, otherwise be robust and use the currently + saved stack pointer. */ + if (ucp->uc_stack.ss_sp && ucp->uc_stack.ss_size) + osp = (unsigned long *)ucp->uc_stack.ss_sp; + else + osp = (unsigned long *)ucp->uc_mcontext.sc_gr[30]; + + sp = (unsigned long *)((((unsigned long) osp) + + FRAME_SIZE_BYTES + ARGS(argc) + STACK_ALIGN) + & ~(STACK_ALIGN - 1)); + + /* Use new frame. */ + ucp->uc_mcontext.sc_gr[30] = ((unsigned long) sp); + + /* Finish frame setup. */ + if (ucp->uc_link) + { + /* Returning to the next context and next frame. */ + sp[-4/sizeof(unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[30]; + sp[-20/sizeof(unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[2]; + } + else + { + /* This is the main context. No frame marker, and no return address. */ + sp[-4/sizeof(unsigned long)] = 0x0; + sp[-20/sizeof(unsigned long)] = 0x0; + } + + /* Store address to jump to. */ + ucp->uc_mcontext.sc_gr[2] = (unsigned long) func; + + /* Process arguments. */ + va_start (ap, argc); + for (i = 0; i < argc; ++i) + { + if (i < 4) + { + ucp->uc_mcontext.sc_gr[26-i] = va_arg (ap, int); + continue; + } + + if ((i < 8) && (sizeof(unsigned long) == 8)) + { + /* 64bit: r19-r22 are arg7-arg4. */ + ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int); + continue; + } + + /* All other arguments go on the stack. */ + sp[-1 * (FRAME_SIZE_UL + 1 + i)] = va_arg (ap, int); + } + va_end (ap); +} +weak_alias(__makecontext, makecontext) + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/mmap.c b/ports/sysdeps/unix/sysv/linux/hppa/mmap.c new file mode 100644 index 0000000000..420d6567a6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/mmap.c @@ -0,0 +1,49 @@ +/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <sys/mman.h> +#include <errno.h> + +/* Map addresses starting near ADDR and extending for LEN bytes. From + OFFSET into the file FD describes according to PROT and FLAGS. If ADDR + is nonzero, it is the desired mapping address. If the MAP_FIXED bit is + set in FLAGS, the mapping will be at ADDR exactly (which must be + page-aligned); otherwise the system chooses a convenient nearby address. + The return value is the actual mapping address chosen or MAP_FAILED + for errors (in which case `errno' is set). A successful `mmap' call + deallocates any previous mapping for the affected region. */ + +#include <sysdep.h> + +__ptr_t +__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +{ + + __ptr_t ret; + + ret = INLINE_SYSCALL(mmap, 6, addr, len, prot, flags, fd, offset); + + /* check if it's really a negative number */ + if(((unsigned long)ret & 0xfffff000) == 0xfffff000) + return MAP_FAILED; + + return ret; + +} + +strong_alias (__mmap, mmap) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..caa9f37999 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h @@ -0,0 +1,225 @@ +/* Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +/* Linuxthread type sizes (bytes): + sizeof(pthread_attr_t) = 0x24 (36) + sizeof(pthread_barrier_t) = 0x30 (48) + sizeof(pthread_barrierattr_t) = 0x4 (4) + sizeof(pthread_cond_t) = 0x30 (48) + sizeof(pthread_condattr_t) = 0x4 (4) + sizeof(pthread_mutex_t) = 0x30 (48) + sizeof(pthread_mutexattr_t) = 0x4 (4) + sizeof(pthread_rwlock_t) = 0x40 (64) + sizeof(pthread_rwlockattr_t) = 0x8 (8) + sizeof(pthread_spinlock_t) = 0x10 (16) */ + +#define __SIZEOF_PTHREAD_ATTR_T 36 +#define __SIZEOF_PTHREAD_BARRIER_T 48 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_MUTEX_T 48 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCK_T 64 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 + +/* Thread identifiers. The structure of the attribute type is not + exposed on purpose. */ +typedef unsigned long int pthread_t; + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + + +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; + + +/* Data structures for mutex handling. The structure of the attribute + type is not exposed on purpose. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock __attribute__ ((aligned(16))); + unsigned int __count; + int __owner; + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; + /* The old 4-word 16-byte aligned lock. This is initalized + to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER. + Unused in NPTL. */ + int __compat_padding[4]; + /* In the old structure there are 4 words left due to alignment. + In NPTL two words are used. */ + unsigned int __nusers; + __extension__ union + { + int __spins; + __pthread_slist_t __list; + }; + /* Two more words are left before the NPTL + pthread_mutex_t is larger than Linuxthreads. */ + int __reserved1; + int __reserved2; + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + long int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is not exposed on purpose. However, this structure + is exposed via PTHREAD_COND_INITIALIZER, and because of this, the + Linuxthreads version sets the first four ints to one. In the NPTL + version we must check, in every function using pthread_cond_t, + for the static Linuxthreads initializer and clear the appropriate + words. */ +typedef union +{ + struct + { + /* In the old Linuxthreads pthread_cond_t, this is the + start of the 4-word lock structure, the next four words + are set all to 1 by the Linuxthreads + PTHREAD_COND_INITIALIZER. */ + int __lock __attribute__ ((aligned(16))); + /* Tracks the initialization of this structure: + 0 initialized with NPTL PTHREAD_COND_INITIALIZER. + 1 initialized with Linuxthreads PTHREAD_COND_INITIALIZER. + 2 initialization in progress. */ + int __initializer; + unsigned int __futex; + void *__mutex; + /* In the old Linuxthreads this would have been the start + of the pthread_fastlock status word. */ + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + /* The NPTL pthread_cond_t is exactly the same size as + the Linuxthreads version, there are no words to spare. */ + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + long int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is not exposed on purpose. */ +typedef union +{ + struct + { + /* In the old Linuxthreads pthread_rwlock_t, this is the + start of the 4-word 16-byte aligned lock structure. The + next four words are all set to 1 by the Linuxthreads + PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL. */ + int __compat_padding[4] __attribute__ ((aligned(16))); + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + int __writer; + /* An unused word, reserved for future use. It was added + to maintain the location of the flags from the Linuxthreads + layout of this structure. */ + int __reserved1; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __pad2; + unsigned char __pad1; + unsigned char __shared; + unsigned char __flags; + /* The NPTL pthread_rwlock_t is 4 words smaller than the + Linuxthreads version. One word is in the middle of the + structure, the other three are at the end. */ + int __reserved2; + int __reserved3; + int __reserved4; + } __data; + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h new file mode 100644 index 0000000000..3406819dd7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/semaphore.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2002, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + +#define __SIZEOF_SEM_T 16 + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/hppa/nptl/clone.S new file mode 100644 index 0000000000..23750b3f88 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/clone.S @@ -0,0 +1,3 @@ +#define RESET_PID +#include <tcb-offsets.h> +#include "../clone.S" diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure b/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure new file mode 100644 index 0000000000..a418c5469a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure @@ -0,0 +1,5 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/hppa/nptl. + +# Needed for LWS CAS +arch_minimum_kernel=2.6.9 diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in b/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in new file mode 100644 index 0000000000..1c7102e260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/configure.in @@ -0,0 +1,5 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/hppa/nptl. + +# Needed for LWS CAS +arch_minimum_kernel=2.6.9 diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/createthread.c new file mode 100644 index 0000000000..e057a98eaf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/createthread.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE (pd + 1) + +/* Get the real implementation. */ +#include <nptl/sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/fork.c new file mode 100644 index 0000000000..84613671b8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/fork.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sched.h> +#include <signal.h> +#include <sysdep.h> +#include <tls.h> + +/* Argument 1 - Clone flags. + 2 - Child stack pointer. + 3 - Parent tid pointer. + 4 - New TLS area pointer. + 5 - Child tid pointer. */ +#define ARCH_FORK() \ + INLINE_SYSCALL (clone, 5, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \ + NULL, NULL, NULL, &THREAD_SELF->tid) + +#include <nptl/sysdeps/unix/sysv/linux/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/libc-lowlevellock.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/libc-lowlevellock.c new file mode 100644 index 0000000000..24d1fcdbb0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/libc-lowlevellock.c @@ -0,0 +1,20 @@ +/* low level locking for pthread library. Generic futex-using version. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "lowlevellock.c" diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c new file mode 100644 index 0000000000..aa69db8c63 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c @@ -0,0 +1,139 @@ +/* low level locking for pthread library. Generic futex-using version. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sysdep.h> +#include <lowlevellock.h> +#include <sys/time.h> + +void +__lll_lock_wait (lll_lock_t *futex, int private) +{ + do + { + int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); + if (oldval != 0) + lll_futex_wait (futex, 2, private); + } + while (atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0); +} + +void +__lll_lock_wait_private (lll_lock_t *futex) +{ + do + { + int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); + if (oldval != 0) + lll_futex_wait (futex, 2, LLL_PRIVATE); + } + while (atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0); +} + +int +__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime, int private) +{ + /* Reject invalid timeouts. */ + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) + return EINVAL; + + do + { + struct timeval tv; + struct timespec rt; + + /* Get the current time. */ + (void) __gettimeofday (&tv, NULL); + + /* Compute relative timeout. */ + rt.tv_sec = abstime->tv_sec - tv.tv_sec; + rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) + { + rt.tv_nsec += 1000000000; + --rt.tv_sec; + } + + /* Already timed out? */ + if (rt.tv_sec < 0) + return ETIMEDOUT; + + /* Wait. */ + int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1); + if (oldval != 0) + lll_futex_timed_wait (futex, 2, &rt, private); + } + while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0); + return 0; +} + + +/* These don't get included in libc.so */ +#ifdef IS_IN_libpthread +int +lll_unlock_wake_cb (lll_lock_t *futex) +{ + int val = atomic_exchange_rel (futex, 0); + + if (__builtin_expect (val > 1, 0)) + lll_private_futex_wake (futex, 1); + return 0; +} + + +int +__lll_timedwait_tid (int *tidp, const struct timespec *abstime) +{ + int tid; + + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) + return EINVAL; + + /* Repeat until thread terminated. */ + while ((tid = *tidp) != 0) + { + struct timeval tv; + struct timespec rt; + + /* Get the current time. */ + (void) __gettimeofday (&tv, NULL); + + /* Compute relative timeout. */ + rt.tv_sec = abstime->tv_sec - tv.tv_sec; + rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) + { + rt.tv_nsec += 1000000000; + --rt.tv_sec; + } + + /* Already timed out? */ + if (rt.tv_sec < 0) + return ETIMEDOUT; + + /* Wait until thread terminates. */ + if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT) + return ETIMEDOUT; + } + + return 0; +} + +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h new file mode 100644 index 0000000000..6d4b13517b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h @@ -0,0 +1,346 @@ +/* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <sysdep.h> +#include <atomic.h> +#include <kernel-features.h> /* Need __ASSUME_PRIVATE_FUTEX. */ +#include <tls.h> /* Need THREAD_*, and header.*. */ + +/* HPPA only has one atomic read and modify memory operation, + load and clear, so hppa uses a kernel helper routine to implement + compare_and_exchange. See atomic.h for the userspace calling + sequence. */ + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + +/* Initialize locks to zero. */ +#define LLL_MUTEX_LOCK_INITIALIZER (0) + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + +/* Type for lock object. */ +typedef int lll_lock_t; + +#define lll_futex_wait(futexp, val, private) \ + lll_futex_timed_wait (futexp, val, 0, private) + +#define lll_futex_timed_wait(futexp, val, timespec, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (val), (timespec)); \ + __ret; \ + }) + +#define lll_futex_wake(futexp, nr, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ + __ret; \ + }) + +#define lll_private_futex_wait(futex, val) \ + lll_private_futex_timed_wait (futex, val, NULL) + +#ifdef __ASSUME_PRIVATE_FUTEX +# define lll_private_futex_timed_wait(futexp, val, timespec) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, \ + (futexp), FUTEX_WAIT | FUTEX_PRIVATE_FLAG, \ + (val), (timespec)); \ + __ret; \ + }) + +# define lll_private_futex_wake(futexp, nr) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, \ + (futexp), FUTEX_WAKE | FUTEX_PRIVATE_FLAG, \ + (nr), 0); \ + __ret; \ + }) + +#else + +# define lll_private_futex_timed_wait(futexp, val, timespec) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret, __op; \ + __op = FUTEX_WAIT | THREAD_GETMEM (THREAD_SELF, header.private_futex); \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, \ + (futexp), __op, (val), (timespec)); \ + __ret; \ + }) + +# define lll_private_futex_wake(futexp, nr) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret, __op; \ + __op = FUTEX_WAKE | THREAD_GETMEM (THREAD_SELF, header.private_futex); \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, \ + (futexp), __op, (nr), 0); \ + __ret; \ + }) +#endif + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ + (nr_wake), (nr_move), (mutex), (val)); \ + __ret; \ + }) + +#define lll_robust_dead(futexv, private) \ + do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + lll_futex_wake (__futexp, 1, private); \ + } \ + while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (nr_wake), (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + __ret; \ + }) + +static inline int +__attribute__ ((always_inline)) +__lll_robust_trylock (int *futex, int id) +{ + return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0; +} +#define lll_robust_trylock(futex, id) \ + __lll_robust_trylock (&(futex), id) + +static inline int +__attribute__ ((always_inline)) +__lll_cond_trylock (int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; +} +#define lll_cond_trylock(futex) __lll_cond_trylock (&(futex)) + +static inline int +__attribute__ ((always_inline)) +__lll_trylock (int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0; +} +#define lll_trylock(futex) __lll_trylock (&(futex)) + +extern void __lll_lock_wait (lll_lock_t *futex, int private) attribute_hidden; +extern void __lll_lock_wait_private (lll_lock_t *futex) attribute_hidden; + +static inline void __attribute__((always_inline)) +__lll_mutex_lock(lll_lock_t *futex, int private) +{ + int val = atomic_compare_and_exchange_val_acq (futex, 1, 0); + + if (__builtin_expect (val != 0, 0)) + { + if (__builtin_constant_p (private) && private == LLL_PRIVATE) + __lll_lock_wait_private (futex); + else + __lll_lock_wait (futex, private); + } +} +#define lll_mutex_lock(futex, private) __lll_mutex_lock (&(futex), private) +#define lll_lock(lock, private) lll_mutex_lock (lock, private) + +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + +static inline int +__attribute__ ((always_inline)) +__lll_robust_lock (int *futex, int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_lock_wait (futex, private); + return result; +} +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private) + +static inline void +__attribute__ ((always_inline)) +__lll_cond_lock (int *futex, int private) +{ + int val = atomic_compare_and_exchange_val_acq (futex, 2, 0); + + if (__builtin_expect (val != 0, 0)) + __lll_lock_wait (futex, private); +} +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + +extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + +static inline int +__attribute__ ((always_inline)) +__lll_timedlock (int *futex, const struct timespec *abstime, int private) +{ + int val = atomic_compare_and_exchange_val_acq (futex, 1, 0); + int result = 0; + + if (__builtin_expect (val != 0, 0)) + result = __lll_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + +static inline int __attribute__ ((always_inline)) +__lll_robust_timedlock (int *futex, const struct timespec *abstime, + int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + +#define __lll_unlock(futex, private) \ + (void) \ + ({ int val = atomic_exchange_rel (futex, 0); \ + if (__builtin_expect (val > 1, 0)) \ + lll_futex_wake (futex, 1, private); \ + }) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + +#define __lll_robust_unlock(futex,private) \ + (void) \ + ({ int val = atomic_exchange_rel (futex, 0); \ + if (__builtin_expect (val & FUTEX_WAITERS, 0)) \ + lll_futex_wake (futex, 1, private); \ + }) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + +#define lll_islocked(futex) \ + (futex != 0) + +/* Our internal lock implementation is identical to the binary-compatible + mutex implementation. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_CONST (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + +#define THREAD_INIT_LOCK(PD, LOCK) \ + (PD)->LOCK = LLL_LOCK_INITIALIZER + +extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden; + +/* The kernel notifies a process which uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do \ + { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED); \ + } \ + while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-initfini.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-initfini.c new file mode 100644 index 0000000000..daf7a0ac36 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-initfini.c @@ -0,0 +1,108 @@ +/* Special .init and .fini section support for HPPA. NPTL version. + Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file with other + programs, and to distribute those programs without any restriction + coming from the use of this file. (The Lesser General Public + License restrictions do apply in other respects; for example, they + cover modification of the file, and distribution when not linked + into another program.) + + The GNU C Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* This file is compiled into assembly code which is then munged by a sed + script into two files: crti.s and crtn.s. + + * crti.s puts a function prologue at the beginning of the + .init and .fini sections and defines global symbols for + those addresses, so they can be called as functions. + + * crtn.s puts the corresponding function epilogues + in the .init and .fini sections. */ + +/* If we use the standard C version, the linkage table pointer won't + be properly preserved due to the splitting up of function prologues + and epilogues. Therefore we write these in assembly to make sure + they do the right thing. */ + +__asm__ ( +"#include \"defs.h\"\n" +"\n" +"/*@HEADER_ENDS*/\n" +"\n" +"/*@_init_PROLOG_BEGINS*/\n" +" .section .init\n" +" .align 4\n" +" .globl _init\n" +" .type _init,@function\n" +"_init:\n" +" stw %rp,-20(%sp)\n" +" stwm %r4,64(%sp)\n" +" stw %r19,-32(%sp)\n" +" bl __pthread_initialize_minimal_internal,%rp\n" +" copy %r19,%r4 /* delay slot */\n" +" copy %r4,%r19\n" +"/*@_init_PROLOG_ENDS*/\n" +"\n" +"/*@_init_EPILOG_BEGINS*/\n" +"/* Here is the tail end of _init. */\n" +" .section .init\n" +" ldw -84(%sp),%rp\n" +" copy %r4,%r19\n" +" bv %r0(%rp)\n" +"_end_init:\n" +" ldwm -64(%sp),%r4\n" +"\n" +"/* Our very own unwind info, because the assembler can't handle\n" +" functions split into two or more pieces. */\n" +" .section .PARISC.unwind,\"a\",@progbits\n" +" .extern _init\n" +" .word _init, _end_init\n" +" .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n" +"\n" +"/*@_init_EPILOG_ENDS*/\n" +"\n" +"/*@_fini_PROLOG_BEGINS*/\n" +" .section .fini\n" +" .align 4\n" +" .globl _fini\n" +" .type _fini,@function\n" +"_fini:\n" +" stw %rp,-20(%sp)\n" +" stwm %r4,64(%sp)\n" +" stw %r19,-32(%sp)\n" +" copy %r19,%r4\n" +"/*@_fini_PROLOG_ENDS*/\n" +"\n" +"/*@_fini_EPILOG_BEGINS*/\n" +" .section .fini\n" +" ldw -84(%sp),%rp\n" +" copy %r4,%r19\n" +" bv %r0(%rp)\n" +"_end_fini:\n" +" ldwm -64(%sp),%r4\n" +"\n" +" .section .PARISC.unwind,\"a\",@progbits\n" +" .extern _fini\n" +" .word _fini, _end_fini\n" +" .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n" +"\n" +"/*@_fini_EPILOG_ENDS*/\n" +"\n" +"/*@TRAILER_BEGINS*/\n" +); diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S new file mode 100644 index 0000000000..83c789c774 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S @@ -0,0 +1,106 @@ +/* Copyright (C) 2005, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> +#include <tcb-offsets.h> + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + +/* Load the thread register. + Load the saved PID value. + Negate the value. + Store the temporary PID. */ +#define SAVE_PID \ + mfctl %cr27, %r26 ASM_LINE_SEP \ + ldw PID_THREAD_OFFSET(%r26),%r1 ASM_LINE_SEP \ + sub %r0,%r1,%r1 ASM_LINE_SEP \ + stw %r1,PID_THREAD_OFFSET(%r26) ASM_LINE_SEP +/* If we are the parent... + Get the thread pointer. + Load the saved PID. + Negate the value (got back original) + Restore the PID. */ +#define RESTORE_PID \ + cmpb,=,n %r0,%ret0,.Lthread_start ASM_LINE_SEP \ + mfctl %cr27, %r26 ASM_LINE_SEP \ + ldw PID_THREAD_OFFSET(%r26),%r1 ASM_LINE_SEP \ + sub %r0,%r1,%r1 ASM_LINE_SEP \ + stw %r1,PID_THREAD_OFFSET(%r26) ASM_LINE_SEP \ +.Lthread_start: ASM_LINE_SEP + + /* r26, r25, r24, r23 are free since vfork has no arguments */ +ENTRY(__vfork) + /* We must not create a frame. When the child unwinds to call + exec it will clobber the same frame that the parent + needs to unwind. */ + + /* Save the PIC register. */ +#ifdef PIC + copy %r19, %r25 /* parent */ +#endif + + /* Save the process PID */ + SAVE_PID + + /* Syscall saves and restores all register states */ + ble 0x100(%sr2,%r0) + ldi __NR_vfork,%r20 + + /* Conditionally restore the PID */ + RESTORE_PID + + /* Check for error */ + ldi -4096,%r1 + comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */ + b,n .Lerror + + /* Return, and DO NOT restore rp. The child may have called + functions that updated the frame's rp. This works because + the kernel ensures rp is preserved across the vfork + syscall. */ + bv,n %r0(%rp) + +.Lerror: + /* Now we need a stack to call a function. We are assured + that there is no child now, so it's safe to create + a frame. */ + stw %rp, -20(%sp) + stwm %r3, 64(%sp) + stw %sp, -4(%sp) + + sub %r0,%ret0,%r3 + SYSCALL_ERROR_HANDLER + /* Restore the PIC register (in delay slot) on error */ +#ifdef PIC + copy %r25, %r19 /* parent */ +#else + nop +#endif + /* Write syscall return into errno location */ + stw %r3, 0(%ret0) + ldw -84(%sp), %rp + bv %r0(%rp) + ldwm -64(%sp), %r3 +PSEUDO_END (__vfork) +libc_hidden_def (__vfork) +weak_alias (__vfork, vfork) + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h new file mode 100644 index 0000000000..6a0d953545 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h @@ -0,0 +1,1184 @@ +/* Copyright (C) 2002-2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _PTHREAD_H +#define _PTHREAD_H 1 + +#include <features.h> +#include <endian.h> +#include <sched.h> +#define __need_timespec +#include <time.h> + +#include <bits/pthreadtypes.h> +#include <bits/setjmp.h> +#include <bits/wordsize.h> + + +/* Detach state. */ +enum +{ + PTHREAD_CREATE_JOINABLE, +#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE + PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED +}; + + +/* Mutex types. */ +enum +{ + PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_ADAPTIVE_NP +#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 + , + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL +#endif +#ifdef __USE_GNU + /* For compatibility. */ + , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP +#endif +}; + + +#ifdef __USE_XOPEN2K +/* Robust mutex or not flags. */ +enum +{ + PTHREAD_MUTEX_STALLED, + PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, + PTHREAD_MUTEX_ROBUST, + PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST +}; +#endif + + +#if defined __USE_POSIX199506 || defined __USE_UNIX98 +/* Mutex protocols. */ +enum +{ + PTHREAD_PRIO_NONE, + PTHREAD_PRIO_INHERIT, + PTHREAD_PRIO_PROTECT +}; +#endif + + +/* Mutex initializers. */ +#if __WORDSIZE == 64 +# define PTHREAD_MUTEX_INITIALIZER \ + { { 0, 0, 0, 0, 0, 0, { 0, 0 } } } +# ifdef __USE_GNU +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0, 0 } } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0, 0 } } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0, 0 } } } +# endif +#else +# define PTHREAD_MUTEX_INITIALIZER \ + { { 0, 0, 0, 0, 0, { 0 } } } +# ifdef __USE_GNU +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } } +# endif +#endif + + +/* Read-write lock types. */ +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +enum +{ + PTHREAD_RWLOCK_PREFER_READER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, + PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP +}; + +/* Read-write lock initializers. */ +# define PTHREAD_RWLOCK_INITIALIZER \ + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } +# ifdef __USE_GNU +# if __WORDSIZE == 64 +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } +# else +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ + 0, 0, 0, 0 } } +# else +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ + 0 } } +# endif +# endif +# endif +#endif /* Unix98 or XOpen2K */ + + +/* Scheduler inheritance. */ +enum +{ + PTHREAD_INHERIT_SCHED, +#define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED + PTHREAD_EXPLICIT_SCHED +#define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED +}; + + +/* Scope handling. */ +enum +{ + PTHREAD_SCOPE_SYSTEM, +#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM + PTHREAD_SCOPE_PROCESS +#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS +}; + + +/* Process shared or private flag. */ +enum +{ + PTHREAD_PROCESS_PRIVATE, +#define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE + PTHREAD_PROCESS_SHARED +#define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED +}; + + + +/* Conditional variable handling. */ +#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } + + +/* Cleanup buffers */ +struct _pthread_cleanup_buffer +{ + void (*__routine) (void *); /* Function to call. */ + void *__arg; /* Its argument. */ + int __canceltype; /* Saved cancellation type. */ + struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ +}; + +/* Cancellation */ +enum +{ + PTHREAD_CANCEL_ENABLE, +#define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE + PTHREAD_CANCEL_DISABLE +#define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE +}; +enum +{ + PTHREAD_CANCEL_DEFERRED, +#define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED + PTHREAD_CANCEL_ASYNCHRONOUS +#define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS +}; +#define PTHREAD_CANCELED ((void *) -1) + + +/* Single execution handling. */ +#define PTHREAD_ONCE_INIT 0 + + +#ifdef __USE_XOPEN2K +/* Value returned by 'pthread_barrier_wait' for one of the threads after + the required number of threads have called this function. + -1 is distinct from 0 and all errno constants */ +# define PTHREAD_BARRIER_SERIAL_THREAD -1 +#endif + + +__BEGIN_DECLS + +/* Create a new thread, starting with execution of START-ROUTINE + getting passed ARG. Creation attributed come from ATTR. The new + handle is stored in *NEWTHREAD. */ +extern int pthread_create (pthread_t *__restrict __newthread, + const pthread_attr_t *__restrict __attr, + void *(*__start_routine) (void *), + void *__restrict __arg) __THROWNL __nonnull ((1, 3)); + +/* Terminate calling thread. + + The registered cleanup handlers are called via exception handling + so we cannot mark this function with __THROW.*/ +extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); + +/* Make calling thread wait for termination of the thread TH. The + exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN + is not NULL. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int pthread_join (pthread_t __th, void **__thread_return); + +#ifdef __USE_GNU +/* Check whether thread TH has terminated. If yes return the status of + the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ +extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; + +/* Make calling thread wait for termination of the thread TH, but only + until TIMEOUT. The exit status of the thread is stored in + *THREAD_RETURN, if THREAD_RETURN is not NULL. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, + const struct timespec *__abstime); +#endif + +/* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. + The resources of TH will therefore be freed immediately when it + terminates, instead of waiting for another thread to perform PTHREAD_JOIN + on it. */ +extern int pthread_detach (pthread_t __th) __THROW; + + +/* Obtain the identifier of the current thread. */ +extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__)); + +/* Compare two thread identifiers. */ +extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) + __THROW __attribute__ ((__const__)); + + +/* Thread attribute handling. */ + +/* Initialize thread attribute *ATTR with default attributes + (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, + no user-provided stack). */ +extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); + +/* Destroy thread attribute *ATTR. */ +extern int pthread_attr_destroy (pthread_attr_t *__attr) + __THROW __nonnull ((1)); + +/* Get detach state attribute. */ +extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, + int *__detachstate) + __THROW __nonnull ((1, 2)); + +/* Set detach state attribute. */ +extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, + int __detachstate) + __THROW __nonnull ((1)); + + +/* Get the size of the guard area created for stack overflow protection. */ +extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, + size_t *__guardsize) + __THROW __nonnull ((1, 2)); + +/* Set the size of the guard area created for stack overflow protection. */ +extern int pthread_attr_setguardsize (pthread_attr_t *__attr, + size_t __guardsize) + __THROW __nonnull ((1)); + + +/* Return in *PARAM the scheduling parameters of *ATTR. */ +extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, + struct sched_param *__restrict __param) + __THROW __nonnull ((1, 2)); + +/* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ +extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, + const struct sched_param *__restrict + __param) __THROW __nonnull ((1, 2)); + +/* Return in *POLICY the scheduling policy of *ATTR. */ +extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict + __attr, int *__restrict __policy) + __THROW __nonnull ((1, 2)); + +/* Set scheduling policy in *ATTR according to POLICY. */ +extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) + __THROW __nonnull ((1)); + +/* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ +extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict + __attr, int *__restrict __inherit) + __THROW __nonnull ((1, 2)); + +/* Set scheduling inheritance mode in *ATTR according to INHERIT. */ +extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inherit) + __THROW __nonnull ((1)); + + +/* Return in *SCOPE the scheduling contention scope of *ATTR. */ +extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, + int *__restrict __scope) + __THROW __nonnull ((1, 2)); + +/* Set scheduling contention scope in *ATTR according to SCOPE. */ +extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) + __THROW __nonnull ((1)); + +/* Return the previously set address for the stack. */ +extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict + __attr, void **__restrict __stackaddr) + __THROW __nonnull ((1, 2)) __attribute_deprecated__; + +/* Set the starting address of the stack of the thread to be created. + Depending on whether the stack grows up or down the value must either + be higher or lower than all the address in the memory block. The + minimal size of the block must be PTHREAD_STACK_MIN. */ +extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, + void *__stackaddr) + __THROW __nonnull ((1)) __attribute_deprecated__; + +/* Return the currently used minimal stack size. */ +extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict + __attr, size_t *__restrict __stacksize) + __THROW __nonnull ((1, 2)); + +/* Add information about the minimum stack size needed for the thread + to be started. This size must never be less than PTHREAD_STACK_MIN + and must also not exceed the system limits. */ +extern int pthread_attr_setstacksize (pthread_attr_t *__attr, + size_t __stacksize) + __THROW __nonnull ((1)); + +#ifdef __USE_XOPEN2K +/* Return the previously set address for the stack. */ +extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr, + size_t *__restrict __stacksize) + __THROW __nonnull ((1, 2, 3)); + +/* The following two interfaces are intended to replace the last two. They + require setting the address as well as the size since only setting the + address will make the implementation on some architectures impossible. */ +extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, + size_t __stacksize) __THROW __nonnull ((1)); +#endif + +#ifdef __USE_GNU +/* Thread created with attribute ATTR will be limited to run only on + the processors represented in CPUSET. */ +extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, + size_t __cpusetsize, + const cpu_set_t *__cpuset) + __THROW __nonnull ((1, 3)); + +/* Get bit set in CPUSET representing the processors threads created with + ATTR can run on. */ +extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, + size_t __cpusetsize, + cpu_set_t *__cpuset) + __THROW __nonnull ((1, 3)); + + +/* Initialize thread attribute *ATTR with attributes corresponding to the + already running thread TH. It shall be called on uninitialized ATTR + and destroyed with pthread_attr_destroy when no longer needed. */ +extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) + __THROW __nonnull ((2)); +#endif + + +/* Functions for scheduling control. */ + +/* Set the scheduling parameters for TARGET_THREAD according to POLICY + and *PARAM. */ +extern int pthread_setschedparam (pthread_t __target_thread, int __policy, + const struct sched_param *__param) + __THROW __nonnull ((3)); + +/* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ +extern int pthread_getschedparam (pthread_t __target_thread, + int *__restrict __policy, + struct sched_param *__restrict __param) + __THROW __nonnull ((2, 3)); + +/* Set the scheduling priority for TARGET_THREAD. */ +extern int pthread_setschedprio (pthread_t __target_thread, int __prio) + __THROW; + + +#ifdef __USE_GNU +/* Get thread name visible in the kernel and its interfaces. */ +extern int pthread_getname_np (pthread_t __target_thread, char *__buf, + size_t __buflen) + __THROW __nonnull ((2)); + +/* Set thread name visible in the kernel and its interfaces. */ +extern int pthread_setname_np (pthread_t __target_thread, const char *__name) + __THROW __nonnull ((2)); +#endif + + +#ifdef __USE_UNIX98 +/* Determine level of concurrency. */ +extern int pthread_getconcurrency (void) __THROW; + +/* Set new concurrency level to LEVEL. */ +extern int pthread_setconcurrency (int __level) __THROW; +#endif + +#ifdef __USE_GNU +/* Yield the processor to another thread or process. + This function is similar to the POSIX `sched_yield' function but + might be differently implemented in the case of a m-on-n thread + implementation. */ +extern int pthread_yield (void) __THROW; + + +/* Limit specified thread TH to run only on the processors represented + in CPUSET. */ +extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize, + const cpu_set_t *__cpuset) + __THROW __nonnull ((3)); + +/* Get bit set in CPUSET representing the processors TH can run on. */ +extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize, + cpu_set_t *__cpuset) + __THROW __nonnull ((3)); +#endif + + +/* Functions for handling initialization. */ + +/* Guarantee that the initialization function INIT_ROUTINE will be called + only once, even if pthread_once is executed several times with the + same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or + extern variable initialized to PTHREAD_ONCE_INIT. + + The initialization functions might throw exception which is why + this function is not marked with __THROW. */ +extern int pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)) __nonnull ((1, 2)); + + +/* Functions for handling cancellation. + + Note that these functions are explicitly not marked to not throw an + exception in C++ code. If cancellation is implemented by unwinding + this is necessary to have the compiler generate the unwind information. */ + +/* Set cancelability state of current thread to STATE, returning old + state in *OLDSTATE if OLDSTATE is not NULL. */ +extern int pthread_setcancelstate (int __state, int *__oldstate); + +/* Set cancellation state of current thread to TYPE, returning the old + type in *OLDTYPE if OLDTYPE is not NULL. */ +extern int pthread_setcanceltype (int __type, int *__oldtype); + +/* Cancel THREAD immediately or at the next possibility. */ +extern int pthread_cancel (pthread_t __th); + +/* Test for pending cancellation for the current thread and terminate + the thread as per pthread_exit(PTHREAD_CANCELED) if it has been + cancelled. */ +extern void pthread_testcancel (void); + + +/* Cancellation handling with integration into exception handling. */ + +typedef struct +{ + struct + { + __jmp_buf __cancel_jmp_buf; + int __mask_was_saved; + } __cancel_jmp_buf[1]; + void *__pad[4]; +} __pthread_unwind_buf_t __attribute__ ((__aligned__)); + +/* No special attributes by default. */ +#ifndef __cleanup_fct_attribute +# define __cleanup_fct_attribute +#endif + + +/* Structure to hold the cleanup handler information. */ +struct __pthread_cleanup_frame +{ + void (*__cancel_routine) (void *); + void *__cancel_arg; + int __do_it; + int __cancel_type; +}; + +#if defined __GNUC__ && defined __EXCEPTIONS +# ifdef __cplusplus +/* Class to handle cancellation handler invocation. */ +class __pthread_cleanup_class +{ + void (*__cancel_routine) (void *); + void *__cancel_arg; + int __do_it; + int __cancel_type; + + public: + __pthread_cleanup_class (void (*__fct) (void *), void *__arg) + : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { } + ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); } + void __setdoit (int __newval) { __do_it = __newval; } + void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, + &__cancel_type); } + void __restore () const { pthread_setcanceltype (__cancel_type, 0); } +}; + +/* Install a cleanup handler: ROUTINE will be called with arguments ARG + when the thread is canceled or calls pthread_exit. ROUTINE will also + be called with arguments ARG when the matching pthread_cleanup_pop + is executed with non-zero EXECUTE argument. + + pthread_cleanup_push and pthread_cleanup_pop are macros and must always + be used in matching pairs at the same nesting level of braces. */ +# define pthread_cleanup_push(routine, arg) \ + do { \ + __pthread_cleanup_class __clframe (routine, arg) + +/* Remove a cleanup handler installed by the matching pthread_cleanup_push. + If EXECUTE is non-zero, the handler function is called. */ +# define pthread_cleanup_pop(execute) \ + __clframe.__setdoit (execute); \ + } while (0) + +# ifdef __USE_GNU +/* Install a cleanup handler as pthread_cleanup_push does, but also + saves the current cancellation type and sets it to deferred + cancellation. */ +# define pthread_cleanup_push_defer_np(routine, arg) \ + do { \ + __pthread_cleanup_class __clframe (routine, arg); \ + __clframe.__defer () + +/* Remove a cleanup handler as pthread_cleanup_pop does, but also + restores the cancellation type that was in effect when the matching + pthread_cleanup_push_defer was called. */ +# define pthread_cleanup_pop_restore_np(execute) \ + __clframe.__restore (); \ + __clframe.__setdoit (execute); \ + } while (0) +# endif +# else +/* Function called to call the cleanup handler. As an extern inline + function the compiler is free to decide inlining the change when + needed or fall back on the copy which must exist somewhere + else. */ +__extern_inline void +__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) +{ + if (__frame->__do_it) + __frame->__cancel_routine (__frame->__cancel_arg); +} + +/* Install a cleanup handler: ROUTINE will be called with arguments ARG + when the thread is canceled or calls pthread_exit. ROUTINE will also + be called with arguments ARG when the matching pthread_cleanup_pop + is executed with non-zero EXECUTE argument. + + pthread_cleanup_push and pthread_cleanup_pop are macros and must always + be used in matching pairs at the same nesting level of braces. */ +# define pthread_cleanup_push(routine, arg) \ + do { \ + struct __pthread_cleanup_frame __clframe \ + __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ + = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ + .__do_it = 1 }; + +/* Remove a cleanup handler installed by the matching pthread_cleanup_push. + If EXECUTE is non-zero, the handler function is called. */ +# define pthread_cleanup_pop(execute) \ + __clframe.__do_it = (execute); \ + } while (0) + +# ifdef __USE_GNU +/* Install a cleanup handler as pthread_cleanup_push does, but also + saves the current cancellation type and sets it to deferred + cancellation. */ +# define pthread_cleanup_push_defer_np(routine, arg) \ + do { \ + struct __pthread_cleanup_frame __clframe \ + __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ + = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ + .__do_it = 1 }; \ + (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \ + &__clframe.__cancel_type) + +/* Remove a cleanup handler as pthread_cleanup_pop does, but also + restores the cancellation type that was in effect when the matching + pthread_cleanup_push_defer was called. */ +# define pthread_cleanup_pop_restore_np(execute) \ + (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \ + __clframe.__do_it = (execute); \ + } while (0) +# endif +# endif +#else +/* Install a cleanup handler: ROUTINE will be called with arguments ARG + when the thread is canceled or calls pthread_exit. ROUTINE will also + be called with arguments ARG when the matching pthread_cleanup_pop + is executed with non-zero EXECUTE argument. + + pthread_cleanup_push and pthread_cleanup_pop are macros and must always + be used in matching pairs at the same nesting level of braces. */ +# define pthread_cleanup_push(routine, arg) \ + do { \ + __pthread_unwind_buf_t __cancel_buf; \ + void (*__cancel_routine) (void *) = (routine); \ + void *__cancel_arg = (arg); \ + int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ + __cancel_buf.__cancel_jmp_buf, 0); \ + if (__builtin_expect (__not_first_call, 0)) \ + { \ + __cancel_routine (__cancel_arg); \ + __pthread_unwind_next (&__cancel_buf); \ + /* NOTREACHED */ \ + } \ + \ + __pthread_register_cancel (&__cancel_buf); \ + do { +extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) + __cleanup_fct_attribute; + +/* Remove a cleanup handler installed by the matching pthread_cleanup_push. + If EXECUTE is non-zero, the handler function is called. */ +# define pthread_cleanup_pop(execute) \ + do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ + } while (0); \ + __pthread_unregister_cancel (&__cancel_buf); \ + if (execute) \ + __cancel_routine (__cancel_arg); \ + } while (0) +extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) + __cleanup_fct_attribute; + +# ifdef __USE_GNU +/* Install a cleanup handler as pthread_cleanup_push does, but also + saves the current cancellation type and sets it to deferred + cancellation. */ +# define pthread_cleanup_push_defer_np(routine, arg) \ + do { \ + __pthread_unwind_buf_t __cancel_buf; \ + void (*__cancel_routine) (void *) = (routine); \ + void *__cancel_arg = (arg); \ + int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ + __cancel_buf.__cancel_jmp_buf, 0); \ + if (__builtin_expect (__not_first_call, 0)) \ + { \ + __cancel_routine (__cancel_arg); \ + __pthread_unwind_next (&__cancel_buf); \ + /* NOTREACHED */ \ + } \ + \ + __pthread_register_cancel_defer (&__cancel_buf); \ + do { +extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf) + __cleanup_fct_attribute; + +/* Remove a cleanup handler as pthread_cleanup_pop does, but also + restores the cancellation type that was in effect when the matching + pthread_cleanup_push_defer was called. */ +# define pthread_cleanup_pop_restore_np(execute) \ + do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ + } while (0); \ + __pthread_unregister_cancel_restore (&__cancel_buf); \ + if (execute) \ + __cancel_routine (__cancel_arg); \ + } while (0) +extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf) + __cleanup_fct_attribute; +# endif + +/* Internal interface to initiate cleanup. */ +extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) + __cleanup_fct_attribute __attribute__ ((__noreturn__)) +# ifndef SHARED + __attribute__ ((__weak__)) +# endif + ; +#endif + +/* Function used in the macros. */ +struct __jmp_buf_tag; +extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW; + + +/* Mutex handling. */ + +/* Initialize a mutex. */ +extern int pthread_mutex_init (pthread_mutex_t *__mutex, + const pthread_mutexattr_t *__mutexattr) + __THROW __nonnull ((1)); + +/* Destroy a mutex. */ +extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) + __THROW __nonnull ((1)); + +/* Try locking a mutex. */ +extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) + __THROWNL __nonnull ((1)); + +/* Lock a mutex. */ +extern int pthread_mutex_lock (pthread_mutex_t *__mutex) + __THROWNL __nonnull ((1)); + +#ifdef __USE_XOPEN2K +/* Wait until lock becomes available, or specified time passes. */ +extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict + __abstime) __THROWNL __nonnull ((1, 2)); +#endif + +/* Unlock a mutex. */ +extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) + __THROWNL __nonnull ((1)); + + +/* Get the priority ceiling of MUTEX. */ +extern int pthread_mutex_getprioceiling (const pthread_mutex_t * + __restrict __mutex, + int *__restrict __prioceiling) + __THROW __nonnull ((1, 2)); + +/* Set the priority ceiling of MUTEX to PRIOCEILING, return old + priority ceiling value in *OLD_CEILING. */ +extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, + int __prioceiling, + int *__restrict __old_ceiling) + __THROW __nonnull ((1, 3)); + + +#ifdef __USE_XOPEN2K8 +/* Declare the state protected by MUTEX as consistent. */ +extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) + __THROW __nonnull ((1)); +# ifdef __USE_GNU +extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) + __THROW __nonnull ((1)); +# endif +#endif + + +/* Functions for handling mutex attributes. */ + +/* Initialize mutex attribute object ATTR with default attributes + (kind is PTHREAD_MUTEX_TIMED_NP). */ +extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) + __THROW __nonnull ((1)); + +/* Destroy mutex attribute object ATTR. */ +extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) + __THROW __nonnull ((1)); + +/* Get the process-shared flag of the mutex attribute ATTR. */ +extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __pshared) + __THROW __nonnull ((1, 2)); + +/* Set the process-shared flag of the mutex attribute ATTR. */ +extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, + int __pshared) + __THROW __nonnull ((1)); + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 +/* Return in *KIND the mutex kind attribute in *ATTR. */ +extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict + __attr, int *__restrict __kind) + __THROW __nonnull ((1, 2)); + +/* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, + PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or + PTHREAD_MUTEX_DEFAULT). */ +extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) + __THROW __nonnull ((1)); +#endif + +/* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ +extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __protocol) + __THROW __nonnull ((1, 2)); + +/* Set the mutex protocol attribute in *ATTR to PROTOCOL (either + PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ +extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, + int __protocol) + __THROW __nonnull ((1)); + +/* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ +extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __prioceiling) + __THROW __nonnull ((1, 2)); + +/* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ +extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, + int __prioceiling) + __THROW __nonnull ((1)); + +#ifdef __USE_XOPEN2K +/* Get the robustness flag of the mutex attribute ATTR. */ +extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, + int *__robustness) + __THROW __nonnull ((1, 2)); +# ifdef __USE_GNU +extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr, + int *__robustness) + __THROW __nonnull ((1, 2)); +# endif + +/* Set the robustness flag of the mutex attribute ATTR. */ +extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, + int __robustness) + __THROW __nonnull ((1)); +# ifdef __USE_GNU +extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, + int __robustness) + __THROW __nonnull ((1)); +# endif +#endif + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Functions for handling read-write locks. */ + +/* Initialize read-write lock RWLOCK using attributes ATTR, or use + the default values if later is NULL. */ +extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, + const pthread_rwlockattr_t *__restrict + __attr) __THROW __nonnull ((1)); + +/* Destroy read-write lock RWLOCK. */ +extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) + __THROW __nonnull ((1)); + +/* Acquire read lock for RWLOCK. */ +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) + __THROWNL __nonnull ((1)); + +/* Try to acquire read lock for RWLOCK. */ +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) + __THROWNL __nonnull ((1)); + +# ifdef __USE_XOPEN2K +/* Try to acquire read lock for RWLOCK or return after specfied time. */ +extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict + __abstime) __THROWNL __nonnull ((1, 2)); +# endif + +/* Acquire write lock for RWLOCK. */ +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) + __THROWNL __nonnull ((1)); + +/* Try to acquire write lock for RWLOCK. */ +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) + __THROWNL __nonnull ((1)); + +# ifdef __USE_XOPEN2K +/* Try to acquire write lock for RWLOCK or return after specfied time. */ +extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict + __abstime) __THROWNL __nonnull ((1, 2)); +# endif + +/* Unlock RWLOCK. */ +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) + __THROWNL __nonnull ((1)); + + +/* Functions for handling read-write lock attributes. */ + +/* Initialize attribute object ATTR with default values. */ +extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) + __THROW __nonnull ((1)); + +/* Destroy attribute object ATTR. */ +extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) + __THROW __nonnull ((1)); + +/* Return current setting of process-shared attribute of ATTR in PSHARED. */ +extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pshared) + __THROW __nonnull ((1, 2)); + +/* Set process-shared attribute of ATTR to PSHARED. */ +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared) + __THROW __nonnull ((1)); + +/* Return current setting of reader/writer preference. */ +extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pref) + __THROW __nonnull ((1, 2)); + +/* Set reader/write preference. */ +extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, + int __pref) __THROW __nonnull ((1)); +#endif + + +/* Functions for handling conditional variables. */ + +/* Initialize condition variable COND using attributes ATTR, or use + the default values if later is NULL. */ +extern int pthread_cond_init (pthread_cond_t *__restrict __cond, + const pthread_condattr_t *__restrict __cond_attr) + __THROW __nonnull ((1)); + +/* Destroy condition variable COND. */ +extern int pthread_cond_destroy (pthread_cond_t *__cond) + __THROW __nonnull ((1)); + +/* Wake up one thread waiting for condition variable COND. */ +extern int pthread_cond_signal (pthread_cond_t *__cond) + __THROWNL __nonnull ((1)); + +/* Wake up all threads waiting for condition variables COND. */ +extern int pthread_cond_broadcast (pthread_cond_t *__cond) + __THROWNL __nonnull ((1)); + +/* Wait for condition variable COND to be signaled or broadcast. + MUTEX is assumed to be locked before. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex) + __nonnull ((1, 2)); + +/* Wait for condition variable COND to be signaled or broadcast until + ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an + absolute time specification; zero is the beginning of the epoch + (00:00:00 GMT, January 1, 1970). + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime) + __nonnull ((1, 2, 3)); + +/* Functions for handling condition variable attributes. */ + +/* Initialize condition variable attribute ATTR. */ +extern int pthread_condattr_init (pthread_condattr_t *__attr) + __THROW __nonnull ((1)); + +/* Destroy condition variable attribute ATTR. */ +extern int pthread_condattr_destroy (pthread_condattr_t *__attr) + __THROW __nonnull ((1)); + +/* Get the process-shared flag of the condition variable attribute ATTR. */ +extern int pthread_condattr_getpshared (const pthread_condattr_t * + __restrict __attr, + int *__restrict __pshared) + __THROW __nonnull ((1, 2)); + +/* Set the process-shared flag of the condition variable attribute ATTR. */ +extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, + int __pshared) __THROW __nonnull ((1)); + +#ifdef __USE_XOPEN2K +/* Get the clock selected for the conditon variable attribute ATTR. */ +extern int pthread_condattr_getclock (const pthread_condattr_t * + __restrict __attr, + __clockid_t *__restrict __clock_id) + __THROW __nonnull ((1, 2)); + +/* Set the clock selected for the conditon variable attribute ATTR. */ +extern int pthread_condattr_setclock (pthread_condattr_t *__attr, + __clockid_t __clock_id) + __THROW __nonnull ((1)); +#endif + + +#ifdef __USE_XOPEN2K +/* Functions to handle spinlocks. */ + +/* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can + be shared between different processes. */ +extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) + __THROW __nonnull ((1)); + +/* Destroy the spinlock LOCK. */ +extern int pthread_spin_destroy (pthread_spinlock_t *__lock) + __THROW __nonnull ((1)); + +/* Wait until spinlock LOCK is retrieved. */ +extern int pthread_spin_lock (pthread_spinlock_t *__lock) + __THROWNL __nonnull ((1)); + +/* Try to lock spinlock LOCK. */ +extern int pthread_spin_trylock (pthread_spinlock_t *__lock) + __THROWNL __nonnull ((1)); + +/* Release spinlock LOCK. */ +extern int pthread_spin_unlock (pthread_spinlock_t *__lock) + __THROWNL __nonnull ((1)); + + +/* Functions to handle barriers. */ + +/* Initialize BARRIER with the attributes in ATTR. The barrier is + opened when COUNT waiters arrived. */ +extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, + const pthread_barrierattr_t *__restrict + __attr, unsigned int __count) + __THROW __nonnull ((1)); + +/* Destroy a previously dynamically initialized barrier BARRIER. */ +extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) + __THROW __nonnull ((1)); + +/* Wait on barrier BARRIER. */ +extern int pthread_barrier_wait (pthread_barrier_t *__barrier) + __THROWNL __nonnull ((1)); + + +/* Initialize barrier attribute ATTR. */ +extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) + __THROW __nonnull ((1)); + +/* Destroy previously dynamically initialized barrier attribute ATTR. */ +extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) + __THROW __nonnull ((1)); + +/* Get the process-shared flag of the barrier attribute ATTR. */ +extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * + __restrict __attr, + int *__restrict __pshared) + __THROW __nonnull ((1, 2)); + +/* Set the process-shared flag of the barrier attribute ATTR. */ +extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared) + __THROW __nonnull ((1)); +#endif + + +/* Functions for handling thread-specific data. */ + +/* Create a key value identifying a location in the thread-specific + data area. Each thread maintains a distinct thread-specific data + area. DESTR_FUNCTION, if non-NULL, is called with the value + associated to that key when the key is destroyed. + DESTR_FUNCTION is not called if the value associated is NULL when + the key is destroyed. */ +extern int pthread_key_create (pthread_key_t *__key, + void (*__destr_function) (void *)) + __THROW __nonnull ((1)); + +/* Destroy KEY. */ +extern int pthread_key_delete (pthread_key_t __key) __THROW; + +/* Return current value of the thread-specific data slot identified by KEY. */ +extern void *pthread_getspecific (pthread_key_t __key) __THROW; + +/* Store POINTER in the thread-specific data slot identified by KEY. */ +extern int pthread_setspecific (pthread_key_t __key, + const void *__pointer) __THROW ; + + +#ifdef __USE_XOPEN2K +/* Get ID of CPU-time clock for thread THREAD_ID. */ +extern int pthread_getcpuclockid (pthread_t __thread_id, + __clockid_t *__clock_id) + __THROW __nonnull ((2)); +#endif + + +/* Install handlers to be called when a new process is created with FORK. + The PREPARE handler is called in the parent process just before performing + FORK. The PARENT handler is called in the parent process just after FORK. + The CHILD handler is called in the child process. Each of the three + handlers can be NULL, meaning that no handler needs to be called at that + point. + PTHREAD_ATFORK can be called several times, in which case the PREPARE + handlers are called in LIFO order (last added with PTHREAD_ATFORK, + first called before FORK), and the PARENT and CHILD handlers are called + in FIFO (first added, first called). */ + +extern int pthread_atfork (void (*__prepare) (void), + void (*__parent) (void), + void (*__child) (void)) __THROW; + + +#ifdef __USE_EXTERN_INLINES +/* Optimizations. */ +__extern_inline int +__NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2)) +{ + return __thread1 == __thread2; +} +#endif + +__END_DECLS + +#endif /* pthread.h */ + +#ifndef _PTHREAD_H_HPPA_ +#define _PTHREAD_H_HPPA_ 1 + +/* The pthread_cond_t initializer is compatible only with NPTL. We do not + want to be forwards compatible, we eventually want to drop the code + that has to clear the old LT initializer. */ +#undef PTHREAD_COND_INITIALIZER +#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, (void *) 0, 0, 0, 0, 0, 0 } } + +/* The pthread_mutex_t and pthread_rwlock_t initializers are compatible + only with NPTL. NPTL assumes pthread_rwlock_t is all zero. */ +#undef PTHREAD_MUTEX_INITIALIZER +#undef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +#undef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP +#undef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +/* Mutex initializers. */ +#define PTHREAD_MUTEX_INITIALIZER \ + { { 0, 0, 0, 0, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } } +#ifdef __USE_GNU +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } } +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } } +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ + { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, { 0, 0, 0, 0 }, 0, { 0 }, 0, 0 } } +#endif + +#undef PTHREAD_RWLOCK_INITIALIZER +#undef PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP +/* Read-write lock initializers. */ +#define PTHREAD_RWLOCK_INITIALIZER \ + { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } +#ifdef __USE_GNU +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { { { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ + 0, 0, 0 } } +#endif /* Unix98 or XOpen2K */ + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthreadP.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthreadP.h new file mode 100644 index 0000000000..0e68ccf0f7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthreadP.h @@ -0,0 +1,17 @@ +#include_next <pthreadP.h> +#ifndef _PTHREADP_H_HPPA_ +#define _PTHREADP_H_HPPA_ 1 + +/* Internal cond functions. */ +extern int __pthread_cond_broadcast_internal (pthread_cond_t *cond); +extern int __pthread_cond_destroy_internal (pthread_cond_t *cond); +extern int __pthread_cond_init_internal (pthread_cond_t *cond, + const pthread_condattr_t *cond_attr); +extern int __pthread_cond_signal_internal (pthread_cond_t *cond); +extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec *abstime); +extern int __pthread_cond_wait_internal (pthread_cond_t *cond, + pthread_mutex_t *mutex); +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_broadcast.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_broadcast.c new file mode 100644 index 0000000000..1aa78cbccb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_broadcast.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <pthread_cond_broadcast.c> +#else +# include <pthread.h> +# include <pthreadP.h> +# include <internaltypes.h> +# include <shlib-compat.h> +int +__pthread_cond_broadcast (cond) + pthread_cond_t *cond; +{ + cond_compat_check_and_clear (cond); + return __pthread_cond_broadcast_internal (cond); +} +versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast, + GLIBC_2_3_2); +# undef versioned_symbol +# define versioned_symbol(lib, local, symbol, version) +# undef __pthread_cond_broadcast +# define __pthread_cond_broadcast __pthread_cond_broadcast_internal +# include_next <pthread_cond_broadcast.c> +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_destroy.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_destroy.c new file mode 100644 index 0000000000..bfaa2f6048 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_destroy.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <pthread_cond_destroy.c> +#else +# include <pthread.h> +# include <pthreadP.h> +# include <internaltypes.h> +# include <shlib-compat.h> +int +__pthread_cond_destroy (cond) + pthread_cond_t *cond; +{ + cond_compat_check_and_clear (cond); + return __pthread_cond_destroy_internal (cond); +} +versioned_symbol (libpthread, __pthread_cond_destroy, pthread_cond_destroy, + GLIBC_2_3_2); +# undef versioned_symbol +# define versioned_symbol(lib, local, symbol, version) +# undef __pthread_cond_destroy +# define __pthread_cond_destroy __pthread_cond_destroy_internal +# include_next <pthread_cond_destroy.c> +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_init.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_init.c new file mode 100644 index 0000000000..735a0e6f27 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_init.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <pthread_cond_init.c> +#else +# include <pthread.h> +# include <pthreadP.h> +# include <internaltypes.h> +# include <shlib-compat.h> +int +__pthread_cond_init (cond, cond_attr) + pthread_cond_t *cond; + const pthread_condattr_t *cond_attr; +{ + cond_compat_clear (cond); + return __pthread_cond_init_internal (cond, cond_attr); +} +versioned_symbol (libpthread, __pthread_cond_init, pthread_cond_init, + GLIBC_2_3_2); +# undef versioned_symbol +# define versioned_symbol(lib, local, symbol, version) +# undef __pthread_cond_init +# define __pthread_cond_init __pthread_cond_init_internal +# include_next <pthread_cond_init.c> +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_signal.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_signal.c new file mode 100644 index 0000000000..a7243fb7bb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_signal.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <pthread_cond_signal.c> +#else +# include <pthread.h> +# include <pthreadP.h> +# include <internaltypes.h> +# include <shlib-compat.h> +int +__pthread_cond_signal (cond) + pthread_cond_t *cond; +{ + cond_compat_check_and_clear (cond); + return __pthread_cond_signal_internal (cond); +} +versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal, + GLIBC_2_3_2); +# undef versioned_symbol +# define versioned_symbol(lib, local, symbol, version) +# undef __pthread_cond_signal +# define __pthread_cond_signal __pthread_cond_signal_internal +# include_next <pthread_cond_signal.c> +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_timedwait.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_timedwait.c new file mode 100644 index 0000000000..6bc7d7459f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_timedwait.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <pthread_cond_timedwait.c> +#else +# include <pthread.h> +# include <pthreadP.h> +# include <internaltypes.h> +# include <shlib-compat.h> +int +__pthread_cond_timedwait (cond, mutex, abstime) + pthread_cond_t *cond; + pthread_mutex_t *mutex; + const struct timespec *abstime; +{ + cond_compat_check_and_clear (cond); + return __pthread_cond_timedwait_internal (cond, mutex, abstime); +} +versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait, + GLIBC_2_3_2); +# undef versioned_symbol +# define versioned_symbol(lib, local, symbol, version) +# undef __pthread_cond_timedwait +# define __pthread_cond_timedwait __pthread_cond_timedwait_internal +# include_next <pthread_cond_timedwait.c> +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_wait.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_wait.c new file mode 100644 index 0000000000..acf7895528 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_cond_wait.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <pthread_cond_wait.c> +#else +# include <pthread.h> +# include <pthreadP.h> +# include <internaltypes.h> +# include <shlib-compat.h> +int +__pthread_cond_wait (cond, mutex) + pthread_cond_t *cond; + pthread_mutex_t *mutex; +{ + cond_compat_check_and_clear (cond); + return __pthread_cond_wait_internal (cond, mutex); +} +versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait, + GLIBC_2_3_2); +# undef versioned_symbol +# define versioned_symbol(lib, local, symbol, version) +# undef __pthread_cond_wait +# define __pthread_cond_wait __pthread_cond_wait_internal +# include_next <pthread_cond_wait.c> +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c new file mode 100644 index 0000000000..974819ead6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c @@ -0,0 +1,93 @@ +/* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "pthreadP.h" +#include <lowlevellock.h> + + +unsigned long int __fork_generation attribute_hidden; + + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_private_futex_wake (once_control, INT_MAX); +} + + +int +__pthread_once (once_control, init_routine) + pthread_once_t *once_control; + void (*init_routine) (void); +{ + while (1) + { + int oldval, val, newval; + + val = *once_control; + do + { + /* Check if the initialized has already been done. */ + if ((val & 2) != 0) + return 0; + + oldval = val; + newval = (oldval & 3) | __fork_generation | 1; + val = atomic_compare_and_exchange_val_acq (once_control, newval, + oldval); + } + while (__builtin_expect (val != oldval, 0)); + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) != 0) + { + /* Check whether the initializer execution was interrupted + by a fork. */ + if (((oldval ^ newval) & -4) == 0) + { + /* Same generation, some other thread was faster. Wait. */ + lll_private_futex_wait (once_control, newval); + continue; + } + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + + /* Add one to *once_control. */ + atomic_increment (once_control); + + /* Wake up all other threads. */ + lll_private_futex_wake (once_control, INT_MAX); + break; + } + + return 0; +} +weak_alias (__pthread_once, pthread_once) +strong_alias (__pthread_once, __pthread_once_internal) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..d3ca0b8a61 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h @@ -0,0 +1,281 @@ +/* Copyright (C) 2005, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sysdeps/generic/sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +# ifndef NO_ERROR +# define NO_ERROR -0x1000 +# endif + +/* The syscall cancellation mechanism requires userspace + assistance, the following code does roughly this: + + do arguments (read arg5 and arg6 to registers) + setup frame + + check if there are threads, yes jump to pseudo_cancel + + unthreaded: + syscall + check syscall return (jump to pre_end) + set errno + set return to -1 + (jump to pre_end) + + pseudo_cancel: + cenable + syscall + cdisable + check syscall return (jump to pre_end) + set errno + set return to -1 + + pre_end + restore stack + + It is expected that 'ret' and 'END' macros will + append an 'undo arguments' and 'return' to the + this PSEUDO macro. */ + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + ENTRY (__##syscall_name##_nocancel) \ + DOARGS_##args ASM_LINE_SEP \ + stwm TREG, 64(%sp) ASM_LINE_SEP \ + .cfi_offset TREG, 0 ASM_LINE_SEP \ + .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \ + stw %sp, -4(%sp) ASM_LINE_SEP \ + .cfi_offset 30, -4 ASM_LINE_SEP \ + stw %r19, -32(%sp) ASM_LINE_SEP \ + .cfi_offset 19, -32 ASM_LINE_SEP \ + /* Save r19 */ ASM_LINE_SEP \ + SAVE_PIC(TREG) ASM_LINE_SEP \ + /* Do syscall, delay loads # */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \ + ldi NO_ERROR,%r1 ASM_LINE_SEP \ + cmpb,>>=,n %r1,%ret0,L(pre_nc_end) ASM_LINE_SEP \ + /* Restore r19 from TREG */ ASM_LINE_SEP \ + LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \ + SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ + /* Use TREG for temp storage */ ASM_LINE_SEP \ + copy %ret0, TREG /* delay */ ASM_LINE_SEP \ + /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \ + /* do a -1*syscall_ret0 */ ASM_LINE_SEP \ + sub %r0, TREG, TREG ASM_LINE_SEP \ + /* Store into errno location */ ASM_LINE_SEP \ + stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ + /* return -1 as error */ ASM_LINE_SEP \ + ldi -1, %ret0 ASM_LINE_SEP \ +L(pre_nc_end): ASM_LINE_SEP \ + /* No need to LOAD_PIC */ ASM_LINE_SEP \ + /* Undo frame */ ASM_LINE_SEP \ + ldwm -64(%sp),TREG ASM_LINE_SEP \ + .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \ + /* Restore rp before exit */ ASM_LINE_SEP \ + ldw -20(%sp), %rp ASM_LINE_SEP \ + .cfi_restore 2 ASM_LINE_SEP \ + ret ASM_LINE_SEP \ + END(__##syscall_name##_nocancel) ASM_LINE_SEP \ + /**********************************************/ASM_LINE_SEP \ + ENTRY (name) \ + DOARGS_##args ASM_LINE_SEP \ + stwm TREG, 64(%sp) ASM_LINE_SEP \ + .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \ + stw %sp, -4(%sp) ASM_LINE_SEP \ + .cfi_offset 30, -4 ASM_LINE_SEP \ + stw %r19, -32(%sp) ASM_LINE_SEP \ + .cfi_offset 19, -32 ASM_LINE_SEP \ + /* Done setting up frame, continue... */ ASM_LINE_SEP \ + SINGLE_THREAD_P ASM_LINE_SEP \ + cmpib,<>,n 0,%ret0,L(pseudo_cancel) ASM_LINE_SEP \ +L(unthreaded): ASM_LINE_SEP \ + /* Save r19 */ ASM_LINE_SEP \ + SAVE_PIC(TREG) ASM_LINE_SEP \ + /* Do syscall, delay loads # */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \ + ldi NO_ERROR,%r1 ASM_LINE_SEP \ + cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \ + /* Restore r19 from TREG */ ASM_LINE_SEP \ + LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \ + SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ + /* Use TREG for temp storage */ ASM_LINE_SEP \ + copy %ret0, TREG /* delay */ ASM_LINE_SEP \ + /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \ + /* do a -1*syscall_ret0 */ ASM_LINE_SEP \ + sub %r0, TREG, TREG ASM_LINE_SEP \ + /* Store into errno location */ ASM_LINE_SEP \ + stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ + b L(pre_end) ASM_LINE_SEP \ + /* return -1 as error */ ASM_LINE_SEP \ + ldi -1, %ret0 /* delay */ ASM_LINE_SEP \ +L(pseudo_cancel): ASM_LINE_SEP \ + PUSHARGS_##args /* Save args */ ASM_LINE_SEP \ + /* Save r19 into TREG */ ASM_LINE_SEP \ + CENABLE /* FUNC CALL */ ASM_LINE_SEP \ + SAVE_PIC(TREG) /* delay */ ASM_LINE_SEP \ + /* restore syscall args */ ASM_LINE_SEP \ + POPARGS_##args ASM_LINE_SEP \ + /* save mask from cenable (use stub rp slot) */ ASM_LINE_SEP \ + stw %ret0, -24(%sp) ASM_LINE_SEP \ + /* ... SYSCALL ... */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \ + /* ............... */ ASM_LINE_SEP \ + LOAD_PIC(TREG) ASM_LINE_SEP \ + /* pass mask as arg0 to cdisable */ ASM_LINE_SEP \ + ldw -24(%sp), %r26 ASM_LINE_SEP \ + CDISABLE ASM_LINE_SEP \ + stw %ret0, -24(%sp) /* delay */ ASM_LINE_SEP \ + /* Restore syscall return */ ASM_LINE_SEP \ + ldw -24(%sp), %ret0 ASM_LINE_SEP \ + /* compare error */ ASM_LINE_SEP \ + ldi NO_ERROR,%r1 ASM_LINE_SEP \ + /* branch if no error */ ASM_LINE_SEP \ + cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \ + LOAD_PIC(TREG) /* cond. nullify */ ASM_LINE_SEP \ + copy %ret0, TREG /* save syscall return */ ASM_LINE_SEP \ + SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ + /* make syscall res value positive */ ASM_LINE_SEP \ + sub %r0, TREG, TREG /* delay */ ASM_LINE_SEP \ + /* No need to LOAD_PIC */ ASM_LINE_SEP \ + /* store into errno location */ ASM_LINE_SEP \ + stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ + /* return -1 */ ASM_LINE_SEP \ + ldi -1, %ret0 ASM_LINE_SEP \ +L(pre_end): ASM_LINE_SEP \ + /* No need to LOAD_PIC */ ASM_LINE_SEP \ + /* Undo frame */ ASM_LINE_SEP \ + ldwm -64(%sp),TREG ASM_LINE_SEP \ + .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \ + /* Restore rp before exit */ ASM_LINE_SEP \ + ldw -20(%sp), %rp ASM_LINE_SEP \ + .cfi_restore 2 ASM_LINE_SEP + +/* Save arguments into our frame */ +# define PUSHARGS_0 /* nothing to do */ +# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 26, -36 ASM_LINE_SEP +# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 25, -40 ASM_LINE_SEP +# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 24, -44 ASM_LINE_SEP +# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 23, -48 ASM_LINE_SEP +# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 22, -52 ASM_LINE_SEP +# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP \ + .cfi_offset 21, -56 ASM_LINE_SEP + +/* Bring them back from the stack */ +# define POPARGS_0 /* nothing to do */ +# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP \ + .cfi_restore 26 ASM_LINE_SEP +# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP \ + .cfi_restore 25 ASM_LINE_SEP +# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP \ + .cfi_restore 24 ASM_LINE_SEP +# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP \ + .cfi_restore 23 ASM_LINE_SEP +# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP \ + .cfi_restore 22 ASM_LINE_SEP +# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP \ + .cfi_restore 21 ASM_LINE_SEP + +# ifdef IS_IN_libpthread +# ifdef PIC +# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \ + bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP +# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \ + bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP +# else +# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \ + bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP +# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \ + bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP +# endif +# elif !defined NOT_IN_libc +# ifdef PIC +# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \ + bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP +# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \ + bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP +# else +# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \ + bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP +# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \ + bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP +# endif +# elif defined IS_IN_librt +# ifdef PIC +# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \ + bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP +# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \ + bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP +# else +# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \ + bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP +# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \ + bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP +# endif +# else +# error Unsupported library +# endif + +# ifdef IS_IN_libpthread +# define __local_multiple_threads __pthread_multiple_threads +# elif !defined NOT_IN_libc +# define __local_multiple_threads __libc_multiple_threads +# elif IS_IN_librt +# define __local_multiple_threads __librt_multiple_threads +# else +# error Unsupported library +# endif + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +# else +/* Read the value of header.multiple_threads from the thread pointer */ +# define SINGLE_THREAD_P \ + mfctl %cr27, %ret0 ASM_LINE_SEP \ + ldw MULTIPLE_THREADS_THREAD_OFFSET(%sr0,%ret0),%ret0 ASM_LINE_SEP +# endif +#elif !defined __ASSEMBLER__ + +/* This code should never be used but we define it anyhow. */ +# define SINGLE_THREAD_P (1) +# define NO_CANCELLATION 1 + +#endif +/* !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt */ + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/profil-counter.h b/ports/sysdeps/unix/sysv/linux/hppa/profil-counter.h new file mode 100644 index 0000000000..a70454a37c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/profil-counter.h @@ -0,0 +1,24 @@ +/* Machine-dependent SIGPROF signal handler. PA-RISC version + Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +static void +profil_counter (int signr, siginfo_t *si, struct ucontext *uctx) +{ + unsigned long ip = uctx->uc_mcontext.sc_iaoq[0] & ~0x3; + profil_count ((void *) ip); +} diff --git a/ports/sysdeps/unix/sysv/linux/hppa/setcontext.S b/ports/sysdeps/unix/sysv/linux/hppa/setcontext.S new file mode 100644 index 0000000000..617837e7b4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/setcontext.S @@ -0,0 +1,157 @@ +/* Install given context. + Copyright (C) 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Helge Deller <deller@gmx.de>, 2008. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include "ucontext_i.h" + + +ENTRY(__setcontext) + /* Prologue */ + stwm %r3, 64(%sp) +#ifdef PIC + stw %r19, -32(%sp) +#endif + + /* Save ucp. */ + copy %r26, %r3 + +.Lagain: + /* Set the current signal mask. */ + /* sigprocmask(SIG_BLOCK, &ucp->uc_sigmask, NULL); */ + copy %r0, %r24 + ldo oSIGMASK(%r3), %r25 + bl sigprocmask, %r2 + ldi SIG_SETMASK, %r26 + + comib,<>,n 0,%ret0,.Lerror + + /* Save %sp, %dp. */ + copy %sp, %r4 + copy %dp, %r5 + copy %r19, %r6 + + /* Get the registers. */ + ldw oR1(%r3), %r1 + ldw oR2(%r3), %r2 + /* ldw oR3(%r3), %r3 - used for ucp pointer. */ + /* ldw oR4(%r3), %r4 - used for original %sp. */ + /* ldw oR5(%r3), %r5 - used for %dp / %r27. */ + /* ldw oR6(%r3), %r6 - used for %r19. */ + ldw oR7(%r3), %r7 + ldw oR8(%r3), %r8 + ldw oR9(%r3), %r9 + ldw oR10(%r3), %r10 + ldw oR11(%r3), %r11 + ldw oR12(%r3), %r12 + ldw oR13(%r3), %r13 + ldw oR14(%r3), %r14 + ldw oR15(%r3), %r15 + ldw oR16(%r3), %r16 + ldw oR17(%r3), %r17 + ldw oR18(%r3), %r18 + ldw oR19(%r3), %r19 + ldw oR20(%r3), %r20 + ldw oR21(%r3), %r21 + /* ldw oR22(%r3), %r22 - dyncall arg. */ + ldw oR23(%r3), %r23 + ldw oR24(%r3), %r24 + ldw oR25(%r3), %r25 + ldw oR26(%r3), %r26 + ldw oR27(%r3), %r27 + ldw oR28(%r3), %r28 + ldw oR29(%r3), %r29 + ldw oR30(%r3), %sp + /* ldw oR31(%r3), %r31 - dyncall scratch register */ + + /* Restore floating-point registers. */ + ldo oFPREGS31(%r3), %r22 + fldds 0(%r22), %fr31 + fldds,mb -8(%r22), %fr30 + fldds,mb -8(%r22), %fr29 + fldds,mb -8(%r22), %fr28 + fldds,mb -8(%r22), %fr27 + fldds,mb -8(%r22), %fr26 + fldds,mb -8(%r22), %fr25 + fldds,mb -8(%r22), %fr24 + fldds,mb -8(%r22), %fr23 + fldds,mb -8(%r22), %fr22 + fldds,mb -8(%r22), %fr21 + fldds,mb -8(%r22), %fr20 + fldds,mb -8(%r22), %fr19 + fldds,mb -8(%r22), %fr18 + fldds,mb -8(%r22), %fr17 + fldds,mb -8(%r22), %fr16 + fldds,mb -8(%r22), %fr15 + fldds,mb -8(%r22), %fr14 + fldds,mb -8(%r22), %fr13 + fldds,mb -8(%r22), %fr12 + fldds,mb -8(%r22), %fr11 + fldds,mb -8(%r22), %fr10 + fldds,mb -8(%r22), %fr9 + fldds,mb -8(%r22), %fr8 + fldds,mb -8(%r22), %fr7 + fldds,mb -8(%r22), %fr6 + fldds,mb -8(%r22), %fr5 + fldds,mb -8(%r22), %fr4 + fldds,mb -8(%r22), %fr3 + fldds,mb -8(%r22), %fr2 + fldds,mb -8(%r22), %fr1 + fldds,mb -8(%r22), %fr0 + + /* Do not load oSS_SP into %sp. The value of oSS_SP indicates + the start of the user allocated stack, but not the sp that + should be used by the new context. In fact makecontext + will create a frame, and adjust sp as required. We do not + support calling getcontext and modifying ss_sp without + a call to makecontext to synchronize ss_sp into the machine + context. */ + + /* Call external function. */ + copy %r2, %r22 + bl $$dyncall, %r31 + copy %r31, %r2 + + /* We return here. Get new ucp in %r3, reload %sp. */ + ldw oUC_LINK(%r3), %r3 + copy %r4, %sp + copy %r5, %dp + copy %r6, %r19 + + /* Continue until ucp == NULL. */ + comib,<> 0,%r3,.Lagain + nop + + /* No further context available. Exit now. */ + bl _exit, %r2 + ldi -1, %r26 + + +.Lerror: + /* Epilogue */ + ldw -84(%r30), %r2 +#ifdef PIC + ldw -96(%r30), %r19 +#endif + bv %r0(%r2) + ldwm -64(%r30), %r3 +L(pseudo_end): +PSEUDO_END(__setcontext) + +weak_alias(__setcontext, setcontext) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/socket.S b/ports/sysdeps/unix/sysv/linux/hppa/socket.S new file mode 100644 index 0000000000..dfbb721a82 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/socket.S @@ -0,0 +1,10 @@ +#include <sysdep.h> + + .globl __socket +PSEUDO(__socket, socket, 3) + +PSEUDO_END(__socket) + +#ifndef NO_WEAK_ALIAS +weak_alias (__socket, socket) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/hppa/swapcontext.c b/ports/sysdeps/unix/sysv/linux/hppa/swapcontext.c new file mode 100644 index 0000000000..98cb39cf65 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/swapcontext.c @@ -0,0 +1,42 @@ +/* Swap to new context. + Copyright (C) 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Helge Deller <deller@gmx.de>, 2008. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <ucontext.h> + +extern int __getcontext (ucontext_t *ucp); +extern int __setcontext (const ucontext_t *ucp); + +int +__swapcontext (ucontext_t *oucp, const ucontext_t *ucp) +{ + /* Save the current machine context to oucp. */ + __getcontext (oucp); + + /* mark sc_sar flag to skip the setcontext call on reactivation. */ + if (oucp->uc_mcontext.sc_sar == 0) { + oucp->uc_mcontext.sc_sar++; + + /* Restore the machine context in ucp. */ + __setcontext (ucp); + } + + return 0; +} + +weak_alias (__swapcontext, swapcontext) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h new file mode 100644 index 0000000000..0adf09029e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h @@ -0,0 +1,143 @@ +/* Copyright (C) 2002-2009, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EPOLL_H +#define _SYS_EPOLL_H 1 + +#include <stdint.h> +#include <sys/types.h> + +/* Get __sigset_t. */ +#include <bits/sigset.h> + +#ifndef __sigset_t_defined +# define __sigset_t_defined +typedef __sigset_t sigset_t; +#endif + + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 010000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; + + +enum EPOLL_EVENTS + { + EPOLLIN = 0x001, +#define EPOLLIN EPOLLIN + EPOLLPRI = 0x002, +#define EPOLLPRI EPOLLPRI + EPOLLOUT = 0x004, +#define EPOLLOUT EPOLLOUT + EPOLLRDNORM = 0x040, +#define EPOLLRDNORM EPOLLRDNORM + EPOLLRDBAND = 0x080, +#define EPOLLRDBAND EPOLLRDBAND + EPOLLWRNORM = 0x100, +#define EPOLLWRNORM EPOLLWRNORM + EPOLLWRBAND = 0x200, +#define EPOLLWRBAND EPOLLWRBAND + EPOLLMSG = 0x400, +#define EPOLLMSG EPOLLMSG + EPOLLERR = 0x008, +#define EPOLLERR EPOLLERR + EPOLLHUP = 0x010, +#define EPOLLHUP EPOLLHUP + EPOLLRDHUP = 0x2000, +#define EPOLLRDHUP EPOLLRDHUP + EPOLLONESHOT = 1u << 30, +#define EPOLLONESHOT EPOLLONESHOT + EPOLLET = 1u << 31 +#define EPOLLET EPOLLET + }; + + +/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ +#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ +#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ +#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ + + +typedef union epoll_data +{ + void *ptr; + int fd; + uint32_t u32; + uint64_t u64; +} epoll_data_t; + +struct epoll_event +{ + uint32_t events; /* Epoll events */ + epoll_data_t data; /* User data variable */ +}; + + +__BEGIN_DECLS + +/* Creates an epoll instance. Returns an fd for the new instance. + The "size" parameter is a hint specifying the number of file + descriptors to be associated with the new instance. The fd + returned by epoll_create() should be closed with close(). */ +extern int epoll_create (int __size) __THROW; + +/* Same as epoll_create but with an FLAGS parameter. The unused SIZE + parameter has been dropped. */ +extern int epoll_create1 (int __flags) __THROW; + + +/* Manipulate an epoll instance "epfd". Returns 0 in case of success, + -1 in case of error ( the "errno" variable will contain the + specific error code ) The "op" parameter is one of the EPOLL_CTL_* + constants defined above. The "fd" parameter is the target of the + operation. The "event" parameter describes which events the caller + is interested in and any associated user data. */ +extern int epoll_ctl (int __epfd, int __op, int __fd, + struct epoll_event *__event) __THROW; + + +/* Wait for events on an epoll instance "epfd". Returns the number of + triggered events returned in "events" buffer. Or -1 in case of + error with the "errno" variable set to the specific error code. The + "events" parameter is a buffer that will contain triggered + events. The "maxevents" is the maximum number of events to be + returned ( usually size of "events" ). The "timeout" parameter + specifies the maximum wait time in milliseconds (-1 == infinite). + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int epoll_wait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout); + + +/* Same as epoll_wait, but the thread's signal mask is temporarily + and atomically replaced with the one provided as parameter. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int epoll_pwait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout, + const __sigset_t *__ss); + +__END_DECLS + +#endif /* sys/epoll.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h new file mode 100644 index 0000000000..d9a3fab383 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +#define _SYS_EVENTFD_H 1 + +#include <stdint.h> + + +/* Type for event counter. */ +typedef uint64_t eventfd_t; + +/* Flags for signalfd. */ +enum + { + EFD_SEMAPHORE = 1, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 010000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define EFD_NONBLOCK EFD_NONBLOCK + }; + + +__BEGIN_DECLS + +/* Return file descriptor for generic event channel. Set initial + value to COUNT. */ +extern int eventfd (int __count, int __flags) __THROW; + +/* Read event counter and possibly wait for events. */ +extern int eventfd_read (int __fd, eventfd_t *__value); + +/* Increment event counter. */ +extern int eventfd_write (int __fd, eventfd_t __value); + +__END_DECLS + +#endif /* sys/eventfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h new file mode 100644 index 0000000000..2580837d11 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h @@ -0,0 +1,106 @@ +/* Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_INOTIFY_H +#define _SYS_INOTIFY_H 1 + +#include <stdint.h> + + +/* Flags for the parameter of inotify_init1. */ +enum + { + IN_CLOEXEC = 010000000, +#define IN_CLOEXEC IN_CLOEXEC + IN_NONBLOCK = 000200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define IN_NONBLOCK IN_NONBLOCK + }; + + +/* Structure describing an inotify event. */ +struct inotify_event +{ + int wd; /* Watch descriptor. */ + uint32_t mask; /* Watch mask. */ + uint32_t cookie; /* Cookie to synchronize two events. */ + uint32_t len; /* Length (including NULs) of name. */ + char name __flexarr; /* Name. */ +}; + + +/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */ +#define IN_ACCESS 0x00000001 /* File was accessed. */ +#define IN_MODIFY 0x00000002 /* File was modified. */ +#define IN_ATTRIB 0x00000004 /* Metadata changed. */ +#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */ +#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */ +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ +#define IN_OPEN 0x00000020 /* File was opened. */ +#define IN_MOVED_FROM 0x00000040 /* File was moved from X. */ +#define IN_MOVED_TO 0x00000080 /* File was moved to Y. */ +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ +#define IN_CREATE 0x00000100 /* Subfile was created. */ +#define IN_DELETE 0x00000200 /* Subfile was deleted. */ +#define IN_DELETE_SELF 0x00000400 /* Self was deleted. */ +#define IN_MOVE_SELF 0x00000800 /* Self was moved. */ + +/* Events sent by the kernel. */ +#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */ +#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */ +#define IN_IGNORED 0x00008000 /* File was ignored. */ + +/* Helper events. */ +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ + +/* Special flags. */ +#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a + directory. */ +#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */ +#define IN_EXCL_UNLINK 0x04000000 /* Exclude events on unlinked + objects. */ +#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already + existing watch. */ +#define IN_ISDIR 0x40000000 /* Event occurred against dir. */ +#define IN_ONESHOT 0x80000000 /* Only send event once. */ + +/* All events which a program can wait on. */ +#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \ + | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \ + | IN_MOVED_TO | IN_CREATE | IN_DELETE \ + | IN_DELETE_SELF | IN_MOVE_SELF) + + +__BEGIN_DECLS + +/* Create and initialize inotify instance. */ +extern int inotify_init (void) __THROW; + +/* Create and initialize inotify instance. */ +extern int inotify_init1 (int __flags) __THROW; + +/* Add watch of object NAME to inotify instance FD. Notify about + events specified by MASK. */ +extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask) + __THROW; + +/* Remove the watch specified by WD from the inotify instance FD. */ +extern int inotify_rm_watch (int __fd, int __wd) __THROW; + +__END_DECLS + +#endif /* sys/inotify.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h new file mode 100644 index 0000000000..97e419523a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h @@ -0,0 +1,119 @@ +/* Copyright (C) 1996, 1997, 1999, 2000, 2006, 2011 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somewhat modelled after the file of the same name on SVR4 + systems. It provides a definition of the core file format for ELF + used on Linux. It doesn't have anything to do with the /proc file + system, even though Linux has one. + + Anyway, the whole purpose of this file is for GDB and GDB only. + Don't read too much into it. Don't use it for anything other than + GDB unless you know what you are doing. */ + +#include <features.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/user.h> + +__BEGIN_DECLS + +typedef unsigned long elf_greg_t; +#define ELF_NGREG 80 /* We only need 64 at present, but leave space + for expansion. */ +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +#define ELF_NFPREG 32 +typedef double elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with Linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + GDB doesn't really use excluded. */ + +struct elf_prstatus + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args. */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned int pr_uid; + unsigned int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + + +/* The rest of this file provides the types for emulation of the + Solaris <proc_service.h> interfaces that should be implemented by + users of libthread_db. */ + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore have only one PID type. */ +typedef __pid_t lwpid_t; + +/* Process status and info. In the end we do provide typedefs for them. */ +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h new file mode 100644 index 0000000000..502b2c1332 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h @@ -0,0 +1,65 @@ +/* Copyright (C) 2007, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SIGNALFD_H +#define _SYS_SIGNALFD_H 1 + +#define __need_sigset_t +#include <signal.h> +#include <stdint.h> + + +struct signalfd_siginfo +{ + uint32_t ssi_signo; + int32_t ssi_errno; + int32_t ssi_code; + uint32_t ssi_pid; + uint32_t ssi_uid; + int32_t ssi_fd; + uint32_t ssi_tid; + uint32_t ssi_band; + uint32_t ssi_overrun; + uint32_t ssi_trapno; + int32_t ssi_status; + int32_t ssi_int; + uint64_t ssi_ptr; + uint64_t ssi_utime; + uint64_t ssi_stime; + uint64_t ssi_addr; + uint8_t __pad[48]; +}; + +/* Flags for signalfd. */ +enum + { + SFD_CLOEXEC = 010000000, +#define SFD_CLOEXEC SFD_CLOEXEC + SFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define SFD_NONBLOCK SFD_NONBLOCK + }; + +__BEGIN_DECLS + +/* Request notification for delivery of signals in MASK to be + performed using descriptor FD.*/ +extern int signalfd (int __fd, const sigset_t *__mask, int __flags) + __THROW __nonnull ((2)); + +__END_DECLS + +#endif /* sys/signalfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h new file mode 100644 index 0000000000..b7794a0c97 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2008, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_TIMERFD_H +#define _SYS_TIMERFD_H 1 + +#include <time.h> + + +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 010000000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 000200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define TFD_NONBLOCK TFD_NONBLOCK + }; + + +/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */ +enum + { + TFD_TIMER_ABSTIME = 1 << 0 +#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME + }; + + +__BEGIN_DECLS + +/* Return file descriptor for new interval timer source. */ +extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW; + +/* Set next expiration time of interval timer source UFD to UTMR. If + FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is + absolute. Optionally return the old expiration time in OTMR. */ +extern int timerfd_settime (int __ufd, int __flags, + const struct itimerspec *__utmr, + struct itimerspec *__otmr) __THROW; + +/* Return the next expiration time of UFD. */ +extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; + +__END_DECLS + +#endif /* sys/timerfd.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h new file mode 100644 index 0000000000..d61355b8c0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h @@ -0,0 +1,66 @@ +/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Don't rely on this, the interface is currently messed up and may need to + be broken to be fixed. */ +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +/* We need the signal context definitions even if they are not used + included in <signal.h>. */ +#include <bits/sigcontext.h> + + +/* Type for general register. */ +typedef unsigned long int greg_t; + +/* Number of general registers. */ +#define NGREG 80 +#define NFPREG 32 + +/* Container for all general registers. */ +typedef struct gregset + { + greg_t g_regs[32]; + greg_t sr_regs[8]; + greg_t cr_regs[24]; + greg_t g_pad[16]; + } gregset_t; + +/* Container for all FPU registers. */ +typedef struct fpregset + { + double fp_dregs[32]; + } fpregset_t; + +/* Context to describe whole processor state. */ +typedef struct sigcontext mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + } ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/user.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/user.h new file mode 100644 index 0000000000..c871f1a03d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/user.h @@ -0,0 +1 @@ +/* This file is not needed, but in practice gdb might try to include it. */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/syscall.S b/ports/sysdeps/unix/sysv/linux/hppa/syscall.S new file mode 100644 index 0000000000..4467feb150 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/syscall.S @@ -0,0 +1,18 @@ +/* Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* HPPA implements syscall() in 'C'; see sysdep.c. */ diff --git a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list new file mode 100644 index 0000000000..0f7537c306 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -0,0 +1,37 @@ +# File name Caller Syscall name # args Strong name Weak names + +# semaphore and shm system calls +msgctl - msgctl i:iip __msgctl msgctl +msgget - msgget i:ii __msgget msgget +msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv +msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +shmat - shmat i:ipi __shmat shmat +shmctl - shmctl i:iip __shmctl shmctl +shmdt - shmdt i:s __shmdt shmdt +shmget - shmget i:iii __shmget shmget +semop - semop i:ipi __semop semop +semtimedop - semtimedop i:ipip semtimedop +semget - semget i:iii __semget semget +semctl - semctl i:iiii __semctl semctl + +# proper socket implementations: +accept - accept Ci:iBN __libc_accept __accept accept +bind - bind i:ipi __bind bind +connect - connect Ci:ipi __libc_connect __connect_internal __connect connect +getpeername - getpeername i:ipp __getpeername getpeername +getsockname - getsockname i:ipp __getsockname getsockname +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt +listen - listen i:ii __listen listen +recv - recv Ci:ibni __libc_recv __recv recv +recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom +recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg +send - send Ci:ibni __libc_send __send send +sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg +sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt +shutdown - shutdown i:ii __shutdown shutdown +socket - socket i:iii __socket socket +socketpair - socketpair i:iiif __socketpair socketpair + +setrlimit - setrlimit i:ip __setrlimit setrlimit +getrlimit - getrlimit i:ip __getrlimit getrlimit diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sysdep.c b/ports/sysdeps/unix/sysv/linux/hppa/sysdep.c new file mode 100644 index 0000000000..a1bfd5ef60 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sysdep.c @@ -0,0 +1,79 @@ +/* Copyright (C) 1997, 1998, 2001, 2003, 2007 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdarg.h> +#include <sysdep.h> +#include <errno.h> + +extern int __syscall_error(int err_no); +extern long int syscall (long int __sysno, ...) __THROW; + +/* This routine is jumped to by all the syscall handlers, to stash + an error number into errno. */ +int +__syscall_error (int err_no) +{ + __set_errno (err_no); + return -1; +} + + +/* HPPA implements syscall() in 'C'; the assembler version would + typically be in syscall.S. Also note that we have INLINE_SYSCALL, + INTERNAL_SYSCALL, and all the generated pure assembly syscall wrappers. + How often the function is used is unknown. */ + +long int +syscall (long int __sysno, ...) +{ + /* FIXME: Keep this matching INLINE_SYSCALL for hppa */ + va_list args; + long int arg0, arg1, arg2, arg3, arg4, arg5; + long int __sys_res; + + /* Load varargs */ + va_start (args, __sysno); + arg0 = va_arg (args, long int); + arg1 = va_arg (args, long int); + arg2 = va_arg (args, long int); + arg3 = va_arg (args, long int); + arg4 = va_arg (args, long int); + arg5 = va_arg (args, long int); + va_end (args); + + { + register unsigned long int __res asm("r28"); + PIC_REG_DEF + LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5) + asm volatile (SAVE_ASM_PIC + " ble 0x100(%%sr2, %%r0) \n" + " copy %1, %%r20 \n" + LOAD_ASM_PIC + : "=r" (__res) + : "r" (__sysno) PIC_REG_USE ASM_ARGS_6 + : "memory", CALL_CLOB_REGS CLOB_ARGS_6); + __sys_res = __res; + } + if ((unsigned long int) __sys_res >= (unsigned long int) -4095) + { + __set_errno (-__sys_res); + __sys_res = -1; + } + return __sys_res; +} + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h b/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h new file mode 100644 index 0000000000..83dd599c68 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h @@ -0,0 +1,498 @@ +/* Assembler macros for PA-RISC. + Copyright (C) 1999, 2001, 2002, 2003, 2007 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999. + Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <asm/unistd.h> +#include <sysdeps/generic/sysdep.h> +#include <sys/syscall.h> + +/* In order to get __set_errno() definition in INLINE_SYSCALL. */ +#ifndef __ASSEMBLER__ +#include <errno.h> +#endif + +#undef ASM_LINE_SEP +#define ASM_LINE_SEP ! + +#undef SYS_ify +#define SYS_ify(syscall_name) (__NR_##syscall_name) + +/* WARNING: TREG must be a callee saves register so + that it doesn't have to be restored after a call + to another function */ +#ifdef PIC +# define TREG %r3 +# define SAVE_PIC(SREG) copy %r19, SREG ASM_LINE_SEP +# define LOAD_PIC(LREG) copy LREG, %r19 ASM_LINE_SEP +/* Inline assembly defines */ +# define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */ +# define SAVE_ASM_PIC " copy %%r19, %" TREG_ASM "\n" +# define LOAD_ASM_PIC " copy %" TREG_ASM ", %%r19\n" +# define CLOB_TREG TREG_ASM , +# define PIC_REG_DEF register unsigned long __r19 asm("r19"); +# define PIC_REG_USE , "r" (__r19) +#else +# define TREG %r3 +# define SAVE_PIC(SREG) nop ASM_LINE_SEP +# define LOAD_PIC(LREG) nop ASM_LINE_SEP +/* Inline assembly defines */ +# define TREG_ASM +# define SAVE_ASM_PIC "nop \n" +# define LOAD_ASM_PIC "nop \n" +# define CLOB_TREG +# define PIC_REG_DEF +# define PIC_REG_USE +#endif + +#ifdef __ASSEMBLER__ + +/* Syntactic details of assembler. */ + +#define ALIGNARG(log2) log2 + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +/* ELF-like local names start with `.L'. */ +#undef L +#define L(name) .L##name + +/* Linux uses a negative return value to indicate syscall errors, + unlike most Unices, which use the condition codes' carry flag. + + Since version 2.1 the return value of a system call might be + negative even if the call succeeded. E.g., the `lseek' system call + might return a large offset. Therefore we must not anymore test + for < 0, but test for a real error by making sure the value in %eax + is a real error number. Linus said he will make sure the no syscall + returns a value in -1 .. -4095 as a valid result so we can safely + test with -4095. */ + +/* We don't want the label for the error handle to be global when we define + it here. */ +/*#ifdef PIC +# define SYSCALL_ERROR_LABEL 0f +#else +# define SYSCALL_ERROR_LABEL syscall_error +#endif*/ + +/* Argument manipulation from the stack for preparing to + make a syscall */ + +#define DOARGS_0 /* nothing */ +#define DOARGS_1 /* nothing */ +#define DOARGS_2 /* nothing */ +#define DOARGS_3 /* nothing */ +#define DOARGS_4 /* nothing */ +#define DOARGS_5 ldw -52(%sp), %r22 ASM_LINE_SEP +#define DOARGS_6 DOARGS_5 ldw -56(%sp), %r21 ASM_LINE_SEP + +#define UNDOARGS_0 /* nothing */ +#define UNDOARGS_1 /* nothing */ +#define UNDOARGS_2 /* nothing */ +#define UNDOARGS_3 /* nothing */ +#define UNDOARGS_4 /* nothing */ +#define UNDOARGS_5 /* nothing */ +#define UNDOARGS_6 /* nothing */ + +/* Define an entry point visible from C. + + There is currently a bug in gdb which prevents us from specifying + incomplete stabs information. Fake some entries here which specify + the current source file. */ +#define ENTRY(name) \ + .text ASM_LINE_SEP \ + .align ALIGNARG(4) ASM_LINE_SEP \ + .export C_SYMBOL_NAME(name) ASM_LINE_SEP \ + .type C_SYMBOL_NAME(name),@function ASM_LINE_SEP \ + C_LABEL(name) ASM_LINE_SEP \ + .PROC ASM_LINE_SEP \ + .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3 ASM_LINE_SEP \ + .ENTRY ASM_LINE_SEP \ + /* SAVE_RP says we do */ ASM_LINE_SEP \ + stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \ + /*FIXME: Call mcount? (carefull with stack!) */ + +/* Some syscall wrappers do not call other functions, and + hence are classified as leaf, so add NO_CALLS for gdb */ +#define ENTRY_LEAF(name) \ + .text ASM_LINE_SEP \ + .align ALIGNARG(4) ASM_LINE_SEP \ + .export C_SYMBOL_NAME(name) ASM_LINE_SEP \ + .type C_SYMBOL_NAME(name),@function ASM_LINE_SEP \ + C_LABEL(name) ASM_LINE_SEP \ + .PROC ASM_LINE_SEP \ + .CALLINFO FRAME=64,NO_CALLS,SAVE_RP,ENTRY_GR=3 ASM_LINE_SEP \ + .ENTRY ASM_LINE_SEP \ + /* SAVE_RP says we do */ ASM_LINE_SEP \ + stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \ + /*FIXME: Call mcount? (carefull with stack!) */ + +#undef END +#define END(name) \ + .EXIT ASM_LINE_SEP \ + .PROCEND ASM_LINE_SEP \ +.size C_SYMBOL_NAME(name), .-C_SYMBOL_NAME(name) ASM_LINE_SEP + +/* If compiled for profiling, call `mcount' at the start + of each function. No, don't bother. gcc will put the + call in for us. */ +#define CALL_MCOUNT /* Do nothing. */ + +/* syscall wrappers consist of + #include <sysdep.h> + PSEUDO(...) + ret + PSEUDO_END(...) + + which means + ENTRY(name) + DO_CALL(...) + nop + bv 0(2) + nop +*/ + +#define PSEUDO(name, syscall_name, args) \ + ENTRY (name) ASM_LINE_SEP \ + /* If necc. load args from stack */ ASM_LINE_SEP \ + DOARGS_##args ASM_LINE_SEP \ + DO_CALL (syscall_name, args) ASM_LINE_SEP \ + UNDOARGS_##args ASM_LINE_SEP \ + nop ASM_LINE_SEP + +#define ret \ + /* Return value set by ERRNO code */ ASM_LINE_SEP \ + bv,n 0(2) ASM_LINE_SEP + +#undef PSEUDO_END +#define PSEUDO_END(name) \ + END (name) + +/* We don't set the errno on the return from the syscall */ +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + ENTRY_LEAF (name) ASM_LINE_SEP \ + DOARGS_##args ASM_LINE_SEP \ + DO_CALL_NOERRNO (syscall_name, args) ASM_LINE_SEP \ + UNDOARGS_##args ASM_LINE_SEP \ + nop ASM_LINE_SEP + +#define ret_NOERRNO ret + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + +/* This has to return the error value */ +#undef PSEUDO_ERRVAL +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + ENTRY_LEAF (name) ASM_LINE_SEP \ + DOARGS_##args ASM_LINE_SEP \ + DO_CALL_ERRVAL (syscall_name, args) ASM_LINE_SEP \ + UNDOARGS_##args ASM_LINE_SEP \ + nop ASM_LINE_SEP + +#define ret_ERRVAL ret + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) \ + END(name) + +#undef JUMPTARGET +#define JUMPTARGET(name) name +#define SYSCALL_PIC_SETUP /* Nothing. */ + + +/* FIXME: This comment is not true. + * All the syscall assembly macros rely on finding the approriate + SYSCALL_ERROR_LABEL or rather HANDLER. */ + +/* int * __errno_location(void) so you have to store your value + into the return address! */ +#define DEFAULT_SYSCALL_ERROR_HANDLER \ + .import __errno_location,code ASM_LINE_SEP \ + /* branch to errno handler */ ASM_LINE_SEP \ + bl __errno_location,%rp ASM_LINE_SEP + +/* Here are the myriad of configuration options that the above can + work for... what we've done is provide the framework for future + changes if required to each section */ + +#ifdef PIC +# if RTLD_PRIVATE_ERRNO +# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER +# else /* !RTLD_PRIVATE_ERRNO */ +# if defined _LIBC_REENTRANT +# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER +# else /* !_LIBC_REENTRANT */ +# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER +# endif /* _LIBC_REENTRANT */ +# endif /* RTLD_PRIVATE_ERRNO */ +#else +# ifndef _LIBC_REENTRANT +# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER +# else +# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER +# endif +#endif + + +/* Linux takes system call arguments in registers: + syscall number gr20 + arg 1 gr26 + arg 2 gr25 + arg 3 gr24 + arg 4 gr23 + arg 5 gr22 + arg 6 gr21 + + The compiler calls us by the C convention: + syscall number in the DO_CALL macro + arg 1 gr26 + arg 2 gr25 + arg 3 gr24 + arg 4 gr23 + arg 5 -52(sp) + arg 6 -56(sp) + + gr22 and gr21 are caller-saves, so we can just load the arguments + there and generally be happy. */ + +/* the cmpb...no_error code below inside DO_CALL + * is intended to mimic the if (__sys_res...) + * code inside INLINE_SYSCALL + */ +#define NO_ERROR -0x1000 + +#undef DO_CALL +#define DO_CALL(syscall_name, args) \ + /* Create a frame */ ASM_LINE_SEP \ + stwm TREG, 64(%sp) ASM_LINE_SEP \ + stw %sp, -4(%sp) ASM_LINE_SEP \ + stw %r19, -32(%sp) ASM_LINE_SEP \ + /* Save r19 */ ASM_LINE_SEP \ + SAVE_PIC(TREG) ASM_LINE_SEP \ + /* Do syscall, delay loads # */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \ + ldi NO_ERROR,%r1 ASM_LINE_SEP \ + cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \ + /* Restore r19 from TREG */ ASM_LINE_SEP \ + LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \ + SYSCALL_ERROR_HANDLER ASM_LINE_SEP \ + /* Use TREG for temp storage */ ASM_LINE_SEP \ + copy %ret0, TREG /* delay */ ASM_LINE_SEP \ + /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \ + /* do a -1*syscall_ret0 */ ASM_LINE_SEP \ + sub %r0, TREG, TREG ASM_LINE_SEP \ + /* Store into errno location */ ASM_LINE_SEP \ + stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \ + /* return -1 as error */ ASM_LINE_SEP \ + ldo -1(%r0), %ret0 ASM_LINE_SEP \ +L(pre_end): ASM_LINE_SEP \ + /* Restore our frame, restoring TREG */ ASM_LINE_SEP \ + ldwm -64(%sp), TREG ASM_LINE_SEP \ + /* Restore return pointer */ ASM_LINE_SEP \ + ldw -20(%sp),%rp ASM_LINE_SEP + +/* We do nothing with the return, except hand it back to someone else */ +#undef DO_CALL_NOERRNO +#define DO_CALL_NOERRNO(syscall_name, args) \ + /* No need to store r19 */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \ + /* Caller will restore r19 */ ASM_LINE_SEP + +/* Here, we return the ERRVAL in assembly, note we don't call the + error handler function, but we do 'negate' the return _IF_ + it's an error. Not sure if this is the right semantic. */ + +#undef DO_CALL_ERRVAL +#define DO_CALL_ERRVAL(syscall_name, args) \ + /* No need to store r19 */ ASM_LINE_SEP \ + ble 0x100(%sr2,%r0) ASM_LINE_SEP \ + ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \ + /* Caller will restore r19 */ ASM_LINE_SEP \ + ldi NO_ERROR,%r1 ASM_LINE_SEP \ + cmpb,>>=,n %r1,%ret0,0f ASM_LINE_SEP \ + sub %r0, %ret0, %ret0 ASM_LINE_SEP \ +0: ASM_LINE_SEP + + +#else + +/* GCC has to be warned that a syscall may clobber all the ABI + registers listed as "caller-saves", see page 8, Table 2 + in section 2.2.6 of the PA-RISC RUN-TIME architecture + document. However! r28 is the result and will conflict with + the clobber list so it is left out. Also the input arguments + registers r20 -> r26 will conflict with the list so they + are treated specially. Although r19 is clobbered by the syscall + we cannot say this because it would violate ABI, thus we say + TREG is clobbered and use that register to save/restore r19 + across the syscall. */ + +#define CALL_CLOB_REGS "%r1", "%r2", CLOB_TREG \ + "%r20", "%r29", "%r31" + +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ +({ \ + long __sys_res; \ + { \ + register unsigned long __res asm("r28"); \ + PIC_REG_DEF \ + LOAD_ARGS_##nr(args) \ + /* FIXME: HACK save/load r19 around syscall */ \ + asm volatile( \ + SAVE_ASM_PIC \ + " ble 0x100(%%sr2, %%r0)\n" \ + " ldi %1, %%r20\n" \ + LOAD_ASM_PIC \ + : "=r" (__res) \ + : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr \ + : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ + ); \ + __sys_res = (long)__res; \ + } \ + if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){ \ + __set_errno(-__sys_res); \ + __sys_res = -1; \ + } \ + __sys_res; \ +}) + +/* INTERNAL_SYSCALL_DECL - Allows us to setup some function static + value to use within the context of the syscall + INTERNAL_SYSCALL_ERROR_P - Returns 0 if it wasn't an error, 1 otherwise + You are allowed to use the syscall result (val) and the DECL error + variable to determine what went wrong. + INTERLAL_SYSCALL_ERRNO - Munges the val/err pair into the error number. + In our case we just flip the sign. */ + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((val < 0) && (val > -4095)) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) + +/* Similar to INLINE_SYSCALL but we don't set errno */ +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err, nr, args...) \ +({ \ + long __sys_res; \ + { \ + register unsigned long __res asm("r28"); \ + PIC_REG_DEF \ + LOAD_ARGS_##nr(args) \ + /* FIXME: HACK save/load r19 around syscall */ \ + asm volatile( \ + SAVE_ASM_PIC \ + " ble 0x100(%%sr2, %%r0)\n" \ + " ldi %1, %%r20\n" \ + LOAD_ASM_PIC \ + : "=r" (__res) \ + : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr \ + : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ + ); \ + __sys_res = (long)__res; \ + } \ + __sys_res; \ + }) + + +/* The _NCS variant allows non-constant syscall numbers. */ +#undef INTERNAL_SYSCALL_NCS +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +({ \ + long __sys_res; \ + { \ + register unsigned long __res asm("r28"); \ + PIC_REG_DEF \ + LOAD_ARGS_##nr(args) \ + /* FIXME: HACK save/load r19 around syscall */ \ + asm volatile( \ + SAVE_ASM_PIC \ + " ble 0x100(%%sr2, %%r0)\n" \ + " copy %1, %%r20\n" \ + LOAD_ASM_PIC \ + : "=r" (__res) \ + : "r" (name) PIC_REG_USE ASM_ARGS_##nr \ + : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ + ); \ + __sys_res = (long)__res; \ + } \ + __sys_res; \ + }) + + + +#define LOAD_ARGS_0() +#define LOAD_ARGS_1(r26) \ + register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \ + LOAD_ARGS_0() +#define LOAD_ARGS_2(r26,r25) \ + register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \ + LOAD_ARGS_1(r26) +#define LOAD_ARGS_3(r26,r25,r24) \ + register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \ + LOAD_ARGS_2(r26,r25) +#define LOAD_ARGS_4(r26,r25,r24,r23) \ + register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \ + LOAD_ARGS_3(r26,r25,r24) +#define LOAD_ARGS_5(r26,r25,r24,r23,r22) \ + register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \ + LOAD_ARGS_4(r26,r25,r24,r23) +#define LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \ + register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \ + LOAD_ARGS_5(r26,r25,r24,r23,r22) + +/* Even with zero args we use r20 for the syscall number */ +#define ASM_ARGS_0 +#define ASM_ARGS_1 ASM_ARGS_0, "r" (__r26) +#define ASM_ARGS_2 ASM_ARGS_1, "r" (__r25) +#define ASM_ARGS_3 ASM_ARGS_2, "r" (__r24) +#define ASM_ARGS_4 ASM_ARGS_3, "r" (__r23) +#define ASM_ARGS_5 ASM_ARGS_4, "r" (__r22) +#define ASM_ARGS_6 ASM_ARGS_5, "r" (__r21) + +/* The registers not listed as inputs but clobbered */ +#define CLOB_ARGS_6 +#define CLOB_ARGS_5 CLOB_ARGS_6, "%r21" +#define CLOB_ARGS_4 CLOB_ARGS_5, "%r22" +#define CLOB_ARGS_3 CLOB_ARGS_4, "%r23" +#define CLOB_ARGS_2 CLOB_ARGS_3, "%r24" +#define CLOB_ARGS_1 CLOB_ARGS_2, "%r25" +#define CLOB_ARGS_0 CLOB_ARGS_1, "%r26" + +#endif /* __ASSEMBLER__ */ + +/* Pointer mangling is not yet supported for HPPA. */ +#define PTR_MANGLE(var) (void) (var) +#define PTR_DEMANGLE(var) (void) (var) + diff --git a/ports/sysdeps/unix/sysv/linux/hppa/ucontext_i.sym b/ports/sysdeps/unix/sysv/linux/hppa/ucontext_i.sym new file mode 100644 index 0000000000..ee33029a07 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/ucontext_i.sym @@ -0,0 +1,59 @@ +#include <stddef.h> +#include <signal.h> +#include <sys/ucontext.h> + +-- + +SIG_BLOCK +SIG_SETMASK + +#define ucontext(member) offsetof (ucontext_t, member) +#define mcontext(member) ucontext (uc_mcontext.member) +#define mreg(reg) mcontext (sc_gr[reg]) + +oUC_FLAGS ucontext (uc_flags) +oUC_LINK ucontext (uc_link) +oSS_SP ucontext (uc_stack.ss_sp) +oSS_FLAGS ucontext (uc_stack.ss_flags) +oSS_SIZE ucontext (uc_stack.ss_size) +oSC_FLAGS mcontext (sc_flags) +oR0 mreg (0) +oR1 mreg (1) +oR2 mreg (2) +oR3 mreg (3) +oR4 mreg (4) +oR5 mreg (5) +oR6 mreg (6) +oR7 mreg (7) +oR8 mreg (8) +oR9 mreg (9) +oR10 mreg (10) +oR11 mreg (11) +oR12 mreg (12) +oR13 mreg (13) +oR14 mreg (14) +oR15 mreg (15) +oR16 mreg (16) +oR17 mreg (17) +oR18 mreg (18) +oR19 mreg (19) +oR20 mreg (20) +oR21 mreg (21) +oR22 mreg (22) +oR23 mreg (23) +oR24 mreg (24) +oR25 mreg (25) +oR26 mreg (26) +oR27 mreg (27) +oR28 mreg (28) +oR29 mreg (29) +oR30 mreg (30) +oR31 mreg (31) +oFPREGS0 mcontext (sc_fr[0]) +oFPREGS31 mcontext (sc_fr[31]) +oIASQ0 mcontext (sc_iasq[0]) +oIASQ1 mcontext (sc_iasq[1]) +oIAOQ0 mcontext (sc_iaoq[0]) +oIAOQ1 mcontext (sc_iaoq[1]) +oSAR mcontext (sc_sar) +oSIGMASK ucontext (uc_sigmask) diff --git a/ports/sysdeps/unix/sysv/linux/hppa/umount.c b/ports/sysdeps/unix/sysv/linux/hppa/umount.c new file mode 100644 index 0000000000..d9d671f88d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/umount.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Huggins-Daines <dhd@debian.org>, 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Since we don't have an oldumount system call, do what the kernel + does down here. */ + +extern long int __umount2 (const char *name, int flags); + +long int +__umount (const char *name) +{ + return __umount2 (name, 0); +} + +weak_alias (__umount, umount); diff --git a/ports/sysdeps/unix/sysv/linux/hppa/xstat.c b/ports/sysdeps/unix/sysv/linux/hppa/xstat.c new file mode 100644 index 0000000000..e9869f5508 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/hppa/xstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/xstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/Implies b/ports/sysdeps/unix/sysv/linux/ia64/Implies new file mode 100644 index 0000000000..8d91c80097 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/Implies @@ -0,0 +1 @@ +unix/sysv/linux/wordsize-64 diff --git a/ports/sysdeps/unix/sysv/linux/ia64/Makefile b/ports/sysdeps/unix/sysv/linux/ia64/Makefile new file mode 100644 index 0000000000..d9a35a7c67 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/Makefile @@ -0,0 +1,27 @@ +ifeq ($(subdir),misc) +sysdep_headers += sys/rse.h +endif + +ifeq ($(subdir),stdlib) +sysdep_routines += __start_context +gen-as-const-headers += sigcontext-offsets.sym +endif + +ifeq ($(subdir),misc) +sysdep_headers += sys/io.h +sysdep_routines += ioperm clone2 +endif + +ifeq ($(subdir),elf) +sysdep-dl-routines += dl-static +sysdep_routines += $(sysdep-dl-routines) +sysdep-rtld-routines += $(sysdep-dl-routines) +endif + +ifeq ($(subdir),rt) +librt-routines += rt-sysdep +endif + +# This is a crude attempt to silence the compiler which complains about +# then 'current' definition in the kernel headers. +CPPFLAGS += -D_ASM_IA64_CURRENT_H diff --git a/ports/sysdeps/unix/sysv/linux/ia64/Versions b/ports/sysdeps/unix/sysv/linux/ia64/Versions new file mode 100644 index 0000000000..13d710a078 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/Versions @@ -0,0 +1,25 @@ +ld { + GLIBC_PRIVATE { + _dl_var_init; + } +} +libc { + GLIBC_2.2 { + ioperm; iopl; + inb; inw; inl; + _inb; _inw; _inl; + outb; outw; _outl; + _outb; _outw; _outl; + pciconfig_read; pciconfig_write; + + # linuxthreads + __clone2; + } + GLIBC_2.2.2 { + # w* + wordexp; + } + GLIBC_2.2.6 { + getunwind; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S new file mode 100644 index 0000000000..75e6951370 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S @@ -0,0 +1,41 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + .section .rodata.str1.8,"aMS",@progbits,1 + .align 8 +.LC0: + .string "longjmp causes uninitialized stack frame" + + .section .sdata,"aws",@progbits + .align 8 + .type longjmp_msg,@object +longjmp_msg: + data8 .LC0 + .size longjmp_msg, .-longjmp_msg + +#define __longjmp ____longjmp_chk + +#define CHECK_RSP(reg) \ + cmp.ltu p0, p8 = reg, r12; \ +(p8) br.cond.dpnt .Lok;; \ + addl r28 = @ltoffx(longjmp_msg#), r1;; \ + ld8.mov r28 = [r28], longjmp_msg#;; \ + ld8 out0 = [r28]; \ + br.call.sptk.many b0 = HIDDEN_JUMPTARGET(__fortify_fail)#;; \ +.Lok: + +#include "__longjmp.S" diff --git a/ports/sysdeps/unix/sysv/linux/ia64/__longjmp.S b/ports/sysdeps/unix/sysv/linux/ia64/__longjmp.S new file mode 100644 index 0000000000..c5244194b5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/__longjmp.S @@ -0,0 +1,170 @@ +/* Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. + + Note that __sigsetjmp() did NOT flush the register stack. Instead, + we do it here since __longjmp() is usually much less frequently + invoked than __sigsetjmp(). The only difficulty is that __sigsetjmp() + didn't (and wouldn't be able to) save ar.rnat either. This is a problem + because if we're not careful, we could end up loading random NaT bits. + There are two cases: + + (i) ar.bsp < ia64_rse_rnat_addr(jmpbuf.ar_bsp) + ar.rnat contains the desired bits---preserve ar.rnat + across loadrs and write to ar.bspstore + + (ii) ar.bsp >= ia64_rse_rnat_addr(jmpbuf.ar_bsp) + The desired ar.rnat is stored in + ia64_rse_rnat_addr(jmpbuf.ar_bsp). Load those + bits into ar.rnat after setting ar.bspstore. */ + +#include <sysdep.h> +#include <features.h> + +# define pPos p6 /* is rotate count positive? */ +# define pNeg p7 /* is rotate count negative? */ + + + /* __longjmp(__jmp_buf buf, int val) */ + +LEAF(__longjmp) +#ifdef CHECK_RSP + alloc r8=ar.pfs,2,1,1,0 +#else + alloc r8=ar.pfs,2,1,0,0 +#endif + mov r27=ar.rsc + add r2=0x98,in0 // r2 <- &jmpbuf.orig_jmp_buf_addr + ;; + ld8 r8=[r2],-16 // r8 <- orig_jmp_buf_addr + mov r10=ar.bsp + and r11=~0x3,r27 // clear ar.rsc.mode + ;; + flushrs // flush dirty regs to backing store (must be first in insn grp) + ld8 r23=[r2],8 // r23 <- jmpbuf.ar_bsp + sub r8=r8,in0 // r8 <- &orig_jmpbuf - &jmpbuf + ;; + ld8 r25=[r2] // r25 <- jmpbuf.ar_unat + extr.u r8=r8,3,6 // r8 <- (&orig_jmpbuf - &jmpbuf)/8 & 0x3f + ;; + cmp.lt pNeg,pPos=r8,r0 + mov r2=in0 + ;; +(pPos) mov r16=r8 +(pNeg) add r16=64,r8 +(pPos) sub r17=64,r8 +(pNeg) sub r17=r0,r8 + ;; + mov ar.rsc=r11 // put RSE in enforced lazy mode + shr.u r8=r25,r16 + add r3=8,in0 // r3 <- &jmpbuf.r1 + shl r9=r25,r17 + ;; + ld8.fill.nta r28=[r2],16 // r28 <- jmpbuf.sp + or r25=r8,r9 + ;; + mov r26=ar.rnat + mov ar.unat=r25 // setup ar.unat (NaT bits for r1, r4-r7, and r12) + ;; +#ifdef CHECK_RSP + CHECK_RSP (r28) +#endif + ld8.fill.nta gp=[r3],16 // r1 (gp) + dep r11=-1,r23,3,6 // r11 <- ia64_rse_rnat_addr(jmpbuf.ar_bsp) + mov sp=r28 // r12 (sp) + ;; + ld8.nta r16=[r2],16 // caller's unat + ld8.nta r17=[r3],16 // fpsr + ;; + ld8.fill.nta r4=[r2],16 // r4 + ld8.fill.nta r5=[r3],16 // r5 (gp) + cmp.geu p8,p0=r10,r11 // p8 <- (ar.bsp >= jmpbuf.ar_bsp) + ;; + ld8.fill.nta r6=[r2],16 // r6 + ld8.fill.nta r7=[r3],16 // r7 + ;; + mov ar.unat=r16 // restore caller's unat + mov ar.fpsr=r17 // restore fpsr + ;; + ld8.nta r16=[r2],16 // b0 + ld8.nta r17=[r3],16 // b1 + ;; +(p8) ld8 r26=[r11] // r26 <- *ia64_rse_rnat_addr(jmpbuf.ar_bsp) + mov ar.bspstore=r23 // restore ar.bspstore + ;; + ld8.nta r18=[r2],16 // b2 + ld8.nta r19=[r3],16 // b3 + ;; +#ifdef PTR_DEMANGLE + PTR_DEMANGLE (r16, r24) +#endif + ld8.nta r20=[r2],16 // b4 + ld8.nta r21=[r3],16 // b5 + ;; + ld8.nta r11=[r2],16 // ar.pfs + ld8.nta r22=[r3],56 // ar.lc + ;; + ld8.nta r24=[r2],32 // pr + mov b0=r16 + ;; + ldf.fill.nta f2=[r2],32 + ldf.fill.nta f3=[r3],32 + mov b1=r17 + ;; + ldf.fill.nta f4=[r2],32 + ldf.fill.nta f5=[r3],32 + mov b2=r18 + ;; + ldf.fill.nta f16=[r2],32 + ldf.fill.nta f17=[r3],32 + mov b3=r19 + ;; + ldf.fill.nta f18=[r2],32 + ldf.fill.nta f19=[r3],32 + mov b4=r20 + ;; + ldf.fill.nta f20=[r2],32 + ldf.fill.nta f21=[r3],32 + mov b5=r21 + ;; + ldf.fill.nta f22=[r2],32 + ldf.fill.nta f23=[r3],32 + mov ar.lc=r22 + ;; + ldf.fill.nta f24=[r2],32 + ldf.fill.nta f25=[r3],32 + cmp.eq p8,p9=0,in1 + ;; + ldf.fill.nta f26=[r2],32 + ldf.fill.nta f27=[r3],32 + mov ar.pfs=r11 + ;; + ldf.fill.nta f28=[r2],32 + ldf.fill.nta f29=[r3],32 + ;; + ldf.fill.nta f30=[r2] + ldf.fill.nta f31=[r3] +(p8) mov r8=1 + + mov ar.rnat=r26 // restore ar.rnat + ;; + mov ar.rsc=r27 // restore ar.rsc +(p9) mov r8=in1 + + invala // virt. -> phys. regnum mapping may change + mov pr=r24,-1 + ret +END(__longjmp) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/__start_context.S b/ports/sysdeps/unix/sysv/linux/ia64/__start_context.S new file mode 100644 index 0000000000..6c9afc1aff --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/__start_context.S @@ -0,0 +1,51 @@ +/* Copyright (C) 2001, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <features.h> + +/* When a context set up by __makecontext() is activated, control + transfers to __start_context. When we get here: + + b1 = entry point of function to call + in0 = address of UCP to resume after function returns + in1 = global pointer for __start_context + out0 .. outN = arguments for function */ + +ENTRY(__start_context) + .prologue + alloc r2 = ar.pfs, 2, 0, 8, 0 + + .save rp, r4 // terminate call chain with a NULL rp + mov r4 = r0 + ;; + + .body + br.call.sptk rp = b1 +1: + mov gp = in1 // restore gp + cmp.ne p6,p0 = in0, r0 // uc_link != 0 ? + ;; +(p6) mov out0 = in0 +(p6) br.call.sptk rp = __setcontext +.Lexit: + mov out0 = 0 + br.call.sptk rp = HIDDEN_JUMPTARGET(exit) + +1: br.cond.sptk .Lexit +END(__start_context) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/endian.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/endian.h new file mode 100644 index 0000000000..98a5e23991 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/endian.h @@ -0,0 +1,7 @@ +/* Linux/ia64 is little-endian. */ + +#ifndef _ENDIAN_H +# error "Never use <bits/endian.h> directly; include <endian.h> instead." +#endif + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h new file mode 100644 index 0000000000..51965b7108 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h @@ -0,0 +1,319 @@ +/* O_*, F_*, FD_* bit values for Linux/IA64. + Copyright (C) 1999, 2000, 2004, 2006, 2007, 2009, 2010, 2011 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + + +#include <sys/types.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on a few file systems. */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 0100 /* not fcntl */ +#define O_EXCL 0200 /* not fcntl */ +#define O_NOCTTY 0400 /* not fcntl */ +#define O_TRUNC 01000 /* not fcntl */ +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 04010000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 + +#ifdef __USE_XOPEN2K8 +# define O_DIRECTORY 0200000 /* must be a directory */ +# define O_NOFOLLOW 0400000 /* don't follow links */ +# define O_CLOEXEC 02000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 040000 +# define O_NOATIME 01000000 /* Do not set atime. */ +# define O_PATH 010000000 /* Resolve pathname but do not open file. */ +#endif + +#ifdef __USE_LARGEFILE64 +/* Not necessary, files are always with 64bit off_t. */ +# define O_LARGEFILE 0 +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 010000 /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#define F_GETLK 5 /* Get record locking info. */ +#define F_SETLK 6 /* Set record locking info (non-blocking). */ +#define F_SETLKW 7 /* Set record locking info (blocking). */ + +/* Not necessary, we always have 64-bit offsets. */ +#define F_GETLK64 5 /* Get record locking info. */ +#define F_SETLK64 6 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 7 /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 0 /* Read lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ + +/* for old implementation of bsd flock () */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +/* We don't need to support __USE_FILE_OFFSET64. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/ipc.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/ipc.h new file mode 100644 index 0000000000..eb014d7b97 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/ipc.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IPC_H +# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." +#endif + +#include <sys/types.h> + +/* Mode bits for `msgget', `semget', and `shmget'. */ +#define IPC_CREAT 01000 /* Create key if key does not exist. */ +#define IPC_EXCL 02000 /* Fail if key exists. */ +#define IPC_NOWAIT 04000 /* Return error on wait. */ + +/* Control commands for `msgctl', `semctl', and `shmctl'. */ +#define IPC_RMID 0 /* Remove identifier. */ +#define IPC_SET 1 /* Set `ipc_perm' options. */ +#define IPC_STAT 2 /* Get `ipc_perm' options. */ +#define IPC_INFO 3 /* See ipcs. */ + +/* Special key values. */ +#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ + + +/* Data structure used to pass permission information to IPC operations. */ +struct ipc_perm + { + __key_t __key; /* Key. */ + __uid_t uid; /* Owner's user ID. */ + __gid_t gid; /* Owner's group ID. */ + __uid_t cuid; /* Creator's user ID. */ + __gid_t cgid; /* Creator's group ID. */ + __mode_t mode; /* Read/write permission. */ + unsigned short int __seq; /* Sequence number. */ + unsigned short int __pad1; + unsigned long int __unused1; + unsigned long int __unused2; + }; diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h new file mode 100644 index 0000000000..59285fef85 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h @@ -0,0 +1,113 @@ +/* Definitions for POSIX memory map interface. Linux/ia64 version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_GROWSUP 0x00200 /* Register stack-like segment */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x02000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ +# define MAP_STACK 0x20000 /* Allocation is for a stack. */ +# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 0x1 /* Sync memory asynchronously. */ +#define MS_INVALIDATE 0x2 /* Invalidate the caches. */ +#define MS_SYNC 0x4 /* Synchronous memory sync. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 0x1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 0x2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ +# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, + overrides the coredump filter bits. */ +# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h new file mode 100644 index 0000000000..2dea986270 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h @@ -0,0 +1,68 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contribute by David Mosberger-Tang <davidm@hpl.hp.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MSG_H +#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." +#endif + +#include <sys/types.h> + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ +#define MSG_EXCEPT 020000 /* recv any msg except of specified type */ + + +/* Structure of record for one message inside the kernel. + The type `struct __msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ + __time_t msg_stime; /* time of last msgsnd command */ + __time_t msg_rtime; /* time of last msgrcv command */ + __time_t msg_ctime; /* time of last change */ + unsigned long int __msg_cbytes; /* current number of bytes on queue */ + unsigned long int msg_qnum; /* number of messages currently on queue */ + unsigned long int msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +#ifdef __USE_MISC + +# define msg_cbytes __msg_cbytes + +/* ipcs ctl commands */ +# define MSG_STAT 11 +# define MSG_INFO 12 + +/* buffer for msgctl calls IPC_INFO, MSG_INFO */ +struct msginfo + { + int msgpool; + int msgmap; + int msgmax; + int msgmnb; + int msgmni; + int msgssz; + int msgtql; + unsigned short int msgseg; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/sem.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/sem.h new file mode 100644 index 0000000000..aa56e155d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/sem.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2000 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SEM_H +# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." +#endif + +#include <sys/types.h> + +/* Flags for `semop'. */ +#define SEM_UNDO 0x1000 /* undo the operation on exit */ + +/* Commands for `semctl'. */ +#define GETPID 11 /* get sempid */ +#define GETVAL 12 /* get semval */ +#define GETALL 13 /* get all semval's */ +#define GETNCNT 14 /* get semncnt */ +#define GETZCNT 15 /* get semzcnt */ +#define SETVAL 16 /* set semval */ +#define SETALL 17 /* set all semval's */ + + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ + unsigned long int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +/* The user should define a union like the following to use it for arguments + for `semctl'. + + union semun + { + int val; <= value for SETVAL + struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET + unsigned short int *array; <= array for GETALL & SETALL + struct seminfo *__buf; <= buffer for IPC_INFO + }; + + Previous versions of this file used to define this union but this is + incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether + one must define the union or not. */ +#define _SEM_SEMUN_UNDEFINED 1 + +#ifdef __USE_MISC + +/* ipcs ctl cmds */ +# define SEM_STAT 18 +# define SEM_INFO 19 + +struct seminfo +{ + int semmap; + int semmni; + int semmns; + int semmnu; + int semmsl; + int semopm; + int semume; + int semusz; + int semvmx; + int semaem; +}; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h new file mode 100644 index 0000000000..fc91bafb1d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h @@ -0,0 +1,34 @@ +/* Define the machine-dependent type `jmp_buf'. Linux/IA-64 version. + Copyright (C) 1999-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SETJMP_H +#define _BITS_SETJMP_H 1 + +#if !defined _SETJMP_H && !defined _PTHREAD_H +# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." +#endif + +/* User code must not depend on the internal representation of jmp_buf. */ + +#define _JBLEN 70 + +/* the __jmp_buf element type should be __float80 per ABI... */ +typedef long __jmp_buf[_JBLEN] __attribute__ ((__aligned__ (16))); /* guarantees 128-bit alignment! */ + +#endif /* bits/setjmp.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/shm.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/shm.h new file mode 100644 index 0000000000..a8783e23ee --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/shm.h @@ -0,0 +1,94 @@ +/* Copyright (C) 2000, 2002, 2005, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." +#endif + +#include <sys/types.h> + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ +#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ + +/* Flags for `shmat'. */ +#define SHM_RDONLY 010000 /* attach read-only else read-write */ +#define SHM_RND 020000 /* round attach address to SHMLBA */ +#define SHM_REMAP 040000 /* take-over region on attach */ +#define SHM_EXEC 0100000 /* execution access */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + +/* Segment low boundary address multiple. */ +#define SHMLBA (1024 * 1024) + +/* Type to count number of attaches. */ +typedef unsigned long int shmatt_t; + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __unused1; + unsigned long int __unused2; + }; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +# define SHM_STAT 13 +# define SHM_INFO 14 + +/* shm_mode upper byte flags */ +# define SHM_DEST 01000 /* segment will be destroyed on last detach */ +# define SHM_LOCKED 02000 /* segment will not be swapped */ +# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ +# define SHM_NORESERVE 010000 /* don't check for reservations */ + +struct shminfo + { + unsigned long int shmmax; + unsigned long int shmmin; + unsigned long int shmmni; + unsigned long int shmseg; + unsigned long int shmall; + unsigned long int __unused1; + unsigned long int __unused2; + unsigned long int __unused3; + unsigned long int __unused4; + }; + +struct shm_info + { + int used_ids; + unsigned long int shm_tot; /* total allocated shm */ + unsigned long int shm_rss; /* total resident shm */ + unsigned long int shm_swp; /* total swapped shm */ + unsigned long int swap_attempts; + unsigned long int swap_successes; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h new file mode 100644 index 0000000000..ee589f6f41 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigaction.h @@ -0,0 +1,74 @@ +/* Definitions for Linux/ia64 sigaction. + Copyright (C) 1996, 1997, 2000, 2003, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." +#endif + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ +#ifdef __USE_POSIX199309 + union + { + /* Used if SA_SIGINFO is not set. */ + __sighandler_t sa_handler; + /* Used if SA_SIGINFO is set. */ + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction +#else + __sighandler_t sa_handler; +#endif + + /* Special flags. */ + unsigned long int sa_flags; + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + }; + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDWAIT 0x00000002 /* Don't create zombie on child death. */ +#define SA_SIGINFO 0x00000004 +#if defined __USE_UNIX98 || defined __USE_MISC +# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ +#endif +#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8 +# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ +# define SA_NODEFER 0x40000000 /* Don't automatically block the signal + when its handler is being executed. */ +# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ +#endif +#ifdef __USE_MISC +# define SA_INTERRUPT 0x20000000 /* Historic no-op. */ + +/* Some aliases for the SA_ constants. */ +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND +# define SA_STACK SA_ONSTACK +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 0 /* for blocking signals */ +#define SIG_UNBLOCK 1 /* for unblocking signals */ +#define SIG_SETMASK 2 /* for setting the signal mask */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h new file mode 100644 index 0000000000..d6e7ce8fc1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h @@ -0,0 +1,79 @@ +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jes Sorensen <jes@linuxcare.com>, July 2000 + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H +# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." +#endif + +#ifndef _BITS_SIGCONTEXT_H +#define _BITS_SIGCONTEXT_H 1 + +#define __need_size_t +#include <stddef.h> +#include <bits/sigstack.h> + +struct ia64_fpreg + { + union + { + unsigned long bits[2]; + } u; + } __attribute__ ((__aligned__ (16))); + +struct sigcontext +{ + unsigned long int sc_flags; /* see manifest constants below */ + unsigned long int sc_nat; /* bit i == 1 iff scratch reg gr[i] is a NaT */ + stack_t sc_stack; /* previously active stack */ + + unsigned long int sc_ip; /* instruction pointer */ + unsigned long int sc_cfm; /* current frame marker */ + unsigned long int sc_um; /* user mask bits */ + unsigned long int sc_ar_rsc; /* register stack configuration register */ + unsigned long int sc_ar_bsp; /* backing store pointer */ + unsigned long int sc_ar_rnat; /* RSE NaT collection register */ + unsigned long int sc_ar_ccv; /* compare & exchange compare value register */ + unsigned long int sc_ar_unat; /* ar.unat of interrupted context */ + unsigned long int sc_ar_fpsr; /* floating-point status register */ + unsigned long int sc_ar_pfs; /* previous function state */ + unsigned long int sc_ar_lc; /* loop count register */ + unsigned long int sc_pr; /* predicate registers */ + unsigned long int sc_br[8]; /* branch registers */ + unsigned long int sc_gr[32]; /* general registers (static partition) */ + struct ia64_fpreg sc_fr[128]; /* floating-point registers */ + unsigned long int sc_rbs_base;/* NULL or new base of sighandler's rbs */ + unsigned long int sc_loadrs; /* see description above */ + unsigned long int sc_ar25; /* cmp8xchg16 uses this */ + unsigned long int sc_ar26; /* rsvd for scratch use */ + unsigned long int sc_rsvd[12];/* reserved for future use */ + + /* sc_mask is actually an sigset_t but we don't want to + * include the kernel headers here. */ + unsigned long int sc_mask; /* signal mask to restore after handler returns */ +}; + +/* sc_flag bit definitions. */ +#define IA64_SC_FLAG_ONSTACK_BIT 0 /* is handler running on signal stack? */ +#define IA64_SC_FLAG_IN_SYSCALL_BIT 1 /* did signal interrupt a syscall? */ +#define IA64_SC_FLAG_FPH_VALID_BIT 2 /* is state in f[32]-f[127] valid? */ + +#define IA64_SC_FLAG_ONSTACK (1 << IA64_SC_FLAG_ONSTACK_BIT) +#define IA64_SC_FLAG_IN_SYSCALL (1 << IA64_SC_FLAG_IN_SYSCALL_BIT) +#define IA64_SC_FLAG_FPH_VALID (1 << IA64_SC_FLAG_FPH_VALID_BIT) + +#endif /* _BITS_SIGCONTEXT_H */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h new file mode 100644 index 0000000000..fbb07b5bc6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h @@ -0,0 +1,348 @@ +/* siginfo_t, sigevent and constants. Linux/ia64 version. + Copyright (C) 2000-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SIGNAL_H && !defined __need_siginfo_t \ + && !defined __need_sigevent_t +# error "Never include this file directly. Use <signal.h> instead" +#endif + +#if (!defined __have_sigval_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t \ + || defined __need_sigevent_t)) +# define __have_sigval_t 1 + +/* Type for data associated with a signal. */ +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; +#endif + +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 + +# define __SI_MAX_SIZE 128 +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) + +typedef struct siginfo + { + int si_signo; /* Signal number. */ + int si_errno; /* If non-zero, an errno value associated with + this signal, as defined in <errno.h>. */ + int si_code; /* Signal code. */ + int __pad0; /* Explicit padding. */ + + union + { + int _pad[__SI_PAD_SIZE]; + + /* kill(). */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + } _kill; + + /* POSIX.1b timers. */ + struct + { + int si_tid; /* Timer ID. */ + int si_overrun; /* Overrun count. */ + sigval_t si_sigval; /* Signal value. */ + } _timer; + + /* POSIX.1b signals. */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + sigval_t si_sigval; /* Signal value. */ + } _rt; + + /* SIGCHLD. */ + struct + { + __pid_t si_pid; /* Which child. */ + __uid_t si_uid; /* Real user ID of sending process. */ + int si_status; /* Exit value or signal. */ + __clock_t si_utime; + __clock_t si_stime; + } _sigchld; + + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ + struct + { + void *si_addr; /* Faulting insn/memory ref. */ + int _si_imm; + unsigned int _si_flags; + unsigned long int _si_isr; + } _sigfault; + + /* SIGPOLL. */ + struct + { + long int si_band; /* Band event for SIGPOLL. */ + int si_fd; + } _sigpoll; + } _sifields; + } siginfo_t; + + +/* X/Open requires some more fields with fixed names. */ +# define si_pid _sifields._kill.si_pid +# define si_uid _sifields._kill.si_uid +# define si_timerid _sifields._timer.si_tid +# define si_overrun _sifields._timer.si_overrun +# define si_status _sifields._sigchld.si_status +# define si_utime _sifields._sigchld.si_utime +# define si_stime _sifields._sigchld.si_stime +# define si_value _sifields._rt.si_sigval +# define si_int _sifields._rt.si_sigval.sival_int +# define si_ptr _sifields._rt.si_sigval.sival_ptr +# define si_addr _sifields._sigfault.si_addr +# define si_band _sifields._sigpoll.si_band +# define si_fd _sifields._sigpoll.si_fd + +# ifdef __USE_GNU +# define si_imm _sifields._sigfault._si_imm +# define si_segvflags _sifields._sigfault._si_flags +# define si_isr _sifields._sigfault._si_isr +# endif + +/* Values for `si_code'. Positive values are reserved for kernel-generated + signals. */ +enum +{ + SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ +# define SI_ASYNCNL SI_ASYNCNL + SI_TKILL = -6, /* Sent by tkill. */ +# define SI_TKILL SI_TKILL + SI_SIGIO, /* Sent by queued SIGIO. */ +# define SI_SIGIO SI_SIGIO + SI_ASYNCIO, /* Sent by AIO completion. */ +# define SI_ASYNCIO SI_ASYNCIO + SI_MESGQ, /* Sent by real time mesq state change. */ +# define SI_MESGQ SI_MESGQ + SI_TIMER, /* Sent by timer expiration. */ +# define SI_TIMER SI_TIMER + SI_QUEUE, /* Sent by sigqueue. */ +# define SI_QUEUE SI_QUEUE + SI_USER, /* Sent by kill, sigsend. */ +# define SI_USER SI_USER + SI_KERNEL = 0x80 /* Send by kernel. */ +#define SI_KERNEL SI_KERNEL +}; + + +/* `si_code' values for SIGILL signal. */ +enum +{ + ILL_ILLOPC = 1, /* Illegal opcode. */ +# define ILL_ILLOPC ILL_ILLOPC + ILL_ILLOPN, /* Illegal operand. */ +# define ILL_ILLOPN ILL_ILLOPN + ILL_ILLADR, /* Illegal addressing mode. */ +# define ILL_ILLADR ILL_ILLADR + ILL_ILLTRP, /* Illegal trap. */ +# define ILL_ILLTRP ILL_ILLTRP + ILL_PRVOPC, /* Privileged opcode. */ +# define ILL_PRVOPC ILL_PRVOPC + ILL_PRVREG, /* Privileged register. */ +# define ILL_PRVREG ILL_PRVREG + ILL_COPROC, /* Coprocessor error. */ +# define ILL_COPROC ILL_COPROC + ILL_BADSTK, /* Internal stack error. */ +# define ILL_BADSTK ILL_BADSTK + ILL_BADIADDR /* Unimplemented instruction address. */ +# define ILL_BADIADDR ILL_BADIADDR + +# ifdef __USE_GNU + , ILL_BREAK +# define ILL_BREAK ILL_BREAK +# endif +}; + +/* `si_code' values for SIGFPE signal. */ +enum +{ + FPE_INTDIV = 1, /* Integer divide by zero. */ +# define FPE_INTDIV FPE_INTDIV + FPE_INTOVF, /* Integer overflow. */ +# define FPE_INTOVF FPE_INTOVF + FPE_FLTDIV, /* Floating point divide by zero. */ +# define FPE_FLTDIV FPE_FLTDIV + FPE_FLTOVF, /* Floating point overflow. */ +# define FPE_FLTOVF FPE_FLTOVF + FPE_FLTUND, /* Floating point underflow. */ +# define FPE_FLTUND FPE_FLTUND + FPE_FLTRES, /* Floating point inexact result. */ +# define FPE_FLTRES FPE_FLTRES + FPE_FLTINV, /* Floating point invalid operation. */ +# define FPE_FLTINV FPE_FLTINV + FPE_FLTSUB /* Subscript out of range. */ +# define FPE_FLTSUB FPE_FLTSUB +# ifdef __USE_GNU + , FPE_DECOVF +# define FPE_DECOVF FPE_DECOVF + , FPE_DECDIV +# define FPE_DECDIV FPE_DECDIV + , FPE_DECERR +# define FPE_DECERR FPE_DECERR + , FPE_INVASC +# define FPE_INVASC FPE_INVASC + , FPE_INVDEC +# define FPE_INVDEC FPE_INVDEC +# endif +}; + +/* `si_code' values for SIGSEGV signal. */ +enum +{ + SEGV_MAPERR = 1, /* Address not mapped to object. */ +# define SEGV_MAPERR SEGV_MAPERR + SEGV_ACCERR /* Invalid permissions for mapped object. */ +# define SEGV_ACCERR SEGV_ACCERR +# ifdef __USE_GNU + , SEGV_PSTKOVF /* Paragraph stack overflow. */ +# define SEGV_PSTKOVF SEGV_PSTKOVF +# endif +}; + +/* `si_code' values for SIGBUS signal. */ +enum +{ + BUS_ADRALN = 1, /* Invalid address alignment. */ +# define BUS_ADRALN BUS_ADRALN + BUS_ADRERR, /* Non-existant physical address. */ +# define BUS_ADRERR BUS_ADRERR + BUS_OBJERR /* Object specific hardware error. */ +# define BUS_OBJERR BUS_OBJERR +}; + +/* `si_code' values for SIGTRAP signal. */ +enum +{ + TRAP_BRKPT = 1, /* Process breakpoint. */ +# define TRAP_BRKPT TRAP_BRKPT + TRAP_TRACE /* Process trace trap. */ +# define TRAP_TRACE TRAP_TRACE + +# ifdef __USE_GNU + , TRAP_BRANCH +# define TRAP_BRANCH TRAP_BRANCH + , TRAP_HWBKPT +# define TRAP_HWBKPT TRAP_HWBKPT +# endif +}; + +/* `si_code' values for SIGCHLD signal. */ +enum +{ + CLD_EXITED = 1, /* Child has exited. */ +# define CLD_EXITED CLD_EXITED + CLD_KILLED, /* Child was killed. */ +# define CLD_KILLED CLD_KILLED + CLD_DUMPED, /* Child terminated abnormally. */ +# define CLD_DUMPED CLD_DUMPED + CLD_TRAPPED, /* Traced child has trapped. */ +# define CLD_TRAPPED CLD_TRAPPED + CLD_STOPPED, /* Child has stopped. */ +# define CLD_STOPPED CLD_STOPPED + CLD_CONTINUED /* Stopped child has continued. */ +# define CLD_CONTINUED CLD_CONTINUED +}; + +/* `si_code' values for SIGPOLL signal. */ +enum +{ + POLL_IN = 1, /* Data input available. */ +# define POLL_IN POLL_IN + POLL_OUT, /* Output buffers available. */ +# define POLL_OUT POLL_OUT + POLL_MSG, /* Input message available. */ +# define POLL_MSG POLL_MSG + POLL_ERR, /* I/O error. */ +# define POLL_ERR POLL_ERR + POLL_PRI, /* High priority input available. */ +# define POLL_PRI POLL_PRI + POLL_HUP /* Device disconnected. */ +# define POLL_HUP POLL_HUP +}; + +# undef __need_siginfo_t +#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ + + +#if (defined _SIGNAL_H || defined __need_sigevent_t) \ + && !defined __have_sigevent_t +# define __have_sigevent_t 1 + +/* Structure to transport application-defined values with signals. */ +# define __SIGEV_MAX_SIZE 64 +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) + +/* Forward declaration. */ +# ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +# endif + +typedef struct sigevent + { + sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + + union + { + int _pad[__SIGEV_PAD_SIZE]; + + /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the + thread to receive the signal. */ + __pid_t _tid; + + struct + { + void (*_function) (sigval_t); /* Function to start. */ + pthread_attr_t *_attribute; /* Thread attributes. */ + } _sigev_thread; + } _sigev_un; + } sigevent_t; + +/* POSIX names to access some of the members. */ +# define sigev_notify_function _sigev_un._sigev_thread._function +# define sigev_notify_attributes _sigev_un._sigev_thread._attribute + +/* `sigev_notify' values. */ +enum +{ + SIGEV_SIGNAL = 0, /* Notify via signal. */ +# define SIGEV_SIGNAL SIGEV_SIGNAL + SIGEV_NONE, /* Other notification: meaningless. */ +# define SIGEV_NONE SIGEV_NONE + SIGEV_THREAD, /* Deliver via thread creation. */ +# define SIGEV_THREAD SIGEV_THREAD + + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ +#define SIGEV_THREAD_ID SIGEV_THREAD_ID +}; + +#endif /* have _SIGNAL_H. */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h new file mode 100644 index 0000000000..f9662e452b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h @@ -0,0 +1,62 @@ +/* sigstack, sigaltstack definitions. + Copyright (C) 1998, 2000, 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include this file directly. Use <signal.h> instead" +#endif + +#ifndef _SIGSTACK_H +#define _SIGSTACK_H 1 + +/* Structure describing a signal stack (obsolete). */ +struct sigstack + { + __ptr_t ss_sp; /* Signal stack pointer. */ + int ss_onstack; /* Nonzero if executing on this stack. */ + }; + + +/* Possible values for `ss_flags.'. */ +enum +{ + SS_ONSTACK = 1, +#define SS_ONSTACK SS_ONSTACK + SS_DISABLE +#define SS_DISABLE SS_DISABLE +}; + +/* Minimum stack size for a signal handler. + + Yes, this should be 131072 but the constant got defined incorrectly + in the kernel and we have to live with it. Users should in any case + use SIGSTKSZ as the size user-supplied buffers should have. */ +#define MINSIGSTKSZ 131027 + +/* System default stack size. */ +#define SIGSTKSZ 262144 + + +/* Alternate, preferred interface. */ +typedef struct sigaltstack + { + __ptr_t ss_sp; + int ss_flags; + size_t ss_size; + } stack_t; + +#endif /* bits/sigstack.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/stat.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/stat.h new file mode 100644 index 0000000000..63c202be07 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/stat.h @@ -0,0 +1,149 @@ +/* Copyright (C) 1999-2002, 2009, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 1 +#define _STAT_VER _STAT_VER_LINUX + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + +struct stat + { + __dev_t st_dev; /* Device. */ + __ino_t st_ino; /* File serial number. */ + __nlink_t st_nlink; /* Link count. */ + __mode_t st_mode; /* File mode. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + int pad0; + __dev_t st_rdev; /* Device number, if device. */ + __off_t st_size; /* Size of file, in bytes. */ +#ifdef __USE_MISC + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + __blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */ + long int __unused[3]; + }; + +#ifdef __USE_LARGEFILE64 +/* Note stat64 is the same shape as stat. */ +struct stat64 + { + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __nlink_t st_nlink; /* Link count. */ + __mode_t st_mode; /* File mode. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + int pad0; + __dev_t st_rdev; /* Device number, if device. */ + __off_t st_size; /* Size of file, in bytes. */ +#ifdef __USE_MISC + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ + long int __unused[3]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits//stat.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/brk.S b/ports/sysdeps/unix/sysv/linux/ia64/brk.S new file mode 100644 index 0000000000..0e011ff5a3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/brk.S @@ -0,0 +1,51 @@ +/* brk system call for Linux/ia64 + Copyright (C) 1999,2000,2001,2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Stephane Eranian <eranian@hpl.hp.com> and + Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include <asm/unistd.h> +#include <asm/errno.h> + + .global __curbrk + .type __curbrk,@object + .size __curbrk,8 + .data + .align 8 +__curbrk: + data8 0 + +weak_alias (__curbrk, ___brk_addr) + +LEAF(__brk) + .regstk 1, 0, 0, 0 + DO_CALL(__NR_brk) + cmp.ltu p6, p0 = ret0, in0 + addl r9 = @ltoff(__curbrk), gp + ;; + ld8 r9 = [r9] +(p6) mov ret0 = ENOMEM +(p6) br.cond.spnt.few __syscall_error + ;; + st8 [r9] = ret0 + mov ret0 = 0 + ret +END(__brk) + +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bsd-_setjmp.S b/ports/sysdeps/unix/sysv/linux/ia64/bsd-_setjmp.S new file mode 100644 index 0000000000..4e6a2da560 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bsd-_setjmp.S @@ -0,0 +1 @@ +/* _setjmp is in setjmp.S */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bsd-setjmp.S b/ports/sysdeps/unix/sysv/linux/ia64/bsd-setjmp.S new file mode 100644 index 0000000000..1da848d2f1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/bsd-setjmp.S @@ -0,0 +1 @@ +/* setjmp is in setjmp.S */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c b/ports/sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c new file mode 100644 index 0000000000..1289d1f740 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c @@ -0,0 +1,31 @@ +/* clock_getcpuclockid -- Get a clockid_t for process CPU time. Linux/IA64 + Copyright (C) 2000,2001,2003,2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <time.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <fcntl.h> + + +#include "has_cpuclock.c" + +#define HAS_CPUCLOCK (has_cpuclock () > 0) + +#include <sysdeps/unix/sysv/linux/clock_getcpuclockid.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/clone.S b/ports/sysdeps/unix/sysv/linux/ia64/clone.S new file mode 100644 index 0000000000..0cfaeab64e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/clone.S @@ -0,0 +1 @@ +/* clone is not supported under Linux/ia64, use clone2. */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/clone2.S b/ports/sysdeps/unix/sysv/linux/ia64/clone2.S new file mode 100644 index 0000000000..d97c927e92 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/clone2.S @@ -0,0 +1,105 @@ +/* Copyright (C) 2000, 2001, 2003, 2004, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +#include <sysdep.h> +#include <asm/errno.h> + + +/* int __clone2(int (*fn) (void *arg), void *child_stack_base, */ +/* size_t child_stack_size, int flags, void *arg, */ +/* pid_t *parent_tid, void *tls, pid_t *child_tid) */ + +#define CHILD p8 +#define PARENT p9 + +ENTRY(__clone2) + .prologue + alloc r2=ar.pfs,8,1,6,0 + cmp.eq p6,p0=0,in0 + cmp.eq p7,p0=0,in1 + mov r8=EINVAL + mov out0=in3 /* Flags are first syscall argument. */ + mov out1=in1 /* Stack address. */ +(p6) br.cond.spnt.many __syscall_error /* no NULL function pointers */ +(p7) br.cond.spnt.many __syscall_error /* no NULL stack pointers */ + ;; + mov out2=in2 /* Stack size. */ + mov out3=in5 /* Parent TID Pointer */ + mov out4=in7 /* Child TID Pointer */ + mov out5=in6 /* TLS pointer */ + /* + * clone2() is special: the child cannot execute br.ret right + * after the system call returns, because it starts out + * executing on an empty stack. Because of this, we can't use + * the new (lightweight) syscall convention here. Instead, we + * just fall back on always using "break". + * + * Furthermore, since the child starts with an empty stack, we + * need to avoid unwinding past invalid memory. To that end, + * we'll pretend now that __clone2() is the end of the + * call-chain. This is wrong for the parent, but only until + * it returns from clone2() but it's better than the + * alternative. + */ + mov r15=SYS_ify (clone2) + .save rp, r0 + break __BREAK_SYSCALL + .body + cmp.eq p6,p0=-1,r10 + cmp.eq CHILD,PARENT=0,r8 /* Are we the child? */ +(p6) br.cond.spnt.many __syscall_error + ;; +(CHILD) mov loc0=gp +(PARENT) ret + ;; +#ifdef RESET_PID + tbit.nz p6,p0=in3,16 /* CLONE_THREAD */ + tbit.z p7,p10=in3,8 /* CLONE_VM */ +(p6) br.cond.dptk 1f + ;; + mov r15=SYS_ify (getpid) +(p10) addl r8=-1,r0 +(p7) break __BREAK_SYSCALL + ;; + add r9=PID,r13 + add r10=TID,r13 + ;; + st4 [r9]=r8 + st4 [r10]=r8 + ;; +#endif +1: ld8 out1=[in0],8 /* Retrieve code pointer. */ + mov out0=in4 /* Pass proper argument to fn */ + ;; + ld8 gp=[in0] /* Load function gp. */ + mov b6=out1 + br.call.dptk.many rp=b6 /* Call fn(arg) in the child */ + ;; + mov out0=r8 /* Argument to _exit */ + mov gp=loc0 + .globl HIDDEN_JUMPTARGET(_exit) + br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit) + /* call _exit with result from fn. */ + ret /* Not reached. */ +PSEUDO_END(__clone2) + +/* For now we leave __clone undefined. This is unlikely to be a */ +/* problem, since at least the i386 __clone in glibc always failed */ +/* with a 0 sp (eventhough the kernel explicitly handled it). */ +/* Thus all such calls needed to pass an explicit sp, and as a result, */ +/* would be unlikely to work on ia64. */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/configure b/ports/sysdeps/unix/sysv/linux/ia64/configure new file mode 100644 index 0000000000..3d025f9dda --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/configure @@ -0,0 +1,10 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/ia64 + +# There are several bits that no longer compile cleanly without +# realtime signal support (ver 2.2.0). Given that we also now +# require TLS (ver 2.6.0), it seems pointless to fix them. +# ??? Surely this should now be the generic default. +arch_minimum_kernel=2.6.0 + +ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/ports/sysdeps/unix/sysv/linux/ia64/configure.in b/ports/sysdeps/unix/sysv/linux/ia64/configure.in new file mode 100644 index 0000000000..99057b8bd1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/configure.in @@ -0,0 +1,10 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/ia64 + +# There are several bits that no longer compile cleanly without +# realtime signal support (ver 2.2.0). Given that we also now +# require TLS (ver 2.6.0), it seems pointless to fix them. +# ??? Surely this should now be the generic default. +arch_minimum_kernel=2.6.0 + +ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/ports/sysdeps/unix/sysv/linux/ia64/dl-brk.S b/ports/sysdeps/unix/sysv/linux/ia64/dl-brk.S new file mode 100644 index 0000000000..eeb96544e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/dl-brk.S @@ -0,0 +1 @@ +#include <brk.S> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/dl-cache.h b/ports/sysdeps/unix/sysv/linux/ia64/dl-cache.h new file mode 100644 index 0000000000..9d1bd6ac77 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/dl-cache.h @@ -0,0 +1,24 @@ +/* Support for reading /etc/ld.so.cache files written by Linux ldconfig. + Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#define _DL_CACHE_DEFAULT_ID 0x203 + +#define _dl_cache_check_flags(flags) \ + ((flags) == _DL_CACHE_DEFAULT_ID) + +#include_next <dl-cache.h> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c b/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c new file mode 100644 index 0000000000..f7fa57eedf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c @@ -0,0 +1,68 @@ +/* Variable initialization. IA-64 version. + Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <ldsodefs.h> + +#ifdef SHARED + +void +_dl_var_init (void *array[]) +{ + /* It has to match "variables" below. */ + enum + { + DL_PAGESIZE = 0, + DL_CLKTCK + }; + + GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]); + GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]); +} + +#else +#include <bits/libc-lock.h> + +__libc_lock_define_initialized_recursive (static, _dl_static_lock) + +static void *variables[] = +{ + &GLRO(dl_pagesize), + &GLRO(dl_clktck) +}; + +void +_dl_static_init (struct link_map *map) +{ + const ElfW(Sym) *ref = NULL; + lookup_t loadbase; + void (*f) (void *[]); + + __libc_lock_lock_recursive (_dl_static_lock); + + loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref, + map->l_local_scope, NULL, 0, 1, NULL); + if (ref != NULL) + { + f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref); + f (variables); + } + + __libc_lock_unlock_recursive (_dl_static_lock); +} + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/ia64/fork.S b/ports/sysdeps/unix/sysv/linux/ia64/fork.S new file mode 100644 index 0000000000..7949a7b619 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/fork.S @@ -0,0 +1,40 @@ +/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +#include <sysdep.h> +#define _SIGNAL_H +#include <bits/signum.h> + +/* pid_t fork(void); */ +/* Implemented as a clone system call with parameters SIGCHLD and 0 */ + +ENTRY(__libc_fork) + alloc r2=ar.pfs,0,0,2,0 + mov out0=SIGCHLD /* Return SIGCHLD when child finishes */ + /* no other clone flags; nothing shared */ + mov out1=0 /* Standard sp value. */ + ;; + DO_CALL (SYS_ify (clone)) + cmp.eq p6,p0=-1,r10 +(p6) br.cond.spnt.few __syscall_error + ret +PSEUDO_END(__libc_fork) + +weak_alias (__libc_fork, __fork) +libc_hidden_def (__fork) +weak_alias (__libc_fork, fork) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c b/ports/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c new file mode 100644 index 0000000000..4c1777a516 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c @@ -0,0 +1,88 @@ +/* Get frequency of the system processor. IA-64/Linux version. + Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <ctype.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include <libc-internal.h> + + +hp_timing_t +__get_clockfreq (void) +{ + /* We read the information from the /proc filesystem. It contains at + least one line like + itc MHz : 733.390988 + We search for this line and convert the number in an integer. */ + static hp_timing_t result; + int fd; + + /* If this function was called before, we know the result. */ + if (result != 0) + return result; + + fd = open ("/proc/cpuinfo", O_RDONLY); + if (__builtin_expect (fd != -1, 1)) + { + /* XXX AFAIK the /proc filesystem can generate "files" only up + to a size of 4096 bytes. */ + char buf[4096]; + ssize_t n; + + n = read (fd, buf, sizeof buf); + if (__builtin_expect (n, 1) > 0) + { + char *mhz = memmem (buf, n, "itc MHz", 7); + + if (__builtin_expect (mhz != NULL, 1)) + { + char *endp = buf + n; + int seen_decpoint = 0; + int ndigits = 0; + + /* Search for the beginning of the string. */ + while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n') + ++mhz; + + while (mhz < endp && *mhz != '\n') + { + if (*mhz >= '0' && *mhz <= '9') + { + result *= 10; + result += *mhz - '0'; + if (seen_decpoint) + ++ndigits; + } + else if (*mhz == '.') + seen_decpoint = 1; + + ++mhz; + } + + /* Compensate for missing digits at the end. */ + while (ndigits++ < 6) + result *= 10; + } + } + + close (fd); + } + + return result; +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/getclktck.c b/ports/sysdeps/unix/sysv/linux/ia64/getclktck.c new file mode 100644 index 0000000000..6636bbe689 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/getclktck.c @@ -0,0 +1,2 @@ +#define SYSTEM_CLK_TCK 1024 +#include <sysdeps/unix/sysv/linux/getclktck.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/getcontext.S b/ports/sysdeps/unix/sysv/linux/ia64/getcontext.S new file mode 100644 index 0000000000..a4a403fc6d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/getcontext.S @@ -0,0 +1,157 @@ +/* Copyright (C) 2001, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <features.h> + +#include "ucontext_i.h" + +/* __getcontext (ucontext_t *ucp) + + Saves the machine context in UCP such that when it is activated, + it appears as if __getcontext() returned again. The only difference + is that on a first return, r9 contains 1 and on a subsequent + return, it contains 0. + + This implementation in intended to be used for *synchronous* context + switches only. Therefore, it does not have to save anything + other than the PRESERVED state. */ + +ENTRY(__getcontext) + .prologue + .body + alloc r11 = ar.pfs, 1, 0, 4, 0 + + // sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask): + + mov r3 = SC_MASK + mov out0 = SIG_BLOCK + + flushrs // save dirty partition on rbs + mov out1 = 0 + add out2 = r3, in0 + + mov out3 = 8 // sizeof kernel sigset_t + DO_CALL(__NR_rt_sigprocmask) + + mov.m rFPSR = ar.fpsr + mov.m rRSC = ar.rsc + add r2 = SC_GR+1*8, r32 + ;; + mov.m rBSP = ar.bsp + .prologue + .save ar.unat, rUNAT + mov.m rUNAT = ar.unat + .body + add r3 = SC_GR+4*8, r32 + ;; + +.mem.offset 0,0; st8.spill [r2] = r1, (5*8 - 1*8) +.mem.offset 8,0; st8.spill [r3] = r4, 16 + mov rPFS = r11 + ;; +.mem.offset 0,0; st8.spill [r2] = r5, 16 +.mem.offset 8,0; st8.spill [r3] = r6, 48 + and rTMP = ~0x3, rRSC + ;; +.mem.offset 0,0; st8.spill [r2] = r7, (SC_FR+2*16-(SC_GR+7*8)) +.mem.offset 8,0; st8.spill [r3] = sp, (SC_FR+3*16-(SC_GR+12*8)) + ;; + mov.m ar.rsc = rTMP // put RSE into enforced lazy mode + mov.m rNAT = ar.unat + mov.i rLC = ar.lc + ;; + mov.m rRNAT = ar.rnat + mov.m ar.rsc = rRSC // restore RSE mode + mov rPR = pr + + /* + * Rotate NaT bits by rPOS positions to the right: + */ + stf.spill [r2] = f2, 32 + stf.spill [r3] = f3, 32 + add rPOS = SC_GR, r32 // rPOS <- &sc_gr[0] + ;; + stf.spill [r2] = f4, (16*16-4*16) + stf.spill [r3] = f5, (17*16-5*16) + extr.u rPOS = rPOS, 3, 6 // get NaT bit number for r0 + ;; + stf.spill [r2] = f16, 32 + stf.spill [r3] = f17, 32 + sub rCPOS = 64, rPOS + ;; + stf.spill [r2] = f18, 32 + stf.spill [r3] = f19, 32 + shr.u rTMP = rNAT, rPOS + ;; + stf.spill [r2] = f20, 32 + stf.spill [r3] = f21, 32 + shl rNAT = rNAT, rCPOS + ;; + stf.spill [r2] = f22, 32 + stf.spill [r3] = f23, 32 + or rNAT = rNAT, rTMP + ;; + stf.spill [r2] = f24, 32 + stf.spill [r3] = f25, 32 + mov r8 = 0 + ;; + stf.spill [r2] = f26, 32 + stf.spill [r3] = f27, 32 + mov r9 = 1 + ;; + stf.spill [r2] = f28, 32 + stf.spill [r3] = f29, 32 + mov rB0 = b0 + ;; + stf.spill [r2] = f30, 32 + stf.spill [r3] = f31, 32 + mov rB1 = b1 + ;; + mov ar.unat = rUNAT // we're done spilling integer regs; restore caller's UNaT + add r2 = SC_NAT, r32 + add r3 = SC_BSP, r32 + ;; + st8 [r2] = rNAT, (SC_RNAT-SC_NAT) + st8 [r3] = rBSP, (SC_UNAT-SC_BSP) + mov rB2 = b2 + ;; + st8 [r2] = rRNAT, (SC_FPSR-SC_RNAT) + st8 [r3] = rUNAT, (SC_PFS-SC_UNAT) + mov rB3 = b3 + ;; + st8 [r2] = rFPSR, (SC_LC-SC_FPSR) + st8 [r3] = rPFS, (SC_PR-SC_PFS) + mov rB4 = b4 + ;; + st8 [r2] = rLC, (SC_BR+0*8-SC_LC) + st8 [r3] = rPR, (SC_BR+1*8-SC_PR) + mov rB5 = b5 + ;; + st8 [r2] = rB0, 16 + st8 [r3] = rB1, 16 + ;; + st8 [r2] = rB2, 16 + st8 [r3] = rB3, 16 + ;; + st8 [r2] = rB4 + st8 [r3] = rB5 + ret +END(__getcontext) + +weak_alias (__getcontext, getcontext) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/getpagesize.c b/ports/sysdeps/unix/sysv/linux/ia64/getpagesize.c new file mode 100644 index 0000000000..ade9123a3a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/getpagesize.c @@ -0,0 +1,38 @@ +/* Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <unistd.h> +#include <sys/param.h> + +#include <ldsodefs.h> +#include <sysdep.h> +#include <sys/syscall.h> + +/* Return the system page size. The return value will depend on how + the kernel is configured. A program must use this call to + determine the page size to ensure proper alignment for calls such + as mmap and friends. --davidm 99/11/30 */ + +int +__getpagesize () +{ + assert (GLRO(dl_pagesize) != 0); + return GLRO(dl_pagesize); +} +libc_hidden_def (__getpagesize) +weak_alias (__getpagesize, getpagesize) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c b/ports/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c new file mode 100644 index 0000000000..7889cdbe13 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/has_cpuclock.c @@ -0,0 +1,51 @@ +/* Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <not-cancel.h> + +static int itc_usable; + +static int +has_cpuclock (void) +{ + if (__builtin_expect (itc_usable == 0, 0)) + { + int newval = 1; + int fd = open_not_cancel_2 ("/proc/sal/itc_drift", O_RDONLY); + if (__builtin_expect (fd != -1, 1)) + { + char buf[16]; + /* We expect the file to contain a single digit followed by + a newline. If the format changes we better not rely on + the file content. */ + if (read_not_cancel (fd, buf, sizeof buf) != 2 + || buf[0] != '0' || buf[1] != '\n') + newval = -1; + + close_not_cancel_no_status (fd); + } + + itc_usable = newval; + } + + return itc_usable; +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/ioperm.c b/ports/sysdeps/unix/sysv/linux/ia64/ioperm.c new file mode 100644 index 0000000000..9753d56944 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/ioperm.c @@ -0,0 +1,216 @@ +/* Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* I/O access is restricted to ISA port space (ports 0..65535). + Modern devices hopefully are sane enough not to put any performance + critical registers in i/o space. + + On the first call to ioperm() or iopl(), the entire (E)ISA port + space is mapped into the virtual address space at address io.base. + mprotect() calls are then used to enable/disable access to ports. + Per 4KB page, there are 4 I/O ports. */ + +#include <errno.h> +#include <fcntl.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <sys/types.h> +#include <sys/mman.h> + +#define MAX_PORT 0x10000 + +/* + * Memory fence w/accept. This should never be used in code that is + * not IA-64 specific. + */ +#define __ia64_mf_a() __asm__ __volatile__ ("mf.a" ::: "memory") + +static struct + { + unsigned long int base; + unsigned long int page_mask; + } +io; + +__inline__ unsigned long int +io_offset (unsigned long int port) +{ + return ((port >> 2) << 12) | (port & 0xfff); +} + +int +_ioperm (unsigned long int from, unsigned long int num, int turn_on) +{ +#if 0 + unsigned long int addr, len, base; +#endif + unsigned long int base; + int prot; + + /* this test isn't as silly as it may look like; consider overflows! */ + if (from >= MAX_PORT || from + num > MAX_PORT) + { + __set_errno (EINVAL); + return -1; + } + + if (turn_on) + { + if (!io.base) + { + unsigned long phys_io_base, len; + int fd; + + io.page_mask = ~(__getpagesize() - 1); + + /* get I/O base physical address from ar.k0 as per PRM: */ + __asm__ ("mov %0=ar.k0" : "=r"(phys_io_base)); + + /* The O_SYNC flag tells the /dev/mem driver to map the + memory uncached: */ + fd = __open ("/dev/mem", O_RDWR | O_SYNC); + if (fd < 0) + return -1; + + len = io_offset (MAX_PORT); +#if 1 + /* see comment below */ + base = (unsigned long int) __mmap (0, len, PROT_READ | PROT_WRITE, MAP_SHARED, + fd, phys_io_base); +#else + base = (unsigned long int) __mmap (0, len, PROT_NONE, MAP_SHARED, + fd, phys_io_base); +#endif + __close (fd); + + if ((long) base == -1) + return -1; + + io.base = base; + } + prot = PROT_READ | PROT_WRITE; + } + else + { + if (!io.base) + return 0; /* never was turned on... */ + + prot = PROT_NONE; + } +#if 0 + /* We can't do mprotect because that would cause us to lose the + uncached flag that the /dev/mem driver turned on. A MAP_UNCACHED + flag seems so much cleaner... */ + addr = (io.base + io_offset (from)) & io.page_mask; + len = io.base + io_offset (from + num) - addr; + return mprotect ((void *) addr, len, prot); +#else + return 0; +#endif +} + +int +_iopl (unsigned int level) +{ + if (level > 3) + { + __set_errno (EINVAL); + return -1; + } + if (level) + { + int retval = _ioperm (0, MAX_PORT, 1); + /* Match the documented error returns of the x86 version. */ + if (retval < 0 && errno == EACCES) + __set_errno (EPERM); + return retval; + } + return 0; +} + +unsigned int +_inb (unsigned long int port) +{ + volatile unsigned char *addr = (void *) io.base + io_offset (port); + unsigned char ret; + + ret = *addr; + __ia64_mf_a(); + return ret; +} + +unsigned int +_inw (unsigned long int port) +{ + volatile unsigned short *addr = (void *) io.base + io_offset (port); + unsigned short ret; + + ret = *addr; + __ia64_mf_a(); + return ret; +} + +unsigned int +_inl (unsigned long int port) +{ + volatile unsigned int *addr = (void *) io.base + io_offset (port); + unsigned int ret; + + ret = *addr; + __ia64_mf_a(); + return ret; +} + +void +_outb (unsigned char val, unsigned long int port) +{ + volatile unsigned char *addr = (void *) io.base + io_offset (port); + + *addr = val; + __ia64_mf_a(); +} + +void +_outw (unsigned short val, unsigned long int port) +{ + volatile unsigned short *addr = (void *) io.base + io_offset (port); + + *addr = val; + __ia64_mf_a(); +} + +void +_outl (unsigned int val, unsigned long int port) +{ + volatile unsigned int *addr = (void *) io.base + io_offset (port); + + *addr = val; + __ia64_mf_a(); +} + +weak_alias (_ioperm, ioperm); +weak_alias (_iopl, iopl); +weak_alias (_inb, inb); +weak_alias (_inw, inw); +weak_alias (_inl, inl); +weak_alias (_outb, outb); +weak_alias (_outw, outw); +weak_alias (_outl, outl); diff --git a/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h new file mode 100644 index 0000000000..f8dc4812cf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -0,0 +1,63 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2010-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + +/* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize + their availability with one define. */ +#if __LINUX_KERNEL_VERSION >= 132416 +# define __ASSUME_CLONE_THREAD_FLAGS 1 +#endif + +/* The utimes syscall has been available for some architectures + forever. */ +#define __ASSUME_UTIMES 1 + +/* pselect/ppoll were introduced just after 2.6.16-rc1. Due to the way + the kernel versions are advertised we can only rely on 2.6.17 to have + the code. */ +#if __LINUX_KERNEL_VERSION >= 0x020616 +# define __ASSUME_PSELECT 1 +# define __ASSUME_PPOLL 1 +#endif + +/* Support for various CLOEXEC and NONBLOCK flags was added in 2.6.23. */ +#if __LINUX_KERNEL_VERSION >= 0x020617 +# define __ASSUME_O_CLOEXEC 1 +#endif + +/* Support for various CLOEXEC and NONBLOCK flags was added in 2.6.27. */ +#if __LINUX_KERNEL_VERSION >= 0x02061b +# define __ASSUME_SOCK_CLOEXEC 1 +# define __ASSUME_IN_NONBLOCK 1 +# define __ASSUME_PIPE2 1 +# define __ASSUME_EVENTFD2 1 +# define __ASSUME_SIGNALFD4 1 +# define __ASSUME_DUP3 1 +#endif + +/* Support for the accept4 syscall was added in 3.3. */ +#if __LINUX_KERNEL_VERSION >= 0x030300 +# define __ASSUME_ACCEPT4 1 +#endif + +#include_next <kernel-features.h> + +#endif /* _KERNEL_FEATURES_H */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/kernel_stat.h b/ports/sysdeps/unix/sysv/linux/ia64/kernel_stat.h new file mode 100644 index 0000000000..2f979f2d63 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/kernel_stat.h @@ -0,0 +1,20 @@ +/* Definition of `struct stat' used in the kernel. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#define STAT_IS_KERNEL_STAT 1 +#define XSTAT_IS_XSTAT64 1 diff --git a/ports/sysdeps/unix/sysv/linux/ia64/ldconfig.h b/ports/sysdeps/unix/sysv/linux/ia64/ldconfig.h new file mode 100644 index 0000000000..dce65b4ffc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/ldconfig.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/generic/ldconfig.h> + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/ports/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed b/ports/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed new file mode 100644 index 0000000000..535d1671e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed @@ -0,0 +1 @@ +s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 \2\3"_ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/ldsodefs.h b/ports/sysdeps/unix/sysv/linux/ia64/ldsodefs.h new file mode 100644 index 0000000000..729aa54813 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/ldsodefs.h @@ -0,0 +1,32 @@ +/* Run-time dynamic linker data structures for loaded ELF shared objects. IA64. + Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LDSODEFS_H + +/* Get the real definitions. */ +#include_next <ldsodefs.h> + +/* Now define our stuff. */ + +/* We need special support to initialize DSO loaded for statically linked + binaries. */ +extern void _dl_static_init (struct link_map *map); +#undef DL_STATIC_INIT +#define DL_STATIC_INIT(map) _dl_static_init (map) + +#endif /* ldsodefs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c b/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c new file mode 100644 index 0000000000..af29bc3d65 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c @@ -0,0 +1,92 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <libintl.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <ucontext.h> +#include <sys/rse.h> + + +struct fdesc + { + unsigned long ip; + unsigned long gp; + }; + +#define PUSH(val) \ +do { \ + if (ia64_rse_is_rnat_slot (rbs)) \ + *rbs++ = 0; \ + *rbs++ = (val); \ +} while (0) + + +/* This implementation can handle an ARGC value of at most 8 and + values can be passed only in integer registers (r32-r39). */ + +void +__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) +{ + struct sigcontext *sc = &ucp->uc_mcontext; + extern void __start_context (ucontext_t *link, long gp, ...); + unsigned long stack_start, stack_end; + va_list ap; + long *rbs; + int i; + + stack_start = (long) sc->sc_stack.ss_sp; + stack_end = (long) sc->sc_stack.ss_sp + sc->sc_stack.ss_size; + + stack_start = (stack_start + 7) & -8; + stack_end = stack_end & -16; + + if (argc > 8) + { + fprintf (stderr, _("\ +makecontext: does not know how to handle more than 8 arguments\n")); + exit (-1); + } + + /* set the entry point and global pointer: */ + sc->sc_br[0] = ((struct fdesc *) &__start_context)->ip; + sc->sc_br[1] = ((struct fdesc *) func)->ip; + sc->sc_gr[1] = ((struct fdesc *) func)->gp; + + /* set up the call frame: */ + sc->sc_ar_pfs = ((sc->sc_ar_pfs & ~0x3fffffffffUL) + | (argc + 2) | ((argc + 2) << 7)); + rbs = (long *) stack_start; + PUSH((long) ucp->uc_link); + PUSH(((struct fdesc *) &__start_context)->gp); + va_start (ap, argc); + for (i = 0; i < argc; ++i) + PUSH(va_arg (ap, long)); + va_end (ap); + + /* set the memory and register stack pointers: */ + sc->sc_ar_bsp = (long) rbs; + sc->sc_gr[12] = stack_end - 16; + + /* clear the NaT bits for r1 and r12: */ + sc->sc_nat &= ~((1 << 1) | (1 << 12)); + sc->sc_ar_rnat = 0; +} + +weak_alias (__makecontext, makecontext) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/Makefile b/ports/sysdeps/unix/sysv/linux/ia64/nptl/Makefile new file mode 100644 index 0000000000..ff98f1a494 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),nptl) +libpthread-sysdep_routines += __ia64_longjmp unwind_longjmp __sigstack_longjmp +endif diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/Versions b/ports/sysdeps/unix/sysv/linux/ia64/nptl/Versions new file mode 100644 index 0000000000..437c4da28b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/Versions @@ -0,0 +1,13 @@ +libpthread { + GLIBC_2.3.3 { + # Changed PTHREAD_STACK_MIN. + pthread_attr_setstack; pthread_attr_setstacksize; + } +} +librt { + GLIBC_2.3.3 { + # Changed timer_t. + timer_create; timer_delete; timer_getoverrun; timer_gettime; + timer_settime; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/__ia64_longjmp.S b/ports/sysdeps/unix/sysv/linux/ia64/nptl/__ia64_longjmp.S new file mode 100644 index 0000000000..7f3648d98b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/__ia64_longjmp.S @@ -0,0 +1,158 @@ +/* Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <features.h> + +LEAF(__ia64_flush_rbs) + flushrs + mov r9 = ar.rsc // 12 cyc latency + ;; + mov r8 = ar.bsp // 12 cyc latency + ;; + and r16 = ~0x3, r9 // clear ar.rsc.mode + ;; + mov ar.rsc = r16 // put RSE into enforced-lazy mode + ;; + mov r10 = ar.rnat // 5 cyc latency + ret +END(__ia64_flush_rbs) + + +# define pPos p6 /* is rotate count positive? */ +# define pNeg p7 /* is rotate count negative? */ + +/* __ia64_longjmp(__jmp_buf buf, int val, long rnat, long rsc) */ + + +LEAF(__ia64_longjmp) + alloc r8=ar.pfs,4,0,0,0 + add r2=0x98,in0 // r2 <- &jmpbuf.orig_jmp_buf_addr + add r3=0x88,in0 // r3 <- &jmpbuf.ar_bsp + ;; + ld8 r8=[r2] // r8 <- orig_jmp_buf_addr + ld8 r23=[r3],8 // r23 <- jmpbuf.ar_bsp + mov r2=in0 + ;; + // + // Note: we need to redo the "flushrs" here even though it's + // already been done by __ia64_flush_rbs. It is needed to + // ensure that ar.bspstore == ar.bsp. + // + flushrs // flush dirty regs to backing store + ld8 r25=[r3] // r25 <- jmpbuf.ar_unat + sub r8=r8,in0 // r8 <- &orig_jmpbuf - &jmpbuf + ;; + add r3=8,in0 // r3 <- &jmpbuf.r1 + extr.u r8=r8,3,6 // r8 <- (&orig_jmpbuf - &jmpbuf)/8 & 0x3f + ;; + cmp.lt pNeg,pPos=r8,r0 + ;; +(pPos) mov r16=r8 +(pNeg) add r16=64,r8 +(pPos) sub r17=64,r8 +(pNeg) sub r17=r0,r8 + ;; + shr.u r8=r25,r16 + shl r9=r25,r17 + ;; + or r25=r8,r9 + ;; + mov ar.unat=r25 // setup ar.unat (NaT bits for r1, r4-r7, and r12) + ;; + ld8.fill.nta sp=[r2],16 // r12 (sp) + ld8.fill.nta gp=[r3],16 // r1 (gp) + dep r11=-1,r23,3,6 // r11 <- ia64_rse_rnat_addr(jmpbuf.ar_bsp) + ;; + ld8.nta r16=[r2],16 // caller's unat + ld8.nta r17=[r3],16 // fpsr + ;; + ld8.fill.nta r4=[r2],16 // r4 + ld8.fill.nta r5=[r3],16 // r5 (gp) + ;; + ld8.fill.nta r6=[r2],16 // r6 + ld8.fill.nta r7=[r3],16 // r7 + ;; + mov ar.unat=r16 // restore caller's unat + mov ar.fpsr=r17 // restore fpsr + ;; + ld8.nta r16=[r2],16 // b0 + ld8.nta r17=[r3],16 // b1 + ;; + mov ar.bspstore=r23 // restore ar.bspstore + ld8.nta r18=[r2],16 // b2 + ;; + mov ar.rnat=in2 // restore ar.rnat + ld8.nta r19=[r3],16 // b3 + ;; + ld8.nta r20=[r2],16 // b4 + ld8.nta r21=[r3],16 // b5 +#ifdef PTR_DEMANGLE + PTR_DEMANGLE (r16, r24) +#endif + ;; + ld8.nta r11=[r2],16 // ar.pfs + ld8.nta r22=[r3],56 // ar.lc + ;; + ld8.nta r24=[r2],32 // pr + mov ar.rsc=in3 // restore ar.rsc + mov b0=r16 + ;; + ldf.fill.nta f2=[r2],32 + ldf.fill.nta f3=[r3],32 + mov b1=r17 + ;; + ldf.fill.nta f4=[r2],32 + ldf.fill.nta f5=[r3],32 + mov b2=r18 + ;; + ldf.fill.nta f16=[r2],32 + ldf.fill.nta f17=[r3],32 + mov b3=r19 + ;; + ldf.fill.nta f18=[r2],32 + ldf.fill.nta f19=[r3],32 + mov b4=r20 + ;; + ldf.fill.nta f20=[r2],32 + ldf.fill.nta f21=[r3],32 + mov b5=r21 + ;; + ldf.fill.nta f22=[r2],32 + ldf.fill.nta f23=[r3],32 + mov ar.lc=r22 + ;; + ldf.fill.nta f24=[r2],32 + ldf.fill.nta f25=[r3],32 + cmp.eq p8,p9=0,in1 + ;; + ldf.fill.nta f26=[r2],32 + ldf.fill.nta f27=[r3],32 + mov ar.pfs=r11 + ;; + ldf.fill.nta f28=[r2],32 + ldf.fill.nta f29=[r3],32 +(p8) mov r8=1 + ;; + ldf.fill.nta f30=[r2] + ldf.fill.nta f31=[r3] +(p9) mov r8=in1 + + invala // virt. -> phys. regnum mapping may change + mov pr=r24,-1 + ret +END(__ia64_longjmp) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/__sigstack_longjmp.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/__sigstack_longjmp.c new file mode 100644 index 0000000000..b7b1558652 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/__sigstack_longjmp.c @@ -0,0 +1,167 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* The public __longjmp() implementation is limited to jumping within + the same stack. That is, in general it is not possible to use this + __longjmp() implementation to cross from one stack to another. + In constrast, the __sigstack_longjmp() implemented here allows + crossing from the alternate signal stack to the normal stack + as a special case. */ + +#include <assert.h> +#include <setjmp.h> +#include <signal.h> +#include <stdint.h> +#include <stdlib.h> + +#include <sysdep.h> +#include <sys/rse.h> + +#define JB_SP 0 +#define JB_BSP 17 + +struct rbs_flush_values + { + unsigned long bsp; + unsigned long rsc; + unsigned long rnat; + }; + +extern struct rbs_flush_values __ia64_flush_rbs (void); +extern void __ia64_longjmp (__jmp_buf buf, int val, long rnat, long rsc) + __attribute__ ((__noreturn__)); + +static void +copy_rbs (unsigned long *dst, unsigned long *dst_end, unsigned long dst_rnat, + unsigned long *src, unsigned long *src_end, + unsigned long current_rnat) +{ + unsigned long dst_slot, src_rnat = 0, src_slot, *src_rnat_addr, nat_bit; + int first_time = 1; + + while (dst < dst_end) + { + dst_slot = ia64_rse_slot_num (dst); + if (dst_slot == 63) + { + *dst++ = dst_rnat; + dst_rnat = 0; + } + else + { + /* read source value, including NaT bit: */ + src_slot = ia64_rse_slot_num (src); + if (src_slot == 63) + { + /* skip src RNaT slot */ + ++src; + src_slot = 0; + } + if (first_time || src_slot == 0) + { + first_time = 0; + src_rnat_addr = ia64_rse_rnat_addr (src); + if (src_rnat_addr < src_end) + src_rnat = *src_rnat_addr; + else + src_rnat = current_rnat; + } + nat_bit = (src_rnat >> src_slot) & 1; + + assert (src < src_end); + + *dst++ = *src++; + if (nat_bit) + dst_rnat |= (1UL << dst_slot); + else + dst_rnat &= ~(1UL << dst_slot); + } + } + dst_slot = ia64_rse_slot_num (dst); + if (dst_slot > 0) + *ia64_rse_rnat_addr (dst) = dst_rnat; +} + +void +__sigstack_longjmp (__jmp_buf buf, int val) +{ + unsigned long *rbs_base, *bsp, *bspstore, *jb_bsp, jb_sp, ss_sp; + unsigned long ndirty, rnat, load_rnat, *jb_rnat_addr; + struct sigcontext *sc; + stack_t stk; + struct rbs_flush_values c; + + /* put RSE into enforced-lazy mode and return current bsp/rsc/rnat: */ + c = __ia64_flush_rbs (); + + jb_sp = ((unsigned long *) buf)[JB_SP]; + jb_bsp = ((unsigned long **) buf)[JB_BSP]; + + INTERNAL_SYSCALL_DECL (err); + (void) INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &stk); + + ss_sp = (unsigned long) stk.ss_sp; + jb_rnat_addr = ia64_rse_rnat_addr (jb_bsp); + + if ((stk.ss_flags & SS_ONSTACK) == 0 || jb_sp - ss_sp < stk.ss_size) + /* Normal non-stack-crossing longjmp; if the RNaT slot for the bsp + saved in the jump-buffer is the same as the one for the current + BSP, use the current AR.RNAT value, otherwise, load it from the + jump-buffer's RNaT-slot. */ + load_rnat = (ia64_rse_rnat_addr ((unsigned long *) c.bsp) != jb_rnat_addr); + else + { + /* If we are on the alternate signal-stack and the jump-buffer + lies outside the signal-stack, we may need to copy back the + dirty partition which was torn off and saved on the + signal-stack when the signal was delivered. + + Caveat: we assume that the top of the alternate signal-stack + stores the sigcontext structure of the signal that + caused the switch to the signal-stack. This should + be a fairly safe assumption but the kernel _could_ + do things differently.. */ + sc = ((struct sigcontext *) ((ss_sp + stk.ss_size) & -16) - 1); + + /* As a sanity-check, verify that the register-backing-store base + of the alternate signal-stack is where we expect it. */ + rbs_base = (unsigned long *) + ((ss_sp + sizeof (long) - 1) & -sizeof (long)); + + assert ((unsigned long) rbs_base == sc->sc_rbs_base); + + ndirty = ia64_rse_num_regs (rbs_base, rbs_base + (sc->sc_loadrs >> 19)); + bsp = (unsigned long *) sc->sc_ar_bsp; + bspstore = ia64_rse_skip_regs (bsp, -ndirty); + + if (bspstore < jb_bsp) + /* AR.BSPSTORE at the time of the signal was below the value + of AR.BSP saved in the jump-buffer => copy the missing + portion from the torn off dirty partition which got saved + on the alternate signal-stack. */ + copy_rbs (bspstore, jb_bsp, sc->sc_ar_rnat, + rbs_base, (unsigned long *) c.bsp, c.rnat); + + load_rnat = 1; + } + if (load_rnat) + rnat = *jb_rnat_addr; + else + rnat = c.rnat; + __ia64_longjmp (buf, val, rnat, c.rsc); +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/local_lim.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/local_lim.h new file mode 100644 index 0000000000..2ae2ef2e49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/local_lim.h @@ -0,0 +1,99 @@ +/* Minimum guaranteed maximum values for system limits. Linux/IA-64 version. + Copyright (C) 1993-1998,2000,2002-2004,2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* The kernel header pollutes the namespace with the NR_OPEN symbol + and defines LINK_MAX although filesystems have different maxima. A + similar thing is true for OPEN_MAX: the limit can be changed at + runtime and therefore the macro must not be defined. Remove this + after including the header if necessary. */ +#ifndef NR_OPEN +# define __undef_NR_OPEN +#endif +#ifndef LINK_MAX +# define __undef_LINK_MAX +#endif +#ifndef OPEN_MAX +# define __undef_OPEN_MAX +#endif +#ifndef ARG_MAX +# define __undef_ARG_MAX +#endif + +/* The kernel sources contain a file with all the needed information. */ +#include <linux/limits.h> + +/* Have to remove NR_OPEN? */ +#ifdef __undef_NR_OPEN +# undef NR_OPEN +# undef __undef_NR_OPEN +#endif +/* Have to remove LINK_MAX? */ +#ifdef __undef_LINK_MAX +# undef LINK_MAX +# undef __undef_LINK_MAX +#endif +/* Have to remove OPEN_MAX? */ +#ifdef __undef_OPEN_MAX +# undef OPEN_MAX +# undef __undef_OPEN_MAX +#endif +/* Have to remove ARG_MAX? */ +#ifdef __undef_ARG_MAX +# undef ARG_MAX +# undef __undef_ARG_MAX +#endif + +/* The number of data keys per process. */ +#define _POSIX_THREAD_KEYS_MAX 128 +/* This is the value this implementation supports. */ +#define PTHREAD_KEYS_MAX 1024 + +/* Controlling the iterations of destructors for thread-specific data. */ +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +/* Number of iterations this implementation does. */ +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS + +/* The number of threads per process. */ +#define _POSIX_THREAD_THREADS_MAX 64 +/* We have no predefined limit on the number of threads. */ +#undef PTHREAD_THREADS_MAX + +/* Maximum amount by which a process can descrease its asynchronous I/O + priority level. */ +#define AIO_PRIO_DELTA_MAX 20 + +/* Minimum size for a thread. We are free to choose a reasonable value. */ +#define PTHREAD_STACK_MIN 196608 + +/* Maximum number of timer expiration overruns. */ +#define DELAYTIMER_MAX 2147483647 + +/* Maximum tty name length. */ +#define TTY_NAME_MAX 32 + +/* Maximum login name length. This is arbitrary. */ +#define LOGIN_NAME_MAX 256 + +/* Maximum host name length. */ +#define HOST_NAME_MAX 64 + +/* Maximum message queue priority level. */ +#define MQ_PRIO_MAX 32768 + +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..5b30713069 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h @@ -0,0 +1,172 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#define __SIZEOF_PTHREAD_ATTR_T 56 +#define __SIZEOF_PTHREAD_MUTEX_T 40 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCK_T 56 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIER_T 32 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + + +/* Thread identifiers. The structure of the attribute type is not + exposed on purpose. */ +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + + +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; + + +/* Data structures for mutex handling. The structure of the attribute + type is not exposed on purpose. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock; + unsigned int __count; + int __owner; + unsigned int __nusers; + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; + int __spins; + __pthread_list_t __list; +#define __PTHREAD_MUTEX_HAVE_PREV 1 + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is not exposed on purpose. */ +typedef union +{ + struct + { + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is not exposed on purpose. */ +typedef union +{ + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + int __writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; + } __data; + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/semaphore.h new file mode 100644 index 0000000000..3a49ee4e3f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/bits/semaphore.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + + +#define __SIZEOF_SEM_T 32 + + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/clone2.S b/ports/sysdeps/unix/sysv/linux/ia64/nptl/clone2.S new file mode 100644 index 0000000000..91f28bab37 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/clone2.S @@ -0,0 +1,9 @@ +/* We want an #include_next, but we are the main source file. + So, #include ourselves and in that incarnation we can use #include_next. */ +#ifndef INCLUDED_SELF +# define INCLUDED_SELF +# include <clone2.S> +#else +# define RESET_PID +# include_next <clone2.S> +#endif diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/createthread.c new file mode 100644 index 0000000000..7d19235c47 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/createthread.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2003, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE ((char *) pd + TLS_PRE_TCB_SIZE) + +#define ARCH_CLONE __clone2 + +/* Get the real implementation. */ +#include <nptl/sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h new file mode 100644 index 0000000000..e30e33d2bc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h @@ -0,0 +1,76 @@ +/* System-specific settings for dynamic linker code. IA-64 version. + Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _DL_SYSDEP_H +#define _DL_SYSDEP_H 1 + +/* This macro must be defined to either 0 or 1. + + If 1, then an errno global variable hidden in ld.so will work right with + all the errno-using libc code compiled for ld.so, and there is never a + need to share the errno location with libc. This is appropriate only if + all the libc functions that ld.so uses are called without PLT and always + get the versions linked into ld.so rather than the libc ones. */ + +#ifdef IS_IN_rtld +# define RTLD_PRIVATE_ERRNO 1 +#else +# define RTLD_PRIVATE_ERRNO 0 +#endif + +/* Traditionally system calls have been made using break 0x100000. A + second method was introduced which, if possible, will use the EPC + instruction. To signal the presence and where to find the code the + kernel passes an AT_SYSINFO_EHDR pointer in the auxiliary vector to + the application. */ +#define NEED_DL_SYSINFO 1 +#define USE_DL_SYSINFO 1 + +#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__ +/* Don't declare this as a function---we want it's entry-point, not + it's function descriptor... */ +extern int _dl_sysinfo_break attribute_hidden; +# define DL_SYSINFO_DEFAULT ((uintptr_t) &_dl_sysinfo_break) +# define DL_SYSINFO_IMPLEMENTATION \ + asm (".text\n\t" \ + ".hidden _dl_sysinfo_break\n\t" \ + ".proc _dl_sysinfo_break\n\t" \ + "_dl_sysinfo_break:\n\t" \ + ".prologue\n\t" \ + ".altrp b6\n\t" \ + ".body\n\t" \ + "break 0x100000;\n\t" \ + "br.ret.sptk.many b6;\n\t" \ + ".endp _dl_sysinfo_break\n\t" \ + ".previous"); +#endif + +/* _dl_argv cannot be attribute_relro, because _dl_start_user + might write into it after _dl_start returns. */ +#define DL_ARGV_NOT_RELRO 1 + + +/* The _dl_discover_osversion function is so far only needed in sysconf + to check for kernels later than 2.6.23. */ +#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617 +/* Get version of the OS. */ +extern int _dl_discover_osversion (void) attribute_hidden; +# define HAVE_DL_DISCOVER_OSVERSION 1 +#endif + +#endif /* dl-sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/fork.c new file mode 100644 index 0000000000..9767d2a9dc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/fork.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sched.h> +#include <signal.h> +#include <sysdep.h> +#include <tls.h> + + +#define ARCH_FORK() \ + INLINE_SYSCALL (clone2, 6, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \ + NULL, 0, NULL, &THREAD_SELF->tid, NULL) + +#include <sysdeps/unix/sysv/linux/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/ld.abilist new file mode 100644 index 0000000000..9ad04eddad --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/ld.abilist @@ -0,0 +1,15 @@ +GLIBC_2.2 + GLIBC_2.2 A + __libc_memalign F + __libc_stack_end D 0x8 + _dl_mcount F + _r_debug D 0x28 + calloc F + free F + malloc F + realloc F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..b7aa242c86 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.2 + GLIBC_2.2 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libanl.abilist new file mode 100644 index 0000000000..c9755d8a33 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist new file mode 100644 index 0000000000..6939ad73bc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist @@ -0,0 +1,2184 @@ +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fallocate64 F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + _sys_errlist D 0x438 + _sys_nerr D 0x4 + ntp_gettimex F + recvmmsg F + sys_errlist D 0x438 + sys_nerr D 0x4 +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _Exit F + _IO_2_1_stderr_ D 0xe0 + _IO_2_1_stdin_ D 0xe0 + _IO_2_1_stdout_ D 0xe0 + _IO_adjust_column F + _IO_adjust_wcolumn F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0xa8 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_getline_info F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_link_in F + _IO_list_all D 0x8 + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_seekwmark F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sputbackwc F + _IO_sscanf F + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_sungetwc F + _IO_switch_to_get_mode F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_unsave_wmarkers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0xa8 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + ___brk_addr D 0x8 + __adjtimex F + __after_morecore_hook D 0x8 + __argz_count F + __argz_next F + __argz_stringify F + __asprintf F + __assert F + __assert_fail F + __assert_perror_fail F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __bsd_getpgrp F + __check_rhosts_file D 0x4 + __clone2 F + __close F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x8 + __ctype32_tolower D 0x8 + __ctype32_toupper D 0x8 + __ctype_b D 0x8 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x8 + __ctype_toupper D 0x8 + __curbrk D 0x8 + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __daylight D 0x4 + __dcgettext F + __default_morecore F + __dgettext F + __divdf3 F + __divdi3 F + __divsf3 F + __divtf3 F + __dup2 F + __duplocale F + __endmntent F + __environ D 0x8 + __errno_location F + __fbufsize F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __flbf F + __fork F + __fpending F + __fpu_control D 0x4 + __fpurge F + __freadable F + __freading F + __free_hook D 0x8 + __freelocale F + __fsetlocking F + __fwritable F + __fwriting F + __fxstat F + __fxstat64 F + __getdelim F + __getmntent_r F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __isinf F + __isinff F + __isinfl F + __islower_l F + __isnan F + __isnanf F + __isnanl F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __ivaliduser F + __key_decryptsession_pk_LOCAL D 0x8 + __key_encryptsession_pk_LOCAL D 0x8 + __key_gendes_LOCAL D 0x8 + __libc_allocate_rtsig F + __libc_calloc F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_free F + __libc_freeres F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_sa_len F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __lxstat64 F + __malloc_hook D 0x8 + __malloc_initialize_hook D 0x8 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x8 + __mempcpy F + __mempcpy_small F + __moddi3 F + __monstartup F + __morecore D 0x8 + __multi3 F + __newlocale F + __nl_langinfo_l F + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __open64 F + __overflow F + __pipe F + __poll F + __pread64 F + __printf_fp F + __profile_frequency F + __progname D 0x8 + __progname_full D 0x8 + __pwrite64 F + __rawmemchr F + __rcmd_errstr D 0x8 + __read F + __realloc_hook D 0x8 + __res_init F + __res_nclose F + __res_ninit F + __res_randomid F + __res_state F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setmntent F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __signbit F + __signbitf F + __signbitl F + __sigpause F + __sigsetjmp F + __sigsuspend F + __statfs F + __stpcpy F + __stpcpy_small F + __stpncpy F + __strcasecmp F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strdup F + __strerror_r F + __strfmon_l F + __strncasecmp_l F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_internal F + __strtod_l F + __strtof_internal F + __strtof_l F + __strtok_r F + __strtok_r_1c F + __strtol_internal F + __strtol_l F + __strtold_internal F + __strtold_l F + __strtoll_internal F + __strtoll_l F + __strtoul_internal F + __strtoul_l F + __strtoull_internal F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __sysconf F + __sysctl F + __sysv_signal F + __timezone D 0x8 + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __tzname D 0x10 + __udivdi3 F + __uflow F + __umoddi3 F + __underflow F + __vfork F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_internal F + __wcstod_l F + __wcstof_internal F + __wcstof_l F + __wcstol_internal F + __wcstol_l F + __wcstold_internal F + __wcstold_l F + __wcstoll_internal F + __wcstoll_l F + __wcstoul_internal F + __wcstoul_l F + __wcstoull_internal F + __wcstoull_l F + __wcsxfrm_l F + __wctrans_l F + __wctype_l F + __woverflow F + __write F + __wuflow F + __wunderflow F + __xmknod F + __xpg_basename F + __xpg_sigpause F + __xstat F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _environ D 0x8 + _exit F + _flushlbf F + _inb F + _inl F + _inw F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x8 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0x18 + _obstack D 0x8 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _outb F + _outl F + _outw F + _res D 0x238 + _res_hconf D 0x48 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x3e8 + _sys_nerr D 0x4 + _sys_siglist D 0x200 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + addseverity F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x8 + argp_program_version D 0x8 + argp_program_version_hook D 0x8 + argp_state_help F + argp_usage F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authdes_create F + authdes_getucred F + authdes_pk_create F + authnone_create F + authunix_create F + authunix_create_default F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + basename F + bcmp F + bcopy F + bdflush F + bind F + bind_textdomain_codeset F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + calloc F + callrpc F + canonicalize_file_name F + capget F + capset F + catclose F + catgets F + catopen F + cbc_crypt F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clntunix_create F + clock F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + creat64 F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + dcngettext F + delete_module F + des_setparity F + dgettext F + difftime F + dirfd F + dirname F + div F + dngettext F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecb_crypt F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + endutxent F + environ D 0x8 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x8 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fattach F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdetach F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + ffsl F + ffsll F + fgetc F + fgetc_unlocked F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpos64 F + fgetpwent F + fgetpwent_r F + fgets F + fgets_unlocked F + fgetspent F + fgetspent_r F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fmemopen F + fmtmsg F + fnmatch F + fopen F + fopen64 F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread F + fread_unlocked F + free F + freeaddrinfo F + freopen F + freopen64 F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fstatfs F + fstatfs64 F + fstatvfs F + fstatvfs64 F + fsync F + ftell F + ftello F + ftello64 F + ftime F + ftok F + ftruncate F + ftruncate64 F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + ftw64 F + funlockfile F + fwide F + fwprintf F + fwrite F + fwrite_unlocked F + fwscanf F + gai_strerror F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcontext F + getcwd F + getdate F + getdate_err D 0x4 + getdate_r F + getdelim F + getdirentries F + getdirentries64 F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getloadavg F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getmsg F + getnameinfo F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getnetname F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getpmsg F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpt F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrlimit64 F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getw F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + getwd F + glob F + glob64 F + glob_pattern_p F + globfree F + globfree64 F + gmtime F + gmtime_r F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + group_member F + gsignal F + gtty F + h_errlist D 0x28 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + host2netname F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + inb F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + inl F + innetgr F + insque F + inw F + ioctl F + ioperm F + iopl F + iruserok F + iruserok_af F + isalnum F + isalpha F + isascii F + isastream F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswblank F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x8 + loc2 D 0x8 + localeconv F + localtime F + localtime_r F + lockf F + lockf64 F + locs D 0x8 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + lseek64 F + madvise F + makecontext F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x8 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcheck_check_all F + mcheck_pedantic F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + mempcpy F + memrchr F + memset F + mincore F + mkdir F + mkdtemp F + mkfifo F + mkstemp F + mkstemp64 F + mktemp F + mktime F + mlock F + mlockall F + mmap F + mmap64 F + modf F + modff F + modfl F + moncontrol F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + netname2host F + netname2user F + nfsservctl F + nftw F + nftw64 F + ngettext F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + ntp_adjtime F + ntp_gettime F + obstack_alloc_failed_handler D 0x8 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open64 F + open_memstream F + opendir F + openlog F + optarg D 0x8 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + outb F + outw F + parse_printf_format F + passwd2des F + pathconf F + pause F + pciconfig_read F + pciconfig_write F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + prctl F + pread F + pread64 F + printf F + printf_size F + printf_size_info F + profil F + program_invocation_name D 0x8 + program_invocation_short_name D 0x8 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + ptsname F + ptsname_r F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putgrent F + putmsg F + putpmsg F + putpwent F + puts F + putspent F + pututline F + pututxline F + putw F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pvalloc F + pwrite F + pwrite64 F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rawmemchr F + rcmd F + rcmd_af F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x8 + read F + readdir F + readdir64 F + readdir64_r F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + revoke F + rewind F + rewinddir F + rexec F + rexec_af F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x20 + rpmatch F + rresvport F + rresvport_af F + rtime F + ruserok F + ruserok_af F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scandir64 F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendfile F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrlimit64 F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setutxent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + sighold F + sigignore F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigqueue F + sigrelse F + sigreturn F + sigset F + sigsetmask F + sigstack F + sigsuspend F + sigtimedwait F + sigvec F + sigwait F + sigwaitinfo F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + statfs64 F + statvfs F + statvfs64 F + stderr D 0x8 + stdin D 0x8 + stdout D 0x8 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcasestr F + strcat F + strchr F + strchrnul F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtoimax F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtoumax F + strtouq F + strverscmp F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreq_common F + svc_getreq_poll F + svc_getreqset F + svc_max_pollfd D 0x4 + svc_pollfd D 0x8 + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0x18 + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + svcunix_create F + svcunixfd_create F + swab F + swapcontext F + swapoff F + swapon F + swprintf F + swscanf F + symlink F + sync F + sys_errlist D 0x3e8 + sys_nerr D 0x4 + sys_sigabbrev D 0x200 + sys_siglist D 0x200 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + sysv_signal F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcgetsid F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + tdestroy F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x8 + tmpfile F + tmpfile64 F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + truncate64 F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x10 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + umount2 F + uname F + ungetc F + ungetwc F + unlink F + unlockpt F + unsetenv F + updwtmp F + updwtmpx F + uselib F + user2netname F + usleep F + ustat F + utime F + utimes F + utmpname F + utmpxname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + versionsort F + versionsort64 F + vfork F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + vwprintf F + vwscanf F + wait F + wait3 F + wait4 F + waitid F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscasecmp F + wcscat F + wcschr F + wcschrnul F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcsftime F + wcslen F + wcsncasecmp F + wcsncat F + wcsncmp F + wcsncpy F + wcsnlen F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstoimax F + wcstok F + wcstol F + wcstold F + wcstoll F + wcstombs F + wcstoq F + wcstoul F + wcstoull F + wcstoumax F + wcstouq F + wcswcs F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmempcpy F + wmemset F + wordexp F + wordfree F + wprintf F + write F + writev F + wscanf F + xdecrypt F + xdr_accepted_reply F + xdr_array F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_getcredres F + xdr_hyper F + xdr_int F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_longlong_t F + xdr_netnamestr F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_sizeof F + xdr_string F + xdr_u_char F + xdr_u_hyper F + xdr_u_int F + xdr_u_long F + xdr_u_longlong_t F + xdr_u_short F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_union F + xdr_unixcred F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F + wordexp F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F + getunwind F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + _sys_errlist D 0x3f0 + _sys_nerr D 0x4 + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoul_l F + strxfrm_l F + sys_errlist D 0x3f0 + sys_nerr D 0x4 + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __register_atfork F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x208 + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + nftw F + nftw64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + strtoll_l F + strtoull_l F + sys_sigabbrev D 0x208 + sys_siglist D 0x208 +GLIBC_2.3.4 + GLIBC_2.3.4 A + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + getipv4sourcefilter F + getsourcefilter F + regexec F + sched_getaffinity F + sched_setaffinity F + setipv4sourcefilter F + setsourcefilter F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __pread64_chk F + __pread_chk F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __stack_chk_fail F + __stpncpy_chk F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __vfwprintf_chk F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + _sys_errlist D 0x420 + _sys_nerr D 0x4 + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + futimesat F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + linkat F + mkdirat F + mkfifoat F + open_wmemstream F + openat F + openat64 F + ppoll F + readlinkat F + renameat F + symlinkat F + sys_errlist D 0x420 + sys_nerr D 0x4 + unlinkat F + unshare F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libcrypt.abilist new file mode 100644 index 0000000000..1df145f260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libdl.abilist new file mode 100644 index 0000000000..62e6b41edb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libdl.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.1 + GLIBC_2.1 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libm.abilist new file mode 100644 index 0000000000..1fb51a118d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libm.abilist @@ -0,0 +1,342 @@ +GLIBC_2.15 + GLIBC_2.15 A + __j0_finite F + __j0f_finite F + __j0l_finite F + __j1_finite F + __j1f_finite F + __j1l_finite F + __jn_finite F + __jnf_finite F + __jnl_finite F + __y0_finite F + __y0f_finite F + __y0l_finite F + __y1_finite F + __y1f_finite F + __y1l_finite F + __yn_finite F + __ynf_finite F + __ynl_finite F +GLIBC_2.2 + GLIBC_2.2 A + _LIB_VERSION D 0x4 + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __fpclassifyl F + __signbit F + __signbitf F + __signbitl F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + cbrt F + cbrtf F + cbrtl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + ceil F + ceilf F + ceill F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + log2 F + log2f F + log2l F + logb F + logbf F + logbl F + logf F + logl F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + matherr F + modf F + modff F + modfl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nextafter F + nextafterf F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow F + pow10 F + pow10f F + pow10l F + powf F + powl F + remainder F + remainderf F + remainderl F + remquo F + remquof F + remquol F + rint F + rintf F + rintl F + round F + roundf F + roundl F + scalb F + scalbf F + scalbl F + scalbln F + scalblnf F + scalblnl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sincos F + sincosf F + sincosl F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.2.3 + GLIBC_2.2.3 A + matherrf F + matherrl F +GLIBC_2.4 + GLIBC_2.4 A diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libnsl.abilist new file mode 100644 index 0000000000..4241e2d887 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libnsl.abilist @@ -0,0 +1,127 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.1 + GLIBC_2.1 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F +GLIBC_2.2 + GLIBC_2.2 A + xdr_ypall F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist new file mode 100644 index 0000000000..b7749e2840 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist @@ -0,0 +1,253 @@ +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __lseek F + __open F + __open64 F + __pread64 F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pthread_setspecific F + __pwrite64 F + __read F + __res_state F + __send F + __sigaction F + __vfork F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + lseek64 F + msync F + nanosleep F + open F + open64 F + pause F + pread F + pread64 F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getguardsize F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setguardsize F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_getpshared F + pthread_condattr_init F + pthread_condattr_setpshared F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_timedlock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_getpshared F + pthread_mutexattr_gettype F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_mutexattr_setpshared F + pthread_mutexattr_settype F + pthread_once F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setconcurrency F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_testcancel F + pthread_yield F + pwrite F + pwrite64 F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_attr_setstack F + pthread_attr_setstacksize F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libresolv.abilist new file mode 100644 index 0000000000..808d0f2f74 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libresolv.abilist @@ -0,0 +1,104 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0xa8 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x450 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x80 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/librt.abilist new file mode 100644 index 0000000000..371d135c8d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/librt.abilist @@ -0,0 +1,59 @@ +GLIBC_2.1 + GLIBC_2.1 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + lio_listio F + lio_listio64 F +GLIBC_2.2 + GLIBC_2.2 A + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.3 + GLIBC_2.3.3 A + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libthread_db.abilist new file mode 100644 index 0000000000..f33138067c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libthread_db.abilist @@ -0,0 +1,48 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libutil.abilist new file mode 100644 index 0000000000..7422687e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h new file mode 100644 index 0000000000..24ed47e226 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h @@ -0,0 +1,294 @@ +/* Copyright (C) 2003, 2004, 2006-2008, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <ia64intrin.h> +#include <atomic.h> +#include <kernel-features.h> + +#define __NR_futex 1230 +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + + +/* Delay in spinlock loop. */ +#define BUSY_WAIT_NOP asm ("hint @pause") + +#define lll_futex_wait(futex, val, private) \ + lll_futex_timed_wait (futex, val, NULL, private) + +#define lll_futex_timed_wait(ftx, val, timespec, private) \ +({ \ + DO_INLINE_SYSCALL(futex, 4, (long) (ftx), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (int) (val), (long) (timespec)); \ + _r10 == -1 ? -_retval : _retval; \ +}) + +#define lll_futex_wake(ftx, nr, private) \ +({ \ + DO_INLINE_SYSCALL(futex, 3, (long) (ftx), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (int) (nr)); \ + _r10 == -1 ? -_retval : _retval; \ +}) + +#define lll_robust_dead(futexv, private) \ +do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + DO_INLINE_SYSCALL(futex, 3, (long) __futexp, \ + __lll_private_flag (FUTEX_WAKE, private), 1); \ + } \ +while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private) \ +({ \ + DO_INLINE_SYSCALL(futex, 6, (long) (ftx), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private), \ + (int) (nr_wake), (int) (nr_move), (long) (mutex), \ + (int) val); \ + _r10 == -1; \ +}) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(ftx, nr_wake, nr_wake2, ftx2, private) \ +({ \ + DO_INLINE_SYSCALL(futex, 6, (long) (ftx), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (int) (nr_wake), (int) (nr_wake2), (long) (ftx2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + _r10 == -1; \ +}) + + +#define __lll_trylock(futex) \ + (atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0) +#define lll_trylock(futex) __lll_trylock (&(futex)) + + +#define __lll_robust_trylock(futex, id) \ + (atomic_compare_and_exchange_val_acq (futex, id, 0) != 0) +#define lll_robust_trylock(futex, id) \ + __lll_robust_trylock (&(futex), id) + + +#define __lll_cond_trylock(futex) \ + (atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0) +#define lll_cond_trylock(futex) __lll_cond_trylock (&(futex)) + + +extern void __lll_lock_wait_private (int *futex) attribute_hidden; +extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + + +#define __lll_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, \ + 1, 0), 0)) \ + { \ + if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \ + __lll_lock_wait_private (__futex); \ + else \ + __lll_lock_wait (__futex, private); \ + } \ + })) +#define lll_lock(futex, private) __lll_lock (&(futex), private) + + +#define __lll_robust_lock(futex, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_lock_wait (__futex, private); \ + __val; \ + }) +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + + +#define __lll_cond_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, 2, \ + 0), 0)) \ + __lll_lock_wait (__futex, private); \ + })) +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + + +#define __lll_robust_cond_lock(futex, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + int __id = (id) | FUTEX_WAITERS; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, \ + __id, 0), 0)) \ + __val = __lll_robust_lock_wait (__futex, private); \ + __val; \ + }) +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_cond_lock (&(futex), id, private) + + +extern int __lll_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + + +#define __lll_timedlock(futex, abstime, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, 1, \ + 0), 0)) \ + __val = __lll_timedlock_wait (__futex, abstime, private); \ + __val; \ + }) +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + + +#define __lll_robust_timedlock(futex, abstime, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_timedlock_wait (__futex, abstime, private); \ + __val; \ + }) +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + + +#define __lll_unlock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + int __val = atomic_exchange_rel (__futex, 0); \ + \ + if (__builtin_expect (__val > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + })) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + + +#define __lll_robust_unlock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + int __val = atomic_exchange_rel (__futex, 0); \ + \ + if (__builtin_expect (__val & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + })) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + + +#define lll_islocked(futex) \ + (futex != 0) + +/* Initializers for lock. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + +/* The kernel notifies a process with uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do \ + { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED); \ + } \ + while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/ia64/nptl/pt-vfork.S new file mode 100644 index 0000000000..1e82b2322d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/pt-vfork.S @@ -0,0 +1,59 @@ +/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +#include <sysdep.h> +#define _SIGNAL_H +#include <bits/signum.h> +#include <tcb-offsets.h> + +/* The following are defined in linux/sched.h, which unfortunately */ +/* is not safe for inclusion in an assembly file. */ +#define CLONE_VM 0x00000100 /* set if VM shared between processes */ +#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ + +/* pid_t vfork(void); */ +/* Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */ + +ENTRY(__vfork) + .prologue // work around a GAS bug which triggers if + .body // first .prologue is not at the beginning of proc. + alloc r2=ar.pfs,0,0,2,0 + adds r14=PID,r13 + ;; + ld4 r16=[r14] + ;; + sub r15=0,r16 + mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD + mov out1=0 /* Standard sp value. */ + ;; + st4 [r14]=r15 + DO_CALL (SYS_ify (clone)) + cmp.eq p0,p7=0,r8 + adds r14=PID,r13 + ;; +(p7) ld4 r16=[r14] + cmp.eq p6,p0=-1,r10 + ;; +(p7) sub r15=0,r16 + ;; +(p7) st4 [r14]=r15 +(p6) br.cond.spnt.few __syscall_error + ret +PSEUDO_END(__vfork) + +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/pthread_once.c new file mode 100644 index 0000000000..7730935dfe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/pthread_once.c @@ -0,0 +1,93 @@ +/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include "pthreadP.h" +#include <lowlevellock.h> + + +unsigned long int __fork_generation attribute_hidden; + + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); +} + + +int +__pthread_once (once_control, init_routine) + pthread_once_t *once_control; + void (*init_routine) (void); +{ + while (1) + { + int oldval, val, newval; + + val = *once_control; + do + { + /* Check if the initialized has already been done. */ + if ((val & 2) != 0) + return 0; + + oldval = val; + newval = (oldval & 3) | __fork_generation | 1; + val = atomic_compare_and_exchange_val_acq (once_control, newval, + oldval); + } + while (__builtin_expect (val != oldval, 0)); + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) != 0) + { + /* Check whether the initializer execution was interrupted + by a fork. */ + if (((oldval ^ newval) & -4) == 0) + { + /* Same generation, some other thread was faster. Wait. */ + lll_futex_wait (once_control, newval, LLL_PRIVATE); + continue; + } + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + + /* Add one to *once_control. */ + atomic_increment (once_control); + + /* Wake up all other threads. */ + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); + break; + } + + return 0; +} +weak_alias (__pthread_once, pthread_once) +hidden_def (__pthread_once) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..b54408812e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/sysdep-cancel.h @@ -0,0 +1,204 @@ +/* Copyright (C) 2002, 2003, 2004, 2006, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +# undef PSEUDO + +# ifndef NOT_IN_libc +# define SYSDEP_CANCEL_ERRNO __libc_errno +# else +# define SYSDEP_CANCEL_ERRNO errno +# endif +# define SYSDEP_CANCEL_ERROR(args) \ +.section .gnu.linkonce.t.__syscall_error_##args, "ax"; \ + .align 32; \ + .proc __syscall_error_##args; \ + .global __syscall_error_##args; \ + .hidden __syscall_error_##args; \ + .size __syscall_error_##args, 64; \ +__syscall_error_##args: \ + .prologue; \ + .regstk args, 5, args, 0; \ + .save ar.pfs, loc0; \ + .save rp, loc1; \ + .body; \ + addl loc4 = @ltoff(@tprel(SYSDEP_CANCEL_ERRNO)), gp;; \ + ld8 loc4 = [loc4]; \ + mov rp = loc1;; \ + mov r8 = -1; \ + add loc4 = loc4, r13;; \ + st4 [loc4] = loc3; \ + mov ar.pfs = loc0 + +# ifndef USE_DL_SYSINFO + +# define PSEUDO(name, syscall_name, args) \ +.text; \ +ENTRY (name) \ + adds r14 = MULTIPLE_THREADS_OFFSET, r13;; \ + ld4 r14 = [r14]; \ + mov r15 = SYS_ify(syscall_name);; \ + cmp4.ne p6, p7 = 0, r14; \ +(p6) br.cond.spnt .Lpseudo_cancel;; \ + break __BREAK_SYSCALL;; \ + cmp.eq p6,p0=-1,r10; \ +(p6) br.cond.spnt.few __syscall_error; \ + ret;; \ + .endp name; \ + .proc __GC_##name; \ + .globl __GC_##name; \ + .hidden __GC_##name; \ +__GC_##name: \ +.Lpseudo_cancel: \ + .prologue; \ + .regstk args, 5, args, 0; \ + .save ar.pfs, loc0; \ + alloc loc0 = ar.pfs, args, 5, args, 0; \ + .save rp, loc1; \ + mov loc1 = rp;; \ + .body; \ + CENABLE;; \ + mov loc2 = r8; \ + COPY_ARGS_##args \ + mov r15 = SYS_ify(syscall_name); \ + break __BREAK_SYSCALL;; \ + mov loc3 = r8; \ + mov loc4 = r10; \ + mov out0 = loc2; \ + CDISABLE;; \ + cmp.eq p6,p0=-1,loc4; \ +(p6) br.cond.spnt.few __syscall_error_##args; \ + mov r8 = loc3; \ + mov rp = loc1; \ + mov ar.pfs = loc0; \ +.Lpseudo_end: \ + ret; \ + .endp __GC_##name; \ + SYSDEP_CANCEL_ERROR(args) + +# else /* USE_DL_SYSINFO */ + +# define PSEUDO(name, syscall_name, args) \ +.text; \ +ENTRY (name) \ + .prologue; \ + adds r2 = SYSINFO_OFFSET, r13; \ + adds r14 = MULTIPLE_THREADS_OFFSET, r13; \ + .save ar.pfs, r11; \ + mov r11 = ar.pfs;; \ + .body; \ + ld4 r14 = [r14]; \ + ld8 r2 = [r2]; \ + mov r15 = SYS_ify(syscall_name);; \ + cmp4.ne p6, p7 = 0, r14; \ + mov b7 = r2; \ +(p6) br.cond.spnt .Lpseudo_cancel; \ + br.call.sptk.many b6 = b7;; \ + mov ar.pfs = r11; \ + cmp.eq p6,p0 = -1, r10; \ +(p6) br.cond.spnt.few __syscall_error; \ + ret;; \ + .endp name; \ + .proc __GC_##name; \ + .globl __GC_##name; \ + .hidden __GC_##name; \ +__GC_##name: \ +.Lpseudo_cancel: \ + .prologue; \ + .regstk args, 5, args, 0; \ + .save ar.pfs, loc0; \ + alloc loc0 = ar.pfs, args, 5, args, 0; \ + adds loc4 = SYSINFO_OFFSET, r13; \ + .save rp, loc1; \ + mov loc1 = rp;; \ + .body; \ + ld8 loc4 = [loc4]; \ + CENABLE;; \ + mov loc2 = r8; \ + mov b7 = loc4; \ + COPY_ARGS_##args \ + mov r15 = SYS_ify(syscall_name); \ + br.call.sptk.many b6 = b7;; \ + mov loc3 = r8; \ + mov loc4 = r10; \ + mov out0 = loc2; \ + CDISABLE;; \ + cmp.eq p6,p0=-1,loc4; \ +(p6) br.cond.spnt.few __syscall_error_##args; \ + mov r8 = loc3; \ + mov rp = loc1; \ + mov ar.pfs = loc0; \ +.Lpseudo_end: \ + ret; \ + .endp __GC_##name; \ + SYSDEP_CANCEL_ERROR(args) + +# endif /* USE_DL_SYSINFO */ + +# undef PSEUDO_END +# define PSEUDO_END(name) .endp + +# ifdef IS_IN_libpthread +# define CENABLE br.call.sptk.many b0 = __pthread_enable_asynccancel +# define CDISABLE br.call.sptk.many b0 = __pthread_disable_asynccancel +# elif !defined NOT_IN_libc +# define CENABLE br.call.sptk.many b0 = __libc_enable_asynccancel +# define CDISABLE br.call.sptk.many b0 = __libc_disable_asynccancel +# elif defined IS_IN_librt +# define CENABLE br.call.sptk.many b0 = __librt_enable_asynccancel +# define CDISABLE br.call.sptk.many b0 = __librt_disable_asynccancel +# else +# error Unsupported library +# endif + +# define COPY_ARGS_0 /* Nothing */ +# define COPY_ARGS_1 COPY_ARGS_0 mov out0 = in0; +# define COPY_ARGS_2 COPY_ARGS_1 mov out1 = in1; +# define COPY_ARGS_3 COPY_ARGS_2 mov out2 = in2; +# define COPY_ARGS_4 COPY_ARGS_3 mov out3 = in3; +# define COPY_ARGS_5 COPY_ARGS_4 mov out4 = in4; +# define COPY_ARGS_6 COPY_ARGS_5 mov out5 = in5; +# define COPY_ARGS_7 COPY_ARGS_6 mov out6 = in6; + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0, 1) +# else +# define SINGLE_THREAD_P \ + adds r14 = MULTIPLE_THREADS_OFFSET, r13 ;; ld4 r14 = [r14] ;; cmp4.ne p6, p7 = 0, r14 +# endif + +#elif !defined __ASSEMBLER__ + +# define SINGLE_THREAD_P (1) +# define NO_CANCELLATION 1 + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_create.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_create.c new file mode 100644 index 0000000000..1ac4c6a6b0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_create.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_delete.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_delete.c new file mode 100644 index 0000000000..9bffef3488 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_delete.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_getoverr.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_getoverr.c new file mode 100644 index 0000000000..24533a0c31 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_getoverr.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_gettime.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_gettime.c new file mode 100644 index 0000000000..c1106695e7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_gettime.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_settime.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_settime.c new file mode 100644 index 0000000000..93d4ad9344 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/timer_settime.c @@ -0,0 +1 @@ +#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/unwind-forcedunwind.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/unwind-forcedunwind.c new file mode 100644 index 0000000000..ad6890428b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/unwind-forcedunwind.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2003, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <dlfcn.h> +#include <stdio.h> +#include <unwind.h> +#include <pthreadP.h> + +static _Unwind_Word (*libgcc_s_getbsp) (struct _Unwind_Context *); + +#define ARCH_CANCEL_INIT(handle) \ + ((libgcc_s_getbsp = __libc_dlsym (handle, "_Unwind_GetBSP")) == NULL) + +#include <sysdeps/pthread/unwind-forcedunwind.c> + +_Unwind_Word +_Unwind_GetBSP (struct _Unwind_Context *context) +{ + if (__builtin_expect (libgcc_s_getbsp == NULL, 0)) + pthread_cancel_init (); + + return libgcc_s_getbsp (context); +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/unwind_longjmp.c b/ports/sysdeps/unix/sysv/linux/ia64/nptl/unwind_longjmp.c new file mode 100644 index 0000000000..5582fcd947 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/unwind_longjmp.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1991,92,94,95,97,98,2000,02,04 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <setjmp.h> +#include <signal.h> +#include <pthreadP.h> +#include <jmpbuf-unwind.h> + +extern void __sigstack_longjmp (__jmp_buf, int) + __attribute__ ((noreturn)); + +/* Like __libc_siglongjmp(), but safe for crossing from alternate + signal stack to normal stack. Needed by NPTL. */ +void +__libc_unwind_longjmp (sigjmp_buf env, int val) +{ + /* Perform any cleanups needed by the frames being unwound. */ + __pthread_cleanup_upto (env->__jmpbuf, CURRENT_STACK_FRAME); + + if (env[0].__mask_was_saved) + /* Restore the saved signal mask. */ + (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, + (sigset_t *) NULL); + + /* Call the machine-dependent function to restore machine state. */ + __sigstack_longjmp (env[0].__jmpbuf, val ?: 1); +} +hidden_def (__libc_unwind_longjmp) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/ia64/nptl/vfork.S new file mode 100644 index 0000000000..a79e2de705 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/vfork.S @@ -0,0 +1,68 @@ +/* Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +#include <sysdep.h> +#define _SIGNAL_H +#include <bits/signum.h> +#include <tcb-offsets.h> + +/* The following are defined in linux/sched.h, which unfortunately */ +/* is not safe for inclusion in an assembly file. */ +#define CLONE_VM 0x00000100 /* set if VM shared between processes */ +#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ + +/* pid_t vfork(void); */ +/* Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */ + +ENTRY(__vfork) + .prologue // work around a GAS bug which triggers if + .body // first .prologue is not at the beginning of proc. + alloc r2=ar.pfs,0,0,2,0 + adds r14=PID,r13 + ;; + ld4 r16=[r14] + ;; + sub r15=0,r16 + cmp.eq p6,p0=0,r16 + ;; +(p6) movl r15=0x80000000 + mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD + mov out1=0 /* Standard sp value. */ + ;; + st4 [r14]=r15 + DO_CALL (SYS_ify (clone)) + cmp.eq p6,p0=0,r8 + adds r14=PID,r13 +(p6) br.cond.dptk 1f + ;; + ld4 r15=[r14] + ;; + extr.u r16=r15,0,31 + ;; + cmp.eq p0,p6=0,r16 + ;; +(p6) sub r16=0,r15 + ;; + st4 [r14]=r16 +1: + cmp.eq p6,p0=-1,r10 +(p6) br.cond.spnt.few __syscall_error + ret +PSEUDO_END(__vfork) +libc_hidden_def (__vfork) +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/pipe.S b/ports/sysdeps/unix/sysv/linux/ia64/pipe.S new file mode 100644 index 0000000000..6bcc6ffc67 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/pipe.S @@ -0,0 +1,37 @@ +/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger <davidm@hpl.hp.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* __pipe is a special syscall since it returns two values. */ + +#include <sysdep.h> + +ENTRY(__pipe) + .regstk 1,0,0,0 + DO_CALL (SYS_ify (pipe)) + cmp.ne p6,p0=-1,r10 + ;; +(p6) st4 [in0]=r8,4 +(p6) mov ret0=0 + ;; +(p6) st4 [in0]=r9 +(p6) ret + br.cond.spnt.few __syscall_error +PSEUDO_END(__pipe) + +libc_hidden_def (__pipe) +weak_alias (__pipe, pipe) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/profil-counter.h b/ports/sysdeps/unix/sysv/linux/ia64/profil-counter.h new file mode 100644 index 0000000000..f634ccc846 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/profil-counter.h @@ -0,0 +1,31 @@ +/* Machine-dependent SIGPROF signal handler. IA-64 version. + Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* In many Unix systems signal handlers are called like this + and the interrupted PC is easily findable in the `struct sigcontext'. */ + +static void +profil_counter (int signr, siginfo_t *si, struct sigcontext *scp) +{ + unsigned long ip = scp->sc_ip & ~0X3ULL, slot = scp->sc_ip & 0x3ull; + + /* Note: Linux/ia64 encodes the slot number in bits 0 and 1. We + want to multiply the slot number by four so we can use bins of + width 4 to get accurate instruction-level profiling. */ + profil_count ((void *) (ip + 4*slot)); +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/readelflib.c b/ports/sysdeps/unix/sysv/linux/ia64/readelflib.c new file mode 100644 index 0000000000..e286c3c80e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/readelflib.c @@ -0,0 +1,59 @@ +/* Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +int process_elf32_file (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); +int process_elf64_file (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); + +/* Returns 0 if everything is ok, != 0 in case of error. */ +int +process_elf_file (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length) +{ + ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; + int ret; + + if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); + else + { + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); + /* Intel 64bit libraries are always libc.so.6+. */ + if (!ret) + *flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6; + return ret; + } +} + +#undef __ELF_NATIVE_CLASS +#undef process_elf_file +#define process_elf_file process_elf32_file +#define __ELF_NATIVE_CLASS 32 +#include "elf/readelflib.c" + +#undef __ELF_NATIVE_CLASS +#undef process_elf_file +#define process_elf_file process_elf64_file +#define __ELF_NATIVE_CLASS 64 +#include "elf/readelflib.c" diff --git a/ports/sysdeps/unix/sysv/linux/ia64/register-dump.h b/ports/sysdeps/unix/sysv/linux/ia64/register-dump.h new file mode 100644 index 0000000000..ac34a81fa2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/register-dump.h @@ -0,0 +1,181 @@ +/* Dump registers. + Copyright (C) 2004-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <string.h> +#include <sys/uio.h> +#include <_itoa.h> + +/* We will print the register dump in this format: + + GP: XXXXXXXXXXXXXXXX R2: XXXXXXXXXXXXXXXX R3: XXXXXXXXXXXXXXXX + R8: XXXXXXXXXXXXXXXX R9: XXXXXXXXXXXXXXXX R10: XXXXXXXXXXXXXXXX + R11: XXXXXXXXXXXXXXXX SP: XXXXXXXXXXXXXXXX TP: XXXXXXXXXXXXXXXX + R14: XXXXXXXXXXXXXXXX R15: XXXXXXXXXXXXXXXX R16: XXXXXXXXXXXXXXXX + R17: XXXXXXXXXXXXXXXX R18: XXXXXXXXXXXXXXXX R19: XXXXXXXXXXXXXXXX + R20: XXXXXXXXXXXXXXXX R21: XXXXXXXXXXXXXXXX R22: XXXXXXXXXXXXXXXX + R23: XXXXXXXXXXXXXXXX R24: XXXXXXXXXXXXXXXX R25: XXXXXXXXXXXXXXXX + R26: XXXXXXXXXXXXXXXX R27: XXXXXXXXXXXXXXXX R28: XXXXXXXXXXXXXXXX + R29: XXXXXXXXXXXXXXXX R30: XXXXXXXXXXXXXXXX R31: XXXXXXXXXXXXXXXX + + RP: XXXXXXXXXXXXXXXX B6: XXXXXXXXXXXXXXXX B7: XXXXXXXXXXXXXXXX + + IP: XXXXXXXXXXXXXXXX RSC: XXXXXXXXXXXXXXXX PR: XXXXXXXXXXXXXXXX + PFS: XXXXXXXXXXXXXXXX UNAT: XXXXXXXXXXXXXXXX CFM: XXXXXXXXXXXXXXXX + CCV: XXXXXXXXXXXXXXXX FPSR: XXXXXXXXXXXXXXXX + + F32: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX F33: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + F34: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX F35: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +... + F124: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX F125: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + F126: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX F127: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + */ + +static void +hexvalue (unsigned long int value, char *buf, size_t len) +{ + char *cp = _itoa_word (value, buf + len, 16, 0); + while (cp > buf) + *--cp = '0'; +} + +static void +regvalue (unsigned long int *value, char letter, int regno, char *buf) +{ + int n = regno >= 100 ? 3 : regno >= 10 ? 2 : 1; + buf[0] = ' '; + buf[1] = letter; + _itoa_word (regno, buf + 2 + n, 10, 0); + buf[2 + n] = ':'; + for (++n; n <= 4; ++n) + buf[2 + n] = ' '; + hexvalue (value[0], buf + 7, 16); + if (letter == 'F') + { + hexvalue (value[1], buf + 7 + 16, 16); + buf[7 + 32] = '\n'; + } + else + buf[7 + 16] = '\n'; +} + +static void +register_dump (int fd, struct sigcontext *ctx) +{ + char gpregs[32 - 5][8 + 16]; + char fpregs[128 - 32][8 + 32]; + char bpregs[3][8 + 16]; + char spregs[8][16]; + struct iovec iov[146]; + size_t nr = 0; + int i; + +#define ADD_STRING(str) \ + do \ + { \ + iov[nr].iov_base = (char *) str; \ + iov[nr].iov_len = strlen (str); \ + ++nr; \ + } \ + while (0) +#define ADD_MEM(str, len) \ + do \ + { \ + iov[nr].iov_base = str; \ + iov[nr].iov_len = len; \ + ++nr; \ + } \ + while (0) + + /* Generate strings of register contents. */ + for (i = 1; i < 4; ++i) + { + regvalue (&ctx->sc_gr[i], 'R', i, gpregs[i - 1]); + if (ctx->sc_nat & (1L << i)) + memcpy (gpregs[i - 1] + 7, "NaT ", 16); + } + for (i = 8; i < 32; ++i) + { + regvalue (&ctx->sc_gr[i], 'R', i, gpregs[i - 5]); + if (ctx->sc_nat & (1L << i)) + memcpy (gpregs[i - 1] + 7, "NaT ", 16); + } + memcpy (gpregs[0] + 1, "GP:", 3); + memcpy (gpregs[7] + 1, "SP: ", 4); + memcpy (gpregs[8] + 1, "TP: ", 4); + + regvalue (&ctx->sc_br[0], 'B', 0, bpregs[0]); + regvalue (&ctx->sc_br[6], 'B', 6, bpregs[1]); + regvalue (&ctx->sc_br[7], 'B', 7, bpregs[2]); + memcpy (bpregs[0] + 1, "RP:", 3); + + if (ctx->sc_flags & IA64_SC_FLAG_FPH_VALID) + for (i = 32; i < 128; ++i) + regvalue (&ctx->sc_fr[i].u.bits[0], 'F', i, fpregs[i - 32]); + + hexvalue (ctx->sc_ip, spregs[0], sizeof (spregs[0])); + hexvalue (ctx->sc_ar_rsc, spregs[1], sizeof (spregs[1])); + hexvalue (ctx->sc_pr, spregs[2], sizeof (spregs[2])); + hexvalue (ctx->sc_ar_pfs, spregs[3], sizeof (spregs[3])); + hexvalue (ctx->sc_ar_unat, spregs[4], sizeof (spregs[4])); + hexvalue (ctx->sc_cfm, spregs[5], sizeof (spregs[5])); + hexvalue (ctx->sc_ar_ccv, spregs[6], sizeof (spregs[6])); + hexvalue (ctx->sc_ar_fpsr, spregs[7], sizeof (spregs[7])); + + /* Generate the output. */ + ADD_STRING ("Register dump:\n\n"); + + for (i = 0; i < 32 - 5; ++i) + ADD_MEM (gpregs[i], sizeof (gpregs[0]) - 1 + ((i % 3) == 2)); + ADD_STRING ("\n"); + + for (i = 0; i < 3; ++i) + ADD_MEM (bpregs[i], sizeof (bpregs[0]) - 1); + + ADD_STRING ("\n\n IP: "); + ADD_MEM (spregs[0], sizeof (spregs[0])); + ADD_STRING (" RSC: "); + ADD_MEM (spregs[1], sizeof (spregs[0])); + ADD_STRING (" PR: "); + ADD_MEM (spregs[2], sizeof (spregs[0])); + ADD_STRING ("\n PFS: "); + ADD_MEM (spregs[3], sizeof (spregs[0])); + ADD_STRING (" UNAT: "); + ADD_MEM (spregs[4], sizeof (spregs[0])); + ADD_STRING (" CFM: "); + ADD_MEM (spregs[5], sizeof (spregs[0])); + ADD_STRING ("\n CCV: "); + ADD_MEM (spregs[6], sizeof (spregs[0])); + ADD_STRING (" FPSR: "); + ADD_MEM (spregs[7], sizeof (spregs[0])); + ADD_STRING ("\n"); + + if (ctx->sc_flags & IA64_SC_FLAG_FPH_VALID) + { + ADD_STRING ("\n"); + + for (i = 0; i < 128 - 32; ++i) + ADD_MEM (fpregs[i], sizeof (fpregs[0]) - 1 + (i & 1)); + } + + /* Write the stuff out. */ + writev (fd, iov, nr); +} + + +#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/rt-sysdep.S b/ports/sysdeps/unix/sysv/linux/ia64/rt-sysdep.S new file mode 100644 index 0000000000..f966bf1e59 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/rt-sysdep.S @@ -0,0 +1 @@ +#include <sysdep.S> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/setcontext.S b/ports/sysdeps/unix/sysv/linux/ia64/setcontext.S new file mode 100644 index 0000000000..14091fefa8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/setcontext.S @@ -0,0 +1,152 @@ +/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <features.h> + +#include "ucontext_i.h" + +/* __setcontext (const ucontext_t *ucp) + + Restores the machine context in UCP and thereby resumes execution + in that context. + + This implementation in intended to be used for *synchronous* context + switches only. Therefore, it does not have to restore anything + other than the PRESERVED state. */ + +ENTRY(__setcontext) + .prologue + .body + alloc r11 = ar.pfs, 1, 0, 4, 0 + + // sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL): + + mov r3 = SC_MASK + mov out0 = SIG_SETMASK + ;; + add out1 = r3, in0 + mov out2 = 0 + mov out3 = 8 // sizeof kernel sigset_t + + invala + DO_CALL(__NR_rt_sigprocmask) + add r2 = SC_NAT, r32 + + add r3 = SC_RNAT, r32 // r3 <- &sc_ar_rnat + add rPOS = SC_GR, r32 // rPOS <- &sc_gr[0] + ;; + ld8 rNAT = [r2], (SC_BSP-SC_NAT) + extr.u rPOS = rPOS, 3, 6 // get NaT bit number for r0 + ;; + ld8 rBSP = [r2], (SC_UNAT-SC_BSP) + ld8 rRNAT = [r3], (SC_FPSR-SC_RNAT) + /* + * Rotate NaT bits by rPOS positions to the left: + */ + sub rCPOS = 64, rPOS + ;; + ld8 rUNAT = [r2], (SC_PFS-SC_UNAT) + ld8 rFPSR = [r3], (SC_LC-SC_FPSR) + shl rTMP = rNAT, rPOS + ;; + ld8 rPFS = [r2], (SC_PR-SC_PFS) + ld8 rLC = [r3], (SC_BR+0*8-SC_LC) + shr.u rNAT = rNAT, rCPOS + ;; + ld8 rPR = [r2], (SC_BR+1*8-SC_PR) + ld8 rB0 = [r3], 16 + or rNAT = rNAT, rTMP + ;; + ld8 rB1 = [r2], 16 + ld8 rB2 = [r3], 16 + ;; + mov.m ar.unat = rNAT + mov.m rRSC = ar.rsc + ;; + ld8 rB3 = [r2], 16 + ld8 rB4 = [r3], (SC_GR+1*8-(SC_BR+4*8)) + ;; + ld8 rB5 = [r2], (SC_GR+4*8-(SC_BR+5*8)) + ld8.fill r1 = [r3], (5*8 - 1*8) + ;; + ld8.fill r4 = [r2], 16 + ld8.fill r5 = [r3], 16 + mov b0 = rB0 + ;; + ld8.fill r6 = [r2], 48 + ld8.fill r7 = [r3], (SC_FR+2*16-(SC_GR+7*8)) + ;; + ld8.fill sp = [r2], (SC_FR+3*16-(SC_GR+12*8)) + mov.m ar.fpsr = rFPSR + mov.i ar.pfs = rPFS + ;; + ldf.fill f3 = [r2], 16 + ldf.fill f2 = [r3], 48 + mov b1 = rB1 + ;; + ldf.fill f4 = [r2], (16*16-4*16) + ldf.fill f5 = [r3], (17*16-5*16) + mov b2 = rB2 + ;; + ldf.fill f16 = [r2], 32 + ldf.fill f17 = [r3], 32 + mov b3 = rB3 + ;; + ldf.fill f18 = [r2], 32 + ldf.fill f19 = [r3], 32 + mov b4 = rB4 + ;; + ldf.fill f20 = [r2], 32 + ldf.fill f21 = [r3], 32 + mov b5 = rB5 + ;; + ldf.fill f22 = [r2], 32 + ldf.fill f23 = [r3], 32 + mov r8 = 0 + ;; + ldf.fill f24 = [r2], 32 + ldf.fill f25 = [r3], 32 + mov r9 = 0 + ;; + ldf.fill f26 = [r2], 32 + ldf.fill f27 = [r3], 32 + dep rTMP = 0, rRSC, 16, 14 // clear ar.rsc.loadrs + ;; + ldf.fill f28 = [r2], 32 + ldf.fill f29 = [r3], 32 + and rTMP = ~0x3, rTMP // clear ar.rsc.mode + ;; + ldf.fill f30 = [r2], 32 + ldf.fill f31 = [r3], 32 + mov pr = rPR, -1 + ;; + mov.m ar.rsc = rTMP // put RSE into enforced lazy mode + ;; + loadrs // drop dirty partition + ;; + mov.m ar.bspstore = rBSP + mov.m ar.unat = rUNAT + mov.i ar.lc = rLC + ;; + mov.m ar.rnat = rRNAT + mov.m ar.rsc = rRSC + ret +END(__setcontext) + +weak_alias (__setcontext, setcontext) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S b/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S new file mode 100644 index 0000000000..95e8cc8093 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/setjmp.S @@ -0,0 +1,198 @@ +/* Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 + Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. + + The layout of the jmp_buf is as follows. This is subject to change + and user-code should never depend on the particular layout of + jmp_buf! + + + offset: description: + ------- ------------ + 0x000 stack pointer (r12) ; unchangeable (see _JMPBUF_UNWINDS) + 0x008 r1 (gp) + 0x010 caller's unat + 0x018 fpsr + 0x020 r4 + 0x028 r5 + 0x030 r6 + 0x038 r7 + 0x040 rp (b0) + 0x048 b1 + 0x050 b2 + 0x058 b3 + 0x060 b4 + 0x068 b5 + 0x070 ar.pfs + 0x078 ar.lc + 0x080 pr + 0x088 ar.bsp ; unchangeable (see __longjmp.S) + 0x090 ar.unat + 0x098 &__jmp_buf ; address of the jmpbuf (needed to locate NaT bits in unat) + 0x0a0 f2 + 0x0b0 f3 + 0x0c0 f4 + 0x0d0 f5 + 0x0e0 f16 + 0x0f0 f17 + 0x100 f18 + 0x110 f19 + 0x120 f20 + 0x130 f21 + 0x130 f22 + 0x140 f23 + 0x150 f24 + 0x160 f25 + 0x170 f26 + 0x180 f27 + 0x190 f28 + 0x1a0 f29 + 0x1b0 f30 + 0x1c0 f31 */ + +#include <sysdep.h> +#include <features.h> + + /* The following two entry points are the traditional entry points: */ + +LEAF(setjmp) + alloc r8=ar.pfs,2,0,0,0 + mov in1=1 + br.cond.sptk.many _GI___sigsetjmp +END(setjmp) + +LEAF(_setjmp) + alloc r8=ar.pfs,2,0,0,0 + mov in1=0 + br.cond.sptk.many _GI___sigsetjmp +END(_setjmp) +libc_hidden_def (_setjmp) + + /* __sigsetjmp(__jmp_buf buf, int savemask) */ + +ENTRY(__sigsetjmp) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) + alloc loc1=ar.pfs,2,5,2,0 + .save ar.unat, loc2 + mov loc2=ar.unat + ;; + mov r17=ar.fpsr + mov r2=in0 + add r3=8,in0 + ;; +.mem.offset 8,0; st8.spill.nta [r2]=sp,16 // r12 (sp) +.mem.offset 0,0; st8.spill.nta [r3]=gp,16 // r1 (gp) + ;; + st8.nta [r2]=loc2,16 // save caller's unat + st8.nta [r3]=r17,16 // save fpsr + add r8=0xa0,in0 + ;; +.mem.offset 8,0; st8.spill.nta [r2]=r4,16 // r4 +.mem.offset 0,0; st8.spill.nta [r3]=r5,16 // r5 + add r9=0xb0,in0 + ;; + stf.spill.nta [r8]=f2,32 + stf.spill.nta [r9]=f3,32 + mov loc0=rp + .body + ;; + stf.spill.nta [r8]=f4,32 + stf.spill.nta [r9]=f5,32 + mov r17=b1 + ;; + stf.spill.nta [r8]=f16,32 + stf.spill.nta [r9]=f17,32 + mov r18=b2 + ;; + stf.spill.nta [r8]=f18,32 + stf.spill.nta [r9]=f19,32 + mov r19=b3 + ;; + stf.spill.nta [r8]=f20,32 + stf.spill.nta [r9]=f21,32 + mov r20=b4 + ;; + stf.spill.nta [r8]=f22,32 + stf.spill.nta [r9]=f23,32 + mov r21=b5 + ;; + stf.spill.nta [r8]=f24,32 + stf.spill.nta [r9]=f25,32 + mov r22=ar.lc + ;; + stf.spill.nta [r8]=f26,32 + stf.spill.nta [r9]=f27,32 + mov r24=pr + ;; + stf.spill.nta [r8]=f28,32 + stf.spill.nta [r9]=f29,32 +#ifdef PTR_MANGLE + mov loc3=loc0 + ;; + PTR_MANGLE (loc3, loc4) +#else + ;; +#endif + stf.spill.nta [r8]=f30 + stf.spill.nta [r9]=f31 + +.mem.offset 8,0; st8.spill.nta [r2]=r6,16 // r6 +.mem.offset 0,0; st8.spill.nta [r3]=r7,16 // r7 + ;; + mov r23=ar.bsp + mov r25=ar.unat + mov out0=in0 + +#ifdef PTR_MANGLE + st8.nta [r2]=loc3,16 // b0 +#else + st8.nta [r2]=loc0,16 // b0 +#endif + st8.nta [r3]=r17,16 // b1 + mov out1=in1 + ;; + st8.nta [r2]=r18,16 // b2 + st8.nta [r3]=r19,16 // b3 + ;; + st8.nta [r2]=r20,16 // b4 + st8.nta [r3]=r21,16 // b5 + ;; + st8.nta [r2]=loc1,16 // ar.pfs + st8.nta [r3]=r22,16 // ar.lc + ;; + st8.nta [r2]=r24,16 // pr + st8.nta [r3]=r23,16 // ar.bsp + ;; + st8.nta [r2]=r25 // ar.unat + st8.nta [r3]=in0 // &__jmp_buf +#if defined NOT_IN_libc && defined IS_IN_rtld + /* In ld.so we never save the signal mask. */ + ;; +#else + br.call.dpnt.few rp=__sigjmp_save +#endif +.ret0: // force a new bundle ::q + mov.m ar.unat=loc2 // restore caller's unat + mov rp=loc0 + mov ar.pfs=loc1 + mov r8=0 + ret +END(__sigsetjmp) +strong_alias(__sigsetjmp, _GI___sigsetjmp) + +weak_extern(_setjmp) +weak_extern(setjmp) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c b/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c new file mode 100644 index 0000000000..bb0d53d54c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1997-2000,2002,2003,2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Linux/IA64 specific sigaction + Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Linux/ia64 only has rt signals, thus we do not even want to try falling + back to the old style signals as the default Linux handler does. */ + +#include <errno.h> +#include <signal.h> +#include <string.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +/* The variable is shared between all wrappers around signal handling + functions which have RT equivalents. This is the definition. */ + + +/* If ACT is not NULL, change the action for SIG to *ACT. + If OACT is not NULL, put the old action for SIG in *OACT. */ +int +__libc_sigaction (sig, act, oact) + int sig; + const struct sigaction *act; + struct sigaction *oact; +{ + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + return INLINE_SYSCALL (rt_sigaction, 4, sig, + CHECK_1_NULL_OK (act), CHECK_1_NULL_OK (oact), _NSIG / 8); +} +libc_hidden_def (__libc_sigaction) + +#ifdef WRAPPER_INCLUDE +# include WRAPPER_INCLUDE +#endif + +#ifndef LIBC_SIGACTION +weak_alias (__libc_sigaction, __sigaction) +libc_hidden_def (__sigaction) +weak_alias (__libc_sigaction, sigaction) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym b/ports/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym new file mode 100644 index 0000000000..943e68a667 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym @@ -0,0 +1,16 @@ +#include <stddef.h> +#include <sys/ucontext.h> + +-- +SC_NAT offsetof (struct sigcontext, sc_nat) +SC_BSP offsetof (struct sigcontext, sc_ar_bsp) +SC_RNAT offsetof (struct sigcontext, sc_ar_rnat) +SC_UNAT offsetof (struct sigcontext, sc_ar_unat) +SC_FPSR offsetof (struct sigcontext, sc_ar_fpsr) +SC_PFS offsetof (struct sigcontext, sc_ar_pfs) +SC_LC offsetof (struct sigcontext, sc_ar_lc) +SC_PR offsetof (struct sigcontext, sc_pr) +SC_BR offsetof (struct sigcontext, sc_br) +SC_GR offsetof (struct sigcontext, sc_gr) +SC_FR offsetof (struct sigcontext, sc_fr) +SC_MASK offsetof (struct sigcontext, sc_mask) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h new file mode 100644 index 0000000000..6771fa24b4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#define SIGCONTEXT siginfo_t *_si, struct sigcontext * +#define SIGCONTEXT_EXTRA_ARGS _si, +#define GET_PC(ctx) ((ctx)->sc_ip) +#define GET_FRAME(ctx) ((void *) 0) +#define GET_STACK(ctx) ((void *) 0) + +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c b/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c new file mode 100644 index 0000000000..8d02643a15 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c @@ -0,0 +1,38 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Linux/ia64 only has rt signals, thus we do not even want to try falling + back to the old style signals as the default Linux handler does. */ + +#include <errno.h> +#include <signal.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +/* Change the set of blocked signals to SET, + wait until a signal arrives, and restore the set of blocked signals. */ +int +sigpending (set) + sigset_t *set; +{ + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8); +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c new file mode 100644 index 0000000000..8776c2000a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Linux/IA64 specific sigprocmask + Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Linux/ia64 only has rt signals, thus we do not even want to try falling + back to the old style signals as the default Linux handler does. */ + +#include <errno.h> +#include <signal.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +/* Get and/or change the set of blocked signals. */ +int +__sigprocmask (how, set, oset) + int how; + const sigset_t *set; + sigset_t *oset; +{ + + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set), + CHECK_SIGSET_NULL_OK (oset), _NSIG / 8); +} +weak_alias (__sigprocmask, sigprocmask) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/swapcontext.c b/ports/sysdeps/unix/sysv/linux/ia64/swapcontext.c new file mode 100644 index 0000000000..20a20ac2ba --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/swapcontext.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <ucontext.h> + +struct rv + { + long retval; + long first_return; + }; + +extern struct rv __getcontext (ucontext_t *__ucp) __THROW; +extern int __setcontext (const ucontext_t *__ucp) __THROW; + +int +__swapcontext (ucontext_t *oucp, const ucontext_t *ucp) +{ + struct rv rv = __getcontext (oucp); + if (rv.first_return) + __setcontext (ucp); + return 0; +} + +weak_alias (__swapcontext, swapcontext) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/io.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/io.h new file mode 100644 index 0000000000..d29e7e95c2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/io.h @@ -0,0 +1,67 @@ +/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IO_H +#define _SYS_IO_H 1 + +#include <features.h> + +__BEGIN_DECLS + +/* If TURN_ON is TRUE, request for permission to do direct i/o on the + port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O + permission off for that range. This call requires root privileges. + + Portability note: not all Linux platforms support this call. Most + platforms based on the PC I/O architecture probably will, however. + E.g., Linux/Alpha for Alpha PCs supports this. */ +extern int ioperm (unsigned long int __from, unsigned long int __num, + int __turn_on); + +/* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to + access any I/O port is granted. This call requires root + privileges. */ +extern int iopl (int __level); + +extern unsigned int _inb (unsigned long int __port); +extern unsigned int _inb (unsigned long int __port); +extern unsigned int _inw (unsigned long int __port); +extern unsigned int _inl (unsigned long int __port); +extern void _outb (unsigned char __val, unsigned long int __port); +extern void _outw (unsigned short __val, unsigned long int __port); +extern void _outl (unsigned int __val, unsigned long int __port); + +#define inb _inb +#define inw _inw +#define inl _inl +#define outb _outb +#define outw _outw +#define outl _outl + +/* Access PCI space protected from machine checks. */ +extern int pciconfig_read (unsigned long int __bus, unsigned long int __dfn, + unsigned long int __off, unsigned long int __len, + unsigned char *__buf); + +extern int pciconfig_write (unsigned long int __bus, unsigned long int __dfn, + unsigned long int __off, unsigned long int __len, + unsigned char *__buf); + +__END_DECLS + +#endif /* _SYS_IO_H */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/procfs.h new file mode 100644 index 0000000000..51c3f7ecb2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/procfs.h @@ -0,0 +1,129 @@ +/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somehow modelled after the file of the same name on SysVr4 + systems. It provides a definition of the core file format for ELF + used on Linux. */ + +#include <features.h> +#include <signal.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/ucontext.h> +#include <sys/user.h> + +__BEGIN_DECLS + +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + +/* We really need just 72 but let's leave some headroom... */ +#define ELF_NGREG 128 +/* f0 and f1 could be omitted, but so what... */ +#define ELF_NFPREG 128 + +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef struct ia64_fpreg elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +typedef elf_greg_t greg_t; +typedef elf_gregset_t gregset_t; +typedef elf_fpregset_t fpregset_t; +#define NGREG ELF_NGREG + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + gdb doesn't really use excluded. Fields present but not used are + marked with "XXX". */ +struct elf_prstatus + { +#if 0 + long int pr_flags; /* XXX Process flags. */ + short int pr_why; /* XXX Reason for process halt. */ + short int pr_what; /* XXX More detailed reason. */ +#endif + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ +#if 0 + struct sigaltstack pr_altstack; /* Alternate stack info. */ + struct sigaction pr_action; /* Signal action for current sig. */ +#endif + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ +#if 0 + long int pr_instr; /* Current instruction. */ +#endif + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned int pr_uid; + unsigned int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef gregset_t prgregset_t; +typedef fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore habe only ine PID type. */ +typedef __pid_t lwpid_t; + + +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h new file mode 100644 index 0000000000..ae94464b20 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h @@ -0,0 +1,191 @@ +/* `ptrace' debugger support interface. Linux/ia64 version. + Copyright (C) 2001, 2006, 2007, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PTRACE_H +#define _SYS_PTRACE_H 1 + +#include <features.h> +#include <sys/ucontext.h> + +__BEGIN_DECLS + +/* Type of the REQUEST argument to `ptrace.' */ +enum __ptrace_request +{ + /* Indicate that the process making this request should be traced. + All signals received by this process can be intercepted by its + parent, and its parent can use the other `ptrace' requests. */ + PTRACE_TRACEME = 0, +#define PT_TRACE_ME PTRACE_TRACEME + + /* Return the word in the process's text space at address ADDR. */ + PTRACE_PEEKTEXT = 1, +#define PT_READ_I PTRACE_PEEKTEXT + + /* Return the word in the process's data space at address ADDR. */ + PTRACE_PEEKDATA = 2, +#define PT_READ_D PTRACE_PEEKDATA + + /* Return the word in the process's user area at offset ADDR. */ + PTRACE_PEEKUSER = 3, +#define PT_READ_U PTRACE_PEEKUSER + + /* Write the word DATA into the process's text space at address ADDR. */ + PTRACE_POKETEXT = 4, +#define PT_WRITE_I PTRACE_POKETEXT + + /* Write the word DATA into the process's data space at address ADDR. */ + PTRACE_POKEDATA = 5, +#define PT_WRITE_D PTRACE_POKEDATA + + /* Write the word DATA into the process's user area at offset ADDR. */ + PTRACE_POKEUSER = 6, +#define PT_WRITE_U PTRACE_POKEUSER + + /* Continue the process. */ + PTRACE_CONT = 7, +#define PT_CONTINUE PTRACE_CONT + + /* Kill the process. */ + PTRACE_KILL = 8, +#define PT_KILL PTRACE_KILL + + /* Single step the process. + This is not supported on all machines. */ + PTRACE_SINGLESTEP = 9, +#define PT_STEP PTRACE_SINGLESTEP + + /* Execute process until next taken branch. */ + PTRACE_SINGLEBLOCK = 12, +#define PT_STEPBLOCK PTRACE_SINGLEBLOCK + + /* Attach to a process that is already running. */ + PTRACE_ATTACH = 16, +#define PT_ATTACH PTRACE_ATTACH + + /* Detach from a process attached to with PTRACE_ATTACH. */ + PTRACE_DETACH = 17, +#define PT_DETACH PTRACE_DETACH + + /* Get all registers (pt_all_user_regs) in one shot */ + PTRACE_GETREGS = 18, +#define PT_GETREGS PTRACE_GETREGS + + /* Set all registers (pt_all_user_regs) in one shot */ + PTRACE_SETREGS = 19, +#define PT_SETREGS PTRACE_SETREGS + + /* Continue and stop at the next (return from) syscall. */ + PTRACE_SYSCALL = 24, +#define PT_SYSCALL PTRACE_SYSCALL + + /* Set ptrace filter options. */ + PTRACE_SETOPTIONS = 0x4200, +#define PT_SETOPTIONS PTRACE_SETOPTIONS + + /* Get last ptrace message. */ + PTRACE_GETEVENTMSG = 0x4201, +#define PT_GETEVENTMSG PTRACE_GETEVENTMSG + + /* Get siginfo for process. */ + PTRACE_GETSIGINFO = 0x4202, +#define PT_GETSIGINFO PTRACE_GETSIGINFO + + /* Set new siginfo for process. */ + PTRACE_SETSIGINFO = 0x4203, +#define PT_SETSIGINFO PTRACE_SETSIGINFO + + /* Get register content. */ + PTRACE_GETREGSET = 0x4204, +#define PTRACE_GETREGSET PTRACE_GETREGSET + + /* Set register content. */ + PTRACE_SETREGSET = 0x4205, +#define PTRACE_SETREGSET PTRACE_SETREGSET + + /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect + signal or group stop state. */ + PTRACE_SEIZE = 0x4206, +#define PTRACE_SEIZE PTRACE_SEIZE + + /* Trap seized tracee. */ + PTRACE_INTERRUPT = 0x4207, +#define PTRACE_INTERRUPT PTRACE_INTERRUPT + + /* Wait for next group event. */ + PTRACE_LISTEN = 0x4208 +}; + + +/* Flag for PTRACE_LISTEN. */ +enum __ptrace_flags +{ + PTRACE_SEIZE_DEVEL = 0x80000000 +}; + +/* pt_all_user_regs is used for PTRACE_GETREGS/PTRACE_SETREGS. */ +struct pt_all_user_regs + { + unsigned long nat; + unsigned long cr_iip; + unsigned long cfm; + unsigned long cr_ipsr; + unsigned long pr; + + unsigned long gr[32]; + unsigned long br[8]; + unsigned long ar[128]; + struct ia64_fpreg fr[128]; + }; + +/* Options set using PTRACE_SETOPTIONS. */ +enum __ptrace_setoptions { + PTRACE_O_TRACESYSGOOD = 0x00000001, + PTRACE_O_TRACEFORK = 0x00000002, + PTRACE_O_TRACEVFORK = 0x00000004, + PTRACE_O_TRACECLONE = 0x00000008, + PTRACE_O_TRACEEXEC = 0x00000010, + PTRACE_O_TRACEVFORKDONE = 0x00000020, + PTRACE_O_TRACEEXIT = 0x00000040, + PTRACE_O_MASK = 0x0000007f +}; + +/* Wait extended result codes for the above trace options. */ +enum __ptrace_eventcodes { + PTRACE_EVENT_FORK = 1, + PTRACE_EVENT_VFORK = 2, + PTRACE_EVENT_CLONE = 3, + PTRACE_EVENT_EXEC = 4, + PTRACE_EVENT_VFORK_DONE = 5, + PTRACE_EVENT_EXIT = 6 +}; + +/* Perform process tracing functions. REQUEST is one of the values + above, and determines the action to be taken. + For all requests except PTRACE_TRACEME, PID specifies the process to be + traced. + + PID and the other arguments described above for the various requests should + appear (those that are used for the particular request) as: + pid_t PID, void *ADDR, int DATA, void *ADDR2 + after REQUEST. */ +extern long int ptrace (enum __ptrace_request __request, ...) __THROW; + +__END_DECLS + +#endif /* _SYS_PTRACE_H */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/rse.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/rse.h new file mode 100644 index 0000000000..62fcaba036 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/rse.h @@ -0,0 +1,77 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _ia64_rse_h +#define _ia64_rse_h + +#include <features.h> + +/* Register stack engine related helper functions. This file may be + used in applications, so be careful about the name-space and give + some consideration to non-GNU C compilers (though __inline is + fine). */ + +static __inline unsigned long +ia64_rse_slot_num (unsigned long *addr) +{ + return (((unsigned long) addr) >> 3) & 0x3f; +} + +/* Return TRUE if ADDR is the address of an RNAT slot. */ + +static __inline unsigned long +ia64_rse_is_rnat_slot (unsigned long *addr) +{ + return ia64_rse_slot_num (addr) == 0x3f; +} + +/* Returns the address of the RNAT slot that covers the slot at + address SLOT_ADDR. */ + +static __inline unsigned long * +ia64_rse_rnat_addr (unsigned long *slot_addr) +{ + return (unsigned long *) ((unsigned long) slot_addr | (0x3f << 3)); +} + +/* Calcuate the number of registers in the dirty partition starting at + BSPSTORE with a size of DIRTY bytes. This isn't simply DIRTY + divided by eight because the 64th slot is used to store ar.rnat. */ + +static __inline unsigned long +ia64_rse_num_regs (unsigned long *bspstore, unsigned long *bsp) +{ + unsigned long slots = (bsp - bspstore); + + return slots - (ia64_rse_slot_num(bspstore) + slots)/0x40; +} + +/* The inverse of the above: given bspstore and the number of + registers, calculate ar.bsp. */ + +static __inline unsigned long * +ia64_rse_skip_regs (unsigned long *addr, long num_regs) +{ + long delta = ia64_rse_slot_num(addr) + num_regs; + + if (num_regs < 0) + delta -= 0x3e; + return addr + num_regs + delta/0x3f; +} + +#endif /* _ia64_rse_h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h new file mode 100644 index 0000000000..e1fa8c609d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h @@ -0,0 +1,65 @@ +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +#include <bits/sigcontext.h> + +/* + * These are here mostly for backwards compatibility with older Unices. + * IA-64 Linux does not distinguish between "struct sigcontext" and + * "ucontext_t" as all the necessary info is inside the former. + */ + +typedef struct sigcontext mcontext_t; + +#if __GNUC_PREREQ (3, 5) +# define _SC_GR0_OFFSET \ + __builtin_offsetof (struct sigcontext, sc_gr[0]) +#elif defined __GNUC__ +# define _SC_GR0_OFFSET \ + (((char *) &((struct sigcontext *) 0)->sc_gr[0]) - (char *) 0) +#else +# define _SC_GR0_OFFSET 0xc8 /* pray that this is correct... */ +#endif + +typedef struct ucontext + { + union + { + mcontext_t _mc; + struct + { + unsigned long _pad[_SC_GR0_OFFSET/8]; + struct ucontext *_link; /* this should overlay sc_gr[0] */ + } + _uc; + } + _u; + } +ucontext_t; + +#define uc_mcontext _u._mc +#define uc_sigmask _u._mc.sc_mask +#define uc_stack _u._mc.sc_stack +#define uc_link _u._uc._link + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h new file mode 100644 index 0000000000..b998f63f02 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +#include <features.h> +#include <sys/types.h> + +/* This definition comes directly from the kernel headers. If + anything changes in them this header has to be changed, too. */ + + +/* The definition in the kernel has the comment "XXX fix me". */ +#define EF_SIZE 3072 + + +struct user +{ + unsigned long int regs[EF_SIZE / 8 + 32]; /* Integer and fp regs. */ + size_t u_tsize; /* Text size (pages). */ + size_t u_dsize; /* Data size (pages). */ + size_t u_ssize; /* Stack size (pages). */ + unsigned long int start_code; /* Text starting address. */ + unsigned long int start_data; /* Data starting address. */ + unsigned long int start_stack; /* Stack starting address. */ + long int signal; /* Signal causing core dump. */ + struct regs *u_ar0; /* Help gdb find registers. */ + unsigned long int magic; /* Identifies a core file. */ + char u_comm[32]; /* User command name. */ +}; + +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_DATA_START_ADDR (u.start_data) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + +#endif /* sys/user.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/syscall.S b/ports/sysdeps/unix/sysv/linux/ia64/syscall.S new file mode 100644 index 0000000000..0308a3c09a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/syscall.S @@ -0,0 +1,29 @@ +/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jes Sorensen <Jes.Sorensen@cern.ch>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +ENTRY(syscall) + alloc r2=ar.pfs,1,0,8,0 + mov r15=r32 /* syscall number */ + break __BREAK_SYSCALL + ;; + cmp.ne p6,p0=-1,r10 /* r10 = -1 on error */ +(p6) ret + br.cond.spnt.few __syscall_error +PSEUDO_END(syscall) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/syscalls.list b/ports/sysdeps/unix/sysv/linux/ia64/syscalls.list new file mode 100644 index 0000000000..8642bac152 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -0,0 +1,50 @@ +# File name Caller Syscall name # args Strong name Weak names + +umount2 - umount 2 __umount2 umount2 + +getpriority - getpriority i:ii __getpriority getpriority + +# semaphore and shm system calls +msgctl - msgctl i:iip __msgctl msgctl +msgget - msgget i:ii __msgget msgget +msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv +msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +shmat - shmat i:ipi __shmat shmat +shmctl - shmctl i:iip __shmctl shmctl +shmdt - shmdt i:s __shmdt shmdt +shmget - shmget i:iii __shmget shmget +semop - semop i:ipi __semop semop +semtimedop - semtimedop i:ipip semtimedop +semget - semget i:iii __semget semget +semctl - semctl i:iiii __semctl semctl + +# proper socket implementations: +accept - accept Ci:iBN __libc_accept __accept accept +bind - bind i:ipi __bind bind +connect - connect Ci:ipi __libc_connect __connect connect +getpeername - getpeername i:ipp __getpeername getpeername +getsockname - getsockname i:ipp __getsockname getsockname +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt +listen - listen i:ii __listen listen +recv - recv Ci:ibni __libc_recv __recv recv +recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom +recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg +send - send Ci:ibni __libc_send __send send +sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg +sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt +shutdown - shutdown i:ii __shutdown shutdown +socket - socket i:iii __socket socket +socketpair - socketpair i:iiif __socketpair socketpair + +# DIG-compliant access to PCI configuration space: +pciconfig_read EXTRA pciconfig_read 5 pciconfig_read +pciconfig_write EXTRA pciconfig_write 5 pciconfig_write + +ptrace - ptrace 4 __ptrace ptrace + + +# System calls with wrappers. + +# IA-64 specific +getunwind EXTRA getunwind i:pi getunwind diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sysconf.c b/ports/sysdeps/unix/sysv/linux/ia64/sysconf.c new file mode 100644 index 0000000000..3cfb0a9cc5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sysconf.c @@ -0,0 +1,30 @@ +/* Get file-specific information about a file. Linux/ia64 version. + Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <stdbool.h> +#include <stdlib.h> +#include <unistd.h> + + +#include "has_cpuclock.c" +#define HAS_CPUCLOCK(name) (has_cpuclock () ? _POSIX_VERSION : -1) + + +/* Now the generic Linux version. */ +#include <sysdeps/unix/sysv/linux/sysconf.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sysdep.S b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.S new file mode 100644 index 0000000000..8a6d8fe0e4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.S @@ -0,0 +1,58 @@ +/* Copyright (C) 1999-2001, 2003, 2004, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <features.h> +#include <tls.h> + +ENTRY(__syscall_error) +#if RTLD_PRIVATE_ERRNO + /* + * Note that the gp has to be set properly for this to work. + * As long as all syscalls are in the same load unit + * (executable or shared library) as this routine, we should + * be fine. Otherwise, we would have to first load the global + * pointer register from __gp. + */ + addl r2=@gprel(rtld_errno),gp + ;; + st4 [r2]=r8 + mov r8=-1 +#else +# ifndef NOT_IN_libc +# define SYSCALL_ERROR_ERRNO __libc_errno +# else +# define SYSCALL_ERROR_ERRNO errno +# endif + addl r2=@ltoff(@tprel(SYSCALL_ERROR_ERRNO)), gp;; + ld8 r2=[r2] + mov r3=r8;; + mov r8=-1 + add r2=r2,r13;; + st4 [r2]=r3 +#endif + ret // ret is #define'd in syscall.h! +END(__syscall_error) + +ENTRY(__ia64_syscall) + mov r15=r37 /* syscall number */ + break __BREAK_SYSCALL + cmp.eq p6,p0=-1,r10 /* r10 = -1 on error */ +(p6) br.cond.spnt.few __syscall_error + ret +PSEUDO_END(__ia64_syscall) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h new file mode 100644 index 0000000000..5d02429e05 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -0,0 +1,383 @@ +/* Copyright (C) 1999-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999. + Based on code originally written by David Mosberger-Tang + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_IA64_SYSDEP_H +#define _LINUX_IA64_SYSDEP_H 1 + +#include <sysdeps/unix/sysdep.h> +#include <sysdeps/ia64/sysdep.h> +#include <dl-sysdep.h> +#include <tls.h> + +/* In order to get __set_errno() definition in INLINE_SYSCALL. */ +#ifndef __ASSEMBLER__ +#include <errno.h> +#endif + +/* As of GAS v2.4.90.0.7, including a ".align" directive inside a + function will cause bad unwind info to be emitted (GAS doesn't know + how to account for the padding introduced by the .align directive). + Turning on this macro will work around this bug by introducing the + necessary padding explicitly. */ +#define GAS_ALIGN_BREAKS_UNWIND_INFO + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +/* This is a kludge to make syscalls.list find these under the names + pread and pwrite, since some kernel headers define those names + and some define the *64 names for the same system calls. */ +#if !defined __NR_pread && defined __NR_pread64 +# define __NR_pread __NR_pread64 +#endif +#if !defined __NR_pwrite && defined __NR_pwrite64 +# define __NR_pwrite __NR_pwrite64 +#endif + +/* This is to help the old kernel headers where __NR_semtimedop is not + available. */ +#ifndef __NR_semtimedop +# define __NR_semtimedop 1247 +#endif + +#if defined USE_DL_SYSINFO \ + && (!defined NOT_IN_libc \ + || defined IS_IN_libpthread || defined IS_IN_librt) +# define IA64_USE_NEW_STUB +#else +# undef IA64_USE_NEW_STUB +#endif + +#ifdef __ASSEMBLER__ + +#undef CALL_MCOUNT +#ifdef PROF +# define CALL_MCOUNT \ + .data; \ +1: data8 0; /* XXX fixme: use .xdata8 once labels work */ \ + .previous; \ + .prologue; \ + .save ar.pfs, r40; \ + alloc out0 = ar.pfs, 8, 0, 4, 0; \ + mov out1 = gp; \ + .save rp, out2; \ + mov out2 = rp; \ + .body; \ + ;; \ + addl out3 = @ltoff(1b), gp; \ + br.call.sptk.many rp = _mcount \ + ;; +#else +# define CALL_MCOUNT /* Do nothing. */ +#endif + +/* Linux uses a negative return value to indicate syscall errors, unlike + most Unices, which use the condition codes' carry flag. + + Since version 2.1 the return value of a system call might be negative + even if the call succeeded. E.g., the `lseek' system call might return + a large offset. Therefore we must not anymore test for < 0, but test + for a real error by making sure the value in %d0 is a real error + number. Linus said he will make sure the no syscall returns a value + in -1 .. -4095 as a valid result so we can savely test with -4095. */ + +/* We don't want the label for the error handler to be visible in the symbol + table when we define it here. */ +#define SYSCALL_ERROR_LABEL __syscall_error + +#undef PSEUDO +#define PSEUDO(name, syscall_name, args) \ + ENTRY(name) \ + DO_CALL (SYS_ify(syscall_name)); \ + cmp.eq p6,p0=-1,r10; \ +(p6) br.cond.spnt.few __syscall_error; + +#define DO_CALL_VIA_BREAK(num) \ + mov r15=num; \ + break __BREAK_SYSCALL + +#ifdef IA64_USE_NEW_STUB +# ifdef SHARED +# define DO_CALL(num) \ + .prologue; \ + adds r2 = SYSINFO_OFFSET, r13;; \ + ld8 r2 = [r2]; \ + .save ar.pfs, r11; \ + mov r11 = ar.pfs;; \ + .body; \ + mov r15 = num; \ + mov b7 = r2; \ + br.call.sptk.many b6 = b7;; \ + .restore sp; \ + mov ar.pfs = r11; \ + .prologue; \ + .body +# else /* !SHARED */ +# define DO_CALL(num) \ + .prologue; \ + mov r15 = num; \ + movl r2 = _dl_sysinfo;; \ + ld8 r2 = [r2]; \ + .save ar.pfs, r11; \ + mov r11 = ar.pfs;; \ + .body; \ + mov b7 = r2; \ + br.call.sptk.many b6 = b7;; \ + .restore sp; \ + mov ar.pfs = r11; \ + .prologue; \ + .body +# endif +#else +# define DO_CALL(num) DO_CALL_VIA_BREAK(num) +#endif + +#undef PSEUDO_END +#define PSEUDO_END(name) .endp C_SYMBOL_NAME(name); + +#undef PSEUDO_NOERRNO +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + ENTRY(name) \ + DO_CALL (SYS_ify(syscall_name)); + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) .endp C_SYMBOL_NAME(name); + +#undef PSEUDO_ERRVAL +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + ENTRY(name) \ + DO_CALL (SYS_ify(syscall_name)); \ + cmp.eq p6,p0=-1,r10; \ +(p6) mov r10=r8; + + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) .endp C_SYMBOL_NAME(name); + +#undef END +#define END(name) \ + .size C_SYMBOL_NAME(name), . - C_SYMBOL_NAME(name) ; \ + .endp C_SYMBOL_NAME(name) + +#define ret br.ret.sptk.few b0 +#define ret_NOERRNO ret +#define ret_ERRVAL ret + +#else /* not __ASSEMBLER__ */ + +#define BREAK_INSN_1(num) "break " #num ";;\n\t" +#define BREAK_INSN(num) BREAK_INSN_1(num) + +/* On IA-64 we have stacked registers for passing arguments. The + "out" registers end up being the called function's "in" + registers. + + Also, since we have plenty of registers we have two return values + from a syscall. r10 is set to -1 on error, whilst r8 contains the + (non-negative) errno on error or the return value on success. + */ + +#ifdef IA64_USE_NEW_STUB + +# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \ + LOAD_ARGS_##nr (args) \ + register long _r8 __asm ("r8"); \ + register long _r10 __asm ("r10"); \ + register long _r15 __asm ("r15") = name; \ + register void *_b7 __asm ("b7") = ((tcbhead_t *)__thread_self)->__private;\ + long _retval; \ + LOAD_REGS_##nr \ + /* \ + * Don't specify any unwind info here. We mark ar.pfs as \ + * clobbered. This will force the compiler to save ar.pfs \ + * somewhere and emit appropriate unwind info for that save. \ + */ \ + __asm __volatile ("br.call.sptk.many b6=%0;;\n" \ + : "=b"(_b7), "=r" (_r8), "=r" (_r10), "=r" (_r15) \ + ASM_OUTARGS_##nr \ + : "0" (_b7), "3" (_r15) ASM_ARGS_##nr \ + : "memory", "ar.pfs" ASM_CLOBBERS_##nr); \ + _retval = _r8; + +#else /* !IA64_USE_NEW_STUB */ + +# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \ + LOAD_ARGS_##nr (args) \ + register long _r8 asm ("r8"); \ + register long _r10 asm ("r10"); \ + register long _r15 asm ("r15") = name; \ + long _retval; \ + LOAD_REGS_##nr \ + __asm __volatile (BREAK_INSN (__BREAK_SYSCALL) \ + : "=r" (_r8), "=r" (_r10), "=r" (_r15) \ + ASM_OUTARGS_##nr \ + : "2" (_r15) ASM_ARGS_##nr \ + : "memory" ASM_CLOBBERS_##nr); \ + _retval = _r8; + +#endif /* !IA64_USE_NEW_STUB */ + +#define DO_INLINE_SYSCALL(name, nr, args...) \ + DO_INLINE_SYSCALL_NCS (__NR_##name, nr, ##args) + +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ \ + DO_INLINE_SYSCALL_NCS (__NR_##name, nr, args) \ + if (_r10 == -1) \ + { \ + __set_errno (_retval); \ + _retval = -1; \ + } \ + _retval; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) long int err + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ \ + DO_INLINE_SYSCALL_NCS (name, nr, args) \ + err = _r10; \ + _retval; }) +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) (err == -1) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (val) + +#define LOAD_ARGS_0() +#define LOAD_REGS_0 +#define LOAD_ARGS_1(a1) \ + long _arg1 = (long) (a1); \ + LOAD_ARGS_0 () +#define LOAD_REGS_1 \ + register long _out0 asm ("out0") = _arg1; \ + LOAD_REGS_0 +#define LOAD_ARGS_2(a1, a2) \ + long _arg2 = (long) (a2); \ + LOAD_ARGS_1 (a1) +#define LOAD_REGS_2 \ + register long _out1 asm ("out1") = _arg2; \ + LOAD_REGS_1 +#define LOAD_ARGS_3(a1, a2, a3) \ + long _arg3 = (long) (a3); \ + LOAD_ARGS_2 (a1, a2) +#define LOAD_REGS_3 \ + register long _out2 asm ("out2") = _arg3; \ + LOAD_REGS_2 +#define LOAD_ARGS_4(a1, a2, a3, a4) \ + long _arg4 = (long) (a4); \ + LOAD_ARGS_3 (a1, a2, a3) +#define LOAD_REGS_4 \ + register long _out3 asm ("out3") = _arg4; \ + LOAD_REGS_3 +#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \ + long _arg5 = (long) (a5); \ + LOAD_ARGS_4 (a1, a2, a3, a4) +#define LOAD_REGS_5 \ + register long _out4 asm ("out4") = _arg5; \ + LOAD_REGS_4 +#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \ + long _arg6 = (long) (a6); \ + LOAD_ARGS_5 (a1, a2, a3, a4, a5) +#define LOAD_REGS_6 \ + register long _out5 asm ("out5") = _arg6; \ + LOAD_REGS_5 + +#define ASM_OUTARGS_0 +#define ASM_OUTARGS_1 ASM_OUTARGS_0, "=r" (_out0) +#define ASM_OUTARGS_2 ASM_OUTARGS_1, "=r" (_out1) +#define ASM_OUTARGS_3 ASM_OUTARGS_2, "=r" (_out2) +#define ASM_OUTARGS_4 ASM_OUTARGS_3, "=r" (_out3) +#define ASM_OUTARGS_5 ASM_OUTARGS_4, "=r" (_out4) +#define ASM_OUTARGS_6 ASM_OUTARGS_5, "=r" (_out5) + +#ifdef IA64_USE_NEW_STUB +#define ASM_ARGS_0 +#define ASM_ARGS_1 ASM_ARGS_0, "4" (_out0) +#define ASM_ARGS_2 ASM_ARGS_1, "5" (_out1) +#define ASM_ARGS_3 ASM_ARGS_2, "6" (_out2) +#define ASM_ARGS_4 ASM_ARGS_3, "7" (_out3) +#define ASM_ARGS_5 ASM_ARGS_4, "8" (_out4) +#define ASM_ARGS_6 ASM_ARGS_5, "9" (_out5) +#else +#define ASM_ARGS_0 +#define ASM_ARGS_1 ASM_ARGS_0, "3" (_out0) +#define ASM_ARGS_2 ASM_ARGS_1, "4" (_out1) +#define ASM_ARGS_3 ASM_ARGS_2, "5" (_out2) +#define ASM_ARGS_4 ASM_ARGS_3, "6" (_out3) +#define ASM_ARGS_5 ASM_ARGS_4, "7" (_out4) +#define ASM_ARGS_6 ASM_ARGS_5, "8" (_out5) +#endif + +#define ASM_CLOBBERS_0 ASM_CLOBBERS_1, "out0" +#define ASM_CLOBBERS_1 ASM_CLOBBERS_2, "out1" +#define ASM_CLOBBERS_2 ASM_CLOBBERS_3, "out2" +#define ASM_CLOBBERS_3 ASM_CLOBBERS_4, "out3" +#define ASM_CLOBBERS_4 ASM_CLOBBERS_5, "out4" +#define ASM_CLOBBERS_5 ASM_CLOBBERS_6, "out5" +#define ASM_CLOBBERS_6_COMMON , "out6", "out7", \ + /* Non-stacked integer registers, minus r8, r10, r15. */ \ + "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", \ + "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", \ + "r28", "r29", "r30", "r31", \ + /* Predicate registers. */ \ + "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \ + /* Non-rotating fp registers. */ \ + "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + /* Branch registers. */ \ + "b6" + +#ifdef IA64_USE_NEW_STUB +# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON +#else +# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7" +#endif + +#endif /* not __ASSEMBLER__ */ + +/* Pointer mangling support. */ +#if defined NOT_IN_libc && defined IS_IN_rtld +/* We cannot use the thread descriptor because in ld.so we use setjmp + earlier than the descriptor is initialized. */ +#else +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(reg, tmpreg) \ + add tmpreg=-16,r13 \ + ;; \ + ld8 tmpreg=[tmpreg] \ + ;; \ + xor reg=reg, tmpreg +# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) +# else +# define PTR_MANGLE(var) \ + (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) +# define PTR_DEMANGLE(var) PTR_MANGLE (var) +# endif +#endif + +#endif /* linux/ia64/sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/system.c b/ports/sysdeps/unix/sysv/linux/ia64/system.c new file mode 100644 index 0000000000..f02a99e9eb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/system.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <kernel-features.h> + +/* We have to and actually can handle cancelable system(). The big + problem: we have to kill the child process if necessary. To do + this a cleanup handler has to be registered and is has to be able + to find the PID of the child. The main problem is to reliable have + the PID when needed. It is not necessary for the parent thread to + return. It might still be in the kernel when the cancellation + request comes. Therefore we have to use the clone() calls ability + to have the kernel write the PID into the user-level variable. */ +#ifdef __ASSUME_CLONE_THREAD_FLAGS +# define FORK() \ + INLINE_SYSCALL (clone2, 6, CLONE_PARENT_SETTID | SIGCHLD, NULL, 0, \ + &pid, NULL, NULL) +#endif + +#include <sysdeps/unix/sysv/linux/system.c> diff --git a/ports/sysdeps/unix/sysv/linux/ia64/ucontext_i.h b/ports/sysdeps/unix/sysv/linux/ia64/ucontext_i.h new file mode 100644 index 0000000000..dd46a4cfd4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/ucontext_i.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Constants shared between setcontext() and getcontext(). Don't + install this header file. */ + +#define SIG_BLOCK 0 +#define SIG_UNBLOCK 1 +#define SIG_SETMASK 2 + +#include <sigcontext-offsets.h> + +#define rTMP r16 +#define rPOS r16 +#define rCPOS r17 +#define rNAT r18 + +#define rB5 r18 +#define rB4 r19 +#define rB3 r20 +#define rB2 r21 +#define rB1 r22 +#define rB0 r23 +#define rRSC r24 +#define rBSP r25 +#define rRNAT r26 +#define rUNAT r27 +#define rFPSR r28 +#define rPFS r29 +#define rLC r30 +#define rPR r31 diff --git a/ports/sysdeps/unix/sysv/linux/ia64/umount.c b/ports/sysdeps/unix/sysv/linux/ia64/umount.c new file mode 100644 index 0000000000..ae0c03659f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/umount.c @@ -0,0 +1,30 @@ +/* umount system call for Linux/ia64. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/mount.h> +#include <errno.h> + +#include <sysdep.h> +#include <bp-checks.h> + +/* Unmount a filesystem. */ +int +umount (const char *special_file) +{ + return INLINE_SYSCALL (umount, 2, CHECK_STRING (special_file), 0); +} diff --git a/ports/sysdeps/unix/sysv/linux/ia64/unwind-dw2-fde.c b/ports/sysdeps/unix/sysv/linux/ia64/unwind-dw2-fde.c new file mode 100644 index 0000000000..15d12abfce --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/unwind-dw2-fde.c @@ -0,0 +1 @@ +/* Linux/ia64 does not need unwind table registry. */ diff --git a/ports/sysdeps/unix/sysv/linux/ia64/vfork.S b/ports/sysdeps/unix/sysv/linux/ia64/vfork.S new file mode 100644 index 0000000000..16c763dc4b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/vfork.S @@ -0,0 +1,43 @@ +/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + + +#include <sysdep.h> +#define _SIGNAL_H +#include <bits/signum.h> + +/* The following are defined in linux/sched.h, which unfortunately */ +/* is not safe for inclusion in an assembly file. */ +#define CLONE_VM 0x00000100 /* set if VM shared between processes */ +#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ + +/* pid_t vfork(void); */ +/* Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */ + +ENTRY(__vfork) + alloc r2=ar.pfs,0,0,2,0 + mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD + mov out1=0 /* Standard sp value. */ + ;; + DO_CALL_VIA_BREAK (SYS_ify (clone)) + cmp.eq p6,p0=-1,r10 +(p6) br.cond.spnt.few __syscall_error + ret +PSEUDO_END(__vfork) +libc_hidden_def (__vfork) + +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/ia64/wordexp.c b/ports/sysdeps/unix/sysv/linux/ia64/wordexp.c new file mode 100644 index 0000000000..1ddece8c3a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/ia64/wordexp.c @@ -0,0 +1,59 @@ +/* Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <shlib-compat.h> + +/* For Linux/Alpha we have to make the wordexp symbols versioned. */ +#define wordexp(words, pwordexp, flags) \ + __new_wordexp (words, pwordexp, flags) + +#include <posix/wordexp.c> + +versioned_symbol (libc, __new_wordexp, wordexp, GLIBC_2_2_2); + + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2_2) +/* The old, incorrect wordexp_t definition. */ +typedef struct + { + int we_wordc; /* Count of words matched. */ + char **we_wordv; /* List of expanded words. */ + int we_offs; /* Slots to reserve in `we_wordv'. */ + } old_wordexp_t; + + +int +attribute_compat_text_section +__old_wordexp (const char *words, old_wordexp_t *pwordexp, int flags) +{ + wordexp_t we; + int result; + + we.we_wordc = pwordexp->we_wordc; + we.we_wordv = pwordexp->we_wordv; + we.we_offs = pwordexp->we_offs; + + result = __new_wordexp (words, &we, flags); + + pwordexp->we_wordc = we.we_wordc; + pwordexp->we_wordv = we.we_wordv; + pwordexp->we_offs = we.we_offs; + + return result; +} +compat_symbol (libc, __old_wordexp, wordexp, GLIBC_2_1); +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/Makefile b/ports/sysdeps/unix/sysv/linux/m68k/Makefile new file mode 100644 index 0000000000..97d95847ff --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/Makefile @@ -0,0 +1,23 @@ +# Linux/m68k uses Motorola asm syntax and the ELF format. + +m68k-syntax-flag = -DMOTOROLA_SYNTAX + +ifeq ($(subdir),csu) +sysdep_routines += m68k-helpers +endif + +ifeq ($(subdir),misc) +sysdep_routines += mremap +sysdep_headers += sys/reg.h +endif + +ifeq ($(subdir),elf) +sysdep_routines += dl-vdso libc-m68k-vdso +sysdep-rtld-routines += m68k-vdso +sysdep-others += lddlibc4 +install-bin += lddlibc4 +endif + +ifeq ($(subdir),resource) +sysdep_routines += oldgetrlimit64 +endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/Versions b/ports/sysdeps/unix/sysv/linux/m68k/Versions new file mode 100644 index 0000000000..8a941f8371 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/Versions @@ -0,0 +1,49 @@ +libc { + GLIBC_2.0 { + # Exception handling support functions from libgcc + __register_frame; __register_frame_table; __deregister_frame; + __frame_state_for; __register_frame_info_table; + + # c* + cacheflush; + } + GLIBC_2.2 { + # functions used in other libraries + __xstat64; __fxstat64; __lxstat64; + + # a* + alphasort64; + + # g* + glob64; + + # New rlimit interface + getrlimit; setrlimit; getrlimit64; + + # r* + readdir64; readdir64_r; + + # s* + scandir64; + + # v* + versionsort64; + } + GLIBC_2.11 { + fallocate64; + } + GLIBC_2.12 { + __m68k_read_tp; + } + GLIBC_PRIVATE { + __vdso_atomic_cmpxchg_32; __vdso_atomic_barrier; + } +} + +ld { + GLIBC_PRIVATE { + __rtld___vdso_read_tp; + __rtld___vdso_atomic_cmpxchg_32; + __rtld___vdso_atomic_barrier; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c b/ports/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c new file mode 100644 index 0000000000..d0d0e410d1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdio.h> +#include <signal.h> +#include <sysdep.h> +#define __longjmp ____longjmp_chk +#define CHECK_SP(sp) \ + do { \ + register unsigned long this_sp asm ("sp"); \ + if ((unsigned long) (sp) < this_sp) \ + { \ + struct sigaltstack oss; \ + INTERNAL_SYSCALL_DECL (err); \ + int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \ + if (!INTERNAL_SYSCALL_ERROR_P (result, err) \ + && ((oss.ss_flags & SS_ONSTACK) == 0 \ + || ((unsigned long) oss.ss_sp + oss.ss_size \ + - (unsigned long) (sp)) < oss.ss_size)) \ + __fortify_fail ("longjmp causes uninitialized stack frame"); \ + } \ + } while (0) + +#include <__longjmp.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/alphasort64.c b/ports/sysdeps/unix/sysv/linux/m68k/alphasort64.c new file mode 100644 index 0000000000..0b5ae47d2f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/alphasort64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/alphasort64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/a.out.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/a.out.h new file mode 100644 index 0000000000..0fb52c3815 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/a.out.h @@ -0,0 +1,3 @@ +#ifndef __A_OUT_GNU_H__ +# error "Never use <bits/a.out.h> directly; include <a.out.h> instead." +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h new file mode 100644 index 0000000000..946cfa2ca7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h @@ -0,0 +1,320 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 2000, 2004, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + +#include <sys/types.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on a few file systems. */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_CREAT 0100 /* not fcntl */ +#define O_EXCL 0200 /* not fcntl */ +#define O_NOCTTY 0400 /* not fcntl */ +#define O_TRUNC 01000 /* not fcntl */ +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_NDELAY O_NONBLOCK +#define O_SYNC 04010000 +#define O_FSYNC O_SYNC +#define O_ASYNC 020000 + +#ifdef __USE_XOPEN2K8 +# define O_DIRECTORY 040000 /* Must be a directory. */ +# define O_NOFOLLOW 0100000 /* Do not follow links. */ +# define O_CLOEXEC 02000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 0200000 /* Direct disk access. */ +# define O_NOATIME 01000000 /* Do not set atime. */ +# define O_PATH 010000000 /* Resolve pathname but do not open file. */ +#endif + +/* For now Linux has synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 010000 /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +#ifdef __USE_LARGEFILE64 +# define O_LARGEFILE 0400000 +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 5 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#endif +#define F_GETLK64 12 /* Get record locking info. */ +#define F_SETLK64 13 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 14 /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ +# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 0 /* Read lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ + +/* For old implementation of bsd flock(). */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation. */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h new file mode 100644 index 0000000000..00659a485f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h @@ -0,0 +1,60 @@ +/* Resolve function pointers to VDSO functions. + Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +#ifndef _M68K_VDSO_H +#define _M68K_VDSO_H + +#ifdef SHARED + +# ifdef IS_IN_rtld +# define M68K_VDSO_SYMBOL(name) __rtld_##name +# define STR_M68K_VDSO_SYMBOL(name) "__rtld_" #name +# else +# define M68K_VDSO_SYMBOL(name) name +# define STR_M68K_VDSO_SYMBOL(name) #name +# endif + +# ifndef __ASSEMBLER__ + +/* We define __rtld_* copies for rtld. + We need them visible in libc to initialize. */ +# if defined IS_IN_rtld || !defined NOT_IN_libc +extern void *__rtld___vdso_read_tp; +extern void *__rtld___vdso_atomic_cmpxchg_32; +extern void *__rtld___vdso_atomic_barrier; + +/* These stubs are meant to be invoked only from the assembly. */ +extern void __vdso_read_tp_stub (void); +extern void __vdso_atomic_cmpxchg_32_stub (void); +extern void __vdso_atomic_barrier_stub (void); +# endif /* IS_IN_rtld || !NOT_IN_libc */ + +/* RTLD should only use its own copies. */ +# ifndef IS_IN_rtld +extern void *__vdso_read_tp; +extern void *__vdso_atomic_cmpxchg_32; +extern void *__vdso_atomic_barrier; +# endif /* !IS_IN_rtld */ + +# endif /* !__ASSEMBLER__ */ + +#endif /* SHARED */ + +#endif /* _M68K_VDSO_H */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h new file mode 100644 index 0000000000..2d7769e7cd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h @@ -0,0 +1,112 @@ +/* Definitions for POSIX memory map interface. Linux/m68k version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x02000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ +# define MAP_STACK 0x20000 /* Allocation is for a stack. */ +# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 4 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ +# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, + overrides the coredump filter bits. */ +# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h new file mode 100644 index 0000000000..7b68bf9a41 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/poll.h @@ -0,0 +1,49 @@ +/* Copyright (C) 1997, 2001, 2008, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_POLL_H +# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." +#endif + +/* Event types that can be polled for. These bits may be set in `events' + to indicate the interesting event types; they will appear in `revents' + to indicate the status of the file descriptor. */ +#define POLLIN 0x001 /* There is data to read. */ +#define POLLPRI 0x002 /* There is urgent data to read. */ +#define POLLOUT 0x004 /* Writing now will not block. */ + +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 +/* These values are defined in XPG4.2. */ +# define POLLRDNORM 0x040 /* Normal data may be read. */ +# define POLLRDBAND 0x080 /* Priority data may be read. */ +# define POLLWRNORM POLLOUT /* Writing now will not block. */ +# define POLLWRBAND 0x100 /* Priority data may be written. */ +#endif + +#ifdef __USE_GNU +/* These are extensions for Linux. */ +# define POLLMSG 0x400 +# define POLLREMOVE 0x1000 +# define POLLRDHUP 0x2000 +#endif + +/* Event types always implicitly polled for. These bits need not be set in + `events', but they will appear in `revents' to indicate the status of + the file descriptor. */ +#define POLLERR 0x008 /* Error condition. */ +#define POLLHUP 0x010 /* Hung up. */ +#define POLLNVAL 0x020 /* Invalid polling request. */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h new file mode 100644 index 0000000000..ce0809f960 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/stat.h @@ -0,0 +1,173 @@ +/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002,2008,2009,2010 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_KERNEL 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ + + +struct stat + { + __dev_t st_dev; /* Device. */ + unsigned short int __pad1; +#ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +#else + __ino_t __st_ino; /* 32bit file serial number. */ +#endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; +#ifndef __USE_FILE_OFFSET64 + __off_t st_size; /* Size of file, in bytes. */ +#else + __off64_t st_size; /* Size of file, in bytes. */ +#endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + +#ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +#else + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +#endif +#if defined __USE_MISC || defined __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif +#ifndef __USE_FILE_OFFSET64 + unsigned long int __unused4; + unsigned long int __unused5; +#else + __ino64_t st_ino; /* File serial number. */ +#endif + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; /* Device. */ + unsigned short int __pad1; + + __ino_t __st_ino; /* 32bit file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# if defined __USE_MISC || defined __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __ino64_t st_ino; /* File serial number. */ + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/brk.c b/ports/sysdeps/unix/sysv/linux/m68k/brk.c new file mode 100644 index 0000000000..595e40c0b4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/brk.c @@ -0,0 +1,47 @@ +/* brk system call for Linux/m68k. + Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sysdep.h> + +void *__curbrk = 0; + +/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt + to work around different old braindamage in the old Linux/x86 ELF + dynamic linker. Sigh. */ +weak_alias (__curbrk, ___brk_addr) + +int +__brk (void *addr) +{ + void *newbrk; + + INTERNAL_SYSCALL_DECL (err); + newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + __curbrk = newbrk; + + if (newbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/clone.S b/ports/sysdeps/unix/sysv/linux/m68k/clone.S new file mode 100644 index 0000000000..ccc7755faa --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/clone.S @@ -0,0 +1,134 @@ +/* Copyright (C) 1996,97,98,2002,2010,2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab (schwab@issan.informatik.uni-dortmund.de) + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after its all over. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> +#ifdef RESET_PID +#include <tls.h> +#endif + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 + +/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, + void *parent_tidptr, void *tls, void *child_tidptr) */ + + .text +ENTRY (__clone) + + /* Sanity check arguments. */ + movel #-EINVAL, %d0 + movel 4(%sp), %a0 /* no NULL function pointers */ + tstl %a0 + jeq SYSCALL_ERROR_LABEL + movel 8(%sp), %a1 /* no NULL stack pointers */ + tstl %a1 + jeq SYSCALL_ERROR_LABEL + + /* Allocate space and copy the argument onto the new stack. */ + movel 16(%sp), -(%a1) + + /* Do the system call */ + movel 12+0(%sp), %d1 /* get flags */ + movel %d3, -(%a1) /* save %d3 and get parent_tidptr */ + movel %d3, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d3, 0) + movel 20+4(%sp), %d3 + movel %d4, -(%a1) /* save %d4 and get child_tidptr */ + movel %d4, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d4, 0) + movel 28+8(%sp), %d4 + movel %d5, -(%a1) /* save %d5 and get tls */ + movel %d5, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d5, 0) + movel 24+12(%sp), %d5 + /* save %d2 and get stack pointer */ +#ifdef __mcoldfire__ + movel %d2, -(%a1) + movel %d2, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d2, 0) + movel %a1, %d2 +#else + exg %d2, %a1 /* save %d2 and get stack pointer */ + cfi_register (%d2, %a1) +#endif + movel #SYS_ify (clone), %d0 + + /* End FDE now, because in the child the unwind info will be + wrong. */ + cfi_endproc + + trap #0 +#ifdef __mcoldfire__ + movel (%sp)+, %d2 +#else + exg %d2, %a1 /* restore %d2 */ +#endif + movel (%sp)+, %d5 /* restore %d5, %d4 and %d3 */ + movel (%sp)+, %d4 + movel (%sp)+, %d3 + + tstl %d0 + jmi SYSCALL_ERROR_LABEL + jeq thread_start + + rts + +thread_start: + cfi_startproc + cfi_undefined (pc) /* Mark end of stack */ + subl %fp, %fp /* terminate the stack frame */ +#ifdef RESET_PID + /* Check and see if we need to reset the PID. */ + movel %d1, %a1 + andl #CLONE_THREAD, %d1 + jne donepid + movel %a1, %d1 + movel #-1, %d0 + andl #CLONE_VM, %d1 + jne gotpid + movel #SYS_ify (getpid), %d0 + trap #0 +gotpid: + movel %a0, -(%sp) + movel %d0, -(%sp) + bsrl __m68k_read_tp@PLTPC + movel (%sp)+, %d0 + movel %d0, PID_OFFSET(%a0) + movel %d0, TID_OFFSET(%a0) + movel (%sp)+, %a0 +donepid: +#endif + jsr (%a0) + movel %d0, %d1 + movel #SYS_ify (exit), %d0 + trap #0 + cfi_endproc + + cfi_startproc +PSEUDO_END (__clone) + +weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h new file mode 100644 index 0000000000..b088a7247c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h @@ -0,0 +1,104 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_ATOMIC_H +#define _BITS_ATOMIC_H 1 + +#include <stdint.h> +#include <sysdep.h> +#include <bits/m68k-vdso.h> + +/* Coldfire has no atomic compare-and-exchange operation, but the + kernel provides userspace atomicity operations. Use them. */ + +typedef int32_t atomic32_t; +typedef uint32_t uatomic32_t; +typedef int_fast32_t atomic_fast32_t; +typedef uint_fast32_t uatomic_fast32_t; + +typedef intptr_t atomicptr_t; +typedef uintptr_t uatomicptr_t; +typedef intmax_t atomic_max_t; +typedef uintmax_t uatomic_max_t; + +/* The only basic operation needed is compare and exchange. */ +/* For ColdFire we'll have to trap into the kernel mode anyway, + so trap from the library rather then from the kernel wrapper. */ +#ifdef SHARED +# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ + ({ \ + /* Use temporary variables to workaround call-clobberness of */ \ + /* the registers. */ \ + __typeof (mem) _mem = mem; \ + __typeof (oldval) _oldval = oldval; \ + __typeof (newval) _newval = newval; \ + register __typeof (mem) _a0 asm ("a0") = _mem; \ + register __typeof (oldval) _d0 asm ("d0") = _oldval; \ + register __typeof (newval) _d1 asm ("d1") = _newval; \ + void *tmp; \ + \ + asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %2\n\t" \ + "lea (-6, %%pc, %2), %2\n\t" \ + "movel " STR_M68K_VDSO_SYMBOL (__vdso_atomic_cmpxchg_32) \ + "@GOT(%2), %2\n\t" \ + "movel (%2), %2\n\t" \ + "jsr (%2)\n\t" \ + : "+d" (_d0), "+m" (*_a0), "=&a" (tmp) \ + : "a" (_a0), "d" (_d1)); \ + _d0; \ + }) +#else +# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ + ({ \ + /* Use temporary variables to workaround call-clobberness of */ \ + /* the registers. */ \ + __typeof (mem) _mem = mem; \ + __typeof (oldval) _oldval = oldval; \ + __typeof (newval) _newval = newval; \ + register __typeof (oldval) _d0 asm ("d0") \ + = SYS_ify (atomic_cmpxchg_32); \ + register __typeof (mem) _a0 asm ("a0") = _mem; \ + register __typeof (oldval) _d2 asm ("d2") = _oldval; \ + register __typeof (newval) _d1 asm ("d1") = _newval; \ + \ + asm ("trap #0" \ + : "+d" (_d0), "+m" (*_a0) \ + : "a" (_a0), "d" (_d2), "d" (_d1)); \ + _d0; \ + }) +#endif + +#ifdef SHARED +# define atomic_full_barrier() \ + ({ \ + void *tmp; \ + \ + asm ("movel #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t" \ + "lea (-6, %pc, %0), %0\n\t" \ + "movel " STR_M68K_VDSO_SYMBOL (__vdso_atomic_barrier) \ + "@GOT(%0), %0\n\t" \ + "movel (%0), %0\n\t" \ + "jsr (%0)\n\t" \ + : "=&a" (tmp)); \ + }) +#else +# define atomic_full_barrier() \ + (INTERNAL_SYSCALL (atomic_barrier, , 0), (void) 0) +#endif + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/ld.abilist new file mode 100644 index 0000000000..8eac745dd1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/ld.abilist @@ -0,0 +1,12 @@ +GLIBC_2.4 + GLIBC_2.4 A + __libc_memalign F + __libc_stack_end D 0x4 + __stack_chk_guard D 0x4 + __tls_get_addr F + _dl_mcount F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..9c795c6e96 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.4 + GLIBC_2.4 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libanl.abilist new file mode 100644 index 0000000000..e10833ed25 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.4 + GLIBC_2.4 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist new file mode 100644 index 0000000000..ca31ead95f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist @@ -0,0 +1,2113 @@ +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + __m68k_read_tp F + _sys_errlist D 0x21c + _sys_nerr D 0x4 + ntp_gettimex F + recvmmsg F + sys_errlist D 0x21c + sys_nerr D 0x4 +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.4 + GLIBC_2.4 A + _Exit F + _IO_2_1_stderr_ D 0x98 + _IO_2_1_stdin_ D 0x98 + _IO_2_1_stdout_ D 0x98 + _IO_adjust_column F + _IO_adjust_wcolumn F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_getline_info F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_seekwmark F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sputbackwc F + _IO_sscanf F + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_sungetwc F + _IO_switch_to_get_mode F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_unsave_wmarkers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + ___brk_addr D 0x4 + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __asprintf F + __assert F + __assert_fail F + __assert_perror_fail F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __chk_fail F + __clone F + __close F + __cmsg_nxthdr F + __confstr_chk F + __connect F + __ctype_b_loc F + __ctype_get_mb_cur_max F + __ctype_tolower_loc F + __ctype_toupper_loc F + __curbrk D 0x4 + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __daylight D 0x4 + __dcgettext F + __default_morecore F + __dgettext F + __divdi3 F + __dup2 F + __duplocale F + __endmntent F + __environ D 0x4 + __errno_location F + __fbufsize F + __fcntl F + __ffs F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finite F + __finitef F + __finitel F + __flbf F + __fork F + __fpending F + __fprintf_chk F + __fpu_control D 0x4 + __fpurge F + __freadable F + __freading F + __free_hook D 0x4 + __freelocale F + __fsetlocking F + __fwprintf_chk F + __fwritable F + __fwriting F + __fxstat F + __fxstat64 F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdelim F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getmntent_r F + __getpagesize F + __getpgid F + __getpid F + __gets_chk F + __gettimeofday F + __getwd_chk F + __gmtime_r F + __h_errno_location F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isctype F + __isdigit_l F + __isgraph_l F + __isinf F + __isinff F + __isinfl F + __islower_l F + __isnan F + __isnanf F + __isnanl F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __ivaliduser F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_calloc F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_free F + __libc_freeres F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_sa_len F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __lxstat64 F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __memalign_hook D 0x4 + __memcpy_chk F + __memmove_chk F + __mempcpy F + __mempcpy_chk F + __mempcpy_small F + __memset_chk F + __moddi3 F + __monstartup F + __morecore D 0x4 + __nanosleep F + __newlocale F + __nl_langinfo_l F + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hostname_digits_dots F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __open64 F + __overflow F + __pipe F + __poll F + __pread64 F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __ptsname_r_chk F + __pwrite64 F + __rawmemchr F + __rcmd_errstr D 0x4 + __read F + __read_chk F + __readlink_chk F + __realloc_hook D 0x4 + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __register_atfork F + __res_init F + __res_nclose F + __res_ninit F + __res_randomid F + __res_state F + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setmntent F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __signbit F + __signbitf F + __sigpause F + __sigsetjmp F + __sigsuspend F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __statfs F + __stpcpy F + __stpcpy_chk F + __stpcpy_small F + __stpncpy F + __stpncpy_chk F + __strcasecmp F + __strcasecmp_l F + __strcasestr F + __strcat_chk F + __strcoll_l F + __strcpy_chk F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strdup F + __strerror_r F + __strfmon_l F + __strftime_l F + __strncasecmp_l F + __strncat_chk F + __strncpy_chk F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_internal F + __strtod_l F + __strtof_internal F + __strtof_l F + __strtok_r F + __strtok_r_1c F + __strtol_internal F + __strtol_l F + __strtold_internal F + __strtold_l F + __strtoll_internal F + __strtoll_l F + __strtoul_internal F + __strtoul_l F + __strtoull_internal F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __swprintf_chk F + __sysconf F + __sysctl F + __syslog_chk F + __sysv_signal F + __timezone D 0x4 + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __ttyname_r_chk F + __tzname D 0x8 + __udivdi3 F + __uflow F + __umoddi3 F + __underflow F + __uselocale F + __vfork F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wait F + __waitpid F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscasecmp_l F + __wcscat_chk F + __wcscoll_l F + __wcscpy_chk F + __wcsftime_l F + __wcsncasecmp_l F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstod_internal F + __wcstod_l F + __wcstof_internal F + __wcstof_l F + __wcstol_internal F + __wcstol_l F + __wcstold_internal F + __wcstold_l F + __wcstoll_internal F + __wcstoll_l F + __wcstombs_chk F + __wcstoul_internal F + __wcstoul_l F + __wcstoull_internal F + __wcstoull_l F + __wcsxfrm_l F + __wctomb_chk F + __wctrans_l F + __wctype_l F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __woverflow F + __wprintf_chk F + __write F + __wuflow F + __wunderflow F + __xmknod F + __xmknodat F + __xpg_basename F + __xpg_sigpause F + __xpg_strerror_r F + __xstat F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _environ D 0x4 + _exit F + _flushlbf F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x1fe + _res_hconf D 0x30 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x210 + _sys_nerr D 0x4 + _sys_siglist D 0x104 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + addseverity F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atof F + atoi F + atol F + atoll F + authdes_create F + authdes_getucred F + authdes_pk_create F + authnone_create F + authunix_create F + authunix_create_default F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + basename F + bcmp F + bcopy F + bdflush F + bind F + bind_textdomain_codeset F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + capget F + capset F + catclose F + catgets F + catopen F + cbc_crypt F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clntunix_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + creat64 F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + dcngettext F + delete_module F + des_setparity F + dgettext F + difftime F + dirfd F + dirname F + div F + dl_iterate_phdr F + dngettext F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + duplocale F + dysize F + eaccess F + ecb_crypt F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + endutxent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + epoll_create F + epoll_ctl F + epoll_wait F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + faccessat F + fattach F + fchdir F + fchflags F + fchmod F + fchmodat F + fchown F + fchownat F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdetach F + fdopen F + fdopendir F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + ffsl F + ffsll F + fgetc F + fgetc_unlocked F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpos64 F + fgetpwent F + fgetpwent_r F + fgets F + fgets_unlocked F + fgetspent F + fgetspent_r F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fgetxattr F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flistxattr F + flock F + flockfile F + fmemopen F + fmtmsg F + fnmatch F + fopen F + fopen64 F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread F + fread_unlocked F + free F + freeaddrinfo F + freeifaddrs F + freelocale F + fremovexattr F + freopen F + freopen64 F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fsetxattr F + fstatfs F + fstatfs64 F + fstatvfs F + fstatvfs64 F + fsync F + ftell F + ftello F + ftello64 F + ftime F + ftok F + ftruncate F + ftruncate64 F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + ftw64 F + funlockfile F + futimes F + futimesat F + fwide F + fwprintf F + fwrite F + fwrite_unlocked F + fwscanf F + gai_strerror F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcontext F + getcwd F + getdate F + getdate_err D 0x4 + getdate_r F + getdelim F + getdirentries F + getdirentries64 F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgrouplist F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getifaddrs F + getipv4sourcefilter F + getitimer F + getline F + getloadavg F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getmsg F + getnameinfo F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getnetname F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getpmsg F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpt F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrlimit64 F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getsourcefilter F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getw F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + getwd F + getxattr F + glob F + glob64 F + glob_pattern_p F + globfree F + globfree64 F + gmtime F + gmtime_r F + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + host2netname F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + index F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + insque F + ioctl F + iruserok F + iruserok_af F + isalnum F + isalnum_l F + isalpha F + isalpha_l F + isascii F + isastream F + isatty F + isblank F + isblank_l F + iscntrl F + iscntrl_l F + isctype F + isdigit F + isdigit_l F + isfdtype F + isgraph F + isgraph_l F + isinf F + isinff F + isinfl F + islower F + islower_l F + isnan F + isnanf F + isnanl F + isprint F + isprint_l F + ispunct F + ispunct_l F + isspace F + isspace_l F + isupper F + isupper_l F + iswalnum F + iswalnum_l F + iswalpha F + iswalpha_l F + iswblank F + iswblank_l F + iswcntrl F + iswcntrl_l F + iswctype F + iswctype_l F + iswdigit F + iswdigit_l F + iswgraph F + iswgraph_l F + iswlower F + iswlower_l F + iswprint F + iswprint_l F + iswpunct F + iswpunct_l F + iswspace F + iswspace_l F + iswupper F + iswupper_l F + iswxdigit F + iswxdigit_l F + isxdigit F + isxdigit_l F + jrand48 F + jrand48_r F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + kill F + killpg F + klogctl F + l64a F + labs F + lchmod F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + lgetxattr F + link F + linkat F + listen F + listxattr F + llabs F + lldiv F + llistxattr F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + lockf64 F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lremovexattr F + lsearch F + lseek F + lseek64 F + lsetxattr F + lutimes F + madvise F + makecontext F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcheck_check_all F + mcheck_pedantic F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + mempcpy F + memrchr F + memset F + mincore F + mkdir F + mkdirat F + mkdtemp F + mkfifo F + mkfifoat F + mkstemp F + mkstemp64 F + mktemp F + mktime F + mlock F + mlockall F + mmap F + mmap64 F + modf F + modff F + modfl F + moncontrol F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + netname2host F + netname2user F + newlocale F + nfsservctl F + nftw F + nftw64 F + ngettext F + nice F + nl_langinfo F + nl_langinfo_l F + nrand48 F + nrand48_r F + ntohl F + ntohs F + ntp_adjtime F + ntp_gettime F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open64 F + open_memstream F + open_wmemstream F + openat F + openat64 F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + passwd2des F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pivot_root F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_openpt F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + ppoll F + prctl F + pread F + pread64 F + printf F + printf_size F + printf_size_info F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + ptsname F + ptsname_r F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putgrent F + putmsg F + putpmsg F + putpwent F + puts F + putspent F + pututline F + pututxline F + putw F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pvalloc F + pwrite F + pwrite64 F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rawmemchr F + rcmd F + rcmd_af F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readahead F + readdir F + readdir64 F + readdir64_r F + readdir_r F + readlink F + readlinkat F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remap_file_pages F + remove F + removexattr F + remque F + rename F + renameat F + revoke F + rewind F + rewinddir F + rexec F + rexec_af F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + rresvport_af F + rtime F + ruserok F + ruserok_af F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scandir64 F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getaffinity F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setaffinity F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + semtimedop F + send F + sendfile F + sendfile64 F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setipv4sourcefilter F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrlimit64 F + setrpcent F + setservent F + setsid F + setsockopt F + setsourcefilter F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setutxent F + setvbuf F + setxattr F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + sighold F + sigignore F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigqueue F + sigrelse F + sigreturn F + sigset F + sigsetmask F + sigstack F + sigsuspend F + sigtimedwait F + sigvec F + sigwait F + sigwaitinfo F + sleep F + snprintf F + sockatmark F + socket F + socketpair F + sprintf F + sprofil F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + statfs64 F + statvfs F + statvfs64 F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcasecmp_l F + strcasestr F + strcat F + strchr F + strchrnul F + strcmp F + strcoll F + strcoll_l F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfmon_l F + strfry F + strftime F + strftime_l F + strlen F + strncasecmp F + strncasecmp_l F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strptime_l F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtod_l F + strtof F + strtof_l F + strtoimax F + strtok F + strtok_r F + strtol F + strtol_l F + strtold F + strtold_l F + strtoll F + strtoll_l F + strtoq F + strtoul F + strtoul_l F + strtoull F + strtoull_l F + strtoumax F + strtouq F + strverscmp F + strxfrm F + strxfrm_l F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreq_common F + svc_getreq_poll F + svc_getreqset F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + svcunix_create F + svcunixfd_create F + swab F + swapcontext F + swapoff F + swapon F + swprintf F + swscanf F + symlink F + symlinkat F + sync F + sys_errlist D 0x210 + sys_nerr D 0x4 + sys_sigabbrev D 0x104 + sys_siglist D 0x104 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + sysv_signal F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcgetsid F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + tdestroy F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x4 + tmpfile F + tmpfile64 F + tmpnam F + tmpnam_r F + toascii F + tolower F + tolower_l F + toupper F + toupper_l F + towctrans F + towctrans_l F + towlower F + towlower_l F + towupper F + towupper_l F + tr_break F + truncate F + truncate64 F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + umount2 F + uname F + ungetc F + ungetwc F + unlink F + unlinkat F + unlockpt F + unsetenv F + unshare F + updwtmp F + updwtmpx F + uselib F + uselocale F + user2netname F + usleep F + ustat F + utime F + utimes F + utmpname F + utmpxname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + versionsort F + versionsort64 F + vfork F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + vwprintf F + vwscanf F + wait F + wait3 F + wait4 F + waitid F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscasecmp F + wcscasecmp_l F + wcscat F + wcschr F + wcschrnul F + wcscmp F + wcscoll F + wcscoll_l F + wcscpy F + wcscspn F + wcsdup F + wcsftime F + wcsftime_l F + wcslen F + wcsncasecmp F + wcsncasecmp_l F + wcsncat F + wcsncmp F + wcsncpy F + wcsnlen F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstod_l F + wcstof F + wcstof_l F + wcstoimax F + wcstok F + wcstol F + wcstol_l F + wcstold F + wcstold_l F + wcstoll F + wcstoll_l F + wcstombs F + wcstoq F + wcstoul F + wcstoul_l F + wcstoull F + wcstoull_l F + wcstoumax F + wcstouq F + wcswcs F + wcswidth F + wcsxfrm F + wcsxfrm_l F + wctob F + wctomb F + wctrans F + wctrans_l F + wctype F + wctype_l F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmempcpy F + wmemset F + wordexp F + wordfree F + wprintf F + write F + writev F + wscanf F + xdecrypt F + xdr_accepted_reply F + xdr_array F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_getcredres F + xdr_hyper F + xdr_int F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_longlong_t F + xdr_netnamestr F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_quad_t F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_sizeof F + xdr_string F + xdr_u_char F + xdr_u_hyper F + xdr_u_int F + xdr_u_long F + xdr_u_longlong_t F + xdr_u_quad_t F + xdr_u_short F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_union F + xdr_unixcred F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libcrypt.abilist new file mode 100644 index 0000000000..8c874edffe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.4 + GLIBC_2.4 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libdl.abilist new file mode 100644 index 0000000000..7f3ebed31d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libdl.abilist @@ -0,0 +1,11 @@ +GLIBC_2.4 + GLIBC_2.4 A + dladdr F + dladdr1 F + dlclose F + dlerror F + dlinfo F + dlmopen F + dlopen F + dlsym F + dlvsym F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libm.abilist new file mode 100644 index 0000000000..cee34728d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libm.abilist @@ -0,0 +1,370 @@ +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __asin_finite F + __asinf_finite F + __atan2_finite F + __atan2f_finite F + __atanh_finite F + __atanhf_finite F + __cosh_finite F + __coshf_finite F + __exp10_finite F + __exp10f_finite F + __exp2_finite F + __exp2f_finite F + __exp_finite F + __expf_finite F + __fmod_finite F + __fmodf_finite F + __gamma_r_finite F + __gammaf_r_finite F + __hypot_finite F + __hypotf_finite F + __j0_finite F + __j0f_finite F + __j1_finite F + __j1f_finite F + __jn_finite F + __jnf_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __log10_finite F + __log10f_finite F + __log2_finite F + __log2f_finite F + __log_finite F + __logf_finite F + __pow_finite F + __powf_finite F + __remainder_finite F + __remainderf_finite F + __scalb_finite F + __scalbf_finite F + __sinh_finite F + __sinhf_finite F + __sqrt_finite F + __sqrtf_finite F + __y0_finite F + __y0f_finite F + __y1_finite F + __y1f_finite F + __yn_finite F + __ynf_finite F +GLIBC_2.4 + GLIBC_2.4 A + _LIB_VERSION D 0x4 + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + cbrt F + cbrtf F + cbrtl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + ceil F + ceilf F + ceill F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + log2 F + log2f F + log2l F + logb F + logbf F + logbl F + logf F + logl F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + matherr F + modf F + modff F + modfl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nextafter F + nextafterf F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow F + pow10 F + pow10f F + pow10l F + powf F + powl F + remainder F + remainderf F + remainderl F + remquo F + remquof F + remquol F + rint F + rintf F + rintl F + round F + roundf F + roundl F + scalb F + scalbf F + scalbl F + scalbln F + scalblnf F + scalblnl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sincos F + sincosf F + sincosl F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libnsl.abilist new file mode 100644 index 0000000000..1d2670c444 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libnsl.abilist @@ -0,0 +1,123 @@ +GLIBC_2.4 + GLIBC_2.4 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + __yp_check F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_obj_p F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypall F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist new file mode 100644 index 0000000000..6c0bbde672 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist @@ -0,0 +1,229 @@ +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.4 + GLIBC_2.4 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __lseek F + __nanosleep F + __open F + __open64 F + __pread64 F + __pthread_cleanup_routine F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pthread_setspecific F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + __pwrite64 F + __read F + __res_state F + __send F + __sigaction F + __vfork F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + lseek64 F + msync F + nanosleep F + open F + open64 F + pause F + pread F + pread64 F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getaffinity_np F + pthread_attr_getdetachstate F + pthread_attr_getguardsize F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setaffinity_np F + pthread_attr_setdetachstate F + pthread_attr_setguardsize F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_getpshared F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_getclock F + pthread_condattr_getpshared F + pthread_condattr_init F + pthread_condattr_setclock F + pthread_condattr_setpshared F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getaffinity_np F + pthread_getattr_np F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_consistent_np F + pthread_mutex_destroy F + pthread_mutex_getprioceiling F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_setprioceiling F + pthread_mutex_timedlock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getpshared F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_gettype F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setpshared F + pthread_mutexattr_setrobust_np F + pthread_mutexattr_settype F + pthread_once F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_self F + pthread_setaffinity_np F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setconcurrency F + pthread_setschedparam F + pthread_setschedprio F + pthread_setspecific F + pthread_sigmask F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_testcancel F + pthread_timedjoin_np F + pthread_tryjoin_np F + pthread_yield F + pwrite F + pwrite64 F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libresolv.abilist new file mode 100644 index 0000000000..e781f2f822 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libresolv.abilist @@ -0,0 +1,95 @@ +GLIBC_2.4 + GLIBC_2.4 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_expand F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_rcode F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_hostalias F + __res_isourserver F + __res_mailok F + __res_mkquery F + __res_nameinquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_ownok F + __res_queriesmatch F + __res_query F + __res_querydomain F + __res_search F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/librt.abilist new file mode 100644 index 0000000000..466df4d93b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/librt.abilist @@ -0,0 +1,44 @@ +GLIBC_2.4 + GLIBC_2.4 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libthread_db.abilist new file mode 100644 index 0000000000..523772441b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libthread_db.abilist @@ -0,0 +1,42 @@ +GLIBC_2.4 + GLIBC_2.4 A + td_init F + td_log F + td_symbol_list F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tls_get_addr F + td_thr_tlsbase F + td_thr_tsd F + td_thr_validate F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libutil.abilist new file mode 100644 index 0000000000..6cb71966a1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.4 + GLIBC_2.4 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h new file mode 100644 index 0000000000..d3ed1a48a4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_M68K_COLDFIRE_SYSDEP_H +#define _LINUX_M68K_COLDFIRE_SYSDEP_H 1 + +#include <sysdeps/unix/sysdep.h> +#include <sysdeps/m68k/coldfire/sysdep.h> +#include <sysdeps/unix/sysv/linux/m68k/sysdep.h> + +#define SYSCALL_ERROR_LOAD_GOT(reg) \ + move.l &_GLOBAL_OFFSET_TABLE_@GOTPC, reg; \ + lea (-6, %pc, reg), reg + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/configure b/ports/sysdeps/unix/sysv/linux/m68k/configure new file mode 100644 index 0000000000..a2fd833321 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/configure @@ -0,0 +1,10 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + case $machine in +m68k/coldfire) + arch_minimum_kernel=2.6.10 + ;; +*) + libc_cv_gcc_unwind_find_fde=yes + ;; +esac +ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed diff --git a/ports/sysdeps/unix/sysv/linux/m68k/configure.in b/ports/sysdeps/unix/sysv/linux/m68k/configure.in new file mode 100644 index 0000000000..6e91ef96f3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/configure.in @@ -0,0 +1,11 @@ +sinclude(./aclocal.m4)dnl Autoconf lossage +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +case $machine in +m68k/coldfire) + arch_minimum_kernel=2.6.10 + ;; +*) + libc_cv_gcc_unwind_find_fde=yes + ;; +esac +ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed diff --git a/ports/sysdeps/unix/sysv/linux/m68k/dl-librecon.h b/ports/sysdeps/unix/sysv/linux/m68k/dl-librecon.h new file mode 100644 index 0000000000..dbb4e75712 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/dl-librecon.h @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/dl-librecon.h> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/fchown.c b/ports/sysdeps/unix/sysv/linux/m68k/fchown.c new file mode 100644 index 0000000000..3a69ecc9e7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/fchown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/fchownat.c b/ports/sysdeps/unix/sysv/linux/m68k/fchownat.c new file mode 100644 index 0000000000..dfed76aeb4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/fchownat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fchownat.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/fcntl.c b/ports/sysdeps/unix/sysv/linux/m68k/fcntl.c new file mode 100644 index 0000000000..ea951bc4f9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/fcntl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/fxstat.c b/ports/sysdeps/unix/sysv/linux/m68k/fxstat.c new file mode 100644 index 0000000000..4f219f0b9d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/fxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/fxstatat.c b/ports/sysdeps/unix/sysv/linux/m68k/fxstatat.c new file mode 100644 index 0000000000..0f8b3135d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/fxstatat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstatat.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getdents64.c b/ports/sysdeps/unix/sysv/linux/m68k/getdents64.c new file mode 100644 index 0000000000..0c75fb5a06 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getdents64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getdents64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getegid.c b/ports/sysdeps/unix/sysv/linux/m68k/getegid.c new file mode 100644 index 0000000000..37b4b4a530 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getegid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/geteuid.c b/ports/sysdeps/unix/sysv/linux/m68k/geteuid.c new file mode 100644 index 0000000000..ebcb555b5e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/geteuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/geteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getgid.c b/ports/sysdeps/unix/sysv/linux/m68k/getgid.c new file mode 100644 index 0000000000..0a4d6061f0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getgroups.c b/ports/sysdeps/unix/sysv/linux/m68k/getgroups.c new file mode 100644 index 0000000000..102ea24e14 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getgroups.c @@ -0,0 +1,2 @@ +/* We also have to rewrite the kernel gid_t to the user land type. */ +#include <sysdeps/unix/sysv/linux/i386/getgroups.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getmsg.c b/ports/sysdeps/unix/sysv/linux/m68k/getmsg.c new file mode 100644 index 0000000000..3a1fa08525 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getmsg.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getpagesize.c b/ports/sysdeps/unix/sysv/linux/m68k/getpagesize.c new file mode 100644 index 0000000000..9e6000a196 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getpagesize.c @@ -0,0 +1,49 @@ +/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@suse.de>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <unistd.h> +#include <sys/param.h> +#include <errno.h> + +#include <ldsodefs.h> +#include <sysdep.h> +#include <sys/syscall.h> + +/* Return the system page size. */ +int +__getpagesize () +{ +#ifdef __NR_getpagesize + int result; +#endif + + if (GLRO(dl_pagesize) != 0) + return GLRO(dl_pagesize); + +#ifdef __NR_getpagesize + INTERNAL_SYSCALL_DECL (err); + result = INTERNAL_SYSCALL (getpagesize, err, 0); + /* The only possible error is ENOSYS. */ + if (!INTERNAL_SYSCALL_ERROR_P (result, err)) + return result; +#endif + + return 4096; +} +libc_hidden_def (__getpagesize) +weak_alias (__getpagesize, getpagesize) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getresgid.c b/ports/sysdeps/unix/sysv/linux/m68k/getresgid.c new file mode 100644 index 0000000000..b703a414cc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getresgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getresuid.c b/ports/sysdeps/unix/sysv/linux/m68k/getresuid.c new file mode 100644 index 0000000000..0b14cefe34 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getresuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c b/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c new file mode 100644 index 0000000000..fc06dbd641 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getrlimit64.c b/ports/sysdeps/unix/sysv/linux/m68k/getrlimit64.c new file mode 100644 index 0000000000..fef018f471 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getsysstats.c b/ports/sysdeps/unix/sysv/linux/m68k/getsysstats.c new file mode 100644 index 0000000000..e3e87f6f93 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getsysstats.c @@ -0,0 +1,37 @@ +/* Determine various system internal values, Linux/m68k version. + Copyright (C) 2003, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@suse.de> + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +/* We need to define a special parser for /proc/cpuinfo. */ +#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \ + do \ + { \ + (RESULT) = 0; \ + /* Read all lines and count the lines starting with the string \ + "CPU:". We don't have to fear extremely long lines since \ + the kernel will not generate them. 8192 bytes are really \ + enough. */ \ + char *l; \ + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ + if (strncmp (l, "CPU:", 4) == 0) \ + ++(RESULT); \ + } \ + while (0) + +#include <sysdeps/unix/sysv/linux/getsysstats.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/getuid.c b/ports/sysdeps/unix/sysv/linux/m68k/getuid.c new file mode 100644 index 0000000000..d682c79a49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/getuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/glob64.c b/ports/sysdeps/unix/sysv/linux/m68k/glob64.c new file mode 100644 index 0000000000..82a9a296a7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/glob64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/glob64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/init-first.c b/ports/sysdeps/unix/sysv/linux/m68k/init-first.c new file mode 100644 index 0000000000..ec311ec427 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/init-first.c @@ -0,0 +1,73 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Note: linking in vDSO to a static binary requires changes to + the main GLIBC proper. Not yet implemented. */ +#ifdef SHARED + +#include <dl-vdso.h> +#include <bits/m68k-vdso.h> + +static inline void +_libc_vdso_platform_setup (void) +{ + void *p; + + PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); + + /* It may happen that rtld didn't initialize the vDSO, so fallback + to the syscall implementations if _dl_vdso_vsym returns NULL. + This may happen when a static executable dlopen's a dynamic library. + This really is nothing more than a workaround for rtld/csu + deficiency. Ideally, init code would setup the vDSO for static + binaries too. */ + + p = _dl_vdso_vsym ("__kernel_read_tp", &linux26); + if (p != NULL) + { + __vdso_read_tp = p; + __rtld___vdso_read_tp = p; + } + else + assert (__vdso_read_tp == (void *) __vdso_read_tp_stub); + + p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26); + if (p != NULL) + { + __vdso_atomic_cmpxchg_32 = p; + __rtld___vdso_atomic_cmpxchg_32 = p; + } + else + assert (__vdso_atomic_cmpxchg_32 + == (void *) __vdso_atomic_cmpxchg_32_stub); + + p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26); + if (p != NULL) + { + __vdso_atomic_barrier = p; + __rtld___vdso_atomic_barrier = p; + } + else + assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub); +} + +#define VDSO_SETUP _libc_vdso_platform_setup + +#endif /* SHARED */ + +#include <sysdeps/unix/sysv/linux/init-first.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h new file mode 100644 index 0000000000..c12be9e07c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -0,0 +1,41 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* These features were surely available with 2.4.12. */ +#if __LINUX_KERNEL_VERSION >= 132108 +# define __ASSUME_MMAP2_SYSCALL 1 +# define __ASSUME_STAT64_SYSCALL 1 +# define __ASSUME_FCNTL64 1 +# define __ASSUME_VFORK_SYSCALL 1 +#endif + +/* Many syscalls were added in 2.6.10 for m68k. */ +#if __LINUX_KERNEL_VERSION >= 132618 +# define __ASSUME_TGKILL 1 +# define __ASSUME_UTIMES 1 +# define __ASSUME_FADVISE64_64_SYSCALL 1 +#endif + +#include_next <kernel-features.h> + +/* These syscalls were added only in 3.0 for m68k. */ +#if __LINUX_KERNEL_VERSION < 0x030000 +# undef __ASSUME_PSELECT +# undef __ASSUME_PPOLL +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/lchown.c b/ports/sysdeps/unix/sysv/linux/m68k/lchown.c new file mode 100644 index 0000000000..c89de99ba2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/lchown.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lchown.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/ldconfig.h b/ports/sysdeps/unix/sysv/linux/m68k/ldconfig.h new file mode 100644 index 0000000000..953f192bcd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/ldconfig.h @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/ldconfig.h> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c b/ports/sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c new file mode 100644 index 0000000000..45982e99b9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/libc-m68k-vdso.c @@ -0,0 +1 @@ +#include "m68k-vdso.c" diff --git a/ports/sysdeps/unix/sysv/linux/m68k/lockf64.c b/ports/sysdeps/unix/sysv/linux/m68k/lockf64.c new file mode 100644 index 0000000000..a88f5a784a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/lockf64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/lxstat.c b/ports/sysdeps/unix/sysv/linux/m68k/lxstat.c new file mode 100644 index 0000000000..2371cd9719 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/lxstat.c @@ -0,0 +1,2 @@ +#include <sysdeps/unix/sysv/linux/i386/lxstat.c> + diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/ld.abilist new file mode 100644 index 0000000000..fc11e36345 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/ld.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + __libc_memalign F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F +GLIBC_2.1 + GLIBC_2.1 A + __libc_stack_end D 0x4 + _dl_mcount F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A + __stack_chk_guard D 0x4 diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..f4ca37f44b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.0 + GLIBC_2.0 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libanl.abilist new file mode 100644 index 0000000000..c9755d8a33 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist new file mode 100644 index 0000000000..c2706f1e14 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist @@ -0,0 +1,2284 @@ +GCC_3.0 + GCC_3.0 A + _Unwind_Find_FDE F + __deregister_frame_info_bases F + __register_frame_info_bases F + __register_frame_info_table_bases F +GLIBC_2.0 + GLIBC_2.0 A + _IO_adjust_column F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_fsetpos F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sscanf F + _IO_stderr_ D 0x50 + _IO_stdin_ D 0x50 + _IO_stdout_ D 0x50 + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_switch_to_get_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + ___brk_addr D 0x4 + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __assert_fail F + __assert_perror_fail F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __clone F + __close F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x4 + __ctype_b D 0x4 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x4 + __ctype_toupper D 0x4 + __curbrk D 0x4 + __daylight D 0x4 + __dcgettext F + __default_morecore F + __deregister_frame F + __deregister_frame_info F + __dgettext F + __divdi3 F + __dup2 F + __environ D 0x4 + __errno_location F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __fork F + __fpu_control D 0x4 + __frame_state_for F + __free_hook D 0x4 + __fxstat F + __getdelim F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __isinf F + __isinff F + __isinfl F + __isnan F + __isnanf F + __isnanl F + __iswctype F + __ivaliduser F + __libc_calloc F + __libc_free F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x4 + __mempcpy F + __moddi3 F + __monstartup F + __morecore D 0x4 + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __overflow F + __pipe F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __rcmd_errstr D 0x4 + __read F + __realloc_hook D 0x4 + __register_frame F + __register_frame_info F + __register_frame_info_table F + __register_frame_table F + __res_randomid F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __sigpause F + __sigsetjmp F + __stpcpy F + __stpncpy F + __strcasecmp F + __strdup F + __strerror_r F + __strtod_internal F + __strtof_internal F + __strtok_r F + __strtol_internal F + __strtold_internal F + __strtoll_internal F + __strtoq_internal F + __strtoul_internal F + __strtoull_internal F + __strtouq_internal F + __sysv_signal F + __timezone D 0x4 + __tzname D 0x8 + __udivdi3 F + __uflow F + __umoddi3 F + __underflow F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcstod_internal F + __wcstof_internal F + __wcstol_internal F + __wcstold_internal F + __wcstoll_internal F + __wcstoul_internal F + __wcstoull_internal F + __write F + __xmknod F + __xpg_basename F + __xstat F + _environ D 0x4 + _exit F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack D 0x4 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x1fe + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x1ec + _sys_nerr D 0x4 + _sys_siglist D 0x80 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authnone_create F + authunix_create F + authunix_create_default F + basename F + bcmp F + bcopy F + bdflush F + bind F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + catclose F + catgets F + catopen F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + delete_module F + dgettext F + difftime F + dirfd F + dirname F + div F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + fgetc F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpwent F + fgetpwent_r F + fgets F + fgetspent F + fgetspent_r F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fnmatch F + fopen F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fread F + free F + freeaddrinfo F + freopen F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fsetpos F + fstatfs F + fsync F + ftell F + ftime F + ftok F + ftruncate F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + funlockfile F + fwrite F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcwd F + getdelim F + getdirentries F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getw F + getwd F + glob F + glob_pattern_p F + globfree F + gmtime F + gmtime_r F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + insque F + ioctl F + iruserok F + isalnum F + isalpha F + isascii F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + madvise F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + memset F + mkdir F + mkfifo F + mkstemp F + mktemp F + mktime F + mlock F + mlockall F + mmap F + modf F + modff F + modfl F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + nfsservctl F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open_memstream F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + prctl F + printf F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putpwent F + puts F + putspent F + pututline F + putw F + pvalloc F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rcmd F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readdir F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + res_init F + revoke F + rewind F + rewinddir F + rexec F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + ruserok F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigreturn F + sigsetmask F + sigstack F + sigsuspend F + sigvec F + sigwait F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcat F + strchr F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtouq F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreqset F + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + swab F + swapoff F + swapon F + symlink F + sync F + sys_errlist D 0x1ec + sys_nerr D 0x4 + sys_sigabbrev D 0x80 + sys_siglist D 0x80 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x4 + tmpfile F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + uname F + ungetc F + unlink F + unsetenv F + updwtmp F + uselib F + usleep F + ustat F + utime F + utimes F + utmpname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + vfork F + vfprintf F + vfscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + wait F + wait3 F + wait4 F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscat F + wcschr F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcslen F + wcsncat F + wcsncmp F + wcsncpy F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstok F + wcstol F + wcstold F + wcstombs F + wcstoq F + wcstoul F + wcstouq F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmemset F + write F + writev F + xdr_accepted_reply F + xdr_array F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_int F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_string F + xdr_u_char F + xdr_u_int F + xdr_u_long F + xdr_u_short F + xdr_union F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.1 + GLIBC_2.1 A + _IO_2_1_stderr_ D 0x98 + _IO_2_1_stdin_ D 0x98 + _IO_2_1_stdout_ D 0x98 + _IO_do_write F + _IO_fclose F + _IO_fdopen F + _IO_fgetpos64 F + _IO_file_attach F + _IO_file_close_it F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_overflow F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_fopen F + _IO_fsetpos64 F + _IO_getline_info F + _IO_popen F + _IO_proc_close F + _IO_proc_open F + __asprintf F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __duplocale F + __freelocale F + __fxstat64 F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __islower_l F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_freeres F + __libc_sa_len F + __lxstat64 F + __newlocale F + __poll F + __pread64 F + __pwrite64 F + __rawmemchr F + __signbit F + __signbitf F + __signbitl F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strfmon_l F + __strncasecmp_l F + __strtod_l F + __strtof_l F + __strtol_l F + __strtold_l F + __strtoll_l F + __strtoul_l F + __strtoull_l F + __strxfrm_l F + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_l F + __wcstof_l F + __wcstol_l F + __wcstold_l F + __wcstoll_l F + __wcstoul_l F + __wcstoull_l F + __wcsxfrm_l F + __wctype_l F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _sys_errlist D 0x1f4 + _sys_nerr D 0x4 + _sys_siglist D 0x100 + addseverity F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + authdes_create F + authdes_getucred F + authdes_pk_create F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + capget F + capset F + cbc_crypt F + clntunix_create F + creat64 F + des_setparity F + ecb_crypt F + endutxent F + fattach F + fclose F + fdetach F + fdopen F + ffsl F + ffsll F + fgetc_unlocked F + fgetpos64 F + fgets_unlocked F + fmtmsg F + fopen F + fopen64 F + fputs_unlocked F + fread_unlocked F + freopen64 F + fseeko F + fseeko64 F + fsetpos64 F + fstatfs64 F + fstatvfs F + fstatvfs64 F + ftello F + ftello64 F + ftruncate64 F + ftw64 F + fwrite_unlocked F + gai_strerror F + getcontext F + getdate F + getdate_err D 0x4 + getdate_r F + getmsg F + getnameinfo F + getnetname F + getpmsg F + getpt F + getrlimit64 F + getutxent F + getutxid F + getutxline F + glob64 F + globfree64 F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + host2netname F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + isastream F + iswblank F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + lockf64 F + lseek64 F + makecontext F + mempcpy F + mmap64 F + netname2host F + netname2user F + nftw F + nftw64 F + ntp_adjtime F + ntp_gettime F + open64 F + passwd2des F + pclose F + popen F + pread F + pread64 F + printf_size F + printf_size_info F + pthread_attr_init F + ptsname F + ptsname_r F + putgrent F + putmsg F + putpmsg F + pututxline F + pwrite F + pwrite64 F + rawmemchr F + readdir64 F + readdir64_r F + rtime F + scalbln F + scalblnf F + scalblnl F + scandir64 F + sendfile F + setrlimit64 F + setutxent F + sighold F + sigignore F + sigqueue F + sigrelse F + sigset F + sigtimedwait F + sigwaitinfo F + statfs64 F + statvfs F + statvfs64 F + strcasestr F + strtoimax F + strtoumax F + strverscmp F + svcunix_create F + svcunixfd_create F + swapcontext F + sys_errlist D 0x1f4 + sys_nerr D 0x4 + sys_sigabbrev D 0x100 + sys_siglist D 0x100 + sysv_signal F + tcgetsid F + tdestroy F + tmpfile F + tmpfile64 F + truncate64 F + umount2 F + unlockpt F + updwtmpx F + user2netname F + utmpxname F + versionsort F + versionsort64 F + waitid F + wcscasecmp F + wcsncasecmp F + wcsnlen F + wcstoimax F + wcstoll F + wcstoull F + wcstoumax F + wcswcs F + wordexp F + wordfree F + xdecrypt F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_getcredres F + xdr_int16_t F + xdr_int32_t F + xdr_int8_t F + xdr_netnamestr F + xdr_sizeof F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint8_t F + xdr_unixcred F +GLIBC_2.1.1 + GLIBC_2.1.1 A + _Exit F + __mempcpy_small F + __stpcpy_small F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtok_r_1c F + __strverscmp F + getutmp F + getutmpx F + imaxabs F + imaxdiv F + strchrnul F + xdr_hyper F + xdr_int64_t F + xdr_longlong_t F + xdr_u_hyper F + xdr_u_longlong_t F + xdr_uint64_t F +GLIBC_2.1.2 + GLIBC_2.1.2 A + __vfork F + getaliasbyname_r F + getaliasent_r F + getgrent_r F + getgrgid_r F + getgrnam_r F + gethostbyaddr_r F + gethostbyname2_r F + gethostbyname_r F + gethostent_r F + getnetbyaddr_r F + getnetbyname_r F + getnetent_r F + getprotobyname_r F + getprotobynumber_r F + getprotoent_r F + getpwent_r F + getpwnam_r F + getpwuid_r F + getrpcbyname_r F + getrpcbynumber_r F + getrpcent_r F + getservbyname_r F + getservbyport_r F + getservent_r F + getspent_r F + getspnam_r F +GLIBC_2.1.3 + GLIBC_2.1.3 A + __cxa_atexit F + __cxa_finalize F + __sigsuspend F +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + __m68k_read_tp F + _sys_errlist D 0x21c + _sys_nerr D 0x4 + ntp_gettimex F + recvmmsg F + sys_errlist D 0x21c + sys_nerr D 0x4 +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _IO_adjust_wcolumn F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_seekwmark F + _IO_sputbackwc F + _IO_sungetwc F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_unsave_wmarkers F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __assert F + __ctype32_tolower D 0x4 + __ctype32_toupper D 0x4 + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __endmntent F + __fbufsize F + __flbf F + __fpending F + __fpurge F + __freadable F + __freading F + __fsetlocking F + __fwritable F + __fwriting F + __fxstat64 F + __getmntent_r F + __lxstat64 F + __nl_langinfo_l F + __open64 F + __res_init F + __res_nclose F + __res_ninit F + __res_state F + __setmntent F + __statfs F + __strndup F + __sysconf F + __sysctl F + __wctrans_l F + __woverflow F + __wuflow F + __wunderflow F + __xpg_sigpause F + __xstat64 F + _flushlbf F + _res_hconf D 0x30 + alphasort64 F + bind_textdomain_codeset F + dcngettext F + dngettext F + fgetpos F + fgetpos64 F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fmemopen F + fopencookie F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fsetpos F + fsetpos64 F + fwide F + fwprintf F + fwscanf F + getdirentries64 F + getloadavg F + getrlimit F + getrlimit64 F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + glob64 F + iruserok_af F + localeconv F + mcheck_check_all F + mcheck_pedantic F + memrchr F + mincore F + mkdtemp F + mkstemp64 F + moncontrol F + msgctl F + ngettext F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + rcmd_af F + readdir64 F + readdir64_r F + rexec_af F + rresvport_af F + ruserok_af F + scandir64 F + semctl F + setrlimit F + shmctl F + svc_getreq_common F + svc_getreq_poll F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + swprintf F + swscanf F + ungetwc F + versionsort64 F + vfwprintf F + vfwscanf F + vswprintf F + vswscanf F + vwprintf F + vwscanf F + wcschrnul F + wcsftime F + wmempcpy F + wprintf F + wscanf F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + _sys_errlist D 0x1f8 + _sys_nerr D 0x4 + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoll_l F + strtoul_l F + strtoull_l F + strxfrm_l F + sys_errlist D 0x1f8 + sys_nerr D 0x4 + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __register_atfork F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x104 + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + nftw F + nftw64 F + posix_fadvise64 F + posix_fallocate64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + sys_sigabbrev D 0x104 + sys_siglist D 0x104 +GLIBC_2.3.4 + GLIBC_2.3.4 A + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + getipv4sourcefilter F + getsourcefilter F + regexec F + sched_getaffinity F + sched_setaffinity F + setipv4sourcefilter F + setsourcefilter F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __pread64_chk F + __pread_chk F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __stack_chk_fail F + __stpncpy_chk F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __vfwprintf_chk F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + _sys_errlist D 0x210 + _sys_nerr D 0x4 + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + futimesat F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + linkat F + mkdirat F + mkfifoat F + open_wmemstream F + openat F + openat64 F + ppoll F + readlinkat F + renameat F + symlinkat F + sys_errlist D 0x210 + sys_nerr D 0x4 + unlinkat F + unshare F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libcrypt.abilist new file mode 100644 index 0000000000..1df145f260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libdl.abilist new file mode 100644 index 0000000000..62e6b41edb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libdl.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.1 + GLIBC_2.1 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libm.abilist new file mode 100644 index 0000000000..35fc1e3d72 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libm.abilist @@ -0,0 +1,412 @@ +GLIBC_2.0 + GLIBC_2.0 A + _LIB_VERSION D 0x4 + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cbrt F + cbrtf F + cbrtl F + ceil F + ceilf F + ceill F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + logb F + logbf F + logbl F + logf F + logl F + matherr F + modf F + modff F + modfl F + nextafter F + nextafterf F + nextafterl F + pow F + powf F + powl F + remainder F + remainderf F + remainderl F + rint F + rintf F + rintl F + scalb F + scalbf F + scalbl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.1 + GLIBC_2.1 A + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __fpclassifyl F + __signbit F + __signbitf F + __signbitl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + fdim F + fdimf F + fdiml F + feclearexcept F + fegetenv F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log2 F + log2f F + log2l F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nexttoward F + nexttowardf F + nexttowardl F + pow10 F + pow10f F + pow10l F + remquo F + remquof F + remquol F + round F + roundf F + roundl F + scalbln F + scalblnf F + scalblnl F + sincos F + sincosf F + sincosl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __acoshl_finite F + __acosl_finite F + __asin_finite F + __asinf_finite F + __asinl_finite F + __atan2_finite F + __atan2f_finite F + __atan2l_finite F + __atanh_finite F + __atanhf_finite F + __atanhl_finite F + __cosh_finite F + __coshf_finite F + __coshl_finite F + __exp10_finite F + __exp10f_finite F + __exp10l_finite F + __exp2_finite F + __exp2f_finite F + __exp2l_finite F + __exp_finite F + __expf_finite F + __expl_finite F + __fmod_finite F + __fmodf_finite F + __fmodl_finite F + __gamma_r_finite F + __gammaf_r_finite F + __gammal_r_finite F + __hypot_finite F + __hypotf_finite F + __hypotl_finite F + __j0_finite F + __j0f_finite F + __j0l_finite F + __j1_finite F + __j1f_finite F + __j1l_finite F + __jn_finite F + __jnf_finite F + __jnl_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __lgammal_r_finite F + __log10_finite F + __log10f_finite F + __log10l_finite F + __log2_finite F + __log2f_finite F + __log2l_finite F + __log_finite F + __logf_finite F + __logl_finite F + __pow_finite F + __powf_finite F + __powl_finite F + __remainder_finite F + __remainderf_finite F + __remainderl_finite F + __scalb_finite F + __scalbf_finite F + __scalbl_finite F + __sinh_finite F + __sinhf_finite F + __sinhl_finite F + __sqrt_finite F + __sqrtf_finite F + __sqrtl_finite F + __y0_finite F + __y0f_finite F + __y0l_finite F + __y1_finite F + __y1f_finite F + __y1l_finite F + __yn_finite F + __ynf_finite F + __ynl_finite F +GLIBC_2.2 + GLIBC_2.2 A + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + feraiseexcept F + fesetenv F + fesetexceptflag F + feupdateenv F +GLIBC_2.4 + GLIBC_2.4 A diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libnsl.abilist new file mode 100644 index 0000000000..4241e2d887 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libnsl.abilist @@ -0,0 +1,127 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.1 + GLIBC_2.1 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F +GLIBC_2.2 + GLIBC_2.2 A + xdr_ypall F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist new file mode 100644 index 0000000000..827114f896 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist @@ -0,0 +1,267 @@ +GLIBC_2.0 + GLIBC_2.0 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __lseek F + __open F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_setspecific F + __read F + __send F + __sigaction F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + msync F + nanosleep F + open F + pause F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_once F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_testcancel F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.1 + GLIBC_2.1 A + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + pthread_attr_getguardsize F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setguardsize F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_create F + pthread_getconcurrency F + pthread_mutexattr_gettype F + pthread_mutexattr_settype F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_setconcurrency F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F +GLIBC_2.1.1 + GLIBC_2.1.1 A + sem_close F + sem_open F + sem_unlink F +GLIBC_2.1.2 + GLIBC_2.1.2 A + __vfork F +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + __open64 F + __pread64 F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pwrite64 F + __res_state F + lseek64 F + open64 F + pread F + pread64 F + pthread_attr_getstack F + pthread_attr_setstack F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_condattr_getpshared F + pthread_condattr_setpshared F + pthread_getcpuclockid F + pthread_mutex_timedlock F + pthread_mutexattr_getpshared F + pthread_mutexattr_setpshared F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_yield F + pwrite F + pwrite64 F + sem_timedwait F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libresolv.abilist new file mode 100644 index 0000000000..f68333d4a4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libresolv.abilist @@ -0,0 +1,104 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/librt.abilist new file mode 100644 index 0000000000..af7df27cb3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/librt.abilist @@ -0,0 +1,52 @@ +GLIBC_2.1 + GLIBC_2.1 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + lio_listio F + lio_listio64 F +GLIBC_2.2 + GLIBC_2.2 A + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libthread_db.abilist new file mode 100644 index 0000000000..f33138067c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libthread_db.abilist @@ -0,0 +1,48 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libutil.abilist new file mode 100644 index 0000000000..7422687e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list new file mode 100644 index 0000000000..913f051ff4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list @@ -0,0 +1,4 @@ +# File name Caller Syscall name Args Strong name Weak names + +oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 +oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h new file mode 100644 index 0000000000..50e3251aef --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_M68K_M680X0_SYSDEP_H +#define _LINUX_M68K_M680X0_SYSDEP_H 1 + +#include <sysdeps/unix/sysdep.h> +#include <sysdeps/m68k/m680x0/sysdep.h> +#include <sysdeps/unix/sysv/linux/m68k/sysdep.h> + +#define SYSCALL_ERROR_LOAD_GOT(reg) \ + lea (_GLOBAL_OFFSET_TABLE_@GOTPC, %pc), reg + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S b/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S new file mode 100644 index 0000000000..3b8ec6e09a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m68k-helpers.S @@ -0,0 +1,95 @@ +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file with other + programs, and to distribute those programs without any restriction + coming from the use of this file. (The GNU Lesser General Public + License restrictions do apply in other respects; for example, they + cover modification of the file, and distribution when not linked + into another program.) + + Note that people who make modified versions of this file are not + obligated to grant this special exception for their modified + versions; it is their choice whether to do so. The GNU Lesser + General Public License gives permission to release a modified + version without this exception; this exception also makes it + possible to release a modified version which carries forward this + exception. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <bits/m68k-vdso.h> + + .text + + .hidden __vdso_read_tp_stub +ENTRY (__vdso_read_tp_stub) + move.l #__NR_get_thread_area, %d0 + trap #0 + move.l %d0, %a0 + rts +END (__vdso_read_tp_stub) + +# ifdef SHARED +/* GCC will emit calls to this routine. Linux has an + equivalent helper function (which clobbers fewer registers than + a normal function call) in a vdso; tail call to the + helper. */ +# ifdef IS_IN_rtld +/* rtld gets a hidden copy of __m68k_read_tp. */ + .hidden __m68k_read_tp +# endif +ENTRY (__m68k_read_tp) + LOAD_GOT (%a0) + move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0 + move.l (%a0), %a0 + jmp (%a0) +END (__m68k_read_tp) + +/* The following two stubs are for macros in atomic.h, they can't + clobber anything. */ + + .hidden __vdso_atomic_cmpxchg_32_stub +ENTRY (__vdso_atomic_cmpxchg_32_stub) + move.l %d2, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d2, 0) + move.l %d0, %d2 + move.l #SYS_ify (atomic_cmpxchg_32), %d0 + trap #0 + move.l (%sp)+, %d2 + cfi_adjust_cfa_offset (-4) + cfi_restore (%d2) + rts +END (__vdso_atomic_cmpxchg_32_stub) + + .hidden __vdso_atomic_barrier_stub +ENTRY (__vdso_atomic_barrier_stub) + move.l %d0, -(%sp) + cfi_adjust_cfa_offset (4) + move.l #SYS_ify (atomic_barrier), %d0 + trap #0 + move.l (%sp)+, %d0 + cfi_adjust_cfa_offset (-4) + rts +END (__vdso_atomic_barrier_stub) +# else /* !SHARED */ +/* If the vDSO is not available, use a syscall to get TP. */ + strong_alias (__vdso_read_tp_stub, __m68k_read_tp) +# endif /* SHARED */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c b/ports/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c new file mode 100644 index 0000000000..6c977337b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/m68k-vdso.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef SHARED + +#include <bits/m68k-vdso.h> + +/* Because these pointers are used from other libraries than libc, + they are exported at GLIBC_PRIVATE version. + We initialize them to syscall implementation so that they will be ready + to use from the very beginning. */ +void * M68K_VDSO_SYMBOL (__vdso_read_tp) += (void *) __vdso_read_tp_stub; +void * M68K_VDSO_SYMBOL (__vdso_atomic_cmpxchg_32) += (void *) __vdso_atomic_cmpxchg_32_stub; +void * M68K_VDSO_SYMBOL (__vdso_atomic_barrier) += (void *) __vdso_atomic_barrier_stub; + +#endif /* SHARED */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/mmap.S b/ports/sysdeps/unix/sysv/linux/m68k/mmap.S new file mode 100644 index 0000000000..b0d9714228 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/mmap.S @@ -0,0 +1,42 @@ +/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + .text +ENTRY (__mmap) + + move.l #SYS_ify (mmap), %d0 /* System call number in %d0. */ + + lea 4(%sp), %a0 /* Address of args is 1st arg. */ + move.l %a0, %d1 + + /* Do the system call trap. */ + trap #0 + + /* Kludge: negative numbers are among the legal return values. + If %d0 is between -4096 and 0 then there was an error. */ + cmp.l #-4096, %d0 + jhi SYSCALL_ERROR_LABEL + + /* Successful; return the syscall's value. Copy it to %a0 because + mmap is declared to return a pointer. */ + move.l %d0, %a0 + rts +PSEUDO_END (__mmap) + +weak_alias (__mmap, mmap) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/mremap.S b/ports/sysdeps/unix/sysv/linux/m68k/mremap.S new file mode 100644 index 0000000000..48e9929bd2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/mremap.S @@ -0,0 +1,28 @@ +/* Copyright (C) 1996, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* The mremap system call is special because it needs to return + its value in register %a0. */ + + .text +PSEUDO (__mremap, mremap, 5) + move.l %d0, %a0 + rts +PSEUDO_END (__mremap) +weak_alias (__mremap, mremap) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/msgctl.c b/ports/sysdeps/unix/sysv/linux/m68k/msgctl.c new file mode 100644 index 0000000000..9f9b8431a3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/msgctl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/msgctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..7bcec6a011 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h @@ -0,0 +1,175 @@ +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#include <endian.h> + +#define __SIZEOF_PTHREAD_ATTR_T 36 +#define __SIZEOF_PTHREAD_MUTEX_T 24 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCK_T 32 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIER_T 20 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + + +/* Thread identifiers. The structure of the attribute type is + deliberately not exposed. */ +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + + +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; + + +/* Data structures for mutex handling. The structure of the attribute + type is deliberately not exposed. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock __attribute__ ((__aligned__ (4))); + unsigned int __count; + int __owner; + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; + unsigned int __nusers; + __extension__ union + { + int __spins; + __pthread_slist_t __list; + }; + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is deliberately not exposed. */ +typedef union +{ + struct + { + int __lock __attribute__ ((__aligned__ (4))); + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int __attribute__ ((__aligned__ (4))) pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is deliberately not exposed. */ +typedef union +{ + struct + { + int __lock __attribute__ ((__aligned__ (4))); + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + unsigned char __pad1; + unsigned char __pad2; + unsigned char __shared; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; + int __writer; + } __data; + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align __attribute__ ((__aligned__ (4))); +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h new file mode 100644 index 0000000000..1582a919c6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/bits/semaphore.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2010, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + + +#define __SIZEOF_SEM_T 16 + + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align __attribute__ ((__aligned__ (4))); +} sem_t; diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/clone.S new file mode 100644 index 0000000000..e7388fee71 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/clone.S @@ -0,0 +1,2 @@ +#define RESET_PID +#include "../clone.S" diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/m68k/nptl/createthread.c new file mode 100644 index 0000000000..a7efb3c825 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/createthread.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE ((void *) (pd) \ + + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) + +/* Get the real implementation. */ +#include <nptl/sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/m68k/nptl/fork.c new file mode 100644 index 0000000000..ffba605940 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/fork.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sched.h> +#include <signal.h> +#include <sysdep.h> +#include <tls.h> + +#define ARCH_FORK() \ + INLINE_SYSCALL (clone, 5, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \ + NULL, &THREAD_SELF->tid, NULL) + +#include <sysdeps/unix/sysv/linux/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h new file mode 100644 index 0000000000..fed152ae34 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h @@ -0,0 +1,279 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Borrowed from ARM's version. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <atomic.h> +#include <kernel-features.h> + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + + +#define lll_futex_wait(futexp, val, private) \ + lll_futex_timed_wait(futexp, val, NULL, private) + +#define lll_futex_timed_wait(futexp, val, timespec, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (val), (timespec)); \ + __ret; \ + }) + +#define lll_futex_wake(futexp, nr, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ + __ret; \ + }) + +#define lll_robust_dead(futexv, private) \ + do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + lll_futex_wake (__futexp, 1, private); \ + } \ + while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ + (nr_wake), (nr_move), (mutex), (val)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (nr_wake), (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + +#define lll_trylock(lock) \ + atomic_compare_and_exchange_val_acq (&(lock), 1, 0) + +#define lll_cond_trylock(lock) \ + atomic_compare_and_exchange_val_acq (&(lock), 2, 0) + +#define lll_robust_trylock(lock, id) \ + atomic_compare_and_exchange_val_acq (&(lock), id, 0) + +extern void __lll_lock_wait_private (int *futex) attribute_hidden; +extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + +#define __lll_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, \ + 1, 0), 0)) \ + { \ + if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \ + __lll_lock_wait_private (__futex); \ + else \ + __lll_lock_wait (__futex, private); \ + } \ + })) +#define lll_lock(futex, private) __lll_lock (&(futex), private) + + +#define __lll_robust_lock(futex, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_lock_wait (__futex, private); \ + __val; \ + }) +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + + +#define __lll_cond_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0)) \ + __lll_lock_wait (__futex, private); \ + })) +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + + +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private) + + +extern int __lll_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + +#define __lll_timedlock(futex, abstime, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0)) \ + __val = __lll_timedlock_wait (__futex, abstime, private); \ + __val; \ + }) +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + + +#define __lll_robust_timedlock(futex, abstime, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_timedlock_wait (__futex, abstime, private); \ + __val; \ + }) +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + + +#define __lll_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + + +#define __lll_robust_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + + +#define lll_islocked(futex) \ + (futex != 0) + + +/* Our internal lock implementation is identical to the binary-compatible + mutex implementation. */ + +/* Initializers for lock. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + +/* The states of a lock are: + 0 - untaken + 1 - taken by one user + >1 - taken by more users */ + +/* The kernel notifies a process which uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED); \ + } while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S new file mode 100644 index 0000000000..25d2460aa3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pt-vfork.S @@ -0,0 +1,35 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tcb-offsets.h> + +#define SAVE_PID \ + bsrl __m68k_read_tp@PLTPC ; /* Get the thread pointer. */ \ + movel %a0, %a1 ; /* Save TP for RESTORE_PID. */ \ + movel PID_OFFSET(%a1), %d0 ; /* Get the PID. */ \ + movel %d0, %d1 ; /* Save PID for RESTORE_PID. */ \ + negl %d0 ; /* Negate the PID. */ \ + movel %d0, PID_OFFSET(%a1) ; /* Store the temporary PID. */ + +#define RESTORE_PID \ + tstl %d0 ; \ + beq 1f ; /* If we are the parent... */ \ + movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \ +1: + +#include <sysdeps/unix/sysv/linux/m68k/vfork.S> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c new file mode 100644 index 0000000000..8d81db602e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/pthread_once.c @@ -0,0 +1,90 @@ +/* Copyright (C) 2010-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "pthreadP.h" +#include <lowlevellock.h> + +unsigned long int __fork_generation attribute_hidden; + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); +} + +int +__pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) +{ + for (;;) + { + int oldval; + int newval; + + /* Pseudo code: + newval = __fork_generation | 1; + oldval = *once_control; + if ((oldval & 2) == 0) + *once_control = newval; + Do this atomically. + */ + do + { + newval = __fork_generation | 1; + oldval = *once_control; + if (oldval & 2) + break; + } while (atomic_compare_and_exchange_val_acq (once_control, newval, oldval) != oldval); + + /* Check if the initializer has already been done. */ + if ((oldval & 2) != 0) + return 0; + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) == 0) + break; + + /* Check whether the initializer execution was interrupted by a fork. */ + if (oldval != newval) + break; + + /* Same generation, some other thread was faster. Wait. */ + lll_futex_wait (once_control, oldval, LLL_PRIVATE); + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + /* Say that the initialisation is done. */ + *once_control = __fork_generation | 2; + + /* Wake up all other threads. */ + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); + + return 0; +} +weak_alias (__pthread_once, pthread_once) +hidden_def (__pthread_once) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..249e0e29f7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h @@ -0,0 +1,138 @@ +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + SINGLE_THREAD_P; \ + jne .Lpseudo_cancel; \ + .type __##syscall_name##_nocancel,@function; \ + .globl __##syscall_name##_nocancel; \ + __##syscall_name##_nocancel: \ + DO_CALL (syscall_name, args); \ + cmp.l &-4095, %d0; \ + jcc SYSCALL_ERROR_LABEL; \ + rts; \ + .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ + .Lpseudo_cancel: \ + CENABLE; \ + DOCARGS_##args \ + move.l %d0, -(%sp); /* Save result of CENABLE. */ \ + cfi_adjust_cfa_offset (4); \ + move.l &SYS_ify (syscall_name), %d0; \ + trap &0; \ + move.l %d0, %d2; \ + CDISABLE; \ + addq.l &4, %sp; /* Remove result of CENABLE from the stack. */ \ + cfi_adjust_cfa_offset (-4); \ + move.l %d2, %d0; \ + UNDOCARGS_##args \ + cmp.l &-4095, %d0; \ + jcc SYSCALL_ERROR_LABEL + +/* Note: we use D2 to save syscall's return value as D0 will be clobbered in + CDISABLE. */ +# define DOCARGS_0 move.l %d2, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d2, 0); +# define UNDOCARGS_0 move.l (%sp)+, %d2; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d2); + +# define DOCARGS_1 _DOCARGS_1 (4); DOCARGS_0 +# define _DOCARGS_1(n) move.l n(%sp), %d1; +# define UNDOCARGS_1 UNDOCARGS_0 + +# define DOCARGS_2 _DOCARGS_2 (8) +# define _DOCARGS_2(n) DOCARGS_0 move.l n+4(%sp), %d2; _DOCARGS_1 (n) +# define UNDOCARGS_2 UNDOCARGS_0 + +/* TODO: We can optimize DOCARGS_{3, 4} by saving registers to a0 and a1 + instead of pushing them on stack. */ +# define DOCARGS_3 _DOCARGS_3 (12) +# define _DOCARGS_3(n) move.l %d3, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d3, 0); \ + move.l n+4(%sp), %d3; _DOCARGS_2 (n) +# define UNDOCARGS_3 UNDOCARGS_2 move.l (%sp)+, %d3; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d3); + +# define DOCARGS_4 _DOCARGS_4 (16) +# define _DOCARGS_4(n) move.l %d4, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d4, 0); \ + move.l n+4(%sp), %d4; _DOCARGS_3 (n) +# define UNDOCARGS_4 UNDOCARGS_3 move.l (%sp)+, %d4; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d4); + +# define DOCARGS_5 _DOCARGS_5 (20) +# define _DOCARGS_5(n) move.l %d5, %a1; cfi_register (%d5, a1); \ + move.l n(%sp), %d5; _DOCARGS_4 (n-4) +# define UNDOCARGS_5 UNDOCARGS_4 move.l %a1, %d5; cfi_restore (%d5); + +# define DOCARGS_6 _DOCARGS_6 (24) +# define _DOCARGS_6(n) move.l n(%sp), %a0; _DOCARGS_5 (n-4) +# define UNDOCARGS_6 UNDOCARGS_5 + +# ifdef PIC +# define PSEUDO_JMP(sym) jbsr sym ## @PLTPC +# else +# define PSEUDO_JMP(sym) jbsr sym +# endif + +# ifdef IS_IN_libpthread +# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel) +# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel) +# elif !defined NOT_IN_libc +# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel) +# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel) +# elif defined IS_IN_librt +# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel) +# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel) +# else +# error Unsupported library +# endif + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +# else +# define SINGLE_THREAD_P \ + PSEUDO_JMP (__m68k_read_tp); \ + tst.l MULTIPLE_THREADS_OFFSET(%a0) +# endif + +#elif !defined __ASSEMBLER__ + +# define SINGLE_THREAD_P (1) +# define NO_CANCELLATION (1) + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, \ + 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S new file mode 100644 index 0000000000..d8c307d2fb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/vfork.S @@ -0,0 +1,37 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tcb-offsets.h> + +#define SAVE_PID \ + bsrl __m68k_read_tp@PLTPC ; /* Get the thread pointer. */ \ + movel %a0, %a1 ; /* Save TP for RESTORE_PID. */ \ + movel PID_OFFSET(%a1), %d0 ; /* Get the PID. */ \ + movel %d0, %d1 ; /* Save PID for RESTORE_PID. */ \ + negl %d0 ; /* Negate the PID. */ \ + bne 1f ; /* If it was zero... */ \ + movel #0x80000000, %d0 ; /* use 0x80000000 instead. */ \ +1: movel %d0, PID_OFFSET(%a1) ; /* Store the temporary PID. */ + +#define RESTORE_PID \ + tstl %d0 ; \ + beq 1f ; /* If we are the parent... */ \ + movel %d1, PID_OFFSET(%a1) ; /* Restore the PID. */ \ +1: + +#include <sysdeps/unix/sysv/linux/m68k/vfork.S> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c b/ports/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c new file mode 100644 index 0000000000..4c27e957bf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/putmsg.c b/ports/sysdeps/unix/sysv/linux/m68k/putmsg.c new file mode 100644 index 0000000000..ebc1680ca7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/putmsg.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/putmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/readdir64.c b/ports/sysdeps/unix/sysv/linux/m68k/readdir64.c new file mode 100644 index 0000000000..2ea26dd409 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/readdir64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/readdir64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/readdir64_r.c b/ports/sysdeps/unix/sysv/linux/m68k/readdir64_r.c new file mode 100644 index 0000000000..9f54f897e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/readdir64_r.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h b/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h new file mode 100644 index 0000000000..877089ecb0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h @@ -0,0 +1,207 @@ +/* Dump registers. + Copyright (C) 1998, 2002, 2004, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@gnu.org>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> +#include <sys/uio.h> +#include <_itoa.h> + +/* We will print the register dump in this format: + + D0: XXXXXXXX D1: XXXXXXXX D2: XXXXXXXX D3: XXXXXXXX + D4: XXXXXXXX D5: XXXXXXXX D6: XXXXXXXX D7: XXXXXXXX + A0: XXXXXXXX A1: XXXXXXXX A2: XXXXXXXX A3: XXXXXXXX + A4: XXXXXXXX A5: XXXXXXXX A6: XXXXXXXX A7: XXXXXXXX + PC: XXXXXXXX SR: XXXX + + OldMask: XXXXXXXX Vector: XXXX + + FP0: XXXXXXXXXXXXXXXXXXXXXXXX FP1: XXXXXXXXXXXXXXXXXXXXXXXX + FP2: XXXXXXXXXXXXXXXXXXXXXXXX FP3: XXXXXXXXXXXXXXXXXXXXXXXX + FP4: XXXXXXXXXXXXXXXXXXXXXXXX FP5: XXXXXXXXXXXXXXXXXXXXXXXX + FP6: XXXXXXXXXXXXXXXXXXXXXXXX FP7: XXXXXXXXXXXXXXXXXXXXXXXX + FPCR: XXXXXXXX FPSR: XXXXXXXX FPIAR: XXXXXXXX + +*/ + +/* Linux saves only the call-clobbered registers in the sigcontext. We + need to use a trampoline that saves the rest so that the C code can + access them. We use the sc_fpstate field, since the handler is not + supposed to return anyway, thus it doesn't matter that it's clobbered. */ + +/* static */ void catch_segfault (int, int, struct sigcontext *); + +/* Dummy function so that we can use asm with arguments. */ +static void __attribute_used__ +__dummy__ (void) +{ + asm ("\n\ +catch_segfault:\n\ + move.l 12(%%sp),%%a0\n\ + lea %c0(%%a0),%%a0\n\ + /* Clear the first 4 bytes to make it a null fp state, just\n\ + in case the handler does return. */\n\ + clr.l (%%a0)+\n\ + movem.l %%d2-%%d7/%%a2-%%a6,(%%a0)\n" +#ifndef __mcoldfire__ + "fmovem.x %%fp2-%%fp7,11*4(%%a0)\n" +#elif defined __mcffpu__ + "fmovem.d %%fp2-%%fp7,11*4(%%a0)\n" +#endif + "jra real_catch_segfault" + : : "n" (offsetof (struct sigcontext, sc_fpstate))); +} +#define catch_segfault(a,b) \ + __attribute_used__ real_catch_segfault(a,b) + +static void +hexvalue (unsigned long int value, char *buf, size_t len) +{ + char *cp = _itoa_word (value, buf + len, 16, 0); + while (cp > buf) + *--cp = '0'; +} + +static void +register_dump (int fd, struct sigcontext *ctx) +{ + char regs[20][8]; + char fpregs[11][24]; + struct iovec iov[63], *next_iov = iov; + unsigned long *p = (unsigned long *) ctx->sc_fpstate + 1; + unsigned long *pfp = (unsigned long *) ctx->sc_fpregs; + int i, j, fpreg_size; + +#define ADD_STRING(str) \ + next_iov->iov_base = (char *) (str); \ + next_iov->iov_len = strlen (str); \ + ++next_iov +#define ADD_MEM(str, len) \ + next_iov->iov_base = (str); \ + next_iov->iov_len = (len); \ + ++next_iov + +#ifdef __mcoldfire__ + fpreg_size = 16; +#else + fpreg_size = 24; +#endif + + /* Generate strings of register contents. */ + hexvalue (ctx->sc_d0, regs[0], 8); + hexvalue (ctx->sc_d1, regs[1], 8); + hexvalue (*p++, regs[2], 8); + hexvalue (*p++, regs[3], 8); + hexvalue (*p++, regs[4], 8); + hexvalue (*p++, regs[5], 8); + hexvalue (*p++, regs[6], 8); + hexvalue (*p++, regs[7], 8); + hexvalue (ctx->sc_a0, regs[8], 8); + hexvalue (ctx->sc_a1, regs[9], 8); + hexvalue (*p++, regs[10], 8); + hexvalue (*p++, regs[11], 8); + hexvalue (*p++, regs[12], 8); + hexvalue (*p++, regs[13], 8); + hexvalue (*p++, regs[14], 8); + hexvalue (ctx->sc_usp, regs[15], 8); + hexvalue (ctx->sc_pc, regs[16], 8); + hexvalue (ctx->sc_sr, regs[17], 4); + hexvalue (ctx->sc_mask, regs[18], 8); + hexvalue (ctx->sc_formatvec & 0xfff, regs[19], 4); + for (i = 0; i < 2; i++) + for (j = 0; j < fpreg_size; j += 8) + hexvalue (*pfp++, fpregs[i] + j, 8); + for (i = 2; i < 8; i++) + for (j = 0; j < fpreg_size; j += 8) + hexvalue (*p++, fpregs[i] + j, 8); + hexvalue (ctx->sc_fpcntl[0], fpregs[8], 8); + hexvalue (ctx->sc_fpcntl[1], fpregs[9], 8); + hexvalue (ctx->sc_fpcntl[2], fpregs[10], 8); + + /* Generate the output. */ + ADD_STRING ("Register dump:\n\n D0: "); + ADD_MEM (regs[0], 8); + ADD_STRING (" D1: "); + ADD_MEM (regs[1], 8); + ADD_STRING (" D2: "); + ADD_MEM (regs[2], 8); + ADD_STRING (" D3: "); + ADD_MEM (regs[3], 8); + ADD_STRING ("\n D4: "); + ADD_MEM (regs[4], 8); + ADD_STRING (" D5: "); + ADD_MEM (regs[5], 8); + ADD_STRING (" D6: "); + ADD_MEM (regs[6], 8); + ADD_STRING (" D7: "); + ADD_MEM (regs[7], 8); + ADD_STRING ("\n A0: "); + ADD_MEM (regs[8], 8); + ADD_STRING (" A1: "); + ADD_MEM (regs[9], 8); + ADD_STRING (" A2: "); + ADD_MEM (regs[10], 8); + ADD_STRING (" A3: "); + ADD_MEM (regs[11], 8); + ADD_STRING ("\n A4: "); + ADD_MEM (regs[12], 8); + ADD_STRING (" A5: "); + ADD_MEM (regs[13], 8); + ADD_STRING (" A6: "); + ADD_MEM (regs[14], 8); + ADD_STRING (" A7: "); + ADD_MEM (regs[15], 8); + ADD_STRING ("\n PC: "); + ADD_MEM (regs[16], 8); + ADD_STRING (" SR: "); + ADD_MEM (regs[17], 4); + + ADD_STRING ("\n\n OldMask: "); + ADD_MEM (regs[18], 8); + ADD_STRING (" Vector: "); + ADD_MEM (regs[19], 4); + + ADD_STRING ("\n\n FP0: "); + ADD_MEM (fpregs[0], fpreg_size); + ADD_STRING (" FP1: "); + ADD_MEM (fpregs[1], fpreg_size); + ADD_STRING ("\n FP2: "); + ADD_MEM (fpregs[2], fpreg_size); + ADD_STRING (" FP3: "); + ADD_MEM (fpregs[3], fpreg_size); + ADD_STRING ("\n FP4: "); + ADD_MEM (fpregs[4], fpreg_size); + ADD_STRING (" FP5: "); + ADD_MEM (fpregs[5], fpreg_size); + ADD_STRING ("\n FP6: "); + ADD_MEM (fpregs[6], fpreg_size); + ADD_STRING (" FP7: "); + ADD_MEM (fpregs[7], fpreg_size); + ADD_STRING ("\n FPCR: "); + ADD_MEM (fpregs[8], 8); + ADD_STRING (" FPSR: "); + ADD_MEM (fpregs[9], 8); + ADD_STRING (" FPIAR: "); + ADD_MEM (fpregs[10], 8); + ADD_STRING ("\n"); + + /* Write the stuff out. */ + writev (fd, iov, next_iov - iov); +} + +#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/scandir64.c b/ports/sysdeps/unix/sysv/linux/m68k/scandir64.c new file mode 100644 index 0000000000..506fd8877c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/scandir64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/scandir64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/semctl.c b/ports/sysdeps/unix/sysv/linux/m68k/semctl.c new file mode 100644 index 0000000000..e9b1a483c9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/semctl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/semctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/semtimedop.S b/ports/sysdeps/unix/sysv/linux/m68k/semtimedop.S new file mode 100644 index 0000000000..b2b79248a9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/semtimedop.S @@ -0,0 +1,69 @@ +/* Copyright (C) 2003, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@suse.de>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define SYSOP_semtimedop 4 + +#define SVRSP 8 /* saved register space */ +#define PARMS 4+SVRSP /* space for 3 saved regs */ +#define SEMID PARMS +#define SOPS SEMID+4 +#define NSOPS SOPS+4 +#define TIMEOUT NSOPS+4 + + .text +ENTRY (semtimedop) + + /* Save registers. */ + move.l %d2, %a1 + move.l %d3, -(%sp) + cfi_adjust_cfa_offset (4) + move.l %d5, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_register (%d2, %a1) + cfi_rel_offset (%d3, 0) + cfi_rel_offset (%d5, 4) + + move.l #SYSOP_semtimedop, %d1 + move.l SEMID(%sp), %d2 + move.l NSOPS(%sp), %d3 + move.l SOPS(%sp), %d5 + move.l TIMEOUT(%sp), %a0 + move.l #SYS_ify (ipc), %d0 + + trap #0 + + /* Restore registers. */ + move.l (%sp)+, %d5 + cfi_adjust_cfa_offset (-4) + cfi_restore (%d5) + move.l (%sp)+, %d3 + cfi_adjust_cfa_offset (-4) + cfi_restore (%d3) + move.l %a1, %d2 + cfi_restore (%d2) + + /* Check for error. */ + tst.l %d0 + jmi SYSCALL_ERROR_LABEL + + /* Successful; return the syscall's value. */ + ret + +PSEUDO_END (semtimedop) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setegid.c b/ports/sysdeps/unix/sysv/linux/m68k/setegid.c new file mode 100644 index 0000000000..2e3a54c893 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setegid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setegid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/seteuid.c b/ports/sysdeps/unix/sysv/linux/m68k/seteuid.c new file mode 100644 index 0000000000..18e41d08c1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/seteuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/seteuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setfsgid.c b/ports/sysdeps/unix/sysv/linux/m68k/setfsgid.c new file mode 100644 index 0000000000..0886712569 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setfsgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setfsgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setfsuid.c b/ports/sysdeps/unix/sysv/linux/m68k/setfsuid.c new file mode 100644 index 0000000000..a9f22eb8ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setfsuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setfsuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setgid.c b/ports/sysdeps/unix/sysv/linux/m68k/setgid.c new file mode 100644 index 0000000000..377021d9ec --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setgroups.c b/ports/sysdeps/unix/sysv/linux/m68k/setgroups.c new file mode 100644 index 0000000000..0e7086278f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setgroups.c @@ -0,0 +1,2 @@ +/* We also have to rewrite the kernel gid_t to the user land type. */ +#include <sysdeps/unix/sysv/linux/i386/setgroups.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setregid.c b/ports/sysdeps/unix/sysv/linux/m68k/setregid.c new file mode 100644 index 0000000000..99c57ad20f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setregid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setregid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setresgid.c b/ports/sysdeps/unix/sysv/linux/m68k/setresgid.c new file mode 100644 index 0000000000..daca1a4833 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setresgid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setresgid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setresuid.c b/ports/sysdeps/unix/sysv/linux/m68k/setresuid.c new file mode 100644 index 0000000000..3aeabe9ad7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setresuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setresuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setreuid.c b/ports/sysdeps/unix/sysv/linux/m68k/setreuid.c new file mode 100644 index 0000000000..8ad61226e9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setreuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setreuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setrlimit.c b/ports/sysdeps/unix/sysv/linux/m68k/setrlimit.c new file mode 100644 index 0000000000..bfaef74c38 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setrlimit.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/setuid.c b/ports/sysdeps/unix/sysv/linux/m68k/setuid.c new file mode 100644 index 0000000000..de394379be --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/setuid.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setuid.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/shmctl.c b/ports/sysdeps/unix/sysv/linux/m68k/shmctl.c new file mode 100644 index 0000000000..7eac6380dd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/shmctl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/shmctl.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h new file mode 100644 index 0000000000..261ccc5de1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#define SIGCONTEXT int _code, struct sigcontext * +#define SIGCONTEXT_EXTRA_ARGS _code, +#define GET_PC(ctx) ((void *) (ctx)->sc_pc) +#define GET_FRAME(ctx) ((void *) __builtin_frame_address (1)) +#define GET_STACK(ctx) ((void *) (ctx)->sc_usp) +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/socket.S b/ports/sysdeps/unix/sysv/linux/m68k/socket.S new file mode 100644 index 0000000000..53aafec820 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/socket.S @@ -0,0 +1,122 @@ +/* Copyright (C) 1996, 1997, 1998, 2010, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep-cancel.h> +#include <socketcall.h> + +#define P(a, b) P2(a, b) +#define P2(a, b) a##b + + .text +/* The socket-oriented system calls are handled unusally in Linux. + They are all gated through the single `socketcall' system call number. + `socketcall' takes two arguments: the first is the subcode, specifying + which socket function is being called; and the second is a pointer to + the arguments to the specific function. + + The .S files for the other calls just #define socket and #include this. */ + +#ifndef __socket +#ifndef NO_WEAK_ALIAS +#define __socket P(__,socket) +#else +#define __socket socket +#endif +#endif + +.globl __socket +ENTRY (__socket) +#ifdef NEED_CANCELLATION +# if !defined CENABLE || !defined CDISABLE +# error CENABLE and/or CDISABLE is not defined +# endif + SINGLE_THREAD_P + jne 1f +#endif + + /* Save registers. */ + move.l %d2, %a0 + cfi_register (%d2, %a0) + + move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */ + + /* Use ## so `socket' is a separate token that might be #define'd. */ + move.l #P (SOCKOP_,socket), %d1 /* Subcode is first arg to syscall. */ + lea 4(%sp), %a1 /* Address of args is 2nd arg. */ + move.l %a1, %d2 + + /* Do the system call trap. */ + trap #0 + + /* Restore registers. */ + move.l %a0, %d2 + cfi_restore (%d2) + + /* %d0 is < 0 if there was an error. */ + tst.l %d0 + jmi SYSCALL_ERROR_LABEL + + /* Successful; return the syscall's value. */ + rts + +#ifdef NEED_CANCELLATION +1: /* Enable asynchronous cancellation. */ + CENABLE + + /* Save D2. */ + move.l %d2, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d2, 0) + + /* Save the result of CENABLE. */ + move.l %d0, -(%sp) + cfi_adjust_cfa_offset (4) + + /* Use ## so `socket' is a separate token that might be #define'd. */ + move.l #P (SOCKOP_,socket), %d1 /* Subcode is first arg to syscall. */ + lea 4+8(%sp), %a1 /* Address of args is 2nd arg. */ + move.l %a1, %d2 + + move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */ + /* Do the system call trap. */ + trap #0 + + /* Restore cancellation. */ + move.l %d0, %d2 + CDISABLE + addq.l #4, %sp + cfi_adjust_cfa_offset (-4) + move.l %d2, %d0 + + /* Restore registers. */ + move.l (%sp)+, %d2 + cfi_adjust_cfa_offset (-4) + cfi_restore (%d2) + + /* %d0 is < 0 if there was an error. */ + tst.l %d0 + jmi SYSCALL_ERROR_LABEL + + /* Successful; return the syscall's value. */ + rts +#endif + +PSEUDO_END (__socket) + +#ifndef NO_WEAK_ALIAS +weak_alias (__socket, socket) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/m68k/sys/procfs.h new file mode 100644 index 0000000000..615fdfbdc8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sys/procfs.h @@ -0,0 +1,125 @@ +/* Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somewhat modelled after the file of the same name on SVR4 + systems. It provides a definition of the core file format for ELF + used on Linux. It doesn't have anything to do with the /proc file + system, even though Linux has one. + + Anyway, the whole purpose of this file is for GDB and GDB only. + Don't read too much into it. Don't use it for anything other than + GDB unless you know what you are doing. */ + +#include <features.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/user.h> + +__BEGIN_DECLS + +/* Type for a general-purpose register. */ +typedef unsigned long elf_greg_t; + +/* And the whole bunch of them. We could have used `struct + user_regs_struct' directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +/* Register set for the floating-point registers. */ +typedef struct user_m68kfp_struct elf_fpregset_t; + + +/* Signal info. */ +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with Linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + GDB doesn't really use excluded. */ + +struct elf_prstatus + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args. */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned short int pr_uid; + unsigned short int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + + +/* The rest of this file provides the types for emulation of the + Solaris <proc_service.h> interfaces that should be implemented by + users of libthread_db. */ + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore have only one PID type. */ +typedef __pid_t lwpid_t; + +/* Process status and info. In the end we do provide typedefs for them. */ +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sys/reg.h b/ports/sysdeps/unix/sysv/linux/m68k/sys/reg.h new file mode 100644 index 0000000000..4145d5012a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sys/reg.h @@ -0,0 +1,101 @@ +/* Copyright (C) 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_REG_H +#define _SYS_REG_H 1 + +/* Index into an array of 4 byte integers returned from ptrace for + location of the users' stored general purpose registers. */ + +enum +{ + PT_D1 = 0, +#define PT_D1 PT_D1 + PT_D2 = 1, +#define PT_D2 PT_D2 + PT_D3 = 2, +#define PT_D3 PT_D3 + PT_D4 = 3, +#define PT_D4 PT_D4 + PT_D5 = 4, +#define PT_D5 PT_D5 + PT_D6 = 5, +#define PT_D6 PT_D6 + PT_D7 = 6, +#define PT_D7 PT_D7 + PT_A0 = 7, +#define PT_A0 PT_A0 + PT_A1 = 8, +#define PT_A1 PT_A1 + PT_A2 = 9, +#define PT_A2 PT_A2 + PT_A3 = 10, +#define PT_A3 PT_A3 + PT_A4 = 11, +#define PT_A4 PT_A4 + PT_A5 = 12, +#define PT_A5 PT_A5 + PT_A6 = 13, +#define PT_A6 PT_A6 + PT_D0 = 14, +#define PT_D0 PT_D0 + PT_USP = 15, +#define PT_USP PT_USP + PT_ORIG_D0 = 16, +#define PT_ORIG_D0 PT_ORIG_D0 + PT_SR = 17, +#define PT_SR PT_SR + PT_PC = 18, +#define PT_PC PT_PC + +#ifdef __mcoldfire__ + PT_FP0 = 21, + PT_FP1 = 23, + PT_FP2 = 25, + PT_FP3 = 27, + PT_FP4 = 29, + PT_FP5 = 31, + PT_FP6 = 33, + PT_FP7 = 35, +#else + PT_FP0 = 21, + PT_FP1 = 24, + PT_FP2 = 27, + PT_FP3 = 30, + PT_FP4 = 33, + PT_FP5 = 36, + PT_FP6 = 39, + PT_FP7 = 42, +#endif +#define PT_FP0 PT_FP0 +#define PT_FP1 PT_FP1 +#define PT_FP2 PT_FP2 +#define PT_FP3 PT_FP3 +#define PT_FP4 PT_FP4 +#define PT_FP5 PT_FP5 +#define PT_FP6 PT_FP6 +#define PT_FP7 PT_FP7 + + PT_FPCR = 45, +#define PT_FPCR PT_FPCR + PT_FPSR = 46, +#define PT_FPSR PT_FPSR + PT_FPIAR = 47 +#define PT_FPIAR PT_FPIAR +}; + +#endif /* _SYS_REG_H */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h new file mode 100644 index 0000000000..c301e1afd0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h @@ -0,0 +1,112 @@ +/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* System V/m68k ABI compliant context switching support. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +/* Type for general register. */ +typedef int greg_t; + +/* Number of general registers. */ +#define NGREG 18 + +/* Container for all general registers. */ +typedef greg_t gregset_t[NGREG]; + +/* Number of each register is the `gregset_t' array. */ +enum +{ + R_D0 = 0, +#define R_D0 R_D0 + R_D1 = 1, +#define R_D1 R_D1 + R_D2 = 2, +#define R_D2 R_D2 + R_D3 = 3, +#define R_D3 R_D3 + R_D4 = 4, +#define R_D4 R_D4 + R_D5 = 5, +#define R_D5 R_D5 + R_D6 = 6, +#define R_D6 R_D6 + R_D7 = 7, +#define R_D7 R_D7 + R_A0 = 8, +#define R_A0 R_A0 + R_A1 = 9, +#define R_A1 R_A1 + R_A2 = 10, +#define R_A2 R_A2 + R_A3 = 11, +#define R_A3 R_A3 + R_A4 = 12, +#define R_A4 R_A4 + R_A5 = 13, +#define R_A5 R_A5 + R_A6 = 14, +#define R_A6 R_A6 + R_A7 = 15, +#define R_A7 R_A7 + R_SP = 15, +#define R_SP R_SP + R_PC = 16, +#define R_PC R_PC + R_PS = 17 +#define R_PS R_PS +}; + +/* Structure to describe FPU registers. */ +typedef struct fpregset +{ + int f_pcr; + int f_psr; + int f_fpiaddr; +#ifdef __mcoldfire__ + int f_fpregs[8][2]; +#else + int f_fpregs[8][3]; +#endif +} fpregset_t; + +/* Context to describe whole processor state. */ +typedef struct +{ + int version; + gregset_t gregs; + fpregset_t fpregs; +} mcontext_t; + +#define MCONTEXT_VERSION 2 + +/* Userlevel context. */ +typedef struct ucontext +{ + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; + __sigset_t uc_sigmask; +} ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h b/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h new file mode 100644 index 0000000000..851de60d74 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h @@ -0,0 +1,65 @@ +/* Copyright (C) 2008, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +/* The whole purpose of this file is for GDB and GDB only. Don't read + too much into it. Don't use it for anything other than GDB unless + you know what you are doing. */ + +struct user_m68kfp_struct { + unsigned long fpregs[8*3]; + unsigned long fpcntl[3]; +}; + +struct user_regs_struct { + long d1, d2, d3, d4, d5, d6, d7; + long a0, a1, a2, a3, a4, a5, a6; + long d0; + long usp; + long orig_d0; + short stkadj; + short sr; + long pc; + short fmtvec; + short __fill; +}; + +struct user { + struct user_regs_struct regs; + int u_fpvalid; + struct user_m68kfp_struct m68kfp; + unsigned long int u_tsize; + unsigned long int u_dsize; + unsigned long int u_ssize; + unsigned long start_code; + unsigned long start_stack; + long int signal; + int reserved; + unsigned long u_ar0; + struct user_m68kfp_struct *u_fpstate; + unsigned long magic; + char u_comm[32]; +}; + +#define NBPG 4096 +#define UPAGES 1 +#define HOST_TEXT_START_ADDR u.start_code +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/syscall.S b/ports/sysdeps/unix/sysv/linux/m68k/syscall.S new file mode 100644 index 0000000000..4a9d5030fc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/syscall.S @@ -0,0 +1,32 @@ +/* Copyright (C) 1996, 1998, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +/* Please consult the file sysdeps/unix/sysv/linux/m68k/sysdep.h for + more information about the value -4095 used below.*/ + + .text +ENTRY (syscall) + move.l 4(%sp), %d0 /* Load syscall number. */ + _DOARGS_6 (28) /* Frob arguments. */ + trap &0 /* Do the system call. */ + UNDOARGS_6 /* Unfrob arguments. */ + cmp.l &-4095, %d0 /* Check %d0 for error. */ + jcc SYSCALL_ERROR_LABEL /* Jump to error handler if negative. */ + rts /* Return to caller. */ +PSEUDO_END (syscall) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list b/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list new file mode 100644 index 0000000000..1e27d8de71 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list @@ -0,0 +1,7 @@ +# File name Caller Syscall name Args Strong name Weak names + +chown - chown32 i:sii __chown chown + +cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush +prlimit64 EXTRA prlimit64 i:iipp prlimit64 +fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.S b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.S new file mode 100644 index 0000000000..85b57f4c29 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.S @@ -0,0 +1,50 @@ +/* Copyright (C) 1996, 2002, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + + +/* The following code is only used in the shared library when we + compile the reentrant version. Otherwise each system call defines + each own version. */ + +#ifndef PIC + +/* The syscall stubs jump here when they detect an error. */ + +#undef CALL_MCOUNT +#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %d0. */ + + .text +ENTRY (__syscall_error) + neg.l %d0 +#ifndef _LIBC_REENTRANT + move.l %d0, errno +#else + move.l %d0, -(%sp) + cfi_adjust_cfa_offset (4) + jbsr __errno_location + move.l (%sp)+, (%a0) + cfi_adjust_cfa_offset (-4) +#endif + move.l #-1, %d0 + /* Copy return value to %a0 for syscalls that are declared to + return a pointer. */ + move.l %d0, %a0 + rts +END (__syscall_error) +#endif /* PIC */ diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h new file mode 100644 index 0000000000..b288712541 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -0,0 +1,326 @@ +/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2010, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>, + December 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tls.h> + +/* Defines RTLD_PRIVATE_ERRNO. */ +#include <dl-sysdep.h> + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +#ifdef __ASSEMBLER__ + +/* Linux uses a negative return value to indicate syscall errors, unlike + most Unices, which use the condition codes' carry flag. + + Since version 2.1 the return value of a system call might be negative + even if the call succeeded. E.g., the `lseek' system call might return + a large offset. Therefore we must not anymore test for < 0, but test + for a real error by making sure the value in %d0 is a real error + number. Linus said he will make sure the no syscall returns a value + in -1 .. -4095 as a valid result so we can savely test with -4095. */ + +/* We don't want the label for the error handler to be visible in the symbol + table when we define it here. */ +#ifdef PIC +#define SYSCALL_ERROR_LABEL .Lsyscall_error +#else +#define SYSCALL_ERROR_LABEL __syscall_error +#endif + +#undef PSEUDO +#define PSEUDO(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args); \ + cmp.l &-4095, %d0; \ + jcc SYSCALL_ERROR_LABEL + +#undef PSEUDO_END +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER; \ + END (name) + +#undef PSEUDO_NOERRNO +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args) + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + +#define ret_NOERRNO rts + +/* The function has to return the error code. */ +#undef PSEUDO_ERRVAL +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args); \ + negl %d0 + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) \ + END (name) + +#define ret_ERRVAL rts + +#ifdef PIC +# if RTLD_PRIVATE_ERRNO +# define SYSCALL_ERROR_HANDLER \ +SYSCALL_ERROR_LABEL: \ + PCREL_OP (lea, rtld_errno, %a0, %a0); \ + neg.l %d0; \ + move.l %d0, (%a0); \ + move.l &-1, %d0; \ + /* Copy return value to %a0 for syscalls that are declared to return \ + a pointer (e.g., mmap). */ \ + move.l %d0, %a0; \ + rts; +# elif defined _LIBC_REENTRANT +# ifndef NOT_IN_libc +# define SYSCALL_ERROR_ERRNO __libc_errno +# else +# define SYSCALL_ERROR_ERRNO errno +# endif +# define SYSCALL_ERROR_HANDLER \ +SYSCALL_ERROR_LABEL: \ + neg.l %d0; \ + move.l %d0, -(%sp); \ + cfi_adjust_cfa_offset (4); \ + jbsr __m68k_read_tp@PLTPC; \ + SYSCALL_ERROR_LOAD_GOT (%a1); \ + add.l (SYSCALL_ERROR_ERRNO@TLSIE, %a1), %a0; \ + move.l (%sp)+, (%a0); \ + cfi_adjust_cfa_offset (-4); \ + move.l &-1, %d0; \ + /* Copy return value to %a0 for syscalls that are declared to return \ + a pointer (e.g., mmap). */ \ + move.l %d0, %a0; \ + rts; +# else /* !_LIBC_REENTRANT */ +/* Store (- %d0) into errno through the GOT. */ +# define SYSCALL_ERROR_HANDLER \ +SYSCALL_ERROR_LABEL: \ + move.l (errno@GOTPC, %pc), %a0; \ + neg.l %d0; \ + move.l %d0, (%a0); \ + move.l &-1, %d0; \ + /* Copy return value to %a0 for syscalls that are declared to return \ + a pointer (e.g., mmap). */ \ + move.l %d0, %a0; \ + rts; +# endif /* _LIBC_REENTRANT */ +#else +# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ +#endif /* PIC */ + +/* Linux takes system call arguments in registers: + + syscall number %d0 call-clobbered + arg 1 %d1 call-clobbered + arg 2 %d2 call-saved + arg 3 %d3 call-saved + arg 4 %d4 call-saved + arg 5 %d5 call-saved + arg 6 %a0 call-clobbered + + The stack layout upon entering the function is: + + 24(%sp) Arg# 6 + 20(%sp) Arg# 5 + 16(%sp) Arg# 4 + 12(%sp) Arg# 3 + 8(%sp) Arg# 2 + 4(%sp) Arg# 1 + (%sp) Return address + + (Of course a function with say 3 arguments does not have entries for + arguments 4 and 5.) + + Separate move's are faster than movem, but need more space. Since + speed is more important, we don't use movem. Since %a0 and %a1 are + scratch registers, we can use them for saving as well. */ + +#define DO_CALL(syscall_name, args) \ + move.l &SYS_ify(syscall_name), %d0; \ + DOARGS_##args \ + trap &0; \ + UNDOARGS_##args + +#define DOARGS_0 /* No arguments to frob. */ +#define UNDOARGS_0 /* No arguments to unfrob. */ +#define _DOARGS_0(n) /* No arguments to frob. */ + +#define DOARGS_1 _DOARGS_1 (4) +#define _DOARGS_1(n) move.l n(%sp), %d1; _DOARGS_0 (n) +#define UNDOARGS_1 UNDOARGS_0 + +#define DOARGS_2 _DOARGS_2 (8) +#define _DOARGS_2(n) move.l %d2, %a0; cfi_register (%d2, %a0); \ + move.l n(%sp), %d2; _DOARGS_1 (n-4) +#define UNDOARGS_2 UNDOARGS_1; move.l %a0, %d2; cfi_restore (%d2) + +#define DOARGS_3 _DOARGS_3 (12) +#define _DOARGS_3(n) move.l %d3, %a1; cfi_register (%d3, %a1); \ + move.l n(%sp), %d3; _DOARGS_2 (n-4) +#define UNDOARGS_3 UNDOARGS_2; move.l %a1, %d3; cfi_restore (%d3) + +#define DOARGS_4 _DOARGS_4 (16) +#define _DOARGS_4(n) move.l %d4, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d4, 0); \ + move.l n+4(%sp), %d4; _DOARGS_3 (n) +#define UNDOARGS_4 UNDOARGS_3; move.l (%sp)+, %d4; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d4) + +#define DOARGS_5 _DOARGS_5 (20) +#define _DOARGS_5(n) move.l %d5, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d5, 0); \ + move.l n+4(%sp), %d5; _DOARGS_4 (n) +#define UNDOARGS_5 UNDOARGS_4; move.l (%sp)+, %d5; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d5) + +#define DOARGS_6 _DOARGS_6 (24) +#define _DOARGS_6(n) _DOARGS_5 (n-4); move.l %a0, -(%sp); \ + cfi_adjust_cfa_offset (4); \ + move.l n+12(%sp), %a0; +#define UNDOARGS_6 move.l (%sp)+, %a0; cfi_adjust_cfa_offset (-4); \ + UNDOARGS_5 + + +#define ret rts +#if 0 /* Not used by Linux */ +#define r0 %d0 +#define r1 %d1 +#define MOVE(x,y) movel x , y +#endif + +#else /* not __ASSEMBLER__ */ + +/* Define a macro which expands into the inline wrapper code for a system + call. */ +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args); \ + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0))\ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \ + _sys_result = (unsigned int) -1; \ + } \ + (int) _sys_result; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) do { } while (0) + +/* Define a macro which expands inline into the wrapper code for a system + call. This use is for internal calls that do not need to handle errors + normally. It will never touch errno. This returns just what the kernel + gave back. */ +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ unsigned int _sys_result; \ + { \ + /* Load argument values in temporary variables + to perform side effects like function calls + before the call used registers are set. */ \ + LOAD_ARGS_##nr (args) \ + LOAD_REGS_##nr \ + register int _d0 asm ("%d0") = name; \ + asm volatile ("trap #0" \ + : "=d" (_d0) \ + : "0" (_d0) ASM_ARGS_##nr \ + : "memory"); \ + _sys_result = _d0; \ + } \ + (int) _sys_result; }) +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ + ((unsigned int) (val) >= -4095U) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) + +#define LOAD_ARGS_0() +#define LOAD_REGS_0 +#define ASM_ARGS_0 +#define LOAD_ARGS_1(a1) \ + LOAD_ARGS_0 () \ + int __arg1 = (int) (a1); +#define LOAD_REGS_1 \ + register int _d1 asm ("d1") = __arg1; \ + LOAD_REGS_0 +#define ASM_ARGS_1 ASM_ARGS_0, "d" (_d1) +#define LOAD_ARGS_2(a1, a2) \ + LOAD_ARGS_1 (a1) \ + int __arg2 = (int) (a2); +#define LOAD_REGS_2 \ + register int _d2 asm ("d2") = __arg2; \ + LOAD_REGS_1 +#define ASM_ARGS_2 ASM_ARGS_1, "d" (_d2) +#define LOAD_ARGS_3(a1, a2, a3) \ + LOAD_ARGS_2 (a1, a2) \ + int __arg3 = (int) (a3); +#define LOAD_REGS_3 \ + register int _d3 asm ("d3") = __arg3; \ + LOAD_REGS_2 +#define ASM_ARGS_3 ASM_ARGS_2, "d" (_d3) +#define LOAD_ARGS_4(a1, a2, a3, a4) \ + LOAD_ARGS_3 (a1, a2, a3) \ + int __arg4 = (int) (a4); +#define LOAD_REGS_4 \ + register int _d4 asm ("d4") = __arg4; \ + LOAD_REGS_3 +#define ASM_ARGS_4 ASM_ARGS_3, "d" (_d4) +#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \ + LOAD_ARGS_4 (a1, a2, a3, a4) \ + int __arg5 = (int) (a5); +#define LOAD_REGS_5 \ + register int _d5 asm ("d5") = __arg5; \ + LOAD_REGS_4 +#define ASM_ARGS_5 ASM_ARGS_4, "d" (_d5) +#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \ + LOAD_ARGS_5 (a1, a2, a3, a4, a5) \ + int __arg6 = (int) (a6); +#define LOAD_REGS_6 \ + register int _a0 asm ("a0") = __arg6; \ + LOAD_REGS_5 +#define ASM_ARGS_6 ASM_ARGS_5, "a" (_a0) + +#endif /* not __ASSEMBLER__ */ + +/* Pointer mangling is not yet supported for M68K. */ +#define PTR_MANGLE(var) (void) (var) +#define PTR_DEMANGLE(var) (void) (var) + +#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO +/* M68K needs system-supplied DSO to access TLS helpers + even when statically linked. */ +# define NEED_STATIC_SYSINFO_DSO 1 +#endif diff --git a/ports/sysdeps/unix/sysv/linux/m68k/versionsort64.c b/ports/sysdeps/unix/sysv/linux/m68k/versionsort64.c new file mode 100644 index 0000000000..144b691e56 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/versionsort64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/versionsort64.c> diff --git a/ports/sysdeps/unix/sysv/linux/m68k/vfork.S b/ports/sysdeps/unix/sysv/linux/m68k/vfork.S new file mode 100644 index 0000000000..24e0c9037c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/vfork.S @@ -0,0 +1,95 @@ +/* Copyright (C) 1999, 2002, 2003, 2010, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Schwab <schwab@gnu.org>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> +#include <kernel-features.h> + +#ifndef SAVE_PID +#define SAVE_PID +#endif + +#ifndef RESTORE_PID +#define RESTORE_PID +#endif + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + +ENTRY (__vfork) + +#ifdef __NR_vfork + + /* SAVE_PID clobbers call-clobbered registers and + saves data in D1 and A1. */ + + SAVE_PID + + /* Pop the return PC value into A0. */ + movel %sp@+, %a0 + cfi_adjust_cfa_offset (-4) + cfi_register (%pc, %a0) + + /* Stuff the syscall number in D0 and trap into the kernel. */ + movel #SYS_ify (vfork), %d0 + trap #0 + + RESTORE_PID + + tstl %d0 + jmi .Lerror /* Branch forward if it failed. */ + + /* Jump to the return PC. */ + jmp %a0@ + +.Lerror: + /* Push back the return PC. */ + movel %a0,%sp@- + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%pc, 0) + +# ifdef __ASSUME_VFORK_SYSCALL +# ifndef PIC + jbra SYSCALL_ERROR_LABEL +# endif +# else + /* Check if vfork syscall is known at all. */ + movel #-ENOSYS,%d1 + cmpl %d0,%d1 + jne SYSCALL_ERROR_LABEL + +# endif +#endif + +#ifndef __ASSUME_VFORK_SYSCALL + /* If we don't have vfork, fork is close enough. */ + + movel #SYS_ify (fork), %d0 + trap #0 + tstl %d0 + jmi SYSCALL_ERROR_LABEL + rts +#endif + +PSEUDO_END (__vfork) +libc_hidden_def (__vfork) + +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/m68k/xstat.c b/ports/sysdeps/unix/sysv/linux/m68k/xstat.c new file mode 100644 index 0000000000..e9869f5508 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/m68k/xstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/xstat.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/Makefile b/ports/sysdeps/unix/sysv/linux/mips/Makefile new file mode 100644 index 0000000000..99c554ff67 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/Makefile @@ -0,0 +1,32 @@ +ifeq ($(subdir),signal) +#sysdep_routines += sigsuspend +endif + +ifeq ($(subdir),misc) +sysdep_routines += cachectl cacheflush sysmips _test_and_set + +sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h +endif + +# _MIPS_SIM_ABI32 == 1, _MIPS_SIM_NABI32 == 2, _MIPS_SIM_ABI64 == 3 +abi-variants := o32 n32 n64 +abi-includes := sgidefs.h +abi-o32-options := -D_MIPS_SIM=1 +abi-o32-condition := _MIPS_SIM == _MIPS_SIM_ABI32 +abi-n32-options := -D_MIPS_SIM=2 +abi-n32-condition := _MIPS_SIM == _MIPS_SIM_NABI32 +abi-n64-options := -D_MIPS_SIM=3 +abi-n64-condition := _MIPS_SIM == _MIPS_SIM_ABI64 + +ifeq ($(subdir),elf) +ifeq ($(build-shared),yes) +# This is needed for DSO loading from static binaries. +sysdep-dl-routines += dl-static +sysdep_routines += dl-static +sysdep-rtld-routines += dl-static +endif +endif + +ifeq ($(subdir),stdlib) +gen-as-const-headers += ucontext_i.sym +endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/Versions b/ports/sysdeps/unix/sysv/linux/mips/Versions new file mode 100644 index 0000000000..a56322a8eb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/Versions @@ -0,0 +1,40 @@ +ld { + GLIBC_PRIVATE { + # used for loading by static libraries + _dl_var_init; + } +} +libc { + # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk. + # When you get an error from errlist-compat.awk, you need to add a new + # version here. Don't do this blindly, since this means changing the ABI + # for all GNU/Linux configurations. + + GLIBC_2.0 { + #errlist-compat 123 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + + # Exception handling support functions from libgcc + __register_frame; __register_frame_table; __deregister_frame; + __frame_state_for; __register_frame_info_table; + + # Needed by gcc: + _flush_cache; + + # c* + cachectl; cacheflush; + + # s* + sysmips; + } + GLIBC_2.2 { + #errlist-compat 1134 + _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; + + # _* + _test_and_set; + } + GLIBC_2.11 { + fallocate64; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c b/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c new file mode 100644 index 0000000000..d8da27024b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <signal.h> +#include <stdio.h> +#define __longjmp ____longjmp_chk +#define CHECK_SP(saved_sp, cur_sp, sp_type) \ + do { \ + sp_type sp_saved = (sp_type) (saved_sp); \ + if (sp_saved < (cur_sp)) \ + { \ + struct __jmp_buf_internal_tag *env_save = env_arg; \ + int val_save = val_arg; \ + stack_t ss; \ + int ret = __sigaltstack (NULL, &ss); \ + if (ret == 0 \ + && (!(ss.ss_flags & SS_ONSTACK) \ + || ((unsigned sp_type) ((sp_type) ss.ss_sp \ + + (sp_type) ss.ss_size \ + - sp_saved) \ + < ss.ss_size))) \ + __fortify_fail ("longjmp causes uninitialized stack frame"); \ + asm volatile ("move %0, %1" : "=r" (env) : "r" (env_save)); \ + asm volatile ("move %0, %1" : "=r" (val) : "r" (val_save)); \ + } \ + } while (0) +#include <__longjmp.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/_test_and_set.c b/ports/sysdeps/unix/sysv/linux/mips/_test_and_set.c new file mode 100644 index 0000000000..57425d412b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/_test_and_set.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Define the real-function versions of all inline functions + defined in sys/tas.h */ + +#include <features.h> + +#define _EXTERN_INLINE +#ifndef __USE_EXTERN_INLINES +# define __USE_EXTERN_INLINES 1 +#endif + +#include "sys/tas.h" diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/endian.h b/ports/sysdeps/unix/sysv/linux/mips/bits/endian.h new file mode 100644 index 0000000000..0a3d2fabe3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/endian.h @@ -0,0 +1,16 @@ +/* The MIPS architecture has selectable endianness. + Linux/MIPS exists in two both little and big endian flavours and we + want to be able to share the installed headerfiles between both, + so we define __BYTE_ORDER based on GCC's predefines. */ + +#ifndef _ENDIAN_H +# error "Never use <bits/endian.h> directly; include <endian.h> instead." +#endif + +#ifdef __MIPSEB__ +# define __BYTE_ORDER __BIG_ENDIAN +#else +# ifdef __MIPSEL__ +# define __BYTE_ORDER __LITTLE_ENDIAN +# endif +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/epoll.h b/ports/sysdeps/unix/sysv/linux/mips/bits/epoll.h new file mode 100644 index 0000000000..4c6eb3bb73 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/epoll.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2002-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EPOLL_H +# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead." +#endif + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 02000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 00000200 +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h b/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h new file mode 100644 index 0000000000..86398f1126 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/errno.h @@ -0,0 +1,66 @@ +/* Error constants. MIPS/Linux specific version. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _ERRNO_H + +# undef EDOM +# undef EILSEQ +# undef ERANGE +# include <linux/errno.h> + +/* Linux has no ENOTSUP error code. */ +# define ENOTSUP EOPNOTSUPP + +# ifndef ECANCELED +# define ECANCELED 158 +# endif + +/* Support for error codes to support robust mutexes was added later, too. */ +# ifndef EOWNERDEAD +# define EOWNERDEAD 165 +# define ENOTRECOVERABLE 166 +# endif + +# ifndef ERFKILL +# define ERFKILL 167 +# endif + +# ifndef EHWPOISON +# define EHWPOISON 168 +# endif + +# ifndef __ASSEMBLER__ +/* Function to get address of global `errno' variable. */ +extern int *__errno_location (void) __THROW __attribute__ ((__const__)); + +# if !defined _LIBC || defined _LIBC_REENTRANT +/* When using threads, errno is a per-thread value. */ +# define errno (*__errno_location ()) +# endif +# endif /* !__ASSEMBLER__ */ +#endif /* _ERRNO_H */ + +#if !defined _ERRNO_H && defined __need_Emath +/* This is ugly but the kernel header is not clean enough. We must + define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is + defined. */ +# define EDOM 33 /* Math argument out of domain of function. */ +# define EILSEQ 88 /* Illegal byte sequence. */ +# define ERANGE 34 /* Math result not representable. */ +#endif /* !_ERRNO_H && __need_Emath */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/eventfd.h b/ports/sysdeps/unix/sysv/linux/mips/bits/eventfd.h new file mode 100644 index 0000000000..6ac2cd83d9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/eventfd.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2007-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_EVENTFD_H +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." +#endif + +/* Flags for eventfd. */ +enum + { + EFD_SEMAPHORE = 00000001, +#define EFD_SEMAPHORE EFD_SEMAPHORE + EFD_CLOEXEC = 02000000, +#define EFD_CLOEXEC EFD_CLOEXEC + EFD_NONBLOCK = 00000200 +#define EFD_NONBLOCK EFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h new file mode 100644 index 0000000000..9645b36639 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h @@ -0,0 +1,334 @@ +/* O_*, F_*, FD_* bit values for Linux. + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006, + 2007, 2009, 2010, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _FCNTL_H +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +#endif + +#include <sgidefs.h> +#include <sys/types.h> +#ifdef __USE_GNU +# include <bits/uio.h> +#endif + + +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 0003 +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDWR 02 +#define O_APPEND 0x0008 +#define O_SYNC 0x4010 +#define O_NONBLOCK 0x0080 +#define O_NDELAY O_NONBLOCK +#define O_CREAT 0x0100 /* not fcntl */ +#define O_TRUNC 0x0200 /* not fcntl */ +#define O_EXCL 0x0400 /* not fcntl */ +#define O_NOCTTY 0x0800 /* not fcntl */ +#define O_FSYNC O_SYNC +#define O_ASYNC 0x1000 + +#ifdef __USE_XOPEN2K8 +# define O_NOFOLLOW 0x20000 /* Do not follow links. */ +# define O_DIRECTORY 0x10000 /* Must be a directory. */ +# define O_CLOEXEC 02000000 /* Set close_on_exec. */ +#endif +#ifdef __USE_GNU +# define O_DIRECT 0x8000 /* Direct disk access hint. */ +# define O_NOATIME 0x40000 /* Do not set atime. */ +# define O_PATH 010000000 /* Resolve pathname but do not open file. */ +#endif + +/* For now Linux has no synchronisity options for data and read operations. + We define the symbols here but let them do the same as O_SYNC since + this is a superset. */ +#if defined __USE_POSIX199309 || defined __USE_UNIX98 +# define O_DSYNC 0x0010 /* Synchronize data. */ +# define O_RSYNC O_SYNC /* Synchronize read operations. */ +#endif + +#ifdef __USE_LARGEFILE64 +# define O_LARGEFILE 0x2000 /* Allow large file opens. */ +#endif + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#ifndef __USE_FILE_OFFSET64 +# define F_GETLK 14 /* Get record locking info. */ +# define F_SETLK 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK F_GETLK64 /* Get record locking info. */ +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ +#endif + +#define F_GETLK64 33 /* Get record locking info. */ +#define F_SETLK64 34 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 35 /* Set record locking info (blocking). */ + +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8 +# define F_SETOWN 24 /* Get owner (process receiving SIGIO). */ +# define F_GETOWN 23 /* Set owner (process receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETSIG 10 /* Set number of signal to be sent. */ +# define F_GETSIG 11 /* Get number of signal to be sent. */ +# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ +# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +#endif + +#ifdef __USE_GNU +# define F_SETLEASE 1024 /* Set a lease. */ +# define F_GETLEASE 1025 /* Enquire what lease is active. */ +# define F_NOTIFY 1026 /* Request notfications on a directory. */ +# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +#endif +#ifdef __USE_XOPEN2K8 +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set. */ +#endif + +/* For F_[GET|SET]FD. */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ +#define F_RDLCK 0 /* Read lock. */ +#define F_WRLCK 1 /* Write lock. */ +#define F_UNLCK 2 /* Remove lock. */ + +/* For old implementation of bsd flock(). */ +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ + +#ifdef __USE_BSD +/* Operations for bsd flock(), also used by the kernel implementation. */ +# define LOCK_SH 1 /* shared lock */ +# define LOCK_EX 2 /* exclusive lock */ +# define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +# define LOCK_UN 8 /* remove lock */ +#endif + +#ifdef __USE_GNU +# define LOCK_MAND 32 /* This is a mandatory flock: */ +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ +#endif + +#ifdef __USE_GNU +/* Types of directory notifications that may be requested with F_NOTIFY. */ +# define DN_ACCESS 0x00000001 /* File accessed. */ +# define DN_MODIFY 0x00000002 /* File modified. */ +# define DN_CREATE 0x00000004 /* File created. */ +# define DN_DELETE 0x00000008 /* File removed. */ +# define DN_RENAME 0x00000010 /* File renamed. */ +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#if _MIPS_SIM != _ABI64 + /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit + fcntls in o32 and n32, never has this field. */ + long int l_sysid; +#endif +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ +#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64 + /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit + flock in o32 and n32, never has this field. */ + long int pad[4]; +#endif + }; +typedef struct flock flock_t; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +#ifdef __USE_GNU +/* Owner types. */ +enum __pid_type + { + F_OWNER_TID = 0, /* Kernel thread. */ + F_OWNER_PID, /* Process. */ + F_OWNER_PGRP, /* Process group. */ + F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ + }; + +/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ +struct f_owner_ex + { + enum __pid_type type; /* Owner type of ID. */ + __pid_t pid; /* ID of owner. */ + }; +#endif + +/* Define some more compatibility macros to be backward compatible with + BSD systems which did not managed to hide these kernel macros. */ +#ifdef __USE_BSD +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY +#endif /* Use BSD. */ + +/* Advise to `posix_fadvise'. */ +#ifdef __USE_XOPEN2K +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ +#endif + + +#ifdef __USE_GNU +/* Flags for SYNC_FILE_RANGE. */ +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages + in the range before performing the + write. */ +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those + dirty pages in the range which are + not presently under writeback. */ +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in + the range after performing the + write. */ + +/* Flags for SPLICE and VMSPLICE. */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to). */ +# define SPLICE_F_MORE 4 /* Expect more data. */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ + + +/* File handle structure. */ +struct file_handle +{ + unsigned int handle_bytes; + int handle_type; + /* File identifier. */ + unsigned char f_handle[0]; +}; + +/* Maximum handle size (for now). */ +# define MAX_HANDLE_SZ 128 +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + + +/* Selective file content synch'ing. */ +extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, + unsigned int __flags); + + +/* Splice address range into a pipe. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, + __off64_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + + +/* Map file name to file handle. */ +extern int name_to_handle_at (int __dfd, const char *__name, + struct file_handle *__handle, int *__mnt_id, + int __flags) __THROW; + +/* Open file using the file handle. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, + int __flags); + +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/inotify.h b/ports/sysdeps/unix/sysv/linux/mips/bits/inotify.h new file mode 100644 index 0000000000..67d648bd94 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/inotify.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2005-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_INOTIFY_H +# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." +#endif + +/* Flags for the parameter of inotify_init1. */ +enum + { + IN_CLOEXEC = 02000000, +#define IN_CLOEXEC IN_CLOEXEC + IN_NONBLOCK = 00000200 +#define IN_NONBLOCK IN_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/ports/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h new file mode 100644 index 0000000000..90496087d1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h @@ -0,0 +1,75 @@ +/* Structure types for pre-termios terminal ioctls. Linux/MIPS version. + Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IOCTL_H +# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." +#endif + +/* Get definition of constants for use with `ioctl'. */ +#include <asm/ioctls.h> + +struct winsize + { + unsigned short int ws_row; + unsigned short int ws_col; + unsigned short int ws_xpixel; + unsigned short int ws_ypixel; + }; + +#define NCC 8 +struct termio + { + unsigned short int c_iflag; /* input mode flags */ + unsigned short int c_oflag; /* output mode flags */ + unsigned short int c_cflag; /* control mode flags */ + unsigned short int c_lflag; /* local mode flags */ + char c_line; /* line discipline */ + /* Yes, this is really NCCS. */ + unsigned char c_cc[32 /* NCCS */]; /* control characters */ + }; + +/* modem lines */ +#define TIOCM_LE 0x001 /* line enable */ +#define TIOCM_DTR 0x002 /* data terminal ready */ +#define TIOCM_RTS 0x004 /* request to send */ +#define TIOCM_ST 0x010 /* secondary transmit */ +#define TIOCM_SR 0x020 /* secondary receive */ +#define TIOCM_CTS 0x040 /* clear to send */ +#define TIOCM_CAR 0x100 /* carrier detect */ +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RNG 0x200 /* ring */ +#define TIOCM_RI TIOCM_RNG +#define TIOCM_DSR 0x400 /* data set ready */ + +/* line disciplines */ +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 /* X.25 async */ +#define N_6PACK 7 +#define N_MASC 8 /* Mobitex module */ +#define N_R3964 9 /* Simatic R3964 module */ +#define N_PROFIBUS_FDL 10 /* Profibus */ +#define N_IRDA 11 /* Linux IR */ +#define N_SMSBLOCK 12 /* SMS block mode */ +#define N_HDLC 13 /* synchronous HDLC */ +#define N_SYNC_PPP 14 /* synchronous PPP */ +#define N_HCI 15 /* Bluetooth HCI UART */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/ipc.h b/ports/sysdeps/unix/sysv/linux/mips/bits/ipc.h new file mode 100644 index 0000000000..a3d9ddc5b8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/ipc.h @@ -0,0 +1,54 @@ +/* Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IPC_H +# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." +#endif + +#include <bits/types.h> + +/* Mode bits for `msgget', `semget', and `shmget'. */ +#define IPC_CREAT 01000 /* Create key if key does not exist. */ +#define IPC_EXCL 02000 /* Fail if key exists. */ +#define IPC_NOWAIT 04000 /* Return error on wait. */ + +/* Control commands for `msgctl', `semctl', and `shmctl'. */ +#define IPC_RMID 0 /* Remove identifier. */ +#define IPC_SET 1 /* Set `ipc_perm' options. */ +#define IPC_STAT 2 /* Get `ipc_perm' options. */ +#ifdef __USE_GNU +# define IPC_INFO 3 /* See ipcs. */ +#endif + +/* Special key values. */ +#define IPC_PRIVATE ((__key_t) 0) /* Private key. */ + + +/* Data structure used to pass permission information to IPC operations. */ +struct ipc_perm + { + __key_t __key; /* Key. */ + unsigned int uid; /* Owner's user ID. */ + unsigned int gid; /* Owner's group ID. */ + unsigned int cuid; /* Creator's user ID. */ + unsigned int cgid; /* Creator's group ID. */ + unsigned int mode; /* Read/write permission. */ + unsigned short int __seq; /* Sequence number. */ + unsigned short int __pad1; + unsigned long int __unused1; + unsigned long int __unused2; +}; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h b/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h new file mode 100644 index 0000000000..26b6502c4f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h @@ -0,0 +1,114 @@ +/* Definitions for POSIX memory map interface. Linux/MIPS version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x0800 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +# define MAP_RENAME MAP_ANONYMOUS +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_NORESERVE 0x0400 /* don't check for reservations */ +# define MAP_ANONYMOUS 0x0800 /* don't use a file */ +# define MAP_GROWSDOWN 0x1000 /* stack-like segment */ +# define MAP_DENYWRITE 0x2000 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x4000 /* mark it as an executable */ +# define MAP_LOCKED 0x8000 /* pages are locked */ +# define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ +# define MAP_NONBLOCK 0x20000 /* do not block on IO */ +# define MAP_STACK 0x40000 /* Allocation is for a stack. */ +# define MAP_HUGETLB 0x80000 /* Create huge page mapping. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 4 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ +# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, + overrides the coredump filter bits. */ +# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h b/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h new file mode 100644 index 0000000000..d531e040ec --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h @@ -0,0 +1,91 @@ +/* Copyright (C) 2002, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MSG_H +# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." +#endif + +#include <bits/types.h> + +/* Define options for message queue functions. */ +#define MSG_NOERROR 010000 /* no error if message is too big */ +#ifdef __USE_GNU +# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ +#endif + +/* Types used in the structure definition. */ +typedef unsigned long int msgqnum_t; +typedef unsigned long int msglen_t; + + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ +#if __WORDSIZE == 32 && defined (__MIPSEB__) + unsigned long int __unused1; +#endif + __time_t msg_stime; /* time of last msgsnd command */ +#if __WORDSIZE == 32 && defined (__MIPSEL__) + unsigned long int __unused1; +#endif +#if __WORDSIZE == 32 && defined (__MIPSEB__) + unsigned long int __unused2; +#endif + __time_t msg_rtime; /* time of last msgrcv command */ +#if __WORDSIZE == 32 && defined (__MIPSEL__) + unsigned long int __unused2; +#endif +#if __WORDSIZE == 32 && defined (__MIPSEB__) + unsigned long int __unused3; +#endif + __time_t msg_ctime; /* time of last change */ +#if __WORDSIZE == 32 && defined (__MIPSEL__) + unsigned long int __unused3; +#endif + unsigned long int __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused4; + unsigned long int __unused5; +}; + +#ifdef __USE_MISC + +# define msg_cbytes __msg_cbytes + +/* ipcs ctl commands */ +# define MSG_STAT 11 +# define MSG_INFO 12 + +/* buffer for msgctl calls IPC_INFO, MSG_INFO */ +struct msginfo + { + int msgpool; + int msgmap; + int msgmax; + int msgmnb; + int msgmni; + int msgssz; + int msgtql; + unsigned short int msgseg; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/poll.h b/ports/sysdeps/unix/sysv/linux/mips/bits/poll.h new file mode 100644 index 0000000000..881f1be746 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/poll.h @@ -0,0 +1,49 @@ +/* Copyright (C) 1997, 2001, 2006, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_POLL_H +# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." +#endif + +/* Event types that can be polled for. These bits may be set in `events' + to indicate the interesting event types; they will appear in `revents' + to indicate the status of the file descriptor. */ +#define POLLIN 0x001 /* There is data to read. */ +#define POLLPRI 0x002 /* There is urgent data to read. */ +#define POLLOUT 0x004 /* Writing now will not block. */ + +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 +/* These values are defined in XPG4.2. */ +# define POLLRDNORM 0x040 /* Normal data may be read. */ +# define POLLRDBAND 0x080 /* Priority data may be read. */ +# define POLLWRNORM POLLOUT /* Writing now will not block. */ +# define POLLWRBAND 0x100 /* Priority data may be written. */ +#endif + +#ifdef __USE_GNU +/* These are extensions for Linux. */ +# define POLLMSG 0x400 +# define POLLREMOVE 0x1000 +# define POLLRDHUP 0x2000 +#endif + +/* Event types always implicitly polled for. These bits need not be set in + `events', but they will appear in `revents' to indicate the status of + the file descriptor. */ +#define POLLERR 0x008 /* Error condition. */ +#define POLLHUP 0x010 /* Hung up. */ +#define POLLNVAL 0x020 /* Invalid polling request. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/resource.h b/ports/sysdeps/unix/sysv/linux/mips/bits/resource.h new file mode 100644 index 0000000000..23e3ae56a0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/resource.h @@ -0,0 +1,275 @@ +/* Bit values & structures for resource limits. Linux/MIPS version. + Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006, 2008, + 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_RESOURCE_H +# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." +#endif + +#include <bits/types.h> + +/* Transmute defines to enumerations. The macro re-definitions are + necessary because some programs want to test for operating system + features with #ifdef RUSAGE_SELF. In ISO C the reflexive + definition is a no-op. */ + +/* Kinds of resource limit. */ +enum __rlimit_resource +{ + /* Per-process CPU limit, in seconds. */ + RLIMIT_CPU = 0, +#define RLIMIT_CPU RLIMIT_CPU + + /* Largest file that can be created, in bytes. */ + RLIMIT_FSIZE = 1, +#define RLIMIT_FSIZE RLIMIT_FSIZE + + /* Maximum size of data segment, in bytes. */ + RLIMIT_DATA = 2, +#define RLIMIT_DATA RLIMIT_DATA + + /* Maximum size of stack segment, in bytes. */ + RLIMIT_STACK = 3, +#define RLIMIT_STACK RLIMIT_STACK + + /* Largest core file that can be created, in bytes. */ + RLIMIT_CORE = 4, +#define RLIMIT_CORE RLIMIT_CORE + + /* Largest resident set size, in bytes. + This affects swapping; processes that are exceeding their + resident set size will be more likely to have physical memory + taken from them. */ + __RLIMIT_RSS = 7, +#define RLIMIT_RSS __RLIMIT_RSS + + /* Number of open files. */ + RLIMIT_NOFILE = 5, + __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE __RLIMIT_OFILE + + /* Address space limit (?) */ + RLIMIT_AS = 6, +#define RLIMIT_AS RLIMIT_AS + + /* Number of processes. */ + __RLIMIT_NPROC = 8, +#define RLIMIT_NPROC __RLIMIT_NPROC + + /* Locked-in-memory address space. */ + __RLIMIT_MEMLOCK = 9, +#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK + + /* Maximum number of file locks. */ + __RLIMIT_LOCKS = 10, +#define RLIMIT_LOCKS __RLIMIT_LOCKS + + /* Maximum number of pending signals. */ + __RLIMIT_SIGPENDING = 11, +#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING + + /* Maximum bytes in POSIX message queues. */ + __RLIMIT_MSGQUEUE = 12, +#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE + + /* Maximum nice priority allowed to raise to. + Nice levels 19 .. -20 correspond to 0 .. 39 + values of this resource limit. */ + __RLIMIT_NICE = 13, +#define RLIMIT_NICE __RLIMIT_NICE + + /* Maximum realtime priority allowed for non-priviledged + processes. */ + __RLIMIT_RTPRIO = 14, +#define RLIMIT_RTPRIO __RLIMIT_RTPRIO + + /* Maximum CPU time in µs that a process scheduled under a real-time + scheduling policy may consume without making a blocking system + call before being forcibly descheduled. */ + __RLIMIT_RTTIME = 15, +#define RLIMIT_RTTIME __RLIMIT_RTTIME + + __RLIMIT_NLIMITS = 16, + __RLIM_NLIMITS = __RLIMIT_NLIMITS +#define RLIMIT_NLIMITS __RLIMIT_NLIMITS +#define RLIM_NLIMITS __RLIM_NLIMITS +}; + +/* Value to indicate that there is no limit. */ +#if _MIPS_SIM == _ABI64 +/* The N64 syscall uses this value. */ +# define RLIM_INFINITY 0xffffffffffffffffUL +# ifdef __USE_LARGEFILE64 +# define RLIM64_INFINITY 0xffffffffffffffffUL +# endif +#else +/* The O32 and N32 syscalls use 0x7fffffff. */ +# ifndef __USE_FILE_OFFSET64 +# define RLIM_INFINITY ((long int)(~0UL >> 1)) +# else +# define RLIM_INFINITY 0x7fffffffffffffffULL +# endif +# ifdef __USE_LARGEFILE64 +# define RLIM64_INFINITY 0x7fffffffffffffffULL +# endif +#endif + +/* We can represent all limits. */ +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY + + +/* Type for resource quantity measurement. */ +#ifndef __USE_FILE_OFFSET64 +typedef __rlim_t rlim_t; +#else +typedef __rlim64_t rlim_t; +#endif +#ifdef __USE_LARGEFILE64 +typedef __rlim64_t rlim64_t; +#endif + +struct rlimit + { + /* The current (soft) limit. */ + rlim_t rlim_cur; + /* The hard limit. */ + rlim_t rlim_max; + }; + +#ifdef __USE_LARGEFILE64 +struct rlimit64 + { + /* The current (soft) limit. */ + rlim64_t rlim_cur; + /* The hard limit. */ + rlim64_t rlim_max; + }; +#endif + +/* Whose usage statistics do you want? */ +enum __rusage_who +{ + /* The calling process. */ + RUSAGE_SELF = 0, +#define RUSAGE_SELF RUSAGE_SELF + + /* All of its terminated child processes. */ + RUSAGE_CHILDREN = -1 +#define RUSAGE_CHILDREN RUSAGE_CHILDREN + +#ifdef __USE_GNU + , + /* The calling thread. */ + RUSAGE_THREAD = 1 +# define RUSAGE_THREAD RUSAGE_THREAD + /* Name for the same functionality on Solaris. */ +# define RUSAGE_LWP RUSAGE_THREAD +#endif +}; + +#define __need_timeval +#include <bits/time.h> /* For `struct timeval'. */ + +/* Structure which says how much of each resource has been used. */ +struct rusage + { + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + long int ru_maxrss; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + long int ru_ixrss; + /* Amount of data segment memory used (kilobyte-seconds). */ + long int ru_idrss; + /* Amount of stack memory used (kilobyte-seconds). */ + long int ru_isrss; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + long int ru_minflt; + /* Number of hard page faults (i.e. those that required I/O). */ + long int ru_majflt; + /* Number of times a process was swapped out of physical memory. */ + long int ru_nswap; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + long int ru_inblock; + /* Number of output operations via the file system. */ + long int ru_oublock; + /* Number of IPC messages sent. */ + long int ru_msgsnd; + /* Number of IPC messages received. */ + long int ru_msgrcv; + /* Number of signals delivered. */ + long int ru_nsignals; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + long int ru_nvcsw; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + long int ru_nivcsw; + }; + +/* Priority limits. */ +#define PRIO_MIN -20 /* Minimum priority a process can have. */ +#define PRIO_MAX 20 /* Maximum priority a process can have. */ + +/* The type of the WHICH argument to `getpriority' and `setpriority', + indicating what flavor of entity the WHO argument specifies. */ +enum __priority_which +{ + PRIO_PROCESS = 0, /* WHO is a process ID. */ +#define PRIO_PROCESS PRIO_PROCESS + PRIO_PGRP = 1, /* WHO is a process group ID. */ +#define PRIO_PGRP PRIO_PGRP + PRIO_USER = 2 /* WHO is a user ID. */ +#define PRIO_USER PRIO_USER +}; + + +__BEGIN_DECLS + +#ifdef __USE_GNU +/* Modify and return resource limits of a process atomically. */ +# ifndef __USE_FILE_OFFSET64 +extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, + enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit), prlimit64); +# else +# define prlimit prlimit64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit64 *__new_limit, + struct rlimit64 *__old_limit) __THROW; +# endif +#endif + +__END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/sem.h b/ports/sysdeps/unix/sysv/linux/mips/bits/sem.h new file mode 100644 index 0000000000..0c3525bd76 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/sem.h @@ -0,0 +1,84 @@ +/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SEM_H +# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." +#endif + +#include <sys/types.h> + +/* Flags for `semop'. */ +#define SEM_UNDO 0x1000 /* undo the operation on exit */ + +/* Commands for `semctl'. */ +#define GETPID 11 /* get sempid */ +#define GETVAL 12 /* get semval */ +#define GETALL 13 /* get all semval's */ +#define GETNCNT 14 /* get semncnt */ +#define GETZCNT 15 /* get semzcnt */ +#define SETVAL 16 /* set semval */ +#define SETALL 17 /* set all semval's */ + + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ + unsigned long int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused1; + unsigned long int __unused2; +}; + +/* The user should define a union like the following to use it for arguments + for `semctl'. + + union semun + { + int val; <= value for SETVAL + struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET + unsigned short int *array; <= array for GETALL & SETALL + struct seminfo *__buf; <= buffer for IPC_INFO + }; + + Previous versions of this file used to define this union but this is + incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether + one must define the union or not. */ +#define _SEM_SEMUN_UNDEFINED 1 + +#ifdef __USE_MISC + +/* ipcs ctl cmds */ +# define SEM_STAT 18 +# define SEM_INFO 19 + +struct seminfo +{ + int semmap; + int semmni; + int semmns; + int semmnu; + int semmsl; + int semopm; + int semume; + int semusz; + int semvmx; + int semaem; +}; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/shm.h b/ports/sysdeps/unix/sysv/linux/mips/bits/shm.h new file mode 100644 index 0000000000..7119652159 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/shm.h @@ -0,0 +1,94 @@ +/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003,2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." +#endif + +#include <bits/types.h> + +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ +#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ + +/* Flags for `shmat'. */ +#define SHM_RDONLY 010000 /* attach read-only else read-write */ +#define SHM_RND 020000 /* round attach address to SHMLBA */ +#define SHM_REMAP 040000 /* take-over region on attach */ +#define SHM_EXEC 0100000 /* execution access */ + +/* Commands for `shmctl'. */ +#define SHM_LOCK 11 /* lock segment (root only) */ +#define SHM_UNLOCK 12 /* unlock segment (root only) */ + +/* Segment low boundary address multiple. */ +#define SHMLBA 0x40000 + + +/* Type to count number of attaches. */ +typedef unsigned long int shmatt_t; + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __unused1; + unsigned long int __unused2; + }; + +#ifdef __USE_MISC + +/* ipcs ctl commands */ +# define SHM_STAT 13 +# define SHM_INFO 14 + +/* shm_mode upper byte flags */ +# define SHM_DEST 01000 /* segment will be destroyed on last detach */ +# define SHM_LOCKED 02000 /* segment will not be swapped */ +# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ + +struct shminfo + { + unsigned long int shmmax; + unsigned long int shmmin; + unsigned long int shmmni; + unsigned long int shmseg; + unsigned long int shmall; + unsigned long int __unused1; + unsigned long int __unused2; + unsigned long int __unused3; + unsigned long int __unused4; + }; + +struct shm_info + { + int used_ids; + unsigned long int shm_tot; /* total allocated shm */ + unsigned long int shm_rss; /* total resident shm */ + unsigned long int shm_swp; /* total swapped shm */ + unsigned long int swap_attempts; + unsigned long int swap_successes; + }; + +#endif /* __USE_MISC */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h new file mode 100644 index 0000000000..92c9ec29ce --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/sigaction.h @@ -0,0 +1,90 @@ +/* The proper definitions for Linux/MIPS's sigaction. + Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2003, 2010 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." +#endif + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Special flags. */ + unsigned int sa_flags; + + /* Signal handler. */ +#ifdef __USE_POSIX199309 + union + { + /* Used if SA_SIGINFO is not set. */ + __sighandler_t sa_handler; + /* Used if SA_SIGINFO is set. */ + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction +#else + __sighandler_t sa_handler; +#endif + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* The ABI says here are two unused ints following. */ + /* Restore handler. */ + void (*sa_restorer) (void); + +#if _MIPS_SZPTR < 64 + int sa_resv[1]; +#endif + }; + +/* Bits in `sa_flags'. */ +/* Please note that some Linux kernels versions use different values for these + flags which is a bug in those kernel versions. */ +#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */ +#define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with + three arguments instead of one. */ +#if defined __USE_UNIX98 || defined __USE_MISC +# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ +#endif +#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8 +# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ +# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ +# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when + its handler is being executed. */ +#endif +#ifdef __USE_MISC +# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ + +/* Some aliases for the SA_ constants. */ +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND +# define SA_STACK SA_ONSTACK +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_NOP 0 /* 0 is unused to catch errors */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ +#ifdef __USE_MISC +# define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: + set only the low 32 bit of the sigset. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h b/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h new file mode 100644 index 0000000000..f41928d107 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h @@ -0,0 +1,83 @@ +/* Copyright (C) 1996, 1997, 1998, 2003, 2004, 2006 Free Software + Foundation, Inc. This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SIGCONTEXT_H +#define _BITS_SIGCONTEXT_H 1 + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H +# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." +#endif + +#include <sgidefs.h> + +#if _MIPS_SIM == _ABIO32 + +/* Certain unused fields were replaced with new ones in 2.6.12-rc4. + The changes were as follows: + + sc_cause -> sc_hi1 + sc_badvaddr -> sc_lo1 + sc_sigset[0] -> sc_hi2 + sc_sigset[1] -> sc_lo2 + sc_sigset[2] -> sc_hi3 + sc_sigset[3] -> sc_lo3 + + sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ +struct sigcontext { + unsigned int sc_regmask; + unsigned int sc_status; + unsigned long long sc_pc; + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned int sc_ownedfp; + unsigned int sc_fpc_csr; + unsigned int sc_fpc_eir; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned long long sc_mdhi; + unsigned long long sc_mdlo; + unsigned long sc_hi1; + unsigned long sc_lo1; + unsigned long sc_hi2; + unsigned long sc_lo2; + unsigned long sc_hi3; + unsigned long sc_lo3; +}; + +#else + +/* This structure changed in 2.6.12-rc4 when DSP support was added. */ +struct sigcontext { + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned long long sc_mdhi; + unsigned long long sc_hi1; + unsigned long long sc_hi2; + unsigned long long sc_hi3; + unsigned long long sc_mdlo; + unsigned long long sc_lo1; + unsigned long long sc_lo2; + unsigned long long sc_lo3; + unsigned long long sc_pc; + unsigned int sc_fpc_csr; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned int sc_reserved; +}; + +#endif /* _MIPS_SIM != _ABIO32 */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h b/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h new file mode 100644 index 0000000000..3337396398 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h @@ -0,0 +1,321 @@ +/* siginfo_t, sigevent and constants. Linux/MIPS version. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SIGNAL_H && !defined __need_siginfo_t \ + && !defined __need_sigevent_t +# error "Never include this file directly. Use <signal.h> instead" +#endif + +#include <bits/wordsize.h> + +#if (!defined __have_sigval_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t \ + || defined __need_sigevent_t)) +# define __have_sigval_t 1 + +/* Type for data associated with a signal. */ +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; +#endif + +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 + +# define __SI_MAX_SIZE 128 +# if __WORDSIZE == 64 +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) +# else +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) +# endif + + +typedef struct + { + int si_signo; /* Signal number. */ + int si_code; /* Signal code. */ + int si_errno; /* If non-zero, an errno value associated with + this signal, as defined in <errno.h>. */ + int __pad0[__SI_MAX_SIZE / sizeof (int) - __SI_PAD_SIZE - 3]; + /* Explicit padding. */ + + union + { + int _pad[__SI_PAD_SIZE]; + + /* kill(). */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + } _kill; + + /* POSIX.1b timers. */ + struct + { + int si_tid; /* Timer ID. */ + int si_overrun; /* Overrun count. */ + sigval_t si_sigval; /* Signal value. */ + } _timer; + + /* POSIX.1b signals. */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + sigval_t si_sigval; /* Signal value. */ + } _rt; + + /* SIGCHLD. */ + struct + { + __pid_t si_pid; /* Which child. */ + __uid_t si_uid; /* Real user ID of sending process. */ + int si_status; /* Exit value or signal. */ + __clock_t si_utime; + __clock_t si_stime; + } _sigchld; + + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ + struct + { + void *si_addr; /* Faulting insn/memory ref. */ + } _sigfault; + + /* SIGPOLL. */ + struct + { + long int si_band; /* Band event for SIGPOLL. */ + int si_fd; + } _sigpoll; + } _sifields; + } siginfo_t; + + +/* X/Open requires some more fields with fixed names. */ +# define si_pid _sifields._kill.si_pid +# define si_uid _sifields._kill.si_uid +# define si_timerid _sifields._timer.si_tid +# define si_overrun _sifields._timer.si_overrun +# define si_status _sifields._sigchld.si_status +# define si_utime _sifields._sigchld.si_utime +# define si_stime _sifields._sigchld.si_stime +# define si_value _sifields._rt.si_sigval +# define si_int _sifields._rt.si_sigval.sival_int +# define si_ptr _sifields._rt.si_sigval.sival_ptr +# define si_addr _sifields._sigfault.si_addr +# define si_band _sifields._sigpoll.si_band +# define si_fd _sifields._sigpoll.si_fd + + +/* Values for `si_code'. Positive values are reserved for kernel-generated + signals. */ +enum +{ + SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ +# define SI_ASYNCNL SI_ASYNCNL + SI_TKILL = -6, /* Sent by tkill. */ +# define SI_TKILL SI_TKILL + SI_SIGIO, /* Sent by queued SIGIO. */ +# define SI_SIGIO SI_SIGIO + SI_MESGQ, /* Sent by real time mesq state change. */ +# define SI_MESGQ SI_MESGQ + SI_TIMER, /* Sent by real time mesq state change. */ +# define SI_TIMER SI_TIMER + SI_ASYNCIO, /* Sent by AIO completion. */ +# define SI_ASYNCIO SI_ASYNCIO + SI_QUEUE, /* Sent by sigqueue. */ +# define SI_QUEUE SI_QUEUE + SI_USER, /* Sent by kill, sigsend. */ +# define SI_USER SI_USER + SI_KERNEL = 0x80 /* Send by kernel. */ +#define SI_KERNEL SI_KERNEL +}; + + +/* `si_code' values for SIGILL signal. */ +enum +{ + ILL_ILLOPC = 1, /* Illegal opcode. */ +# define ILL_ILLOPC ILL_ILLOPC + ILL_ILLOPN, /* Illegal operand. */ +# define ILL_ILLOPN ILL_ILLOPN + ILL_ILLADR, /* Illegal addressing mode. */ +# define ILL_ILLADR ILL_ILLADR + ILL_ILLTRP, /* Illegal trap. */ +# define ILL_ILLTRP ILL_ILLTRP + ILL_PRVOPC, /* Privileged opcode. */ +# define ILL_PRVOPC ILL_PRVOPC + ILL_PRVREG, /* Privileged register. */ +# define ILL_PRVREG ILL_PRVREG + ILL_COPROC, /* Coprocessor error. */ +# define ILL_COPROC ILL_COPROC + ILL_BADSTK /* Internal stack error. */ +# define ILL_BADSTK ILL_BADSTK +}; + +/* `si_code' values for SIGFPE signal. */ +enum +{ + FPE_INTDIV = 1, /* Integer divide by zero. */ +# define FPE_INTDIV FPE_INTDIV + FPE_INTOVF, /* Integer overflow. */ +# define FPE_INTOVF FPE_INTOVF + FPE_FLTDIV, /* Floating point divide by zero. */ +# define FPE_FLTDIV FPE_FLTDIV + FPE_FLTOVF, /* Floating point overflow. */ +# define FPE_FLTOVF FPE_FLTOVF + FPE_FLTUND, /* Floating point underflow. */ +# define FPE_FLTUND FPE_FLTUND + FPE_FLTRES, /* Floating point inexact result. */ +# define FPE_FLTRES FPE_FLTRES + FPE_FLTINV, /* Floating point invalid operation. */ +# define FPE_FLTINV FPE_FLTINV + FPE_FLTSUB /* Subscript out of range. */ +# define FPE_FLTSUB FPE_FLTSUB +}; + +/* `si_code' values for SIGSEGV signal. */ +enum +{ + SEGV_MAPERR = 1, /* Address not mapped to object. */ +# define SEGV_MAPERR SEGV_MAPERR + SEGV_ACCERR /* Invalid permissions for mapped object. */ +# define SEGV_ACCERR SEGV_ACCERR +}; + +/* `si_code' values for SIGBUS signal. */ +enum +{ + BUS_ADRALN = 1, /* Invalid address alignment. */ +# define BUS_ADRALN BUS_ADRALN + BUS_ADRERR, /* Non-existant physical address. */ +# define BUS_ADRERR BUS_ADRERR + BUS_OBJERR /* Object specific hardware error. */ +# define BUS_OBJERR BUS_OBJERR +}; + +/* `si_code' values for SIGTRAP signal. */ +enum +{ + TRAP_BRKPT = 1, /* Process breakpoint. */ +# define TRAP_BRKPT TRAP_BRKPT + TRAP_TRACE /* Process trace trap. */ +# define TRAP_TRACE TRAP_TRACE +}; + +/* `si_code' values for SIGCHLD signal. */ +enum +{ + CLD_EXITED = 1, /* Child has exited. */ +# define CLD_EXITED CLD_EXITED + CLD_KILLED, /* Child was killed. */ +# define CLD_KILLED CLD_KILLED + CLD_DUMPED, /* Child terminated abnormally. */ +# define CLD_DUMPED CLD_DUMPED + CLD_TRAPPED, /* Traced child has trapped. */ +# define CLD_TRAPPED CLD_TRAPPED + CLD_STOPPED, /* Child has stopped. */ +# define CLD_STOPPED CLD_STOPPED + CLD_CONTINUED /* Stopped child has continued. */ +# define CLD_CONTINUED CLD_CONTINUED +}; + +/* `si_code' values for SIGPOLL signal. */ +enum +{ + POLL_IN = 1, /* Data input available. */ +# define POLL_IN POLL_IN + POLL_OUT, /* Output buffers available. */ +# define POLL_OUT POLL_OUT + POLL_MSG, /* Input message available. */ +# define POLL_MSG POLL_MSG + POLL_ERR, /* I/O error. */ +# define POLL_ERR POLL_ERR + POLL_PRI, /* High priority input available. */ +# define POLL_PRI POLL_PRI + POLL_HUP /* Device disconnected. */ +# define POLL_HUP POLL_HUP +}; + +# undef __need_siginfo_t +#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ + + +#if (defined _SIGNAL_H || defined __need_sigevent_t) \ + && !defined __have_sigevent_t +# define __have_sigevent_t 1 + +/* Structure to transport application-defined values with signals. */ +# define __SIGEV_MAX_SIZE 64 +# if __WORDSIZE == 64 +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) +# else +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) +# endif + +/* Forward declaration. */ +# ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +# endif + +typedef struct sigevent + { + sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + + union + { + int _pad[__SIGEV_PAD_SIZE]; + + /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the + thread to receive the signal. */ + __pid_t _tid; + + struct + { + void (*_function) (sigval_t); /* Function to start. */ + pthread_attr_t *_attribute; /* Thread attributes. */ + } _sigev_thread; + } _sigev_un; + } sigevent_t; + +/* POSIX names to access some of the members. */ +# define sigev_notify_function _sigev_un._sigev_thread._function +# define sigev_notify_attributes _sigev_un._sigev_thread._attribute + +/* `sigev_notify' values. */ +enum +{ + SIGEV_SIGNAL = 0, /* Notify via signal. */ +# define SIGEV_SIGNAL SIGEV_SIGNAL + SIGEV_NONE, /* Other notification: meaningless. */ +# define SIGEV_NONE SIGEV_NONE + SIGEV_THREAD, /* Deliver via thread creation. */ +# define SIGEV_THREAD SIGEV_THREAD + + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ +#define SIGEV_THREAD_ID SIGEV_THREAD_ID +}; + +#endif /* have _SIGNAL_H. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/signalfd.h b/ports/sysdeps/unix/sysv/linux/mips/bits/signalfd.h new file mode 100644 index 0000000000..c2bea7605a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/signalfd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2007-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SIGNALFD_H +# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." +#endif + +/* Flags for signalfd. */ +enum + { + SFD_CLOEXEC = 02000000, +#define SFD_CLOEXEC SFD_CLOEXEC + SFD_NONBLOCK = 00000200 +#define SFD_NONBLOCK SFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/signum.h b/ports/sysdeps/unix/sysv/linux/mips/bits/signum.h new file mode 100644 index 0000000000..c11dda01c0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/signum.h @@ -0,0 +1,78 @@ +/* Signal number definitions. Linux version. + Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +#ifdef __USE_UNIX98 +# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ +#endif + + +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGEMT 7 +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* BUS error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGPWR 19 /* Power failure restart (System V). */ +#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ +#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */ +#define SIGIO 22 /* I/O now possible (4.2 BSD). */ +#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ +#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 24 /* Keyboard stop (POSIX). */ +#define SIGCONT 25 /* Continue (POSIX). */ +#define SIGTTIN 26 /* Background read from tty (POSIX). */ +#define SIGTTOU 27 /* Background write to tty (POSIX). */ +#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ +#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ + + +#define _NSIG 128 /* Biggest signal number + 1 + (including real-time signals). */ + +#define SIGRTMIN (__libc_current_sigrtmin ()) +#define SIGRTMAX (__libc_current_sigrtmax ()) + +/* These are the hard limits of the kernel. These values should not be + used directly at user level. */ +#define __SIGRTMIN 32 +#define __SIGRTMAX (_NSIG - 1) + +#endif /* <signal.h> included. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/sigstack.h b/ports/sysdeps/unix/sysv/linux/mips/bits/sigstack.h new file mode 100644 index 0000000000..4cba91cfcc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/sigstack.h @@ -0,0 +1,54 @@ +/* sigstack, sigaltstack definitions. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include this file directly. Use <signal.h> instead" +#endif + + +/* Structure describing a signal stack (obsolete). */ +struct sigstack + { + void *ss_sp; /* Signal stack pointer. */ + int ss_onstack; /* Nonzero if executing on this stack. */ + }; + + +/* Possible values for `ss_flags.'. */ +enum +{ + SS_ONSTACK = 1, +#define SS_ONSTACK SS_ONSTACK + SS_DISABLE +#define SS_DISABLE SS_DISABLE +}; + +/* Minimum stack size for a signal handler. */ +#define MINSIGSTKSZ 2048 + +/* System default stack size. */ +#define SIGSTKSZ 8192 + + +/* Alternate, preferred interface. */ +typedef struct sigaltstack + { + void *ss_sp; + size_t ss_size; + int ss_flags; + } stack_t; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/socket_type.h b/ports/sysdeps/unix/sysv/linux/mips/bits/socket_type.h new file mode 100644 index 0000000000..0ece9f03da --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/socket_type.h @@ -0,0 +1,55 @@ +/* Define enum __socket_type for Linux/MIPS. + Copyright (C) 1991-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SOCKET_H +# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." +#endif + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_STREAM = 2, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET + SOCK_DCCP = 6, +#define SOCK_DCCP SOCK_DCCP /* Datagram Congestion Control Protocol. */ + SOCK_PACKET = 10, /* Linux specific way of getting packets + at the dev level. For writing rarp and + other similar things on the user level. */ +#define SOCK_PACKET SOCK_PACKET + + /* Flags to be ORed into the type parameter of socket and socketpair and + used for the flags parameter of paccept. */ + + SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the + new descriptor(s). */ +#define SOCK_CLOEXEC SOCK_CLOEXEC + SOCK_NONBLOCK = 00000200 /* Atomically mark descriptor(s) as + non-blocking. */ +#define SOCK_NONBLOCK SOCK_NONBLOCK +}; diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h b/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h new file mode 100644 index 0000000000..f65bae47f6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/stat.h @@ -0,0 +1,263 @@ +/* Copyright (C) 1992-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +#include <sgidefs.h> + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_KERNEL 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */ + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ + + +#if _MIPS_SIM == _ABIO32 +/* Structure describing file characteristics. */ +struct stat + { + unsigned long int st_dev; + long int st_pad1[3]; +#ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +#else + __ino64_t st_ino; /* File serial number. */ +#endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned long int st_rdev; /* Device number, if device. */ +#ifndef __USE_FILE_OFFSET64 + long int st_pad2[2]; + __off_t st_size; /* Size of file, in bytes. */ + /* SVR4 added this extra long to allow for expansion of off_t. */ + long int st_pad3; +#else + long int st_pad2[3]; + __off64_t st_size; /* Size of file, in bytes. */ +#endif +#if defined __USE_MISC || defined __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ +#ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ +#else + long int st_pad4; + __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ +#endif + long int st_pad5[14]; + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + unsigned long int st_dev; + long int st_pad1[3]; + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned long int st_rdev; /* Device number, if device. */ + long int st_pad2[3]; + __off64_t st_size; /* Size of file, in bytes. */ +# if defined __USE_MISC || defined __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + long int st_pad3; + __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ + long int st_pad4[14]; + }; +#endif +#else +struct stat + { + __dev_t st_dev; + int st_pad1[3]; /* Reserved for st_dev expansion */ +#ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; +#else + __ino64_t st_ino; +#endif + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; +#if !defined __USE_FILE_OFFSET64 + unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ + __off_t st_size; + int st_pad3; +#else + unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ + __off64_t st_size; +#endif +#if defined __USE_MISC || defined __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + __blksize_t st_blksize; + unsigned int st_pad4; +#ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; +#else + __blkcnt64_t st_blocks; +#endif + int st_pad5[14]; + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; + unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ + __ino64_t st_ino; + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ + __off64_t st_size; +# if defined __USE_MISC || defined __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; + unsigned int st_pad3; + __blkcnt64_t st_blocks; + int st_pad4[14]; +}; +#endif +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h new file mode 100644 index 0000000000..c2f8051328 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/statfs.h @@ -0,0 +1,73 @@ +/* Copyright (C) 1997, 2000, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_STATFS_H +# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." +#endif + +#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/ + +struct statfs + { + long int f_type; +#define f_fstyp f_type + long int f_bsize; + long int f_frsize; /* Fragment size - unsupported */ +#ifndef __USE_FILE_OFFSET64 + __fsblkcnt_t f_blocks; + __fsblkcnt_t f_bfree; + __fsblkcnt_t f_files; + __fsblkcnt_t f_ffree; + __fsblkcnt_t f_bavail; +#else + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_files; + __fsblkcnt64_t f_ffree; + __fsblkcnt64_t f_bavail; +#endif + + /* Linux specials */ + __fsid_t f_fsid; + long int f_namelen; + long int f_flags; + long int f_spare[5]; + }; + +#ifdef __USE_LARGEFILE64 +struct statfs64 + { + long int f_type; +#define f_fstyp f_type + long int f_bsize; + long int f_frsize; /* Fragment size - unsupported */ + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_files; + __fsblkcnt64_t f_ffree; + __fsblkcnt64_t f_bavail; + + /* Linux specials */ + __fsid_t f_fsid; + long int f_namelen; + long int f_flags; + long int f_spare[5]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATFS_F_NAMELEN diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/termios.h b/ports/sysdeps/unix/sysv/linux/mips/bits/termios.h new file mode 100644 index 0000000000..58e0cbec91 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -0,0 +1,220 @@ +/* termios type and macro definitions. Linux/MIPS version. + Copyright (C) 1993, 94, 95, 96, 97, 99, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios.h> directly; use <termios.h> instead." +#endif + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 32 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + }; + +/* c_cc characters */ +#define VINTR 0 /* Interrupt character [ISIG]. */ +#define VQUIT 1 /* Quit character [ISIG]. */ +#define VERASE 2 /* Erase character [ICANON]. */ +#define VKILL 3 /* Kill-line character [ICANON]. */ +#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ +#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ +#define VEOL2 6 /* Second EOL character [ICANON]. */ +#define VSWTC 7 +#define VSWTCH VSWTC +#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ +#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ +#define VSUSP 10 /* Suspend character [ISIG]. */ + /* VDSUSP is not supported on Linux. */ +/* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */ +#define VREPRINT 12 /* Reprint-line character [ICANON]. */ +#define VDISCARD 13 /* Discard character [IEXTEN]. */ +#define VWERASE 14 /* Word-erase character [ICANON]. */ +#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ +#define VEOF 16 /* End-of-file character [ICANON]. */ +#define VEOL 17 /* End-of-line character [ICANON]. */ + +/* c_iflag bits */ +#define IGNBRK 0000001 /* Ignore break condition. */ +#define BRKINT 0000002 /* Signal interrupt on break. */ +#define IGNPAR 0000004 /* Ignore characters with parity errors. */ +#define PARMRK 0000010 /* Mark parity and framing errors. */ +#define INPCK 0000020 /* Enable input parity check. */ +#define ISTRIP 0000040 /* Strip 8th bit off characters. */ +#define INLCR 0000100 /* Map NL to CR on input. */ +#define IGNCR 0000200 /* Ignore CR. */ +#define ICRNL 0000400 /* Map CR to NL on input. */ +#define IUCLC 0001000 /* Map upper case to lower case on input. */ +#define IXON 0002000 /* Enable start/stop output control. */ +#define IXANY 0004000 /* Any character will restart after stop. */ +#define IXOFF 0010000 /* Enable start/stop input control. */ +#define IMAXBEL 0020000 /* Ring bell when input queue is full. */ +#define IUTF8 0040000 /* Input is UTF8. */ + +/* c_oflag bits */ +#define OPOST 0000001 /* Perform output processing. */ +#define OLCUC 0000002 /* Map lower case to upper case on output. */ +#define ONLCR 0000004 /* Map NL to CR-NL on output. */ +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 +#define OFILL 0000100 +#define OFDEL 0000200 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 0000400 +# define NL0 0000000 +# define NL1 0000400 +# define CRDLY 0003000 +# define CR0 0000000 +# define CR1 0001000 +# define CR2 0002000 +# define CR3 0003000 +# define TABDLY 0014000 +# define TAB0 0000000 +# define TAB1 0004000 +# define TAB2 0010000 +# define TAB3 0014000 +# define BSDLY 0020000 +# define BS0 0000000 +# define BS1 0020000 +# define FFDLY 0100000 +# define FF0 0000000 +# define FF1 0100000 +#endif + +#define VTDLY 0040000 +#define VT0 0000000 +#define VT1 0040000 + +#ifdef __USE_MISC +# define XTABS 0014000 +#endif + +/* c_cflag bit meaning */ +#ifdef __USE_MISC +# define CBAUD 0010017 +#endif +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#ifdef __USE_MISC +# define EXTA B19200 +# define EXTB B38400 +#endif +#define CSIZE 0000060 /* Number of bits per byte (mask). */ +#define CS5 0000000 /* 5 bits per byte. */ +#define CS6 0000020 /* 6 bits per byte. */ +#define CS7 0000040 /* 7 bits per byte. */ +#define CS8 0000060 /* 8 bits per byte. */ +#define CSTOPB 0000100 /* Two stop bits instead of one. */ +#define CREAD 0000200 /* Enable receiver. */ +#define PARENB 0000400 /* Parity enable. */ +#define PARODD 0001000 /* Odd parity instead of even. */ +#define HUPCL 0002000 /* Hang up on last close. */ +#define CLOCAL 0004000 /* Ignore modem status lines. */ +#ifdef __USE_MISC +# define CBAUDEX 0010000 +#endif +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define B500000 0010005 +#define B576000 0010006 +#define B921600 0010007 +#define B1000000 0010010 +#define B1152000 0010011 +#define B1500000 0010012 +#define B2000000 0010013 +#define B2500000 0010014 +#define B3000000 0010015 +#define B3500000 0010016 +#define B4000000 0010017 +#define __MAX_BAUD B4000000 +#ifdef __USE_MISC +# define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CRTSCTS 020000000000 /* flow control */ +#endif + +/* c_lflag bits */ +#define ISIG 0000001 /* Enable signals. */ +#define ICANON 0000002 /* Do erase and kill processing. */ +#if defined __USE_MISC || defined __USE_XOPEN +# define XCASE 0000004 +#endif +#define ECHO 0000010 /* Enable echo. */ +#define ECHOE 0000020 /* Visual erase for ERASE. */ +#define ECHOK 0000040 /* Echo NL after KILL. */ +#define ECHONL 0000100 /* Echo NL even if ECHO is off. */ +#define NOFLSH 0000200 /* Disable flush after interrupt. */ +#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ +#ifdef __USE_MISC +# define ECHOCTL 0001000 /* Echo control characters as ^X. */ +# define ECHOPRT 0002000 /* Hardcopy visual erase. */ +# define ECHOKE 0004000 /* Visual erase for KILL. */ +# define FLUSHO 0020000 +# define PENDIN 0040000 /* Retype pending input (state). */ +#endif +#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ +#define ITOSTOP TOSTOP +#ifdef __USE_BSD +# define EXTPROC 0200000 +#endif + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + +/* tcflow() and TCXONC use these */ +#define TCOOFF 0 /* Suspend output. */ +#define TCOON 1 /* Restart suspended output. */ +#define TCIOFF 2 /* Send a STOP character. */ +#define TCION 3 /* Send a START character. */ + +/* tcflush() and TCFLSH use these */ +#define TCIFLUSH 0 /* Discard data received but not yet read. */ +#define TCOFLUSH 1 /* Discard data written but not yet sent. */ +#define TCIOFLUSH 2 /* Discard all pending data. */ + +/* tcsetattr uses these */ +#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */ +#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */ +#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */ + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/timerfd.h b/ports/sysdeps/unix/sysv/linux/mips/bits/timerfd.h new file mode 100644 index 0000000000..032735d015 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/bits/timerfd.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2008-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_TIMERFD_H +# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." +#endif + +/* Bits to be set in the FLAGS parameter of `timerfd_create'. */ +enum + { + TFD_CLOEXEC = 02000000, +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 00000200 +#define TFD_NONBLOCK TFD_NONBLOCK + }; diff --git a/ports/sysdeps/unix/sysv/linux/mips/brk.c b/ports/sysdeps/unix/sysv/linux/mips/brk.c new file mode 100644 index 0000000000..9f63698e90 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/brk.c @@ -0,0 +1,56 @@ +/* brk system call for Linux/MIPS. + Copyright (C) 2000, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <unistd.h> +#include <sysdep.h> + +void *__curbrk = 0; + +/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt + to work around different old braindamage in the old Linux/x86 ELF + dynamic linker. Sigh. */ +weak_alias (__curbrk, ___brk_addr) + +int +__brk (void *addr) +{ + void *newbrk; + + { + register long int res __asm__ ("$2"); + + asm ("move\t$4,%2\n\t" + "li\t%0,%1\n\t" + "syscall" /* Perform the system call. */ + : "=r" (res) + : "I" (SYS_ify (brk)), "r" (addr) + : "$4", "$7", __SYSCALL_CLOBBERS); + newbrk = (void *) res; + } + __curbrk = newbrk; + + if (newbrk < addr) + { + __set_errno (ENOMEM); + return -1; + } + + return 0; +} +weak_alias (__brk, brk) diff --git a/ports/sysdeps/unix/sysv/linux/mips/clone.S b/ports/sysdeps/unix/sysv/linux/mips/clone.S new file mode 100644 index 0000000000..ce49cb57d1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/clone.S @@ -0,0 +1,165 @@ +/* Copyright (C) 1996, 1997, 2000, 2003, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ralf Baechle <ralf@linux-mips.org>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after its all over. */ + +#include <sys/asm.h> +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> +#ifdef RESET_PID +#include <tls.h> +#endif + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 + +/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, + void *parent_tidptr, void *tls, void *child_tidptr) */ + + .text +#if _MIPS_SIM == _ABIO32 +# define EXTRA_LOCALS 1 +#else +# define EXTRA_LOCALS 0 +#endif +LOCALSZ= 4 +FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK +GPOFF= FRAMESZ-(1*SZREG) +NESTED(__clone,4*SZREG,sp) +#ifdef __PIC__ + SETUP_GP +#endif + PTR_SUBU sp, FRAMESZ + SETUP_GP64 (GPOFF, __clone) +#ifdef __PIC__ + SAVE_GP (GPOFF) +#endif +#ifdef PROF + .set noat + move $1,ra + jal _mcount + .set at +#endif + + + /* Sanity check arguments. */ + li v0,EINVAL + beqz a0,L(error) /* No NULL function pointers. */ + beqz a1,L(error) /* No NULL stack pointers. */ + + PTR_SUBU a1,32 /* Reserve argument save space. */ + PTR_S a0,0(a1) /* Save function pointer. */ + PTR_S a3,PTRSIZE(a1) /* Save argument pointer. */ +#ifdef RESET_PID + LONG_S a2,(PTRSIZE*2)(a1) /* Save clone flags. */ +#endif + + move a0,a2 + + /* Shuffle in the last three arguments - arguments 5, 6, and 7 to + this function, but arguments 3, 4, and 5 to the syscall. */ +#if _MIPS_SIM == _ABIO32 + PTR_L a2,(FRAMESZ+PTRSIZE+PTRSIZE+16)(sp) + PTR_S a2,16(sp) + PTR_L a2,(FRAMESZ+16)(sp) + PTR_L a3,(FRAMESZ+PTRSIZE+16)(sp) +#else + move a2,a4 + move a3,a5 + move a4,a6 +#endif + + /* Do the system call */ + li v0,__NR_clone + syscall + + bnez a3,L(error) + beqz v0,L(thread_start) + + /* Successful return from the parent */ + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + ret + + /* Something bad happened -- no child created */ +L(error): +#ifdef __PIC__ + PTR_LA t9,__syscall_error + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + jr t9 +#else + RESTORE_GP64 + PTR_ADDU sp, FRAMESZ + j __syscall_error +#endif + END(__clone) + +/* Load up the arguments to the function. Put this block of code in + its own function so that we can terminate the stack trace with our + debug info. */ + +ENTRY(__thread_start) +L(thread_start): + /* cp is already loaded. */ + SAVE_GP (GPOFF) + /* The stackframe has been created on entry of clone(). */ + +#ifdef RESET_PID + /* Check and see if we need to reset the PID. */ + LONG_L a0,(PTRSIZE*2)(sp) + and a1,a0,CLONE_THREAD + beqz a1,L(restore_pid) +L(donepid): +#endif + + /* Restore the arg for user's function. */ + PTR_L t9,0(sp) /* Function pointer. */ + PTR_L a0,PTRSIZE(sp) /* Argument pointer. */ + + /* Call the user's function. */ + jal t9 + + /* Call _exit rather than doing it inline for breakpoint purposes. */ + move a0,v0 +#ifdef __PIC__ + PTR_LA t9,_exit + jalr t9 +#else + jal _exit +#endif + +#ifdef RESET_PID +L(restore_pid): + and a1,a0,CLONE_VM + li v0,-1 + bnez a1,L(gotpid) + li v0,__NR_getpid + syscall +L(gotpid): + READ_THREAD_POINTER(v1) + INT_S v0,PID_OFFSET(v1) + INT_S v0,TID_OFFSET(v1) + b L(donepid) +#endif + + END(__thread_start) + +weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/mips/configure b/ports/sysdeps/unix/sysv/linux/mips/configure new file mode 100644 index 0000000000..099014fdc7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/configure @@ -0,0 +1,36 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/mips. + +case "$prefix" in +/usr | /usr/) + # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib. + # Allow earlier configure scripts to handle libc_cv_slibdir, libdir, + # and libc_cv_localedir. + test -n "$libc_cv_slibdir" || \ + case $machine in + mips/mips64/n64/* ) + libc_cv_slibdir="/lib64" + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/lib64'; + # Locale data can be shared between 32bit and 64bit libraries + libc_cv_localedir='${exec_prefix}/lib/locale' + fi + ;; + mips/mips64/n32/* ) + libc_cv_slibdir="/lib32" + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/lib32'; + # Locale data can be shared between 32bit and 64bit libraries + libc_cv_localedir='${exec_prefix}/lib/locale' + fi + ;; + *) + libc_cv_slibdir="/lib" + ;; + esac +esac + +if test -z "$arch_minimum_kernel"; then + arch_minimum_kernel=2.6.12 + libc_cv_gcc_unwind_find_fde=yes +fi diff --git a/ports/sysdeps/unix/sysv/linux/mips/configure.in b/ports/sysdeps/unix/sysv/linux/mips/configure.in new file mode 100644 index 0000000000..466a349fc5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/configure.in @@ -0,0 +1,37 @@ +sinclude(./aclocal.m4)dnl Autoconf lossage +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/mips. + +case "$prefix" in +/usr | /usr/) + # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib. + # Allow earlier configure scripts to handle libc_cv_slibdir, libdir, + # and libc_cv_localedir. + test -n "$libc_cv_slibdir" || \ + case $machine in + mips/mips64/n64/* ) + libc_cv_slibdir="/lib64" + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/lib64'; + # Locale data can be shared between 32bit and 64bit libraries + libc_cv_localedir='${exec_prefix}/lib/locale' + fi + ;; + mips/mips64/n32/* ) + libc_cv_slibdir="/lib32" + if test "$libdir" = '${exec_prefix}/lib'; then + libdir='${exec_prefix}/lib32'; + # Locale data can be shared between 32bit and 64bit libraries + libc_cv_localedir='${exec_prefix}/lib/locale' + fi + ;; + *) + libc_cv_slibdir="/lib" + ;; + esac +esac + +if test -z "$arch_minimum_kernel"; then + arch_minimum_kernel=2.6.12 + libc_cv_gcc_unwind_find_fde=yes +fi diff --git a/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h b/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h new file mode 100644 index 0000000000..1991c9c93c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h @@ -0,0 +1,56 @@ +/* Support for reading /etc/ld.so.cache files written by Linux ldconfig. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <ldconfig.h> + +/* Redefine the cache ID for new ABIs; o32 keeps using the generic check. */ +#if _MIPS_SIM == _ABI64 +# define _DL_CACHE_DEFAULT_ID (FLAG_MIPS64_LIBN64 | FLAG_ELF_LIBC6) +#elif _MIPS_SIM == _ABIN32 +# define _DL_CACHE_DEFAULT_ID (FLAG_MIPS64_LIBN32 | FLAG_ELF_LIBC6) +#endif + +#ifdef _DL_CACHE_DEFAULT_ID +# define _dl_cache_check_flags(flags) \ + ((flags) == _DL_CACHE_DEFAULT_ID) +#endif + +#define add_system_dir(dir) \ + do \ + { \ + size_t len = strlen (dir); \ + char path[len + 3]; \ + memcpy (path, dir, len + 1); \ + if (len >= 6 \ + && (! memcmp (path + len - 6, "/lib64", 6) \ + || ! memcmp (path + len - 6, "/lib32", 6))) \ + { \ + len -= 2; \ + path[len] = '\0'; \ + } \ + add_dir (path); \ + if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \ + { \ + memcpy (path + len, "32", 3); \ + add_dir (path); \ + memcpy (path + len, "64", 3); \ + add_dir (path); \ + } \ + } while (0) + +#include_next <dl-cache.h> diff --git a/ports/sysdeps/unix/sysv/linux/mips/dl-static.c b/ports/sysdeps/unix/sysv/linux/mips/dl-static.c new file mode 100644 index 0000000000..a23f22a355 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/dl-static.c @@ -0,0 +1,91 @@ +/* Variable initialization. MIPS version. + Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <ldsodefs.h> + +#ifdef SHARED + +void +_dl_var_init (void *array[]) +{ + /* It has to match "variables" below. */ + enum + { + DL_PAGESIZE = 0 + }; + + GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]); +} + +#else +#include <bits/libc-lock.h> + +__libc_lock_define_initialized_recursive (static, _dl_static_lock) + +static void *variables[] = +{ + &GLRO(dl_pagesize) +}; + +static void +_dl_unprotect_relro (struct link_map *l) +{ + ElfW(Addr) start = ((l->l_addr + l->l_relro_addr) + & ~(GLRO(dl_pagesize) - 1)); + ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size) + & ~(GLRO(dl_pagesize) - 1)); + + if (start != end) + __mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE); +} + +void +_dl_static_init (struct link_map *l) +{ + struct link_map *rtld_map = l; + struct r_scope_elem **scope; + const ElfW(Sym) *ref = NULL; + lookup_t loadbase; + void (*f) (void *[]); + size_t i; + + __libc_lock_lock_recursive (_dl_static_lock); + + loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope, + NULL, 0, 1, NULL); + + for (scope = l->l_local_scope; *scope != NULL; scope++) + for (i = 0; i < (*scope)->r_nlist; i++) + if ((*scope)->r_list[i] == loadbase) + { + rtld_map = (*scope)->r_list[i]; + break; + } + + if (ref != NULL) + { + f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref); + _dl_unprotect_relro (rtld_map); + f (variables); + _dl_protect_relro (rtld_map); + } + + __libc_lock_unlock_recursive (_dl_static_lock); +} + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/fcntl.c b/ports/sysdeps/unix/sysv/linux/mips/fcntl.c new file mode 100644 index 0000000000..ea951bc4f9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/fcntl.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fcntl.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/getcontext.S b/ports/sysdeps/unix/sysv/linux/mips/getcontext.S new file mode 100644 index 0000000000..c4ad081b0f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/getcontext.S @@ -0,0 +1,148 @@ +/* Save current context. + Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maciej W. Rozycki <macro@codesourcery.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sys/asm.h> +#include <sys/fpregdef.h> +#include <sys/regdef.h> + +#include "ucontext_i.h" + +/* int getcontext (ucontext_t *ucp) */ + + .text +LOCALSZ = 0 +MASK = 0x00000000 +#ifdef __PIC__ +LOCALSZ = 1 /* save gp */ +# if _MIPS_SIM != _ABIO32 +MASK = 0x10000000 +# endif +#endif +FRAMESZ = ((LOCALSZ * SZREG) + ALSZ) & ALMASK +GPOFF = FRAMESZ - (1 * SZREG) + +NESTED (__getcontext, FRAMESZ, ra) + .mask MASK, 0 + .fmask 0x00000000, 0 + +#ifdef __PIC__ + SETUP_GP + + move a2, sp +# define _SP a2 + +# if _MIPS_SIM != _ABIO32 + move a3, gp +# define _GP a3 +# endif + + PTR_ADDIU sp, -FRAMESZ + SETUP_GP64 (GPOFF, __getcontext) + SAVE_GP (GPOFF) + +#else /* ! __PIC__ */ +# define _SP sp +# define _GP gp + +#endif /* ! __PIC__ */ + +#ifdef PROF + .set noat + move AT, ra + jal _mcount + .set at +#endif + + /* Store a magic flag. */ + li v1, 1 + REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */ + + REG_S s0, (16 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s1, (17 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s2, (18 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s3, (19 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s4, (20 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s5, (21 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s6, (22 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s7, (23 * SZREG + MCONTEXT_GREGS)(a0) +#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32 + REG_S _GP, (28 * SZREG + MCONTEXT_GREGS)(a0) +#endif + REG_S _SP, (29 * SZREG + MCONTEXT_GREGS)(a0) + REG_S fp, (30 * SZREG + MCONTEXT_GREGS)(a0) + REG_S ra, (31 * SZREG + MCONTEXT_GREGS)(a0) + REG_S ra, MCONTEXT_PC(a0) + +#ifdef __mips_hard_float +# if _MIPS_SIM == _ABI64 + s.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(a0) + +# else /* _MIPS_SIM != _ABI64 */ + s.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(a0) + +# endif /* _MIPS_SIM != _ABI64 */ + + cfc1 v1, fcr31 + sw v1, MCONTEXT_FPC_CSR(a0) +#endif /* __mips_hard_float */ + +/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */ + li a3, _NSIG8 + PTR_ADDU a2, a0, UCONTEXT_SIGMASK + move a1, zero + li a0, SIG_BLOCK + + li v0, SYS_ify (rt_sigprocmask) + syscall + bnez a3, 99f + +#ifdef __PIC__ + RESTORE_GP64 + PTR_ADDIU sp, FRAMESZ +#endif + move v0, zero + jr ra + +99: +#ifdef __PIC__ + PTR_LA t9, JUMPTARGET (__syscall_error) + RESTORE_GP64 + PTR_ADDIU sp, FRAMESZ + jr t9 + +#else /* ! __PIC__ */ + + j JUMPTARGET (__syscall_error) +#endif /* ! __PIC__ */ +PSEUDO_END (__getcontext) + +weak_alias (__getcontext, getcontext) diff --git a/ports/sysdeps/unix/sysv/linux/mips/getmsg.c b/ports/sysdeps/unix/sysv/linux/mips/getmsg.c new file mode 100644 index 0000000000..3a1fa08525 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/getmsg.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/getsysstats.c b/ports/sysdeps/unix/sysv/linux/mips/getsysstats.c new file mode 100644 index 0000000000..9092a882d3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/getsysstats.c @@ -0,0 +1,36 @@ +/* Determine various system internal values, Linux/MIPS version. + Copyright (C) 2001, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +/* We need to define a special parser for /proc/cpuinfo. */ +#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \ + do \ + { \ + (RESULT) = 0; \ + /* Read all lines and count the lines starting with the string \ + "cpu model". We don't have to fear extremely long lines since \ + the kernel will not generate them. 8192 bytes are really \ + enough. */ \ + char *l; \ + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ + if (strncmp (l, "cpu model", 9) == 0) \ + ++(RESULT); \ + } \ + while (0) + +#include <sysdeps/unix/sysv/linux/getsysstats.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/ipc_priv.h b/ports/sysdeps/unix/sysv/linux/mips/ipc_priv.h new file mode 100644 index 0000000000..9b85386a7c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/ipc_priv.h @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/alpha/ipc_priv.h> diff --git a/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h b/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h new file mode 100644 index 0000000000..70f1fc1ed4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -0,0 +1,41 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 1999-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sgidefs.h> + +/* MIPS platforms had IPC64 all along. */ +#define __ASSUME_IPC64 1 + +#if _MIPS_SIM == _ABIN32 +# define __ASSUME_FCNTL64 1 +#endif + +/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */ +#if __LINUX_KERNEL_VERSION >= 0x02061c +# define __ASSUME_EVENTFD2 1 +# define __ASSUME_SIGNALFD4 1 +#endif + +#include_next <kernel-features.h> + +/* The n32 syscall ABI did not have a getdents64 syscall until + 2.6.35. */ +#if _MIPS_SIM == _ABIN32 && __LINUX_KERNEL_VERSION < 0x020623 +# undef __ASSUME_GETDENTS64_SYSCALL +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h b/ports/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h new file mode 100644 index 0000000000..77ffaf68df --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h @@ -0,0 +1,10 @@ +/* Linux kernel RT signal frame. */ +typedef struct kernel_rt_sigframe + { + uint32_t rs_ass[4]; + uint32_t rs_code[2]; + siginfo_t rs_info; + struct ucontext rs_uc; + uint32_t rs_altcode[8] __attribute__ ((__aligned__ (1 << 7))); + } +kernel_rt_sigframe_t; diff --git a/ports/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h b/ports/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h new file mode 100644 index 0000000000..b6f52cc9c9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/kernel_sigaction.h @@ -0,0 +1,40 @@ +/* This is the sigaction structure from the Linux 2.1.24 kernel. */ + +#include <sgidefs.h> + +#define HAVE_SA_RESTORER + +struct old_kernel_sigaction { + unsigned int sa_flags; + __sighandler_t k_sa_handler; + unsigned long sa_mask; + unsigned int __pad0[3]; /* reserved, keep size constant */ + + /* Abi says here follows reserved int[2] */ + void (*sa_restorer)(void); +#if (_MIPS_SZPTR < 64) + /* + * For 32 bit code we have to pad struct sigaction to get + * constant size for the ABI + */ + int pad1[1]; /* reserved */ +#endif +}; + + +#define _KERNEL_NSIG 128 +#define _KERNEL_NSIG_BPW _MIPS_SZLONG +#define _KERNEL_NSIG_WORDS (_KERNEL_NSIG / _KERNEL_NSIG_BPW) + +typedef struct { + unsigned long sig[_KERNEL_NSIG_WORDS]; +} kernel_sigset_t; + +/* This is the sigaction structure from the Linux 2.1.68 kernel. */ +struct kernel_sigaction { + unsigned int sa_flags; + __sighandler_t k_sa_handler; + kernel_sigset_t sa_mask; + void (*sa_restorer)(void); + int s_resv[1]; /* reserved */ +}; diff --git a/ports/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/ports/sysdeps/unix/sysv/linux/mips/kernel_stat.h new file mode 100644 index 0000000000..e785bcd8cf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/kernel_stat.h @@ -0,0 +1,57 @@ +#include <sgidefs.h> +/* As tempting as it is to define XSTAT_IS_XSTAT64 for n64, the + userland data structures are not identical, because of different + padding. */ +/* Definition of `struct stat' used in the kernel. */ +#if _MIPS_SIM != _ABIO32 +struct kernel_stat + { + unsigned int st_dev; + unsigned int __pad1[3]; + unsigned long long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + int st_uid; + int st_gid; + unsigned int st_rdev; + unsigned int __pad2[3]; + long long st_size; + unsigned int st_atime_sec; + unsigned int st_atime_nsec; + unsigned int st_mtime_sec; + unsigned int st_mtime_nsec; + unsigned int st_ctime_sec; + unsigned int st_ctime_nsec; + unsigned int st_blksize; + unsigned int __pad3; + unsigned long long st_blocks; + }; +#else +struct kernel_stat + { + unsigned long int st_dev; + long int __pad1[3]; /* Reserved for network id */ + unsigned long int st_ino; + unsigned long int st_mode; + unsigned long int st_nlink; + long int st_uid; + long int st_gid; + unsigned long int st_rdev; + long int __pad2[2]; + long int st_size; + long int __pad3; + unsigned int st_atime_sec; + unsigned int st_atime_nsec; + unsigned int st_mtime_sec; + unsigned int st_mtime_nsec; + unsigned int st_ctime_sec; + unsigned int st_ctime_nsec; + long int st_blksize; + long int st_blocks; + char st_fstype[16]; /* Filesystem type name, unsupported */ + long st_pad4[8]; + /* Linux specific fields */ + unsigned int st_flags; + unsigned int st_gen; + }; +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/kernel_termios.h b/ports/sysdeps/unix/sysv/linux/mips/kernel_termios.h new file mode 100644 index 0000000000..ee59a81562 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/kernel_termios.h @@ -0,0 +1,34 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _KERNEL_TERMIOS_H +#define _KERNEL_TERMIOS_H 1 +/* The following corresponds to the values from the Linux 2.1.24 kernel. */ + +#define __KERNEL_NCCS 23 + +struct __kernel_termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[__KERNEL_NCCS]; /* control characters */ + }; + +#endif /* kernel_termios.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/ldsodefs.h b/ports/sysdeps/unix/sysv/linux/mips/ldsodefs.h new file mode 100644 index 0000000000..b097a2d131 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/ldsodefs.h @@ -0,0 +1,40 @@ +/* Run-time dynamic linker data structures for loaded ELF shared objects. MIPS. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LDSODEFS_H + +/* Get the real definitions. */ +#include_next <ldsodefs.h> + +/* Now define our stuff. */ + +/* We need special support to initialize DSO loaded for statically linked + binaries. */ +extern void _dl_static_init (struct link_map *map); +#undef DL_STATIC_INIT +#define DL_STATIC_INIT(map) _dl_static_init (map) + +/* Allow ABIVERSION == 1, meaning PLTs and copy relocations are + required, with ELFOSABI_SYSV. */ +#undef VALID_ELF_ABIVERSION +#define VALID_ELF_ABIVERSION(osabi,ver) \ + (ver == 0 \ + || (osabi == ELFOSABI_SYSV && ver < 2) \ + || (osabi == ELFOSABI_LINUX && ver < LIBC_ABI_MAX)) + +#endif /* ldsodefs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/libc-abis b/ports/sysdeps/unix/sysv/linux/mips/libc-abis new file mode 100644 index 0000000000..f180a03efd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/libc-abis @@ -0,0 +1,13 @@ +# See the copy of this file in libc for detailed explanations. This +# copy needs to include all libc definitions applicable to MIPS; only +# one copy will be used. +# +# Feature Name Configuration +# ------------ ------------- +# +# MIPS PLTs. +MIPS_PLT mips*-*-linux* +# +# Unique symbol definitions for C++. +# Architecture independent, all ELF targets (== all targets) +UNIQUE diff --git a/ports/sysdeps/unix/sysv/linux/mips/lockf64.c b/ports/sysdeps/unix/sysv/linux/mips/lockf64.c new file mode 100644 index 0000000000..a88f5a784a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/lockf64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lockf64.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/makecontext.S b/ports/sysdeps/unix/sysv/linux/mips/makecontext.S new file mode 100644 index 0000000000..6427339a66 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/makecontext.S @@ -0,0 +1,188 @@ +/* Modify saved context. + Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maciej W. Rozycki <macro@codesourcery.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sys/asm.h> +#include <sys/fpregdef.h> +#include <sys/regdef.h> + +#include "ucontext_i.h" + +/* int makecontext (ucontext_t *ucp, (void *func) (), int argc, ...) */ + + .text +LOCALSZ = 0 +ARGSZ = 0 +MASK = 0x00000000 +#ifdef __PIC__ +LOCALSZ = 1 /* save gp */ +#endif +#if _MIPS_SIM != _ABIO32 +ARGSZ = 5 /* save a3-a7 */ +# ifdef __PIC__ +MASK = 0x10000000 +# endif +#endif +FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK +GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG) +#if _MIPS_SIM != _ABIO32 +A3OFF = FRAMESZ - (5 * SZREG) /* callee-allocated */ +A4OFF = FRAMESZ - (4 * SZREG) +A5OFF = FRAMESZ - (3 * SZREG) +A6OFF = FRAMESZ - (2 * SZREG) +A7OFF = FRAMESZ - (1 * SZREG) +NARGREGS = 8 +#else +A3OFF = FRAMESZ + (3 * SZREG) /* caller-allocated */ +NARGREGS = 4 +#endif + +NESTED (__makecontext, FRAMESZ, ra) + .mask MASK, -(ARGSZ * SZREG) + .fmask 0x00000000, 0 + +98: +#ifdef __PIC__ + SETUP_GP +#endif + + PTR_ADDIU sp, -FRAMESZ + +#ifdef __PIC__ + SETUP_GP64 (GPOFF, __makecontext) + SAVE_GP (GPOFF) +#endif + +#ifdef PROF + .set noat + move AT, ra + jal _mcount + .set at +#endif + + /* Store args to be passed. */ + REG_S a3, A3OFF(sp) +#if _MIPS_SIM != _ABIO32 + REG_S a4, A4OFF(sp) + REG_S a5, A5OFF(sp) + REG_S a6, A6OFF(sp) + REG_S a7, A7OFF(sp) +#endif + + /* Store a magic flag. */ + li v1, 1 + REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */ + + /* Set up the stack. */ + PTR_L t0, STACK_SP(a0) + PTR_L t2, STACK_SIZE(a0) + PTR_ADDIU t1, sp, A3OFF + PTR_ADDU t0, t2 + and t0, ALMASK + blez a2, 2f /* no arguments */ + + /* Store register arguments. */ + PTR_ADDIU t2, a0, MCONTEXT_GREGS + 4 * SZREG + move t3, zero +0: + addiu t3, 1 + REG_L v1, (t1) + PTR_ADDIU t1, SZREG + REG_S v1, (t2) + PTR_ADDIU t2, SZREG + bgeu t3, a2, 2f /* all done */ + bltu t3, NARGREGS, 0b /* next */ + + /* Make room for stack arguments. */ + PTR_SUBU t2, a2, t3 + PTR_SLL t2, 3 + PTR_SUBU t0, t2 + and t0, ALMASK + + /* Store stack arguments. */ + move t2, t0 +1: + addiu t3, 1 + REG_L v1, (t1) + PTR_ADDIU t1, SZREG + REG_S v1, (t2) + PTR_ADDIU t2, SZREG + bltu t3, a2, 1b /* next */ + +2: +#if _MIPS_SIM == _ABIO32 + /* Make room for a0-a3 storage. */ + PTR_ADDIU t0, -(NARGSAVE * SZREG) +#endif + PTR_L v1, UCONTEXT_LINK(a0) +#ifdef __PIC__ + PTR_ADDIU t9, 99f - 98b +#else + PTR_LA t9, 99f +#endif + REG_S t0, (29 * SZREG + MCONTEXT_GREGS)(a0) /* sp */ + REG_S v1, (16 * SZREG + MCONTEXT_GREGS)(a0) /* s0 */ +#ifdef __PIC__ + REG_S gp, (17 * SZREG + MCONTEXT_GREGS)(a0) /* s1 */ +#endif + REG_S t9, (31 * SZREG + MCONTEXT_GREGS)(a0) /* ra */ + REG_S a1, MCONTEXT_PC(a0) + +#ifdef __PIC__ + RESTORE_GP64 + PTR_ADDIU sp, FRAMESZ +#endif + jr ra + +99: +#ifdef __PIC__ + move gp, s1 +#endif + move a0, zero + beqz s0, 0f + + /* setcontext (ucp) */ + move a0, s0 +#ifdef __PIC__ + PTR_LA t9, JUMPTARGET (__setcontext) + jalr t9 +# if _MIPS_SIM == _ABIO32 + move gp, s1 +# endif +#else + jal JUMPTARGET (__setcontext) +#endif + move a0, v0 + +0: + /* exit (a0) */ +#ifdef __PIC__ + PTR_LA t9, HIDDEN_JUMPTARGET (exit) + jalr t9 +#else + jal HIDDEN_JUMPTARGET (exit) +#endif + + /* You don't exist, you won't feel anything. */ +1: + lb zero, (zero) + b 1b +PSEUDO_END (__makecontext) + +weak_alias (__makecontext, makecontext) diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/Makefile b/ports/sysdeps/unix/sysv/linux/mips/mips32/Makefile new file mode 100644 index 0000000000..77e91218a8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/Makefile @@ -0,0 +1 @@ +default-abi := o32 diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/accept4.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/accept4.c new file mode 100644 index 0000000000..d79f1b0bf0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/accept4.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2008, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Avoid accept4.c trying to use a definition based on the socketcall + syscall and internal_accept4.S. */ + +#include <errno.h> +#include <signal.h> +#include <sys/socket.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <kernel-features.h> + +#undef __NR_socketcall + +#include <sysdeps/unix/sysv/linux/accept4.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c new file mode 100644 index 0000000000..9838182c39 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <errno.h> +#include <endian.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +/* Truncate the file FD refers to to LENGTH bytes. */ +int +__ftruncate64 (int fd, off64_t length) +{ + unsigned int low = length & 0xffffffff; + unsigned int high = length >> 32; + int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0, + __LONG_LONG_PAIR (high, low)); + return result; +} +weak_alias (__ftruncate64, ftruncate64) diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/fxstatat.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/fxstatat.c new file mode 100644 index 0000000000..0f8b3135d8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/fxstatat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstatat.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S new file mode 100644 index 0000000000..30434d7334 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_accept4.S @@ -0,0 +1,2 @@ +/* MIPS does not have socket.S and the socketcall syscall should + generally be avoided, though it exists. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S new file mode 100644 index 0000000000..30434d7334 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_recvmmsg.S @@ -0,0 +1,2 @@ +/* MIPS does not have socket.S and the socketcall syscall should + generally be avoided, though it exists. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_sendmmsg.S b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_sendmmsg.S new file mode 100644 index 0000000000..30434d7334 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/internal_sendmmsg.S @@ -0,0 +1,2 @@ +/* MIPS does not have socket.S and the socketcall syscall should + generally be avoided, though it exists. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/ld.abilist new file mode 100644 index 0000000000..21a212d1ff --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/ld.abilist @@ -0,0 +1,20 @@ +GLIBC_2.0 + GLIBC_2.0 A + __libc_memalign F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F +GLIBC_2.2 + GLIBC_2.2 A + __libc_stack_end D 0x4 + _dl_mcount F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A + __stack_chk_guard D 0x4 +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..1f5c1e2935 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libBrokenLocale.abilist @@ -0,0 +1,5 @@ +GLIBC_2.0 + GLIBC_2.0 A + __ctype_get_mb_cur_max F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libanl.abilist new file mode 100644 index 0000000000..b1dcc5ade6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libanl.abilist @@ -0,0 +1,8 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist new file mode 100644 index 0000000000..80f7d3321d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist @@ -0,0 +1,2244 @@ +GCC_3.0 + GCC_3.0 A + _Unwind_Find_FDE F + __deregister_frame_info_bases F + __register_frame_info_bases F + __register_frame_info_table_bases F +GLIBC_2.0 + GLIBC_2.0 A + _IO_adjust_column F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_fsetpos F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sscanf F + _IO_stderr_ D 0x50 + _IO_stdin_ D 0x50 + _IO_stdout_ D 0x50 + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_switch_to_get_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + ___brk_addr D 0x4 + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __assert_fail F + __assert_perror_fail F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __clone F + __close F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x4 + __ctype_b D 0x4 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x4 + __ctype_toupper D 0x4 + __curbrk D 0x4 + __daylight D 0x4 + __dcgettext F + __default_morecore F + __deregister_frame F + __deregister_frame_info F + __dgettext F + __dup2 F + __environ D 0x4 + __errno_location F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __fork F + __fpu_control D 0x4 + __frame_state_for F + __free_hook D 0x4 + __fxstat F + __getdelim F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __isinf F + __isinff F + __isinfl F + __isnan F + __isnanf F + __isnanl F + __iswctype F + __ivaliduser F + __libc_calloc F + __libc_free F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x4 + __mempcpy F + __monstartup F + __morecore D 0x4 + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __overflow F + __pipe F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __rcmd_errstr D 0x4 + __read F + __realloc_hook D 0x4 + __register_frame F + __register_frame_info F + __register_frame_info_table F + __register_frame_table F + __res_randomid F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __sigpause F + __sigsetjmp F + __stpcpy F + __stpncpy F + __strcasecmp F + __strdup F + __strerror_r F + __strtod_internal F + __strtof_internal F + __strtok_r F + __strtol_internal F + __strtold_internal F + __strtoll_internal F + __strtoq_internal F + __strtoul_internal F + __strtoull_internal F + __strtouq_internal F + __sysv_signal F + __timezone D 0x4 + __tzname D 0x8 + __uflow F + __underflow F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcstod_internal F + __wcstof_internal F + __wcstol_internal F + __wcstold_internal F + __wcstoll_internal F + __wcstoul_internal F + __wcstoull_internal F + __write F + __xmknod F + __xpg_basename F + __xstat F + _environ D 0x4 + _exit F + _flush_cache F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack D 0x4 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x200 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x1ec + _sys_nerr D 0x4 + _sys_siglist D 0x80 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authnone_create F + authunix_create F + authunix_create_default F + basename F + bcmp F + bcopy F + bdflush F + bind F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cachectl F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + catclose F + catgets F + catopen F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + delete_module F + dgettext F + difftime F + dirfd F + dirname F + div F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + fgetc F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpwent F + fgetpwent_r F + fgets F + fgetspent F + fgetspent_r F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fnmatch F + fopen F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fread F + free F + freeaddrinfo F + freopen F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fsetpos F + fstatfs F + fsync F + ftell F + ftime F + ftok F + ftruncate F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + funlockfile F + fwrite F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcwd F + getdelim F + getdirentries F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getw F + getwd F + glob F + glob_pattern_p F + globfree F + gmtime F + gmtime_r F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + insque F + ioctl F + iruserok F + isalnum F + isalpha F + isascii F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + madvise F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + memset F + mkdir F + mkfifo F + mkstemp F + mktemp F + mktime F + mlock F + mlockall F + mmap F + modf F + modff F + modfl F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + nfsservctl F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open_memstream F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + prctl F + printf F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putpwent F + puts F + putspent F + pututline F + putw F + pvalloc F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rcmd F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readdir F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + res_init F + revoke F + rewind F + rewinddir F + rexec F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + ruserok F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigreturn F + sigsetmask F + sigstack F + sigsuspend F + sigvec F + sigwait F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcat F + strchr F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtouq F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreqset F + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + swab F + swapoff F + swapon F + symlink F + sync F + sys_errlist D 0x1ec + sys_nerr D 0x4 + sys_sigabbrev D 0x80 + sys_siglist D 0x80 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + sysmips F + system F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x4 + tmpfile F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + uname F + ungetc F + unlink F + unsetenv F + updwtmp F + uselib F + usleep F + ustat F + utime F + utimes F + utmpname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + vfork F + vfprintf F + vfscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + wait F + wait3 F + wait4 F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscat F + wcschr F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcslen F + wcsncat F + wcsncmp F + wcsncpy F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstok F + wcstol F + wcstold F + wcstombs F + wcstoq F + wcstoul F + wcstouq F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmemset F + write F + writev F + xdr_accepted_reply F + xdr_array F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_int F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_string F + xdr_u_char F + xdr_u_int F + xdr_u_long F + xdr_u_short F + xdr_union F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + ntp_gettimex F + recvmmsg F +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _Exit F + _IO_2_1_stderr_ D 0xa0 + _IO_2_1_stdin_ D 0xa0 + _IO_2_1_stdout_ D 0xa0 + _IO_adjust_wcolumn F + _IO_do_write F + _IO_fclose F + _IO_fdopen F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_file_attach F + _IO_file_close_it F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_overflow F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_fopen F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_getline_info F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_popen F + _IO_proc_close F + _IO_proc_open F + _IO_seekwmark F + _IO_sputbackwc F + _IO_sungetwc F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_unsave_wmarkers F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __asprintf F + __assert F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __ctype32_tolower D 0x4 + __ctype32_toupper D 0x4 + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __duplocale F + __endmntent F + __fbufsize F + __flbf F + __fpending F + __fpurge F + __freadable F + __freading F + __freelocale F + __fsetlocking F + __fwritable F + __fwriting F + __fxstat64 F + __getmntent_r F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __islower_l F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_freeres F + __libc_sa_len F + __lxstat64 F + __mempcpy_small F + __newlocale F + __nl_langinfo_l F + __open64 F + __poll F + __pread64 F + __pwrite64 F + __rawmemchr F + __res_init F + __res_nclose F + __res_ninit F + __res_state F + __setmntent F + __signbit F + __signbitf F + __sigsuspend F + __statfs F + __stpcpy_small F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strfmon_l F + __strncasecmp_l F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_l F + __strtof_l F + __strtok_r_1c F + __strtol_l F + __strtold_l F + __strtoll_l F + __strtoul_l F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __sysconf F + __sysctl F + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __vfork F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_l F + __wcstof_l F + __wcstol_l F + __wcstold_l F + __wcstoll_l F + __wcstoul_l F + __wcstoull_l F + __wcsxfrm_l F + __wctrans_l F + __wctype_l F + __woverflow F + __wuflow F + __wunderflow F + __xpg_sigpause F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _flushlbf F + _res_hconf D 0x30 + _sys_errlist D 0x11b8 + _sys_nerr D 0x4 + _sys_siglist D 0x100 + _test_and_set F + addseverity F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + authdes_create F + authdes_getucred F + authdes_pk_create F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + bind_textdomain_codeset F + capget F + capset F + cbc_crypt F + clntunix_create F + creat64 F + dcngettext F + des_setparity F + dngettext F + ecb_crypt F + endutxent F + fattach F + fclose F + fdetach F + fdopen F + ffsl F + ffsll F + fgetc_unlocked F + fgetpos F + fgetpos64 F + fgets_unlocked F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fmemopen F + fmtmsg F + fopen F + fopen64 F + fopencookie F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread_unlocked F + freopen64 F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fstatfs64 F + fstatvfs F + fstatvfs64 F + ftello F + ftello64 F + ftruncate64 F + ftw64 F + fwide F + fwprintf F + fwrite_unlocked F + fwscanf F + gai_strerror F + getaliasbyname_r F + getaliasent_r F + getcontext F + getdate F + getdate_err D 0x4 + getdate_r F + getdirentries64 F + getgrent_r F + getgrgid_r F + getgrnam_r F + gethostbyaddr_r F + gethostbyname2_r F + gethostbyname_r F + gethostent_r F + getloadavg F + getmsg F + getnameinfo F + getnetbyaddr_r F + getnetbyname_r F + getnetent_r F + getnetname F + getpmsg F + getprotobyname_r F + getprotobynumber_r F + getprotoent_r F + getpt F + getpwent_r F + getpwnam_r F + getpwuid_r F + getrlimit64 F + getrpcbyname_r F + getrpcbynumber_r F + getrpcent_r F + getservbyname_r F + getservbyport_r F + getservent_r F + getspent_r F + getspnam_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + glob64 F + globfree64 F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + host2netname F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + iruserok_af F + isastream F + iswblank F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + localeconv F + lockf64 F + lseek64 F + makecontext F + mcheck_check_all F + mcheck_pedantic F + mempcpy F + memrchr F + mincore F + mkdtemp F + mkstemp64 F + mmap64 F + moncontrol F + msgctl F + netname2host F + netname2user F + nftw F + nftw64 F + ngettext F + ntp_adjtime F + ntp_gettime F + open64 F + passwd2des F + pclose F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + pread F + pread64 F + printf_size F + printf_size_info F + pthread_attr_init F + ptsname F + ptsname_r F + putgrent F + putmsg F + putpmsg F + pututxline F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pwrite F + pwrite64 F + rawmemchr F + rcmd_af F + readdir64 F + readdir64_r F + rexec_af F + rresvport_af F + rtime F + ruserok_af F + scandir64 F + semctl F + sendfile F + setrlimit64 F + setutxent F + shmctl F + sighold F + sigignore F + sigqueue F + sigrelse F + sigset F + sigtimedwait F + sigwaitinfo F + statfs64 F + statvfs F + statvfs64 F + strcasestr F + strchrnul F + strtoimax F + strtoumax F + strverscmp F + svc_getreq_common F + svc_getreq_poll F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + svcunix_create F + svcunixfd_create F + swapcontext F + swprintf F + swscanf F + sys_errlist D 0x11b8 + sys_nerr D 0x4 + sys_sigabbrev D 0x100 + sys_siglist D 0x100 + sysv_signal F + tcgetsid F + tdestroy F + tmpfile F + tmpfile64 F + truncate64 F + umount2 F + ungetwc F + unlockpt F + updwtmpx F + user2netname F + utmpxname F + versionsort F + versionsort64 F + vfwprintf F + vfwscanf F + vswprintf F + vswscanf F + vwprintf F + vwscanf F + waitid F + wcscasecmp F + wcschrnul F + wcsftime F + wcsncasecmp F + wcsnlen F + wcstoimax F + wcstoll F + wcstoull F + wcstoumax F + wcswcs F + wmempcpy F + wordexp F + wordfree F + wprintf F + wscanf F + xdecrypt F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_getcredres F + xdr_hyper F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_longlong_t F + xdr_netnamestr F + xdr_sizeof F + xdr_u_hyper F + xdr_u_longlong_t F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_unixcred F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoll_l F + strtoul_l F + strtoull_l F + strxfrm_l F + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __register_atfork F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x200 + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + nftw F + nftw64 F + posix_fadvise64 F + posix_fallocate64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + sys_sigabbrev D 0x200 + sys_siglist D 0x200 +GLIBC_2.3.4 + GLIBC_2.3.4 A + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + getipv4sourcefilter F + getsourcefilter F + regexec F + sched_getaffinity F + sched_setaffinity F + setipv4sourcefilter F + setsourcefilter F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __pread64_chk F + __pread_chk F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __stack_chk_fail F + __stpncpy_chk F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __vfwprintf_chk F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + futimesat F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + linkat F + mkdirat F + mkfifoat F + open_wmemstream F + openat F + openat64 F + ppoll F + readlinkat F + renameat F + symlinkat F + unlinkat F + unshare F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libcidn.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libcidn.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libcidn.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libcrypt.abilist new file mode 100644 index 0000000000..c548eee671 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libcrypt.abilist @@ -0,0 +1,11 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libdl.abilist new file mode 100644 index 0000000000..49d9581f59 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libdl.abilist @@ -0,0 +1,20 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.2 + GLIBC_2.2 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libm.abilist new file mode 100644 index 0000000000..defa1b0b49 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libm.abilist @@ -0,0 +1,376 @@ +GLIBC_2.0 + GLIBC_2.0 A + _LIB_VERSION D 0x4 + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cbrt F + cbrtf F + cbrtl F + ceil F + ceilf F + ceill F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + logb F + logbf F + logbl F + logf F + logl F + matherr F + modf F + modff F + modfl F + nextafter F + nextafterf F + nextafterl F + pow F + powf F + powl F + remainder F + remainderf F + remainderl F + rint F + rintf F + rintl F + scalb F + scalbf F + scalbl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __asin_finite F + __asinf_finite F + __atan2_finite F + __atan2f_finite F + __atanh_finite F + __atanhf_finite F + __cosh_finite F + __coshf_finite F + __exp10_finite F + __exp10f_finite F + __exp2_finite F + __exp2f_finite F + __exp_finite F + __expf_finite F + __fmod_finite F + __fmodf_finite F + __gamma_r_finite F + __gammaf_r_finite F + __hypot_finite F + __hypotf_finite F + __j0_finite F + __j0f_finite F + __j1_finite F + __j1f_finite F + __jn_finite F + __jnf_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __log10_finite F + __log10f_finite F + __log2_finite F + __log2f_finite F + __log_finite F + __logf_finite F + __pow_finite F + __powf_finite F + __remainder_finite F + __remainderf_finite F + __scalb_finite F + __scalbf_finite F + __sinh_finite F + __sinhf_finite F + __sqrt_finite F + __sqrtf_finite F + __y0_finite F + __y0f_finite F + __y1_finite F + __y1f_finite F + __yn_finite F + __ynf_finite F +GLIBC_2.2 + GLIBC_2.2 A + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log2 F + log2f F + log2l F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nexttoward F + nexttowardf F + nexttowardl F + pow10 F + pow10f F + pow10l F + remquo F + remquof F + remquol F + round F + roundf F + roundl F + scalbln F + scalblnf F + scalblnl F + sincos F + sincosf F + sincosl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F +GLIBC_2.4 + GLIBC_2.4 A + exp2l F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnsl.abilist new file mode 100644 index 0000000000..dbf11b808f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnsl.abilist @@ -0,0 +1,127 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.2 + GLIBC_2.2 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F + xdr_ypall F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_compat.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_compat.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_compat.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_db.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_db.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_db.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_dns.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_dns.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_dns.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_files.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_files.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_files.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_hesiod.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_hesiod.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_hesiod.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_nis.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_nis.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_nis.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_nisplus.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_nisplus.abilist new file mode 100644 index 0000000000..3bda3ac3b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libnss_nisplus.abilist @@ -0,0 +1,2 @@ +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist new file mode 100644 index 0000000000..c3ba9d4f4d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist @@ -0,0 +1,265 @@ +GLIBC_2.0 + GLIBC_2.0 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __lseek F + __open F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_setspecific F + __read F + __send F + __sigaction F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + msync F + nanosleep F + open F + pause F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_once F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_testcancel F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __open64 F + __pread64 F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pwrite64 F + __res_state F + __vfork F + lseek64 F + open64 F + pread F + pread64 F + pthread_attr_getguardsize F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setguardsize F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_condattr_getpshared F + pthread_condattr_setpshared F + pthread_create F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_mutex_timedlock F + pthread_mutexattr_getpshared F + pthread_mutexattr_gettype F + pthread_mutexattr_setpshared F + pthread_mutexattr_settype F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_setconcurrency F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_yield F + pwrite F + pwrite64 F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_attr_setstack F + pthread_attr_setstacksize F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libresolv.abilist new file mode 100644 index 0000000000..41205ea636 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libresolv.abilist @@ -0,0 +1,106 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/librt.abilist new file mode 100644 index 0000000000..207605eff3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/librt.abilist @@ -0,0 +1,52 @@ +GLIBC_2.2 + GLIBC_2.2 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libthread_db.abilist new file mode 100644 index 0000000000..76ded51299 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libthread_db.abilist @@ -0,0 +1,50 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libutil.abilist new file mode 100644 index 0000000000..119a9df922 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libutil.abilist @@ -0,0 +1,10 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F +_gp_disp + _gp_disp A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c new file mode 100644 index 0000000000..d39e8f44fe --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +posix_fadvise (int fd, off_t offset, off_t len, int advise) +{ +/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0, + __LONG_LONG_PAIR (offset >> 31, offset), + __LONG_LONG_PAIR (len >> 31, len), + advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c new file mode 100644 index 0000000000..e547e69379 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c @@ -0,0 +1,60 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) +{ +/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0, + __LONG_LONG_PAIR ((long) (offset >> 32), + (long) offset), + __LONG_LONG_PAIR ((long) (len >> 32), + (long) len), + advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} + +#include <shlib-compat.h> + +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) + +int +attribute_compat_text_section +__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise) +{ + return __posix_fadvise64_l64 (fd, offset, len, advise); +} + +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); +#else +strong_alias (__posix_fadvise64_l64, posix_fadvise64); +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c new file mode 100644 index 0000000000..80170c3e8a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/arm/readahead.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c new file mode 100644 index 0000000000..371932ecd4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Avoid recvmmsg.c trying to use a definition based on the socketcall + syscall and internal_recvmmsg.S. */ + +#include <errno.h> +#include <sys/socket.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <kernel-features.h> + +#undef __NR_socketcall + +#include <sysdeps/unix/sysv/linux/recvmmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c new file mode 100644 index 0000000000..0dc6dd0122 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Avoid sendmmsg.c trying to use a definition based on the socketcall + syscall and internal_sendmmsg.S. */ + +#include <errno.h> +#include <sys/socket.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <kernel-features.h> + +#undef __NR_socketcall + +#include <sysdeps/unix/sysv/linux/sendmmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c new file mode 100644 index 0000000000..2dc110ba7e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c @@ -0,0 +1,59 @@ +/* Selective file content synch'ing. + Copyright (C) 2006, 2007, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sys/types.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> + + +#ifdef __NR_sync_file_range +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (sync_file_range, 7, fd, 0, + __LONG_LONG_PAIR ((long) (from >> 32), (long) from), + __LONG_LONG_PAIR ((long) (to >> 32), (long) to), + flags); + + int result; + int oldtype = LIBC_CANCEL_ASYNC (); + + result = INLINE_SYSCALL (sync_file_range, 7, fd, 0, + __LONG_LONG_PAIR ((long) (from >> 32), (long) from), + __LONG_LONG_PAIR ((long) (to >> 32), (long) to), + flags); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +#else +int +sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (sync_file_range) + +# include <stub-tag.h> +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list b/ports/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list new file mode 100644 index 0000000000..f357b5c918 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list @@ -0,0 +1,5 @@ +# File name Caller Syscall name # args Strong name Weak names + +prlimit64 EXTRA prlimit64 i:iipp prlimit64 + +fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h new file mode 100644 index 0000000000..8c024b0241 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -0,0 +1,300 @@ +/* Copyright (C) 2000, 2002, 2003, 2004, 2005, + 2009, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_MIPS_MIPS32_SYSDEP_H +#define _LINUX_MIPS_MIPS32_SYSDEP_H 1 + +/* There is some commonality. */ +#include <sysdeps/unix/mips/mips32/sysdep.h> + +#include <tls.h> + +/* In order to get __set_errno() definition in INLINE_SYSCALL. */ +#ifndef __ASSEMBLER__ +#include <errno.h> +#endif + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +#ifdef __ASSEMBLER__ + +/* We don't want the label for the error handler to be visible in the symbol + table when we define it here. */ +#ifdef __PIC__ +# define SYSCALL_ERROR_LABEL 99b +#endif + +#else /* ! __ASSEMBLER__ */ + +/* Define a macro which expands into the inline wrapper code for a system + call. */ +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ INTERNAL_SYSCALL_DECL(err); \ + long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ + if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ + result_var = -1L; \ + } \ + result_var; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) long err + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (val) + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \ + "i" (SYS_ify (name)), err, args) + +#undef INTERNAL_SYSCALL_NCS +#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ + internal_syscall##nr (= number, , "r" (__v0), err, args) + +#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0), "r" (__a1) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +/* We need to use a frame pointer for the functions in which we + adjust $sp around the syscall, or debug information and unwind + information will be $sp relative and thus wrong during the syscall. As + of GCC 4.7, this is sufficient. */ +#define FORCE_FRAME_POINTER \ + void *volatile __fp_force __attribute__ ((unused)) = alloca (4) + +#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\ +({ \ + long _sys_result; \ + \ + FORCE_FRAME_POINTER; \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "subu\t$29, 32\n\t" \ + "sw\t%6, 16($29)\n\t" \ + cs_init \ + "syscall\n\t" \ + "addiu\t$29, 32\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), \ + "r" ((long)arg5) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\ +({ \ + long _sys_result; \ + \ + FORCE_FRAME_POINTER; \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "subu\t$29, 32\n\t" \ + "sw\t%6, 16($29)\n\t" \ + "sw\t%7, 20($29)\n\t" \ + cs_init \ + "syscall\n\t" \ + "addiu\t$29, 32\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), \ + "r" ((long)arg5), "r" ((long)arg6) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ +({ \ + long _sys_result; \ + \ + FORCE_FRAME_POINTER; \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "subu\t$29, 32\n\t" \ + "sw\t%6, 16($29)\n\t" \ + "sw\t%7, 20($29)\n\t" \ + "sw\t%8, 24($29)\n\t" \ + cs_init \ + "syscall\n\t" \ + "addiu\t$29, 32\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), \ + "r" ((long)arg5), "r" ((long)arg6), "r" ((long)arg7) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \ + "$14", "$15", "$24", "$25", "hi", "lo", "memory" + +#endif /* __ASSEMBLER__ */ + +/* Pointer mangling is not yet supported for MIPS. */ +#define PTR_MANGLE(var) (void) (var) +#define PTR_DEMANGLE(var) (void) (var) + +#endif /* linux/mips/mips32/sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c new file mode 100644 index 0000000000..3fad93f50e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <endian.h> +#include <errno.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +/* Truncate the file FD refers to to LENGTH bytes. */ +int +truncate64 (const char *path, off64_t length) +{ + unsigned int low = length & 0xffffffff; + unsigned int high = length >> 32; + int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0, + __LONG_LONG_PAIR (high, low)); + return result; +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/Makefile b/ports/sysdeps/unix/sysv/linux/mips/mips64/Makefile new file mode 100644 index 0000000000..0a37c5b9b4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/Makefile @@ -0,0 +1,9 @@ +ifeq ($(subdir),socket) +CFLAGS-recv.c += -fexceptions +CFLAGS-send.c += -fexceptions +endif + +ifeq ($(subdir),nptl) +CFLAGS-recv.c += -fexceptions +CFLAGS-send.c += -fexceptions +endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/configure b/ports/sysdeps/unix/sysv/linux/mips/mips64/configure new file mode 100644 index 0000000000..f86f3276a5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/configure @@ -0,0 +1,4 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/mips/mips64. + +ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/configure.in b/ports/sysdeps/unix/sysv/linux/mips/mips64/configure.in new file mode 100644 index 0000000000..c137ec5552 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/configure.in @@ -0,0 +1,5 @@ +sinclude(./aclocal.m4)dnl Autoconf lossage +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/mips/mips64. + +ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c new file mode 100644 index 0000000000..6e25b021ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c @@ -0,0 +1 @@ +/* Empty. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c new file mode 100644 index 0000000000..1078cc35ac --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c @@ -0,0 +1,112 @@ +/* Copyright (C) 2005,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#include <xstatconv.h> + +/* Get information about the file NAME in BUF. */ + +int +__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) +{ + if (__builtin_expect (vers != _STAT_VER_LINUX, 0)) + { + __set_errno (EINVAL); + return -1; + } + + int result; + INTERNAL_SYSCALL_DECL (err); + struct kernel_stat kst; + +#ifdef __NR_newfstatat +# ifndef __ASSUME_ATFCTS + if (__have_atfcts >= 0) +# endif + { + result = INTERNAL_SYSCALL (newfstatat, err, 4, fd, file, &kst, flag); +# ifndef __ASSUME_ATFCTS + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1) + && INTERNAL_SYSCALL_ERRNO (result, err) == ENOSYS) + __have_atfcts = -1; + else +# endif + if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat64_conv (vers, &kst, st); + else + { + __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + return -1; + } + } +#endif + +#ifndef __ASSUME_ATFCTS + if (flag & ~AT_SYMLINK_NOFOLLOW) + { + __set_errno (EINVAL); + return -1; + } + + char *buf = NULL; + + if (fd != AT_FDCWD && file[0] != '/') + { + size_t filelen = strlen (file); + static const char procfd[] = "/proc/self/fd/%d/%s"; + /* Buffer for the path name we are going to use. It consists of + - the string /proc/self/fd/ + - the file descriptor number + - the file name provided. + The final NUL is included in the sizeof. A bit of overhead + due to the format elements compensates for possible negative + numbers. */ + size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen; + buf = alloca (buflen); + + __snprintf (buf, buflen, procfd, fd, file); + file = buf; + } + + if (flag & AT_SYMLINK_NOFOLLOW) + result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file), + __ptrvalue (&kst)); + else + result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file), + __ptrvalue (&kst)); + + if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat64_conv (vers, &kst, st); + + __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); + return -1; +#endif +} +libc_hidden_def (__fxstatat64) diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h new file mode 100644 index 0000000000..7e690952b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/generic/ldconfig.h> + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib32/ld.so.1", FLAG_ELF_LIBC6 }, \ + { "/lib64/ld.so.1", FLAG_ELF_LIBC6 }, +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed b/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed new file mode 100644 index 0000000000..2c327327e0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed @@ -0,0 +1 @@ +s_^\(RTLDLIST=\)\(.*lib\)\(\|32\|64\)\(/[^/]*\.so\.[0-9.]*\)[ ]*$_\1"\232\4 \264\4 \2\4"_ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/llseek.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/llseek.c new file mode 100644 index 0000000000..24013a8224 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/llseek.c @@ -0,0 +1 @@ +/* lseek() is 64-bit capable already. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c new file mode 100644 index 0000000000..91c6f1ab28 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/msg.h> +#include <ipc_priv.h> +#include <sysdep.h> + +#include <bp-checks.h> + +int __msgctl (int msqid, int cmd, struct msqid_ds *buf); + +int +__msgctl (int msqid, int cmd, struct msqid_ds *buf) +{ + return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, CHECK_1 (buf)); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __msgctl, msgctl, GLIBC_2_0); diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/Makefile b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/Makefile new file mode 100644 index 0000000000..2368c40385 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/Makefile @@ -0,0 +1 @@ +default-abi := n32 diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c new file mode 100644 index 0000000000..1e81bcdd7a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep-cancel.h> + + +/* Reserve storage for the data of the file associated with FD. */ +int +fallocate (int fd, int mode, __off_t offset, __off_t len) +{ +#ifdef __NR_fallocate + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len); + + int result; + int oldtype = LIBC_CANCEL_ASYNC (); + + result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len); + + LIBC_CANCEL_RESET (oldtype); + + return result; +#else + __set_errno (ENOSYS); + return -1; +#endif +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c new file mode 100644 index 0000000000..36be2e6261 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep-cancel.h> + + +/* Reserve storage for the data of the file associated with FD. */ +int +fallocate64 (int fd, int mode, __off64_t offset, __off64_t len) +{ +#ifdef __NR_fallocate + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len); + + int result; + int oldtype = LIBC_CANCEL_ASYNC (); + + result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len); + + LIBC_CANCEL_RESET (oldtype); + + return result; +#else + __set_errno (ENOSYS); + return -1; +#endif +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/ld.abilist new file mode 100644 index 0000000000..72180cced8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/ld.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + __libc_memalign F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F +GLIBC_2.2 + GLIBC_2.2 A + __libc_stack_end D 0x4 + _dl_mcount F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A + __stack_chk_guard D 0x4 diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..f4ca37f44b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.0 + GLIBC_2.0 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libanl.abilist new file mode 100644 index 0000000000..c9755d8a33 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist new file mode 100644 index 0000000000..6d64e1d238 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist @@ -0,0 +1,2240 @@ +GCC_3.0 + GCC_3.0 A + _Unwind_Find_FDE F + __deregister_frame_info_bases F + __register_frame_info_bases F + __register_frame_info_table_bases F +GLIBC_2.0 + GLIBC_2.0 A + _IO_adjust_column F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_fsetpos F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sscanf F + _IO_stderr_ D 0x50 + _IO_stdin_ D 0x50 + _IO_stdout_ D 0x50 + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_switch_to_get_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + ___brk_addr D 0x4 + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __assert_fail F + __assert_perror_fail F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __clone F + __close F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x4 + __ctype_b D 0x4 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x4 + __ctype_toupper D 0x4 + __curbrk D 0x4 + __daylight D 0x4 + __dcgettext F + __default_morecore F + __deregister_frame F + __deregister_frame_info F + __dgettext F + __dup2 F + __environ D 0x4 + __errno_location F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __fork F + __fpu_control D 0x4 + __frame_state_for F + __free_hook D 0x4 + __fxstat F + __getdelim F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __isinf F + __isinff F + __isinfl F + __isnan F + __isnanf F + __isnanl F + __iswctype F + __ivaliduser F + __libc_calloc F + __libc_free F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x4 + __mempcpy F + __monstartup F + __morecore D 0x4 + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __overflow F + __pipe F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __rcmd_errstr D 0x4 + __read F + __realloc_hook D 0x4 + __register_frame F + __register_frame_info F + __register_frame_info_table F + __register_frame_table F + __res_randomid F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __sigpause F + __sigsetjmp F + __stpcpy F + __stpncpy F + __strcasecmp F + __strdup F + __strerror_r F + __strtod_internal F + __strtof_internal F + __strtok_r F + __strtol_internal F + __strtold_internal F + __strtoll_internal F + __strtoq_internal F + __strtoul_internal F + __strtoull_internal F + __strtouq_internal F + __sysv_signal F + __timezone D 0x4 + __tzname D 0x8 + __uflow F + __underflow F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcstod_internal F + __wcstof_internal F + __wcstol_internal F + __wcstold_internal F + __wcstoll_internal F + __wcstoul_internal F + __wcstoull_internal F + __write F + __xmknod F + __xpg_basename F + __xstat F + _environ D 0x4 + _exit F + _flush_cache F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack D 0x4 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x200 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x1ec + _sys_nerr D 0x4 + _sys_siglist D 0x80 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authnone_create F + authunix_create F + authunix_create_default F + basename F + bcmp F + bcopy F + bdflush F + bind F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cachectl F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + catclose F + catgets F + catopen F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + delete_module F + dgettext F + difftime F + dirfd F + dirname F + div F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + fgetc F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpwent F + fgetpwent_r F + fgets F + fgetspent F + fgetspent_r F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fnmatch F + fopen F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fread F + free F + freeaddrinfo F + freopen F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fsetpos F + fstatfs F + fsync F + ftell F + ftime F + ftok F + ftruncate F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + funlockfile F + fwrite F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcwd F + getdelim F + getdirentries F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getw F + getwd F + glob F + glob_pattern_p F + globfree F + gmtime F + gmtime_r F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + insque F + ioctl F + iruserok F + isalnum F + isalpha F + isascii F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + madvise F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + memset F + mkdir F + mkfifo F + mkstemp F + mktemp F + mktime F + mlock F + mlockall F + mmap F + modf F + modff F + modfl F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + nfsservctl F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open_memstream F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + prctl F + printf F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putpwent F + puts F + putspent F + pututline F + putw F + pvalloc F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rcmd F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readdir F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + res_init F + revoke F + rewind F + rewinddir F + rexec F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + ruserok F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigreturn F + sigsetmask F + sigstack F + sigsuspend F + sigvec F + sigwait F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcat F + strchr F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtouq F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreqset F + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + swab F + swapoff F + swapon F + symlink F + sync F + sys_errlist D 0x1ec + sys_nerr D 0x4 + sys_sigabbrev D 0x80 + sys_siglist D 0x80 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + sysmips F + system F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x4 + tmpfile F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + uname F + ungetc F + unlink F + unsetenv F + updwtmp F + uselib F + usleep F + ustat F + utime F + utimes F + utmpname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + vfork F + vfprintf F + vfscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + wait F + wait3 F + wait4 F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscat F + wcschr F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcslen F + wcsncat F + wcsncmp F + wcsncpy F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstok F + wcstol F + wcstold F + wcstombs F + wcstoq F + wcstoul F + wcstouq F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmemset F + write F + writev F + xdr_accepted_reply F + xdr_array F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_int F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_string F + xdr_u_char F + xdr_u_int F + xdr_u_long F + xdr_u_short F + xdr_union F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + ntp_gettimex F + recvmmsg F +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _Exit F + _IO_2_1_stderr_ D 0xa0 + _IO_2_1_stdin_ D 0xa0 + _IO_2_1_stdout_ D 0xa0 + _IO_adjust_wcolumn F + _IO_do_write F + _IO_fclose F + _IO_fdopen F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_file_attach F + _IO_file_close_it F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_overflow F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_fopen F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_getline_info F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_popen F + _IO_proc_close F + _IO_proc_open F + _IO_seekwmark F + _IO_sputbackwc F + _IO_sungetwc F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_unsave_wmarkers F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __asprintf F + __assert F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __ctype32_tolower D 0x4 + __ctype32_toupper D 0x4 + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __duplocale F + __endmntent F + __fbufsize F + __flbf F + __fpending F + __fpurge F + __freadable F + __freading F + __freelocale F + __fsetlocking F + __fwritable F + __fwriting F + __fxstat64 F + __getmntent_r F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __islower_l F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_freeres F + __libc_sa_len F + __lxstat64 F + __mempcpy_small F + __newlocale F + __nl_langinfo_l F + __open64 F + __poll F + __pread64 F + __pwrite64 F + __rawmemchr F + __res_init F + __res_nclose F + __res_ninit F + __res_state F + __setmntent F + __signbit F + __signbitf F + __signbitl F + __sigsuspend F + __statfs F + __stpcpy_small F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strfmon_l F + __strncasecmp_l F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_l F + __strtof_l F + __strtok_r_1c F + __strtol_l F + __strtold_l F + __strtoll_l F + __strtoul_l F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __sysconf F + __sysctl F + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __vfork F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_l F + __wcstof_l F + __wcstol_l F + __wcstold_l F + __wcstoll_l F + __wcstoul_l F + __wcstoull_l F + __wcsxfrm_l F + __wctrans_l F + __wctype_l F + __woverflow F + __wuflow F + __wunderflow F + __xpg_sigpause F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _flushlbf F + _res_hconf D 0x30 + _sys_errlist D 0x11b8 + _sys_nerr D 0x4 + _sys_siglist D 0x100 + _test_and_set F + addseverity F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + authdes_create F + authdes_getucred F + authdes_pk_create F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + bind_textdomain_codeset F + capget F + capset F + cbc_crypt F + clntunix_create F + creat64 F + dcngettext F + des_setparity F + dngettext F + ecb_crypt F + endutxent F + fattach F + fclose F + fdetach F + fdopen F + ffsl F + ffsll F + fgetc_unlocked F + fgetpos F + fgetpos64 F + fgets_unlocked F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fmemopen F + fmtmsg F + fopen F + fopen64 F + fopencookie F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread_unlocked F + freopen64 F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fstatfs64 F + fstatvfs F + fstatvfs64 F + ftello F + ftello64 F + ftruncate64 F + ftw64 F + fwide F + fwprintf F + fwrite_unlocked F + fwscanf F + gai_strerror F + getaliasbyname_r F + getaliasent_r F + getcontext F + getdate F + getdate_err D 0x4 + getdate_r F + getdirentries64 F + getgrent_r F + getgrgid_r F + getgrnam_r F + gethostbyaddr_r F + gethostbyname2_r F + gethostbyname_r F + gethostent_r F + getloadavg F + getmsg F + getnameinfo F + getnetbyaddr_r F + getnetbyname_r F + getnetent_r F + getnetname F + getpmsg F + getprotobyname_r F + getprotobynumber_r F + getprotoent_r F + getpt F + getpwent_r F + getpwnam_r F + getpwuid_r F + getrlimit64 F + getrpcbyname_r F + getrpcbynumber_r F + getrpcent_r F + getservbyname_r F + getservbyport_r F + getservent_r F + getspent_r F + getspnam_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + glob64 F + globfree64 F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + host2netname F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + iruserok_af F + isastream F + iswblank F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + localeconv F + lockf64 F + lseek64 F + makecontext F + mcheck_check_all F + mcheck_pedantic F + mempcpy F + memrchr F + mincore F + mkdtemp F + mkstemp64 F + mmap64 F + moncontrol F + netname2host F + netname2user F + nftw F + nftw64 F + ngettext F + ntp_adjtime F + ntp_gettime F + open64 F + passwd2des F + pclose F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + pread F + pread64 F + printf_size F + printf_size_info F + pthread_attr_init F + ptsname F + ptsname_r F + putgrent F + putmsg F + putpmsg F + pututxline F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pwrite F + pwrite64 F + rawmemchr F + rcmd_af F + readdir64 F + readdir64_r F + rexec_af F + rresvport_af F + rtime F + ruserok_af F + scandir64 F + sendfile F + setrlimit64 F + setutxent F + sighold F + sigignore F + sigqueue F + sigrelse F + sigset F + sigtimedwait F + sigwaitinfo F + statfs64 F + statvfs F + statvfs64 F + strcasestr F + strchrnul F + strtoimax F + strtoumax F + strverscmp F + svc_getreq_common F + svc_getreq_poll F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + svcunix_create F + svcunixfd_create F + swapcontext F + swprintf F + swscanf F + sys_errlist D 0x11b8 + sys_nerr D 0x4 + sys_sigabbrev D 0x100 + sys_siglist D 0x100 + sysv_signal F + tcgetsid F + tdestroy F + tmpfile F + tmpfile64 F + truncate64 F + umount2 F + ungetwc F + unlockpt F + updwtmpx F + user2netname F + utmpxname F + versionsort F + versionsort64 F + vfwprintf F + vfwscanf F + vswprintf F + vswscanf F + vwprintf F + vwscanf F + waitid F + wcscasecmp F + wcschrnul F + wcsftime F + wcsncasecmp F + wcsnlen F + wcstoimax F + wcstoll F + wcstoull F + wcstoumax F + wcswcs F + wmempcpy F + wordexp F + wordfree F + wprintf F + wscanf F + xdecrypt F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_getcredres F + xdr_hyper F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_longlong_t F + xdr_netnamestr F + xdr_sizeof F + xdr_u_hyper F + xdr_u_longlong_t F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_unixcred F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoll_l F + strtoul_l F + strtoull_l F + strxfrm_l F + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __register_atfork F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x200 + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + nftw F + nftw64 F + posix_fadvise64 F + posix_fallocate64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + sys_sigabbrev D 0x200 + sys_siglist D 0x200 +GLIBC_2.3.4 + GLIBC_2.3.4 A + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + getipv4sourcefilter F + getsourcefilter F + regexec F + sched_getaffinity F + sched_setaffinity F + setipv4sourcefilter F + setsourcefilter F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __pread64_chk F + __pread_chk F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __stack_chk_fail F + __stpncpy_chk F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __vfwprintf_chk F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + futimesat F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + linkat F + mkdirat F + mkfifoat F + open_wmemstream F + openat F + openat64 F + ppoll F + readlinkat F + renameat F + symlinkat F + unlinkat F + unshare F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libcrypt.abilist new file mode 100644 index 0000000000..1df145f260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libdl.abilist new file mode 100644 index 0000000000..57c2492e1f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libdl.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.2 + GLIBC_2.2 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libm.abilist new file mode 100644 index 0000000000..064eeba0b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libm.abilist @@ -0,0 +1,403 @@ +GLIBC_2.0 + GLIBC_2.0 A + _LIB_VERSION D 0x4 + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cbrt F + cbrtf F + cbrtl F + ceil F + ceilf F + ceill F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + logb F + logbf F + logbl F + logf F + logl F + matherr F + modf F + modff F + modfl F + nextafter F + nextafterf F + nextafterl F + pow F + powf F + powl F + remainder F + remainderf F + remainderl F + rint F + rintf F + rintl F + scalb F + scalbf F + scalbl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __acoshl_finite F + __acosl_finite F + __asin_finite F + __asinf_finite F + __asinl_finite F + __atan2_finite F + __atan2f_finite F + __atan2l_finite F + __atanh_finite F + __atanhf_finite F + __atanhl_finite F + __cosh_finite F + __coshf_finite F + __coshl_finite F + __exp10_finite F + __exp10f_finite F + __exp10l_finite F + __exp2_finite F + __exp2f_finite F + __exp2l_finite F + __exp_finite F + __expf_finite F + __expl_finite F + __fmod_finite F + __fmodf_finite F + __fmodl_finite F + __gamma_r_finite F + __gammaf_r_finite F + __gammal_r_finite F + __hypot_finite F + __hypotf_finite F + __hypotl_finite F + __j0_finite F + __j0f_finite F + __j0l_finite F + __j1_finite F + __j1f_finite F + __j1l_finite F + __jn_finite F + __jnf_finite F + __jnl_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __lgammal_r_finite F + __log10_finite F + __log10f_finite F + __log10l_finite F + __log2_finite F + __log2f_finite F + __log2l_finite F + __log_finite F + __logf_finite F + __logl_finite F + __pow_finite F + __powf_finite F + __powl_finite F + __remainder_finite F + __remainderf_finite F + __remainderl_finite F + __scalb_finite F + __scalbf_finite F + __scalbl_finite F + __sinh_finite F + __sinhf_finite F + __sinhl_finite F + __sqrt_finite F + __sqrtf_finite F + __sqrtl_finite F + __y0_finite F + __y0f_finite F + __y0l_finite F + __y1_finite F + __y1f_finite F + __y1l_finite F + __yn_finite F + __ynf_finite F + __ynl_finite F +GLIBC_2.2 + GLIBC_2.2 A + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __fpclassifyl F + __signbit F + __signbitf F + __signbitl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log2 F + log2f F + log2l F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nexttoward F + nexttowardf F + nexttowardl F + pow10 F + pow10f F + pow10l F + remquo F + remquof F + remquol F + round F + roundf F + roundl F + scalbln F + scalblnf F + scalblnl F + sincos F + sincosf F + sincosl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F +GLIBC_2.4 + GLIBC_2.4 A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libnsl.abilist new file mode 100644 index 0000000000..b38ad63e0d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libnsl.abilist @@ -0,0 +1,125 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.2 + GLIBC_2.2 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F + xdr_ypall F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist new file mode 100644 index 0000000000..4e0b07f698 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist @@ -0,0 +1,263 @@ +GLIBC_2.0 + GLIBC_2.0 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __lseek F + __open F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_setspecific F + __read F + __send F + __sigaction F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + msync F + nanosleep F + open F + pause F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_once F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_testcancel F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __open64 F + __pread64 F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pwrite64 F + __res_state F + __vfork F + lseek64 F + open64 F + pread F + pread64 F + pthread_attr_getguardsize F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setguardsize F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_condattr_getpshared F + pthread_condattr_setpshared F + pthread_create F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_mutex_timedlock F + pthread_mutexattr_getpshared F + pthread_mutexattr_gettype F + pthread_mutexattr_setpshared F + pthread_mutexattr_settype F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_setconcurrency F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_yield F + pwrite F + pwrite64 F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_attr_setstack F + pthread_attr_setstacksize F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libresolv.abilist new file mode 100644 index 0000000000..f68333d4a4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libresolv.abilist @@ -0,0 +1,104 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/librt.abilist new file mode 100644 index 0000000000..e091de0638 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/librt.abilist @@ -0,0 +1,50 @@ +GLIBC_2.2 + GLIBC_2.2 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libthread_db.abilist new file mode 100644 index 0000000000..f33138067c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libthread_db.abilist @@ -0,0 +1,48 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libutil.abilist new file mode 100644 index 0000000000..7422687e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c new file mode 100644 index 0000000000..3c0122c983 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2003, 2004, 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +posix_fadvise (int fd, off_t offset, off_t len, int advise) +{ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c new file mode 100644 index 0000000000..f6d75377f8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) +{ +/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} + +#include <shlib-compat.h> + +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) + +int +attribute_compat_text_section +__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise) +{ + return __posix_fadvise64_l64 (fd, offset, len, advise); +} + +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); +#else +strong_alias (__posix_fadvise64_l64, posix_fadvise64); +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c new file mode 100644 index 0000000000..84ab68003d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2007, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <fcntl.h> +#include <kernel-features.h> +#include <sysdep.h> + +#define posix_fallocate static internal_fallocate +#include <sysdeps/posix/posix_fallocate.c> +#undef posix_fallocate + +#if !defined __ASSUME_FALLOCATE && defined __NR_fallocate +int __have_fallocate attribute_hidden; +#endif + + +/* Reserve storage for the data of the file associated with FD. */ +int +posix_fallocate (int fd, __off_t offset, __off_t len) +{ +#ifdef __NR_fallocate +# ifndef __ASSUME_FALLOCATE + if (__builtin_expect (__have_fallocate >= 0, 1)) +# endif + { + INTERNAL_SYSCALL_DECL (err); + int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len); + + if (! INTERNAL_SYSCALL_ERROR_P (res, err)) + return 0; + +# ifndef __ASSUME_FALLOCATE + if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0)) + __have_fallocate = -1; + else +# endif + if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP) + return INTERNAL_SYSCALL_ERRNO (res, err); + } +#endif + + return internal_fallocate (fd, offset, len); +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c new file mode 100644 index 0000000000..34bb9f5e2b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c @@ -0,0 +1,59 @@ +/* Copyright (C) 2007, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <fcntl.h> +#include <kernel-features.h> +#include <sysdep.h> + +extern int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len); +#define __posix_fallocate64_l64 static internal_fallocate64 +#include <sysdeps/posix/posix_fallocate64.c> +#undef __posix_fallocate64_l64 + +#if !defined __ASSUME_FALLOCATE && defined __NR_fallocate +/* Defined in posix_fallocate.c. */ +extern int __have_fallocate attribute_hidden; +#endif + + +/* Reserve storage for the data of the file associated with FD. */ +int +__posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len) +{ +#ifdef __NR_fallocate +# ifndef __ASSUME_FALLOCATE + if (__builtin_expect (__have_fallocate >= 0, 1)) +# endif + { + INTERNAL_SYSCALL_DECL (err); + int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len); + + if (! INTERNAL_SYSCALL_ERROR_P (res, err)) + return 0; + +# ifndef __ASSUME_FALLOCATE + if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0)) + __have_fallocate = -1; + else +# endif + if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP) + return INTERNAL_SYSCALL_ERRNO (res, err); + } +#endif + + return internal_fallocate64 (fd, offset, len); +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list new file mode 100644 index 0000000000..7ad55231f6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list @@ -0,0 +1,8 @@ +# File name Caller Syscall name # args Strong name Weak names + +readahead - readahead i:iii __readahead readahead +sync_file_range - sync_file_range Ci:iiii sync_file_range + +prlimit64 EXTRA prlimit64 i:iipp prlimit64 + +fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h new file mode 100644 index 0000000000..98088d32fd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h @@ -0,0 +1,258 @@ +/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2009, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_MIPS_SYSDEP_H +#define _LINUX_MIPS_SYSDEP_H 1 + +/* There is some commonality. */ +#include <sysdeps/unix/mips/mips64/n32/sysdep.h> + +#include <tls.h> + +/* In order to get __set_errno() definition in INLINE_SYSCALL. */ +#ifndef __ASSEMBLER__ +#include <errno.h> +#endif + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +#ifdef __ASSEMBLER__ + +/* We don't want the label for the error handler to be visible in the symbol + table when we define it here. */ +#ifdef __PIC__ +# define SYSCALL_ERROR_LABEL 99b +#endif + +#else /* ! __ASSEMBLER__ */ + +/* Convert X to a long long, without losing any bits if it is one + already or warning if it is a 32-bit pointer. */ +#define ARGIFY(X) ((long long) (__typeof__ ((X) - (X))) (X)) + +/* Define a macro which expands into the inline wrapper code for a system + call. */ +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ INTERNAL_SYSCALL_DECL(err); \ + long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ + if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ + result_var = -1L; \ + } \ + result_var; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) long err + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (val) + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \ + "i" (SYS_ify (name)), err, args) + +#undef INTERNAL_SYSCALL_NCS +#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ + internal_syscall##nr (= number, , "r" (__v0), err, args) + +#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a0 asm("$4") = ARGIFY (arg1); \ + register long long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a0 asm("$4") = ARGIFY (arg1); \ + register long long __a1 asm("$5") = ARGIFY (arg2); \ + register long long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0), "r" (__a1) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a0 asm("$4") = ARGIFY (arg1); \ + register long long __a1 asm("$5") = ARGIFY (arg2); \ + register long long __a2 asm("$6") = ARGIFY (arg3); \ + register long long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a0 asm("$4") = ARGIFY (arg1); \ + register long long __a1 asm("$5") = ARGIFY (arg2); \ + register long long __a2 asm("$6") = ARGIFY (arg3); \ + register long long __a3 asm("$7") = ARGIFY (arg4); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a0 asm("$4") = ARGIFY (arg1); \ + register long long __a1 asm("$5") = ARGIFY (arg2); \ + register long long __a2 asm("$6") = ARGIFY (arg3); \ + register long long __a3 asm("$7") = ARGIFY (arg4); \ + register long long __a4 asm("$8") = ARGIFY (arg5); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \ +({ \ + long _sys_result; \ + \ + { \ + register long long __v0 asm("$2") ncs_init; \ + register long long __a0 asm("$4") = ARGIFY (arg1); \ + register long long __a1 asm("$5") = ARGIFY (arg2); \ + register long long __a2 asm("$6") = ARGIFY (arg3); \ + register long long __a3 asm("$7") = ARGIFY (arg4); \ + register long long __a4 asm("$8") = ARGIFY (arg5); \ + register long long __a5 asm("$9") = ARGIFY (arg6); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \ + "r" (__a5) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ + "$14", "$15", "$24", "$25", "hi", "lo", "memory" +#endif /* __ASSEMBLER__ */ + +/* Pointer mangling is not yet supported for MIPS. */ +#define PTR_MANGLE(var) (void) (var) +#define PTR_DEMANGLE(var) (void) (var) + +#endif /* linux/mips/sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/Makefile b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/Makefile new file mode 100644 index 0000000000..fed17ba64a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/Makefile @@ -0,0 +1 @@ +default-abi := n64 diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c new file mode 100644 index 0000000000..d3b72183ce --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/wordsize-64/fallocate.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c new file mode 100644 index 0000000000..fb2b6813a2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c @@ -0,0 +1 @@ +/* fallocate64 is in fallocate.c */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c new file mode 100644 index 0000000000..6e25b021ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatfs64.c @@ -0,0 +1 @@ +/* Empty. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c new file mode 100644 index 0000000000..46389568b2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c @@ -0,0 +1 @@ +#include <io/ftw.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c new file mode 100644 index 0000000000..cb02172b3e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c @@ -0,0 +1 @@ +#include <io/ftw64.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c new file mode 100644 index 0000000000..33918ea6a5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c @@ -0,0 +1 @@ +/* glob64 is in glob.c */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S new file mode 100644 index 0000000000..3ff0d0e57b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S @@ -0,0 +1,41 @@ +/* Copyright 2003, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include <sys/asm.h> + +/* Sign-extend the ioctl number, since the kernel wants it as a + sign-extended 32-bit value, but our prototype is that of a long. */ + + .text +ENTRY (__ioctl) + sll a1, a1, 0 + li v0, __NR_ioctl + syscall /* Do the system call. */ + bne a3, zero, L(error) + ret + +L(error): + SETUP_GP64 (a0, __ioctl) + PTR_LA t9, __syscall_error + RESTORE_GP64 + jr t9 + +PSEUDO_END (__ioctl) + +weak_alias (__ioctl, ioctl) diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/ld.abilist new file mode 100644 index 0000000000..ea78cdb80e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/ld.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + __libc_memalign F + _r_debug D 0x28 + calloc F + free F + malloc F + realloc F +GLIBC_2.2 + GLIBC_2.2 A + __libc_stack_end D 0x8 + _dl_mcount F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A + __stack_chk_guard D 0x8 diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..f4ca37f44b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.0 + GLIBC_2.0 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libanl.abilist new file mode 100644 index 0000000000..c9755d8a33 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist new file mode 100644 index 0000000000..701152eeb5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist @@ -0,0 +1,2237 @@ +GCC_3.0 + GCC_3.0 A + _Unwind_Find_FDE F + __deregister_frame_info_bases F + __register_frame_info_bases F + __register_frame_info_table_bases F +GLIBC_2.0 + GLIBC_2.0 A + _IO_adjust_column F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0xa8 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_fsetpos F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_link_in F + _IO_list_all D 0x8 + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sscanf F + _IO_stderr_ D 0x98 + _IO_stdin_ D 0x98 + _IO_stdout_ D 0x98 + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_switch_to_get_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + ___brk_addr D 0x8 + __adjtimex F + __after_morecore_hook D 0x8 + __argz_count F + __argz_next F + __argz_stringify F + __assert_fail F + __assert_perror_fail F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __clone F + __close F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x8 + __ctype_b D 0x8 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x8 + __ctype_toupper D 0x8 + __curbrk D 0x8 + __daylight D 0x4 + __dcgettext F + __default_morecore F + __deregister_frame F + __deregister_frame_info F + __dgettext F + __dup2 F + __environ D 0x8 + __errno_location F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __fork F + __fpu_control D 0x4 + __frame_state_for F + __free_hook D 0x8 + __fxstat F + __getdelim F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __isinf F + __isinff F + __isinfl F + __isnan F + __isnanf F + __isnanl F + __iswctype F + __ivaliduser F + __libc_calloc F + __libc_free F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_start_main F + __libc_valloc F + __lseek F + __lxstat F + __malloc_hook D 0x8 + __malloc_initialize_hook D 0x8 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x8 + __mempcpy F + __monstartup F + __morecore D 0x8 + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __overflow F + __pipe F + __printf_fp F + __profile_frequency F + __progname D 0x8 + __progname_full D 0x8 + __rcmd_errstr D 0x8 + __read F + __realloc_hook D 0x8 + __register_frame F + __register_frame_info F + __register_frame_info_table F + __register_frame_table F + __res_randomid F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __sigpause F + __sigsetjmp F + __stpcpy F + __stpncpy F + __strcasecmp F + __strdup F + __strerror_r F + __strtod_internal F + __strtof_internal F + __strtok_r F + __strtol_internal F + __strtold_internal F + __strtoll_internal F + __strtoul_internal F + __strtoull_internal F + __sysv_signal F + __timezone D 0x8 + __tzname D 0x10 + __uflow F + __underflow F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcstod_internal F + __wcstof_internal F + __wcstol_internal F + __wcstold_internal F + __wcstoll_internal F + __wcstoul_internal F + __wcstoull_internal F + __write F + __xmknod F + __xpg_basename F + __xstat F + _environ D 0x8 + _exit F + _flush_cache F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x8 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0x18 + _obstack D 0x8 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x238 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x3d8 + _sys_nerr D 0x4 + _sys_siglist D 0x100 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authnone_create F + authunix_create F + authunix_create_default F + basename F + bcmp F + bcopy F + bdflush F + bind F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cachectl F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + catclose F + catgets F + catopen F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + delete_module F + dgettext F + difftime F + dirfd F + dirname F + div F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + environ D 0x8 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x8 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + fgetc F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpwent F + fgetpwent_r F + fgets F + fgetspent F + fgetspent_r F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fnmatch F + fopen F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fread F + free F + freeaddrinfo F + freopen F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fsetpos F + fstatfs F + fsync F + ftell F + ftime F + ftok F + ftruncate F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + funlockfile F + fwrite F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcwd F + getdelim F + getdirentries F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getw F + getwd F + glob F + glob_pattern_p F + globfree F + gmtime F + gmtime_r F + group_member F + gsignal F + gtty F + h_errlist D 0x28 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + insque F + ioctl F + iruserok F + isalnum F + isalpha F + isascii F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x8 + loc2 D 0x8 + localeconv F + localtime F + localtime_r F + lockf F + locs D 0x8 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + madvise F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x8 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + memset F + mkdir F + mkfifo F + mkstemp F + mktemp F + mktime F + mlock F + mlockall F + mmap F + modf F + modff F + modfl F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + nfsservctl F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + obstack_alloc_failed_handler D 0x8 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open_memstream F + opendir F + openlog F + optarg D 0x8 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + prctl F + printf F + profil F + program_invocation_name D 0x8 + program_invocation_short_name D 0x8 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putpwent F + puts F + putspent F + pututline F + putw F + pvalloc F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rcmd F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x8 + read F + readdir F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + res_init F + revoke F + rewind F + rewinddir F + rexec F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x20 + rpmatch F + rresvport F + ruserok F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigreturn F + sigsetmask F + sigstack F + sigsuspend F + sigvec F + sigwait F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + stderr D 0x8 + stdin D 0x8 + stdout D 0x8 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcat F + strchr F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtouq F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreqset F + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0x18 + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + swab F + swapoff F + swapon F + symlink F + sync F + sys_errlist D 0x3d8 + sys_nerr D 0x4 + sys_sigabbrev D 0x100 + sys_siglist D 0x100 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + sysmips F + system F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x8 + tmpfile F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x10 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + uname F + ungetc F + unlink F + unsetenv F + updwtmp F + uselib F + usleep F + ustat F + utime F + utimes F + utmpname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + vfork F + vfprintf F + vfscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + wait F + wait3 F + wait4 F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscat F + wcschr F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcslen F + wcsncat F + wcsncmp F + wcsncpy F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstok F + wcstol F + wcstold F + wcstombs F + wcstoq F + wcstoul F + wcstouq F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmemset F + write F + writev F + xdr_accepted_reply F + xdr_array F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_int F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_string F + xdr_u_char F + xdr_u_int F + xdr_u_long F + xdr_u_short F + xdr_union F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + ntp_gettimex F + recvmmsg F +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _Exit F + _IO_2_1_stderr_ D 0xe0 + _IO_2_1_stdin_ D 0xe0 + _IO_2_1_stdout_ D 0xe0 + _IO_adjust_wcolumn F + _IO_do_write F + _IO_fclose F + _IO_fdopen F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_file_attach F + _IO_file_close_it F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_overflow F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_fopen F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_getline_info F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_popen F + _IO_proc_close F + _IO_proc_open F + _IO_seekwmark F + _IO_sputbackwc F + _IO_sungetwc F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_unsave_wmarkers F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0xa8 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __asprintf F + __assert F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __ctype32_tolower D 0x8 + __ctype32_toupper D 0x8 + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __duplocale F + __endmntent F + __fbufsize F + __flbf F + __fpending F + __fpurge F + __freadable F + __freading F + __freelocale F + __fsetlocking F + __fwritable F + __fwriting F + __fxstat64 F + __getmntent_r F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __islower_l F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __key_decryptsession_pk_LOCAL D 0x8 + __key_encryptsession_pk_LOCAL D 0x8 + __key_gendes_LOCAL D 0x8 + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_freeres F + __libc_sa_len F + __lxstat64 F + __mempcpy_small F + __newlocale F + __nl_langinfo_l F + __open64 F + __poll F + __pread64 F + __pwrite64 F + __rawmemchr F + __res_init F + __res_nclose F + __res_ninit F + __res_state F + __setmntent F + __signbit F + __signbitf F + __signbitl F + __sigsuspend F + __statfs F + __stpcpy_small F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strfmon_l F + __strncasecmp_l F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_l F + __strtof_l F + __strtok_r_1c F + __strtol_l F + __strtold_l F + __strtoll_l F + __strtoul_l F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __sysconf F + __sysctl F + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __vfork F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_l F + __wcstof_l F + __wcstol_l F + __wcstold_l F + __wcstoll_l F + __wcstoul_l F + __wcstoull_l F + __wcsxfrm_l F + __wctrans_l F + __wctype_l F + __woverflow F + __wuflow F + __wunderflow F + __xpg_sigpause F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _flushlbf F + _res_hconf D 0x48 + _sys_errlist D 0x2370 + _sys_nerr D 0x4 + _sys_siglist D 0x200 + _test_and_set F + addseverity F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x8 + argp_program_version D 0x8 + argp_program_version_hook D 0x8 + argp_state_help F + argp_usage F + authdes_create F + authdes_getucred F + authdes_pk_create F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + bind_textdomain_codeset F + capget F + capset F + cbc_crypt F + clntunix_create F + creat64 F + dcngettext F + des_setparity F + dngettext F + ecb_crypt F + endutxent F + fattach F + fclose F + fdetach F + fdopen F + ffsl F + ffsll F + fgetc_unlocked F + fgetpos F + fgetpos64 F + fgets_unlocked F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fmemopen F + fmtmsg F + fopen F + fopen64 F + fopencookie F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread_unlocked F + freopen64 F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fstatfs64 F + fstatvfs F + fstatvfs64 F + ftello F + ftello64 F + ftruncate64 F + ftw64 F + fwide F + fwprintf F + fwrite_unlocked F + fwscanf F + gai_strerror F + getaliasbyname_r F + getaliasent_r F + getcontext F + getdate F + getdate_err D 0x4 + getdate_r F + getdirentries64 F + getgrent_r F + getgrgid_r F + getgrnam_r F + gethostbyaddr_r F + gethostbyname2_r F + gethostbyname_r F + gethostent_r F + getloadavg F + getmsg F + getnameinfo F + getnetbyaddr_r F + getnetbyname_r F + getnetent_r F + getnetname F + getpmsg F + getprotobyname_r F + getprotobynumber_r F + getprotoent_r F + getpt F + getpwent_r F + getpwnam_r F + getpwuid_r F + getrlimit64 F + getrpcbyname_r F + getrpcbynumber_r F + getrpcent_r F + getservbyname_r F + getservbyport_r F + getservent_r F + getspent_r F + getspnam_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + glob64 F + globfree64 F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + host2netname F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + iruserok_af F + isastream F + iswblank F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + localeconv F + lockf64 F + lseek64 F + makecontext F + mcheck_check_all F + mcheck_pedantic F + mempcpy F + memrchr F + mincore F + mkdtemp F + mkstemp64 F + mmap64 F + moncontrol F + netname2host F + netname2user F + nftw F + nftw64 F + ngettext F + ntp_adjtime F + ntp_gettime F + open64 F + passwd2des F + pclose F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + pread F + pread64 F + printf_size F + printf_size_info F + pthread_attr_init F + ptsname F + ptsname_r F + putgrent F + putmsg F + putpmsg F + pututxline F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pwrite F + pwrite64 F + rawmemchr F + rcmd_af F + readdir64 F + readdir64_r F + rexec_af F + rresvport_af F + rtime F + ruserok_af F + scandir64 F + sendfile F + setrlimit64 F + setutxent F + sighold F + sigignore F + sigqueue F + sigrelse F + sigset F + sigtimedwait F + sigwaitinfo F + statfs64 F + statvfs F + statvfs64 F + strcasestr F + strchrnul F + strtoimax F + strtoumax F + strverscmp F + svc_getreq_common F + svc_getreq_poll F + svc_max_pollfd D 0x4 + svc_pollfd D 0x8 + svcunix_create F + svcunixfd_create F + swapcontext F + swprintf F + swscanf F + sys_errlist D 0x2370 + sys_nerr D 0x4 + sys_sigabbrev D 0x200 + sys_siglist D 0x200 + sysv_signal F + tcgetsid F + tdestroy F + tmpfile F + tmpfile64 F + truncate64 F + umount2 F + ungetwc F + unlockpt F + updwtmpx F + user2netname F + utmpxname F + versionsort F + versionsort64 F + vfwprintf F + vfwscanf F + vswprintf F + vswscanf F + vwprintf F + vwscanf F + waitid F + wcscasecmp F + wcschrnul F + wcsftime F + wcsncasecmp F + wcsnlen F + wcstoimax F + wcstoll F + wcstoull F + wcstoumax F + wcswcs F + wmempcpy F + wordexp F + wordfree F + wprintf F + wscanf F + xdecrypt F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_getcredres F + xdr_hyper F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_longlong_t F + xdr_netnamestr F + xdr_sizeof F + xdr_u_hyper F + xdr_u_longlong_t F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_unixcred F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoul_l F + strxfrm_l F + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __register_atfork F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x400 + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + nftw F + nftw64 F + posix_fadvise64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + strtoll_l F + strtoull_l F + sys_sigabbrev D 0x400 + sys_siglist D 0x400 +GLIBC_2.3.4 + GLIBC_2.3.4 A + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + getipv4sourcefilter F + getsourcefilter F + regexec F + sched_getaffinity F + sched_setaffinity F + setipv4sourcefilter F + setsourcefilter F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __pread64_chk F + __pread_chk F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __stack_chk_fail F + __stpncpy_chk F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __vfwprintf_chk F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + futimesat F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + linkat F + mkdirat F + mkfifoat F + open_wmemstream F + openat F + openat64 F + ppoll F + readlinkat F + renameat F + symlinkat F + unlinkat F + unshare F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libcrypt.abilist new file mode 100644 index 0000000000..1df145f260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libdl.abilist new file mode 100644 index 0000000000..57c2492e1f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libdl.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.2 + GLIBC_2.2 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libm.abilist new file mode 100644 index 0000000000..064eeba0b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libm.abilist @@ -0,0 +1,403 @@ +GLIBC_2.0 + GLIBC_2.0 A + _LIB_VERSION D 0x4 + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cbrt F + cbrtf F + cbrtl F + ceil F + ceilf F + ceill F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + logb F + logbf F + logbl F + logf F + logl F + matherr F + modf F + modff F + modfl F + nextafter F + nextafterf F + nextafterl F + pow F + powf F + powl F + remainder F + remainderf F + remainderl F + rint F + rintf F + rintl F + scalb F + scalbf F + scalbl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __acoshl_finite F + __acosl_finite F + __asin_finite F + __asinf_finite F + __asinl_finite F + __atan2_finite F + __atan2f_finite F + __atan2l_finite F + __atanh_finite F + __atanhf_finite F + __atanhl_finite F + __cosh_finite F + __coshf_finite F + __coshl_finite F + __exp10_finite F + __exp10f_finite F + __exp10l_finite F + __exp2_finite F + __exp2f_finite F + __exp2l_finite F + __exp_finite F + __expf_finite F + __expl_finite F + __fmod_finite F + __fmodf_finite F + __fmodl_finite F + __gamma_r_finite F + __gammaf_r_finite F + __gammal_r_finite F + __hypot_finite F + __hypotf_finite F + __hypotl_finite F + __j0_finite F + __j0f_finite F + __j0l_finite F + __j1_finite F + __j1f_finite F + __j1l_finite F + __jn_finite F + __jnf_finite F + __jnl_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __lgammal_r_finite F + __log10_finite F + __log10f_finite F + __log10l_finite F + __log2_finite F + __log2f_finite F + __log2l_finite F + __log_finite F + __logf_finite F + __logl_finite F + __pow_finite F + __powf_finite F + __powl_finite F + __remainder_finite F + __remainderf_finite F + __remainderl_finite F + __scalb_finite F + __scalbf_finite F + __scalbl_finite F + __sinh_finite F + __sinhf_finite F + __sinhl_finite F + __sqrt_finite F + __sqrtf_finite F + __sqrtl_finite F + __y0_finite F + __y0f_finite F + __y0l_finite F + __y1_finite F + __y1f_finite F + __y1l_finite F + __yn_finite F + __ynf_finite F + __ynl_finite F +GLIBC_2.2 + GLIBC_2.2 A + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __fpclassifyl F + __signbit F + __signbitf F + __signbitl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log2 F + log2f F + log2l F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nexttoward F + nexttowardf F + nexttowardl F + pow10 F + pow10f F + pow10l F + remquo F + remquof F + remquol F + round F + roundf F + roundl F + scalbln F + scalblnf F + scalblnl F + sincos F + sincosf F + sincosl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F +GLIBC_2.4 + GLIBC_2.4 A diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libnsl.abilist new file mode 100644 index 0000000000..b38ad63e0d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libnsl.abilist @@ -0,0 +1,125 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.2 + GLIBC_2.2 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F + xdr_ypall F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist new file mode 100644 index 0000000000..4e0b07f698 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist @@ -0,0 +1,263 @@ +GLIBC_2.0 + GLIBC_2.0 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __lseek F + __open F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_setspecific F + __read F + __send F + __sigaction F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + msync F + nanosleep F + open F + pause F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_once F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_testcancel F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __open64 F + __pread64 F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pwrite64 F + __res_state F + __vfork F + lseek64 F + open64 F + pread F + pread64 F + pthread_attr_getguardsize F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setguardsize F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_condattr_getpshared F + pthread_condattr_setpshared F + pthread_create F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_mutex_timedlock F + pthread_mutexattr_getpshared F + pthread_mutexattr_gettype F + pthread_mutexattr_setpshared F + pthread_mutexattr_settype F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_setconcurrency F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_yield F + pwrite F + pwrite64 F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_attr_setstack F + pthread_attr_setstacksize F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libresolv.abilist new file mode 100644 index 0000000000..808d0f2f74 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libresolv.abilist @@ -0,0 +1,104 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0xa8 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x450 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x80 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/librt.abilist new file mode 100644 index 0000000000..e091de0638 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/librt.abilist @@ -0,0 +1,50 @@ +GLIBC_2.2 + GLIBC_2.2 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libthread_db.abilist new file mode 100644 index 0000000000..f33138067c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libthread_db.abilist @@ -0,0 +1,48 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libutil.abilist new file mode 100644 index 0000000000..7422687e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c new file mode 100644 index 0000000000..2b7c0e21bc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#define posix_fadvise64 __no_posix_fadvise64 +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> +#undef posix_fadvise64 + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + +int +posix_fadvise (int fd, off_t offset, off_t len, int advise) +{ +#ifdef __NR_fadvise64 + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; +#else + return ENOSYS; +#endif +} + +#include <shlib-compat.h> + +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) +strong_alias (posix_fadvise, __posix_fadvise64_l32); +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); +strong_alias (posix_fadvise, __posix_fadvise64_l64); +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); +#else +strong_alias (posix_fadvise, posix_fadvise64); +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c new file mode 100644 index 0000000000..c9f72c4ce1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c @@ -0,0 +1 @@ +/* posix_fadvise64 is in posix_fadvise.c */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c new file mode 100644 index 0000000000..b3fe81bc8c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c new file mode 100644 index 0000000000..f466f13e45 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c @@ -0,0 +1 @@ +/* posix_fallocate64 is in posix_fallocate.c */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c new file mode 100644 index 0000000000..fd9320cfc7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/preadv64.c @@ -0,0 +1 @@ +/* Empty since the preadv syscall is equivalent. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c new file mode 100644 index 0000000000..8b72a2928b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c @@ -0,0 +1 @@ +/* Empty since the pwritev syscall is equivalent. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c new file mode 100644 index 0000000000..6e25b021ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/statfs64.c @@ -0,0 +1 @@ +/* Empty. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list new file mode 100644 index 0000000000..c94fe75a71 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list @@ -0,0 +1,10 @@ +# File name Caller Syscall name # args Strong name Weak names + +sync_file_range - sync_file_range Ci:iiii sync_file_range + +prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 + +fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark + +fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 +statfs - statfs i:sp __statfs statfs statfs64 __statfs64 diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h new file mode 100644 index 0000000000..0baa94f1d7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h @@ -0,0 +1,254 @@ +/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2009, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LINUX_MIPS_SYSDEP_H +#define _LINUX_MIPS_SYSDEP_H 1 + +/* There is some commonality. */ +#include <sysdeps/unix/mips/mips64/n64/sysdep.h> + +#include <tls.h> + +/* In order to get __set_errno() definition in INLINE_SYSCALL. */ +#ifndef __ASSEMBLER__ +#include <errno.h> +#endif + +/* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h + of the kernel. But these symbols do not follow the SYS_* syntax + so we have to redefine the `SYS_ify' macro here. */ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + +#ifdef __ASSEMBLER__ + +/* We don't want the label for the error handler to be visible in the symbol + table when we define it here. */ +#ifdef __PIC__ +# define SYSCALL_ERROR_LABEL 99b +#endif + +#else /* ! __ASSEMBLER__ */ + +/* Define a macro which expands into the inline wrapper code for a system + call. */ +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ INTERNAL_SYSCALL_DECL(err); \ + long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ + if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ + result_var = -1L; \ + } \ + result_var; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) long err + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (val) + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \ + "i" (SYS_ify (name)), err, args) + +#undef INTERNAL_SYSCALL_NCS +#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ + internal_syscall##nr (= number, , "r" (__v0), err, args) + +#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0), "r" (__a1) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "=r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + register long __a4 asm("$8") = (long) arg5; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \ +({ \ + long _sys_result; \ + \ + { \ + register long __v0 asm("$2") ncs_init; \ + register long __a0 asm("$4") = (long) arg1; \ + register long __a1 asm("$5") = (long) arg2; \ + register long __a2 asm("$6") = (long) arg3; \ + register long __a3 asm("$7") = (long) arg4; \ + register long __a4 asm("$8") = (long) arg5; \ + register long __a5 asm("$9") = (long) arg6; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + cs_init \ + "syscall\n\t" \ + ".set\treorder" \ + : "=r" (__v0), "+r" (__a3) \ + : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \ + "r" (__a5) \ + : __SYSCALL_CLOBBERS); \ + err = __a3; \ + _sys_result = __v0; \ + } \ + _sys_result; \ +}) + +#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ + "$14", "$15", "$24", "$25", "hi", "lo", "memory" +#endif /* __ASSEMBLER__ */ + +/* Pointer mangling is not yet supported for MIPS. */ +#define PTR_MANGLE(var) (void) (var) +#define PTR_DEMANGLE(var) (void) (var) + +#endif /* linux/mips/sysdep.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..b089f57472 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h @@ -0,0 +1,182 @@ +/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sysdeps/generic/sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif +#include <sys/asm.h> + +/* Gas will put the initial save of $gp into the CIE, because it appears to + happen before any instructions. So we use cfi_same_value instead of + cfi_restore. */ + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +#ifdef __PIC__ +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .align 2; \ + L(pseudo_start): \ + cfi_startproc; \ + cfi_adjust_cfa_offset (STKSPACE); \ + cfi_rel_offset (gp, STKOFF_GP); \ + 99: PTR_LA t9,__syscall_error; \ + /* manual cpreturn */ \ + REG_L gp, STKOFF_GP(sp); \ + cfi_same_value (gp); \ + RESTORESTK; \ + jr t9; \ + .type __##syscall_name##_nocancel, @function; \ + .globl __##syscall_name##_nocancel; \ + __##syscall_name##_nocancel: \ + SAVESTK; \ + .cpsetup t9, STKOFF_GP, name; \ + cfi_rel_offset (gp, STKOFF_GP); \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + bne a3, zero, SYSCALL_ERROR_LABEL; \ + /* manual cpreturn */ \ + REG_L gp, STKOFF_GP(sp); \ + cfi_same_value (gp); \ + RESTORESTK; \ + ret; \ + .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ + ENTRY (name) \ + SAVESTK; \ + .cpsetup t9, STKOFF_GP, name; \ + cfi_rel_offset (gp, STKOFF_GP); \ + SINGLE_THREAD_P(v1); \ + bne zero, v1, L(pseudo_cancel); \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, SYSCALL_ERROR_LABEL; \ + /* manual cpreturn */ \ + REG_L gp, STKOFF_GP(sp); \ + cfi_same_value (gp); \ + RESTORESTK; \ + ret; \ + L(pseudo_cancel): \ + cfi_adjust_cfa_offset (STKSPACE); \ + cfi_rel_offset (gp, STKOFF_GP); \ + REG_S ra, STKOFF_RA(sp); \ + cfi_rel_offset (ra, STKOFF_RA); \ + PUSHARGS_##args; /* save syscall args */ \ + CENABLE; \ + REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \ + POPARGS_##args; /* restore syscall args */ \ + .set noreorder; \ + li v0, SYS_ify (syscall_name); \ + syscall; \ + .set reorder; \ + REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \ + REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \ + REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \ + CDISABLE; \ + REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \ + REG_L ra, STKOFF_RA(sp); /* restore return address */ \ + REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \ + bne a3, zero, SYSCALL_ERROR_LABEL; \ + /* manual cpreturn */ \ + REG_L gp, STKOFF_GP(sp); \ + cfi_same_value (gp); \ + RESTORESTK; \ + L(pseudo_end): + + +# undef PSEUDO_END +# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym + +#endif + +# define PUSHARGS_0 /* nothing to do */ +# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp); cfi_rel_offset (a0, STKOFF_A0); +# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp); cfi_rel_offset (a1, STKOFF_A1); +# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp); cfi_rel_offset (a2, STKOFF_A2); +# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp); cfi_rel_offset (a3, STKOFF_A3); +# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp); cfi_rel_offset (a3, STKOFF_A4); +# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp); cfi_rel_offset (a3, STKOFF_A5); + +# define POPARGS_0 /* nothing to do */ +# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp); +# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp); +# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp); +# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp); +# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp); +# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp); + +/* Save an even number of slots. Should be 0 if an even number of slots + are used below, or SZREG if an odd number are used. */ +# define STK_PAD SZREG + +/* Place values that we are more likely to use later in this sequence, i.e. + closer to the SP at function entry. If you do that, the are more + likely to already be in your d-cache. */ +# define STKOFF_A5 (STK_PAD) +# define STKOFF_A4 (STKOFF_A5 + SZREG) +# define STKOFF_A3 (STKOFF_A4 + SZREG) +# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */ +# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */ +# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */ +# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */ +# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */ +# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */ +# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */ +# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */ + +# define STKSPACE (STKOFF_GP + SZREG) +# define SAVESTK PTR_SUBU sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE) +# define RESTORESTK PTR_ADDU sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE) + +# ifdef IS_IN_libpthread +# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9 +# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9 +# elif defined IS_IN_librt +# define CENABLE PTR_LA t9, __librt_enable_asynccancel; jalr t9 +# define CDISABLE PTR_LA t9, __librt_disable_asynccancel; jalr t9 +# else +# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9 +# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9 +# endif + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) \ + == 0, 1) +# else +# define SINGLE_THREAD_P(reg) \ + READ_THREAD_POINTER(reg); \ + lw reg, MULTIPLE_THREADS_OFFSET(reg) +#endif + +#elif !defined __ASSEMBLER__ + +# define SINGLE_THREAD_P 1 +# define NO_CANCELLATION 1 + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/recv.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/recv.c new file mode 100644 index 0000000000..b910525c92 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/recv.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/x86_64/recv.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c new file mode 100644 index 0000000000..3c1c910642 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c @@ -0,0 +1,56 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stdarg.h> +#include <sys/sem.h> +#include <ipc_priv.h> +#include <sysdep.h> + +/* Define a `union semun' suitable for Linux here. */ +union semun +{ + int val; /* value for SETVAL */ + struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ + unsigned short int *array; /* array for GETALL & SETALL */ + struct seminfo *__buf; /* buffer for IPC_INFO */ +}; + +#include <bp-checks.h> +#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */ + +int __semctl (int semid, int semnum, int cmd, ...); + +int +__semctl (int semid, int semnum, int cmd, ...) +{ + union semun arg; + va_list ap; + + va_start (ap, cmd); + + /* Get the argument. */ + arg = va_arg (ap, union semun); + + va_end (ap); + + return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64, + CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __semctl, semctl, GLIBC_2_0); diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/send.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/send.c new file mode 100644 index 0000000000..d2c2996a21 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/send.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/x86_64/send.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c new file mode 100644 index 0000000000..da07427c3a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/shm.h> +#include <ipc_priv.h> +#include <sysdep.h> + +#include <bp-checks.h> + +int __shmctl (int shmid, int cmd, struct shmid_ds *buf); + +int +__shmctl (int shmid, int cmd, struct shmid_ds *buf) +{ + return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, CHECK_1 (buf)); +} + +#include <shlib-compat.h> +versioned_symbol (libc, __shmctl, shmctl, GLIBC_2_0); diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S new file mode 100644 index 0000000000..d6f0be2e1b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S @@ -0,0 +1,59 @@ +/* Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include <sys/asm.h> + +/* Usage: + long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5, arg6, arg7) + + We need to do some arg shifting, syscall_number will be in v0. */ + + + .text +NESTED (syscall, SZREG, ra) + .mask 0x00010000, -SZREG + .fmask 0x00000000, 0 + PTR_ADDIU sp, -SZREG + REG_S s0, (sp) + + move s0, a0 + move a0, a1 /* shift arg1 - arg7. */ + move a1, a2 + move a2, a3 + move a3, a4 + move a4, a5 + move a5, a6 + move a6, a7 + + move v0, s0 /* Syscall number -> v0 */ + syscall /* Do the system call. */ + + REG_L s0, (sp) + PTR_ADDIU sp, SZREG + bne a3, zero, L(error) + + ret + +L(error): + SETUP_GP64 (a0, syscall) + PTR_LA t9, __syscall_error + RESTORE_GP64 + jr t9 + +END (syscall) diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/ports/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list new file mode 100644 index 0000000000..867323a96b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -0,0 +1,18 @@ +# File name Caller Syscall name Args Strong name Weak names + +lseek - lseek Ci:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64 + +ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64 +truncate - truncate i:si truncate truncate64 + +# Semaphore and shm system calls. msgctl, shmctl, and semctl have C +# wrappers (to set __IPC_64). +msgget - msgget i:ii __msgget msgget +msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv +msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +shmat - shmat i:ipi __shmat shmat +shmdt - shmdt i:s __shmdt shmdt +shmget - shmget i:iii __shmget shmget +semop - semop i:ipi __semop semop +semtimedop - semtimedop i:ipip semtimedop +semget - semget i:iii __semget semget diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/truncate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/truncate64.c new file mode 100644 index 0000000000..6e25b021ab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/truncate64.c @@ -0,0 +1 @@ +/* Empty. */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/umount.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/umount.c new file mode 100644 index 0000000000..9a91ba5b2f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/umount.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/hppa/umount.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h new file mode 100644 index 0000000000..3a15de2c30 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/local_lim.h @@ -0,0 +1,100 @@ +/* Minimum guaranteed maximum values for system limits. MIPS Linux version. + Copyright (C) 1993-1998,2000,2002,2003,2004,2007,2008 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* The kernel header pollutes the namespace with the NR_OPEN symbol + and defines LINK_MAX although filesystems have different maxima. A + similar thing is true for OPEN_MAX: the limit can be changed at + runtime and therefore the macro must not be defined. Remove this + after including the header if necessary. */ +#ifndef NR_OPEN +# define __undef_NR_OPEN +#endif +#ifndef LINK_MAX +# define __undef_LINK_MAX +#endif +#ifndef OPEN_MAX +# define __undef_OPEN_MAX +#endif +#ifndef ARG_MAX +# define __undef_ARG_MAX +#endif + +/* The kernel sources contain a file with all the needed information. */ +#include <linux/limits.h> + +/* Have to remove NR_OPEN? */ +#ifdef __undef_NR_OPEN +# undef NR_OPEN +# undef __undef_NR_OPEN +#endif +/* Have to remove LINK_MAX? */ +#ifdef __undef_LINK_MAX +# undef LINK_MAX +# undef __undef_LINK_MAX +#endif +/* Have to remove OPEN_MAX? */ +#ifdef __undef_OPEN_MAX +# undef OPEN_MAX +# undef __undef_OPEN_MAX +#endif +/* Have to remove ARG_MAX? */ +#ifdef __undef_ARG_MAX +# undef ARG_MAX +# undef __undef_ARG_MAX +#endif + +/* The number of data keys per process. */ +#define _POSIX_THREAD_KEYS_MAX 128 +/* This is the value this implementation supports. */ +#define PTHREAD_KEYS_MAX 1024 + +/* Controlling the iterations of destructors for thread-specific data. */ +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +/* Number of iterations this implementation does. */ +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS + +/* The number of threads per process. */ +#define _POSIX_THREAD_THREADS_MAX 64 +/* We have no predefined limit on the number of threads. */ +#undef PTHREAD_THREADS_MAX + +/* Maximum amount by which a process can descrease its asynchronous I/O + priority level. */ +#define AIO_PRIO_DELTA_MAX 20 + +/* Minimum size for a thread. At least two pages with 64k pages. */ +#define PTHREAD_STACK_MIN 131072 + +/* Maximum number of timer expiration overruns. */ +#define DELAYTIMER_MAX 2147483647 + +/* Maximum tty name length. */ +#define TTY_NAME_MAX 32 + +/* Maximum login name length. This is arbitrary. */ +#define LOGIN_NAME_MAX 256 + +/* Maximum host name length. */ +#define HOST_NAME_MAX 64 + +/* Maximum message queue priority level. */ +#define MQ_PRIO_MAX 32768 + +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..2fda0d30cd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h @@ -0,0 +1,232 @@ +/* Machine-specific pthread type layouts. MIPS version. + Copyright (C) 2005-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#include <endian.h> + +#if _MIPS_SIM == _ABI64 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#else +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#endif + + +/* Thread identifiers. The structure of the attribute type is + deliberately not exposed. */ +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + + +#if _MIPS_SIM == _ABI64 +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; +#else +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; +#endif + + +/* Data structures for mutex handling. The structure of the attribute + type is deliberately not exposed. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock; + unsigned int __count; + int __owner; +#if _MIPS_SIM == _ABI64 + unsigned int __nusers; +#endif + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; +#if _MIPS_SIM == _ABI64 + int __spins; + __pthread_list_t __list; +# define __PTHREAD_MUTEX_HAVE_PREV 1 +#else + unsigned int __nusers; + __extension__ union + { + int __spins; + __pthread_slist_t __list; + }; +#endif + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is deliberately not exposed. */ +typedef union +{ + struct + { + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is deliberately not exposed. */ +typedef union +{ +# if _MIPS_SIM == _ABI64 + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + int __writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; + } __data; +# else + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned char __pad1; + unsigned char __pad2; + unsigned char __shared; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; +#else + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; + unsigned char __shared; + unsigned char __pad1; + unsigned char __pad2; +#endif + int __writer; + } __data; +# endif + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h new file mode 100644 index 0000000000..d8516547cc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/bits/semaphore.h @@ -0,0 +1,36 @@ +/* Copyright (C) 2002, 2005, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + +#if _MIPS_SIM == _ABI64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/mips/nptl/clone.S new file mode 100644 index 0000000000..80c265bf6c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/clone.S @@ -0,0 +1,2 @@ +#define RESET_PID +#include <sysdeps/unix/sysv/linux/mips/clone.S> diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/mips/nptl/createthread.c new file mode 100644 index 0000000000..f4a41f2cd6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/createthread.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE ((void *) (pd) \ + + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) + +/* Get the real implementation. */ +#include <nptl/sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/mips/nptl/fork.c new file mode 100644 index 0000000000..d31889e42c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/fork.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h new file mode 100644 index 0000000000..88b601eadd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h @@ -0,0 +1,294 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, + 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <atomic.h> +#include <sysdep.h> +#include <kernel-features.h> + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + + +#define lll_futex_wait(futexp, val, private) \ + lll_futex_timed_wait(futexp, val, NULL, private) + +#define lll_futex_timed_wait(futexp, val, timespec, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (val), (timespec)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ + }) + +#define lll_futex_wake(futexp, nr, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \ + }) + +#define lll_robust_dead(futexv, private) \ + do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + lll_futex_wake (__futexp, 1, private); \ + } \ + while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (long) (futexp), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ + (nr_wake), (nr_move), (mutex), (val)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (nr_wake), (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + +static inline int __attribute__((always_inline)) +__lll_trylock(int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0; +} +#define lll_trylock(lock) __lll_trylock (&(lock)) + + +static inline int __attribute__((always_inline)) +__lll_cond_trylock(int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; +} +#define lll_cond_trylock(lock) __lll_cond_trylock (&(lock)) + + +static inline int __attribute__((always_inline)) +__lll_robust_trylock(int *futex, int id) +{ + return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0; +} +#define lll_robust_trylock(lock, id) \ + __lll_robust_trylock (&(lock), id) + +extern void __lll_lock_wait_private (int *futex) attribute_hidden; +extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + +#define __lll_lock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, \ + 1, 0), 0)) \ + { \ + if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \ + __lll_lock_wait_private (__futex); \ + else \ + __lll_lock_wait (__futex, private); \ + } \ + })) +#define lll_lock(futex, private) __lll_lock (&(futex), private) + + +#define __lll_robust_lock(futex, id, private) \ + ({ \ + int *__futex = (futex); \ + int __val = 0; \ + \ + if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \ + 0), 0)) \ + __val = __lll_robust_lock_wait (__futex, private); \ + __val; \ + }) +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + + +static inline void __attribute__ ((always_inline)) +__lll_cond_lock (int *futex, int private) +{ + if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0) + __lll_lock_wait (futex, private); +} +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + + +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private) + + +extern int __lll_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + +static inline int __attribute__ ((always_inline)) +__lll_timedlock (int *futex, const struct timespec *abstime, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) + result = __lll_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + + +static inline int __attribute__ ((always_inline)) +__lll_robust_timedlock (int *futex, const struct timespec *abstime, + int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + + +#define __lll_unlock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + int __val = atomic_exchange_rel (__futex, 0); \ + \ + if (__builtin_expect (__val > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + })) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + + +#define __lll_robust_unlock(futex, private) \ + ((void) ({ \ + int *__futex = (futex); \ + int __val = atomic_exchange_rel (__futex, 0); \ + \ + if (__builtin_expect (__val & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + })) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + + +#define lll_islocked(futex) \ + (futex != 0) + + +/* Our internal lock implementation is identical to the binary-compatible + mutex implementation. */ + +/* Initializers for lock. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + +/* The states of a lock are: + 0 - untaken + 1 - taken by one user + >1 - taken by more users */ + +/* The kernel notifies a process which uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED); \ + } while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/mips/nptl/pt-vfork.S new file mode 100644 index 0000000000..d31dda22af --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/pt-vfork.S @@ -0,0 +1,36 @@ +/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tls.h> + +/* Save the PID value. */ +#define SAVE_PID \ + READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ + lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ + subu a2, $0, a2; /* Negate it. */ \ + sw a2, PID_OFFSET(v1); /* Store the temporary PID. */ + +/* Restore the old PID value in the parent. */ +#define RESTORE_PID \ + beqz v0, 1f; /* If we are the parent... */ \ + READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ + lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ + subu a2, $0, a2; /* Re-negate it. */ \ + sw a2, PID_OFFSET(v1); /* Restore the PID. */ \ +1: + +#include <sysdeps/unix/sysv/linux/mips/vfork.S> diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c new file mode 100644 index 0000000000..308da8bbce --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/pthread_once.c @@ -0,0 +1,93 @@ +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "pthreadP.h" +#include <lowlevellock.h> + + +unsigned long int __fork_generation attribute_hidden; + + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); +} + + +int +__pthread_once (once_control, init_routine) + pthread_once_t *once_control; + void (*init_routine) (void); +{ + while (1) + { + int oldval, val, newval; + + val = *once_control; + do + { + /* Check if the initialized has already been done. */ + if ((val & 2) != 0) + return 0; + + oldval = val; + newval = (oldval & 3) | __fork_generation | 1; + val = atomic_compare_and_exchange_val_acq (once_control, newval, + oldval); + } + while (__builtin_expect (val != oldval, 0)); + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) != 0) + { + /* Check whether the initializer execution was interrupted + by a fork. */ + if (((oldval ^ newval) & -4) == 0) + { + /* Same generation, some other thread was faster. Wait. */ + lll_futex_wait (once_control, newval, LLL_PRIVATE); + continue; + } + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + + /* Add one to *once_control. */ + atomic_increment (once_control); + + /* Wake up all other threads. */ + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); + break; + } + + return 0; +} +weak_alias (__pthread_once, pthread_once) +hidden_def (__pthread_once) diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..4eff4b7319 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h @@ -0,0 +1,188 @@ +/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sysdeps/generic/sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +# ifdef __PIC__ +# define PSEUDO_CPLOAD .cpload t9; +# define PSEUDO_ERRJMP la t9, __syscall_error; jr t9; +# define PSEUDO_SAVEGP sw gp, 32(sp); cfi_rel_offset (gp, 32); +# define PSEUDO_LOADGP lw gp, 32(sp); +# else +# define PSEUDO_CPLOAD +# define PSEUDO_ERRJMP j __syscall_error; +# define PSEUDO_SAVEGP +# define PSEUDO_LOADGP +# endif + +# undef PSEUDO +# define PSEUDO(name, syscall_name, args) \ + .align 2; \ + L(pseudo_start): \ + cfi_startproc; \ + 99: PSEUDO_ERRJMP \ + .type __##syscall_name##_nocancel, @function; \ + .globl __##syscall_name##_nocancel; \ + __##syscall_name##_nocancel: \ + .set noreorder; \ + PSEUDO_CPLOAD \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, 99b; \ + ret; \ + .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ + ENTRY (name) \ + .set noreorder; \ + PSEUDO_CPLOAD \ + .set reorder; \ + SINGLE_THREAD_P(v1); \ + bne zero, v1, L(pseudo_cancel); \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall; \ + .set reorder; \ + bne a3, zero, 99b; \ + ret; \ + L(pseudo_cancel): \ + SAVESTK_##args; \ + sw ra, 28(sp); \ + cfi_rel_offset (ra, 28); \ + PSEUDO_SAVEGP \ + PUSHARGS_##args; /* save syscall args */ \ + CENABLE; \ + PSEUDO_LOADGP \ + sw v0, 44(sp); /* save mask */ \ + POPARGS_##args; /* restore syscall args */ \ + .set noreorder; \ + li v0, SYS_ify (syscall_name); \ + syscall; \ + .set reorder; \ + sw v0, 36(sp); /* save syscall result */ \ + sw a3, 40(sp); /* save syscall error flag */ \ + lw a0, 44(sp); /* pass mask as arg1 */ \ + CDISABLE; \ + PSEUDO_LOADGP \ + lw v0, 36(sp); /* restore syscall result */ \ + lw a3, 40(sp); /* restore syscall error flag */ \ + lw ra, 28(sp); /* restore return address */ \ + .set noreorder; \ + bne a3, zero, 99b; \ + RESTORESTK; \ + L(pseudo_end): \ + .set reorder; + +# undef PSEUDO_END +# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym + +# define PUSHARGS_0 /* nothing to do */ +# define PUSHARGS_1 PUSHARGS_0 sw a0, 0(sp); cfi_rel_offset (a0, 0); +# define PUSHARGS_2 PUSHARGS_1 sw a1, 4(sp); cfi_rel_offset (a1, 4); +# define PUSHARGS_3 PUSHARGS_2 sw a2, 8(sp); cfi_rel_offset (a2, 8); +# define PUSHARGS_4 PUSHARGS_3 sw a3, 12(sp); cfi_rel_offset (a3, 12); +# define PUSHARGS_5 PUSHARGS_4 /* handled by SAVESTK_## */ +# define PUSHARGS_6 PUSHARGS_5 +# define PUSHARGS_7 PUSHARGS_6 + +# define POPARGS_0 /* nothing to do */ +# define POPARGS_1 POPARGS_0 lw a0, 0(sp); +# define POPARGS_2 POPARGS_1 lw a1, 4(sp); +# define POPARGS_3 POPARGS_2 lw a2, 8(sp); +# define POPARGS_4 POPARGS_3 lw a3, 12(sp); +# define POPARGS_5 POPARGS_4 /* args already in new stackframe */ +# define POPARGS_6 POPARGS_5 +# define POPARGS_7 POPARGS_6 + + +# define STKSPACE 48 +# define SAVESTK_0 subu sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE) +# define SAVESTK_1 SAVESTK_0 +# define SAVESTK_2 SAVESTK_1 +# define SAVESTK_3 SAVESTK_2 +# define SAVESTK_4 SAVESTK_3 +# define SAVESTK_5 lw t0, 16(sp); \ + SAVESTK_0; \ + sw t0, 16(sp) + +# define SAVESTK_6 lw t0, 16(sp); \ + lw t1, 20(sp); \ + SAVESTK_0; \ + sw t0, 16(sp); \ + sw t1, 20(sp) + +# define SAVESTK_7 lw t0, 16(sp); \ + lw t1, 20(sp); \ + lw t2, 24(sp); \ + SAVESTK_0; \ + sw t0, 16(sp); \ + sw t1, 20(sp); \ + sw t2, 24(sp) + +# define RESTORESTK addu sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE) + + +# ifdef __PIC__ +/* We use jalr rather than jal. This means that the assembler will not + automatically restore $gp (in case libc has multiple GOTs) so we must + do it manually - which we have to do anyway since we don't use .cprestore. + It also shuts up the assembler warning about not using .cprestore. */ +# define PSEUDO_JMP(sym) la t9, sym; jalr t9; +# else +# define PSEUDO_JMP(sym) jal sym; +# endif + +# ifdef IS_IN_libpthread +# define CENABLE PSEUDO_JMP (__pthread_enable_asynccancel) +# define CDISABLE PSEUDO_JMP (__pthread_disable_asynccancel) +# elif defined IS_IN_librt +# define CENABLE PSEUDO_JMP (__librt_enable_asynccancel) +# define CDISABLE PSEUDO_JMP (__librt_disable_asynccancel) +# else +# define CENABLE PSEUDO_JMP (__libc_enable_asynccancel) +# define CDISABLE PSEUDO_JMP (__libc_disable_asynccancel) +# endif + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) \ + == 0, 1) +# else +# define SINGLE_THREAD_P(reg) \ + READ_THREAD_POINTER(reg); \ + lw reg, MULTIPLE_THREADS_OFFSET(reg) +#endif + +#elif !defined __ASSEMBLER__ + +# define SINGLE_THREAD_P 1 +# define NO_CANCELLATION 1 + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/mips/nptl/vfork.S new file mode 100644 index 0000000000..cafe316f1a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/nptl/vfork.S @@ -0,0 +1,41 @@ +/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <tls.h> + +/* Save the PID value. */ +#define SAVE_PID \ + READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ + lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ + subu a2, $0, a2; /* Negate it. */ \ + bnez a2, 1f; /* If it was zero... */ \ + lui a2, 0x8000; /* use 0x80000000 instead. */ \ +1: sw a2, PID_OFFSET(v1); /* Store the temporary PID. */ + +/* Restore the old PID value in the parent. */ +#define RESTORE_PID \ + beqz v0, 1f; /* If we are the parent... */ \ + READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \ + lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \ + subu a2, $0, a2; /* Re-negate it. */ \ + lui a0, 0x8000; /* Load 0x80000000... */ \ + bne a2, a0, 2f; /* ... compare against it... */ \ + li a2, 0; /* ... use 0 instead. */ \ +2: sw a2, PID_OFFSET(v1); /* Restore the PID. */ \ +1: + +#include <sysdeps/unix/sysv/linux/mips/vfork.S> diff --git a/ports/sysdeps/unix/sysv/linux/mips/pipe.S b/ports/sysdeps/unix/sysv/linux/mips/pipe.S new file mode 100644 index 0000000000..1708888da4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/pipe.S @@ -0,0 +1 @@ +#include <sysdeps/unix/mips/pipe.S> diff --git a/ports/sysdeps/unix/sysv/linux/mips/pread.c b/ports/sysdeps/unix/sysv/linux/mips/pread.c new file mode 100644 index 0000000000..a868130ea1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/pread.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#ifndef NO_SGIDEFS_H +#include <sgidefs.h> +#endif +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pread +# error "__NR_pread and __NR_pread64 both defined???" +# endif +# define __NR_pread __NR_pread64 +#endif + + +ssize_t +__libc_pread (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off_t offset; +{ + ssize_t result; + +#if _MIPS_SIM != _ABI64 + assert (sizeof (offset) == 4); +#endif + + if (SINGLE_THREAD_P) + { +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, + offset); +#else + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +#endif + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); +#else + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +#endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pread, __pread) +weak_alias (__libc_pread, pread) diff --git a/ports/sysdeps/unix/sysv/linux/mips/pread64.c b/ports/sysdeps/unix/sysv/linux/mips/pread64.c new file mode 100644 index 0000000000..6f9b0054a5 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/pread64.c @@ -0,0 +1,79 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#ifndef NO_SGIDEFS_H +#include <sgidefs.h> +#endif +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pread +# error "__NR_pread and __NR_pread64 both defined???" +# endif +# define __NR_pread __NR_pread64 +#endif + + +ssize_t +__libc_pread64 (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off64_t offset; +{ + ssize_t result; + + + if (SINGLE_THREAD_P) + { +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, + offset); +#else + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +#endif + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); +#else + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +#endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pread64, __pread64) +weak_alias (__libc_pread64, pread64) diff --git a/ports/sysdeps/unix/sysv/linux/mips/profil-counter.h b/ports/sysdeps/unix/sysv/linux/mips/profil-counter.h new file mode 100644 index 0000000000..8a6a0bcf3d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/profil-counter.h @@ -0,0 +1,2 @@ +/* We can use the ix86 version. */ +#include <sysdeps/unix/sysv/linux/i386/profil-counter.h> diff --git a/ports/sysdeps/unix/sysv/linux/mips/putmsg.c b/ports/sysdeps/unix/sysv/linux/mips/putmsg.c new file mode 100644 index 0000000000..ebc1680ca7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/putmsg.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/putmsg.c> diff --git a/ports/sysdeps/unix/sysv/linux/mips/pwrite.c b/ports/sysdeps/unix/sysv/linux/mips/pwrite.c new file mode 100644 index 0000000000..cc0c3b7c22 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/pwrite.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <assert.h> +#include <errno.h> +#ifndef NO_SGIDEFS_H +#include <sgidefs.h> +#endif +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pwrite +# error "__NR_pwrite and __NR_pwrite64 both defined???" +# endif +# define __NR_pwrite __NR_pwrite64 +#endif + + +ssize_t +__libc_pwrite (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off_t offset; +{ + ssize_t result; + +#if _MIPS_SIM != _ABI64 + assert (sizeof (offset) == 4); +#endif + + if (SINGLE_THREAD_P) + { +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, + offset); +#else + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +#endif + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); +#else + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); +#endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +strong_alias (__libc_pwrite, __pwrite) +weak_alias (__libc_pwrite, pwrite) diff --git a/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c b/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c new file mode 100644 index 0000000000..d60accd57f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c @@ -0,0 +1,80 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ralf Baechle <ralf@gnu.org>, 1998. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#ifndef NO_SGIDEFS_H +#include <sgidefs.h> +#endif +#include <unistd.h> +#include <endian.h> + +#include <sysdep-cancel.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +#include <kernel-features.h> + +#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ +# ifdef __NR_pwrite +# error "__NR_pwrite and __NR_pwrite64 both defined???" +# endif +# define __NR_pwrite __NR_pwrite64 +#endif + + +ssize_t +__libc_pwrite64 (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off64_t offset; +{ + ssize_t result; + + if (SINGLE_THREAD_P) + { +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, + offset); +#else + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +#endif + + return result; + } + + int oldtype = LIBC_CANCEL_ASYNC (); + +#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); +#else + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); +#endif + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + +weak_alias (__libc_pwrite64, __pwrite64) +libc_hidden_weak (__pwrite64) +weak_alias (__libc_pwrite64, pwrite64) diff --git a/ports/sysdeps/unix/sysv/linux/mips/readelflib.c b/ports/sysdeps/unix/sysv/linux/mips/readelflib.c new file mode 100644 index 0000000000..56eecd24cf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/readelflib.c @@ -0,0 +1,73 @@ +/* Copyright (C) 1999, 2001, 2002, 2003, 2005, 2009 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Alexandre Oliva <aoliva@redhat.com> + Based on work ../x86_64/readelflib.c, + contributed by Andreas Jaeger <aj@suse.de>, 1999 and + Jakub Jelinek <jakub@redhat.com>, 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +int process_elf32_file (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); +int process_elf64_file (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); + +/* Returns 0 if everything is ok, != 0 in case of error. */ +int +process_elf_file (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) +{ + ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; + int ret; + + if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) + { + Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header; + + ret = process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); + + /* n32 libraries are always libc.so.6+. */ + if (!ret && (elf32_header->e_flags & EF_MIPS_ABI2) != 0) + *flag = FLAG_MIPS64_LIBN32|FLAG_ELF_LIBC6; + } + else + { + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); + /* n64 libraries are always libc.so.6+. */ + if (!ret) + *flag = FLAG_MIPS64_LIBN64|FLAG_ELF_LIBC6; + } + + return ret; +} + +#undef __ELF_NATIVE_CLASS +#undef process_elf_file +#define process_elf_file process_elf32_file +#define __ELF_NATIVE_CLASS 32 +#include "elf/readelflib.c" + +#undef __ELF_NATIVE_CLASS +#undef process_elf_file +#define process_elf_file process_elf64_file +#define __ELF_NATIVE_CLASS 64 +#include "elf/readelflib.c" diff --git a/ports/sysdeps/unix/sysv/linux/mips/register-dump.h b/ports/sysdeps/unix/sysv/linux/mips/register-dump.h new file mode 100644 index 0000000000..186228119f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/register-dump.h @@ -0,0 +1,104 @@ +/* Dump registers. + Copyright (C) 2000-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Jaeger <aj@suse.de>, 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <_itoa.h> + +/* We will print the register dump in this format: + + R0 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R8 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R16 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R24 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + pc lo hi + XXXXXXXX XXXXXXXX XXXXXXXX + The FPU registers will not be printed. +*/ + +static void +hexvalue (unsigned long int value, char *buf, size_t len) +{ + char *cp = _itoa_word (value, buf + len, 16, 0); + while (cp > buf) + *--cp = '0'; +} + +static void +register_dump (int fd, struct sigcontext *ctx) +{ + char regs[38][8]; + struct iovec iov[38 * 2 + 10]; + size_t nr = 0; + int i; + +#define ADD_STRING(str) \ + iov[nr].iov_base = (char *) str; \ + iov[nr].iov_len = strlen (str); \ + ++nr +#define ADD_MEM(str, len) \ + iov[nr].iov_base = str; \ + iov[nr].iov_len = len; \ + ++nr + + /* Generate strings of register contents. */ + for (i = 0; i < 32; i++) + hexvalue (ctx->sc_regs[i], regs[i], 8); + hexvalue (ctx->sc_pc, regs[32], 8); + hexvalue (ctx->sc_mdhi, regs[33], 8); + hexvalue (ctx->sc_mdlo, regs[34], 8); + + /* Generate the output. */ + ADD_STRING ("Register dump:\n\n R0 "); + for (i = 0; i < 8; i++) + { + ADD_MEM (regs[i], 8); + ADD_STRING (" "); + } + ADD_STRING ("\n R8 "); + for (i = 8; i < 16; i++) + { + ADD_MEM (regs[i], 8); + ADD_STRING (" "); + } + ADD_STRING ("\n R16 "); + for (i = 16; i < 24; i++) + { + ADD_MEM (regs[i], 8); + ADD_STRING (" "); + } + ADD_STRING ("\n R24 "); + for (i = 24; i < 32; i++) + { + ADD_MEM (regs[i], 8); + ADD_STRING (" "); + } + ADD_STRING ("\n pc lo hi\n "); + for (i = 32; i < 35; i++) + { + ADD_MEM (regs[i], 8); + ADD_STRING (" "); + } + ADD_STRING ("\n"); + + /* Write the stuff out. */ + writev (fd, iov, nr); +} + + +#define REGISTER_DUMP register_dump (fd, ctx) diff --git a/ports/sysdeps/unix/sysv/linux/mips/setcontext.S b/ports/sysdeps/unix/sysv/linux/mips/setcontext.S new file mode 100644 index 0000000000..d3cde0e504 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/setcontext.S @@ -0,0 +1,191 @@ +/* Set current context. + Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maciej W. Rozycki <macro@codesourcery.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sys/asm.h> +#include <sys/fpregdef.h> +#include <sys/regdef.h> + +#include "ucontext_i.h" + +/* int setcontext (const ucontext_t *ucp) */ + + .text +LOCALSZ = 0 +ARGSZ = 0 +MASK = 0x00000000 +#ifdef __PIC__ +LOCALSZ = 1 /* save gp */ +#endif +#if _MIPS_SIM != _ABIO32 +ARGSZ = 1 /* save a0 */ +# ifdef __PIC__ +MASK = 0x10000000 +# endif +#endif +FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK +GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG) +#if _MIPS_SIM != _ABIO32 +A0OFF = FRAMESZ - (1 * SZREG) /* callee-allocated */ +#else +A0OFF = FRAMESZ + (0 * SZREG) /* caller-allocated */ +#endif + +NESTED (__setcontext, FRAMESZ, ra) + .mask MASK, -(ARGSZ * SZREG) + .fmask 0x00000000, 0 + +#ifdef __PIC__ + SETUP_GP +#endif + + PTR_ADDIU sp, -FRAMESZ + +#ifdef __PIC__ + SETUP_GP64 (GPOFF, __setcontext) + SAVE_GP (GPOFF) +#endif + +#ifdef PROF + .set noat + move AT, ra + jal _mcount + .set at +#endif + + /* Check for the magic flag. */ + li v0, 1 + REG_L v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */ + bne v0, v1, 98f + + REG_S a0, A0OFF(sp) + +/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */ + li a3, _NSIG8 + move a2, zero + PTR_ADDU a1, a0, UCONTEXT_SIGMASK + li a0, SIG_SETMASK + + li v0, SYS_ify (rt_sigprocmask) + syscall + bnez a3, 99f + + REG_L v0, A0OFF(sp) + +#ifdef __mips_hard_float +# if _MIPS_SIM == _ABI64 + l.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(v0) + +# else /* _MIPS_SIM != _ABI64 */ + l.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(v0) + +# endif /* _MIPS_SIM != _ABI64 */ + + lw v1, MCONTEXT_FPC_CSR(v0) + ctc1 v1, fcr31 +#endif /* __mips_hard_float */ + + /* Note the contents of argument registers will be random + unless makecontext() has been called. */ + REG_L a0, (4 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a1, (5 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a2, (6 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a3, (7 * SZREG + MCONTEXT_GREGS)(v0) +#if _MIPS_SIM != _ABIO32 + REG_L a4, (8 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a5, (9 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a6, (10 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a7, (11 * SZREG + MCONTEXT_GREGS)(v0) +#endif + + REG_L s0, (16 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s1, (17 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s2, (18 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s3, (19 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s4, (20 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s5, (21 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s6, (22 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s7, (23 * SZREG + MCONTEXT_GREGS)(v0) +#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32 + REG_L gp, (28 * SZREG + MCONTEXT_GREGS)(v0) +#endif + REG_L sp, (29 * SZREG + MCONTEXT_GREGS)(v0) + REG_L fp, (30 * SZREG + MCONTEXT_GREGS)(v0) + REG_L ra, (31 * SZREG + MCONTEXT_GREGS)(v0) + REG_L t9, MCONTEXT_PC(v0) + + move v0, zero + jr t9 + +98: + /* This is a context obtained from a signal handler. + Perform a full restore by pushing the context + passed onto a simulated signal frame on the stack + and call the signal return syscall as if a signal + handler exited normally. */ + PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK) + + /* Only ucontext is referred to from rt_sigreturn, + copy it. */ + PTR_ADDIU t1, sp, RT_SIGFRAME_UCONTEXT + li t3, ((UCONTEXT_SIZE + SZREG - 1) / SZREG) - 1 +0: + REG_L t2, (a0) + PTR_ADDIU a0, SZREG + REG_S t2, (t1) + PTR_ADDIU t1, SZREG + .set noreorder + bgtz t3, 0b + addiu t3, -1 + .set reorder + +/* rt_sigreturn () -- no arguments, sp points to struct rt_sigframe. */ + li v0, SYS_ify (rt_sigreturn) + syscall + + /* Restore the stack and fall through to the error + path. Successful rt_sigreturn never returns to + its calling place. */ + PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK) +99: +#ifdef __PIC__ + PTR_LA t9, JUMPTARGET (__syscall_error) + RESTORE_GP64 + PTR_ADDIU sp, FRAMESZ + jr t9 + +#else /* ! __PIC__ */ + + j JUMPTARGET (__syscall_error) +#endif /* ! __PIC__ */ +PSEUDO_END (__setcontext) + +weak_alias (__setcontext, setcontext) diff --git a/ports/sysdeps/unix/sysv/linux/mips/sigaction.c b/ports/sysdeps/unix/sysv/linux/mips/sigaction.c new file mode 100644 index 0000000000..d646af3f22 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sigaction.c @@ -0,0 +1,128 @@ +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sgidefs.h> +#include <signal.h> +#include <string.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +#include <sgidefs.h> + +#include <kernel-features.h> + +/* The difference here is that the sigaction structure used in the + kernel is not the same as we use in the libc. Therefore we must + translate it here. */ +#include <kernel_sigaction.h> + +#if _MIPS_SIM != _ABIO32 + +# ifdef __NR_rt_sigreturn +static void restore_rt (void) asm ("__restore_rt"); +# endif +# ifdef __NR_sigreturn +static void restore (void) asm ("__restore"); +# endif +#endif + +/* If ACT is not NULL, change the action for SIG to *ACT. + If OACT is not NULL, put the old action for SIG in *OACT. */ +int +__libc_sigaction (sig, act, oact) + int sig; + const struct sigaction *act; + struct sigaction *oact; +{ + int result; + + struct kernel_sigaction kact, koact; + + if (act) + { + kact.k_sa_handler = act->sa_handler; + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kernel_sigset_t)); + kact.sa_flags = act->sa_flags; +#ifdef HAVE_SA_RESTORER +# if _MIPS_SIM == _ABIO32 + kact.sa_restorer = act->sa_restorer; +# else + kact.sa_restorer = &restore_rt; +# endif +#endif + } + + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + result = INLINE_SYSCALL (rt_sigaction, 4, sig, + act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, + sizeof (kernel_sigset_t)); + + if (oact && result >= 0) + { + oact->sa_handler = koact.k_sa_handler; + memcpy (&oact->sa_mask, &koact.sa_mask, + sizeof (kernel_sigset_t)); + oact->sa_flags = koact.sa_flags; +#ifdef HAVE_SA_RESTORER + oact->sa_restorer = koact.sa_restorer; +#endif + } + return result; +} +libc_hidden_def (__libc_sigaction) + +#ifdef WRAPPER_INCLUDE +# include WRAPPER_INCLUDE +#endif + +#ifndef LIBC_SIGACTION +weak_alias (__libc_sigaction, __sigaction) +libc_hidden_weak (__sigaction) +weak_alias (__libc_sigaction, sigaction) +#endif + +/* NOTE: Please think twice before making any changes to the bits of + code below. GDB needs some intimate knowledge about it to + recognize them as signal trampolines, and make backtraces through + signal handlers work right. Important are both the names + (__restore_rt) and the exact instruction sequence. + If you ever feel the need to make any changes, please notify the + appropriate GDB maintainer. */ + +#define RESTORE(name, syscall) RESTORE2 (name, syscall) +#define RESTORE2(name, syscall) \ +asm \ + ( \ + ".align 4\n" \ + "__" #name ":\n" \ + " li $2, " #syscall "\n" \ + " syscall\n" \ + ); + +/* The return code for realtime-signals. */ +#if _MIPS_SIM != _ABIO32 +# ifdef __NR_rt_sigreturn +RESTORE (restore_rt, __NR_rt_sigreturn) +# endif +# ifdef __NR_sigreturn +RESTORE (restore, __NR_sigreturn) +# endif +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h new file mode 100644 index 0000000000..9edde21683 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h @@ -0,0 +1,42 @@ +/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Jaeger <aj@suse.de>, 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +#include <sgidefs.h> + +#if _MIPS_SIM == _ABIO32 + +#define SIGCONTEXT unsigned long _code, struct sigcontext * +#define SIGCONTEXT_EXTRA_ARGS _code, +#define GET_PC(ctx) ((void *) ctx->sc_pc) +#define GET_FRAME(ctx) ((void *) ctx->sc_regs[30]) +#define GET_STACK(ctx) ((void *) ctx->sc_regs[29]) +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) + +#else + +#define SIGCONTEXT unsigned long _code, ucontext_t * +#define SIGCONTEXT_EXTRA_ARGS _code, +#define GET_PC(ctx) ((void *) ctx->uc_mcontext.pc) +#define GET_FRAME(ctx) ((void *) ctx->uc_mcontext.gregs[30]) +#define GET_STACK(ctx) ((void *) ctx->uc_mcontext.gregs[29]) +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S b/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S new file mode 100644 index 0000000000..c7ac19b9f9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S @@ -0,0 +1,211 @@ +/* Save and set current context. + Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Maciej W. Rozycki <macro@codesourcery.com>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <sys/asm.h> +#include <sys/fpregdef.h> +#include <sys/regdef.h> + +#include "ucontext_i.h" + +/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */ + + .text +LOCALSZ = 0 +ARGSZ = 0 +MASK = 0x00000000 +#ifdef __PIC__ +LOCALSZ = 1 /* save gp */ +#endif +#if _MIPS_SIM != _ABIO32 +ARGSZ = 1 /* save a1 */ +# ifdef __PIC__ +MASK = 0x10000000 +# endif +#endif +FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK +GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG) +#if _MIPS_SIM != _ABIO32 +A1OFF = FRAMESZ - (1 * SZREG) /* callee-allocated */ +#else +A1OFF = FRAMESZ + (1 * SZREG) /* caller-allocated */ +#endif + +NESTED (__swapcontext, FRAMESZ, ra) + .mask MASK, -(ARGSZ * SZREG) + .fmask 0x00000000, 0 + +#ifdef __PIC__ + SETUP_GP + + move a2, sp +# define _SP a2 + +# if _MIPS_SIM != _ABIO32 + move a3, gp +# define _GP a3 +# endif + + PTR_ADDIU sp, -FRAMESZ + SETUP_GP64 (GPOFF, __swapcontext) + SAVE_GP (GPOFF) + +#else /* ! __PIC__ */ +# define _SP sp +# define _GP gp + +#endif /* ! __PIC__ */ + +#ifdef PROF + .set noat + move AT, ra + jal _mcount + .set at +#endif + + /* Store a magic flag. */ + li v1, 1 + REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */ + + REG_S s0, (16 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s1, (17 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s2, (18 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s3, (19 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s4, (20 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s5, (21 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s6, (22 * SZREG + MCONTEXT_GREGS)(a0) + REG_S s7, (23 * SZREG + MCONTEXT_GREGS)(a0) +#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32 + REG_S _GP, (28 * SZREG + MCONTEXT_GREGS)(a0) +#endif + REG_S _SP, (29 * SZREG + MCONTEXT_GREGS)(a0) + REG_S fp, (30 * SZREG + MCONTEXT_GREGS)(a0) + REG_S ra, (31 * SZREG + MCONTEXT_GREGS)(a0) + REG_S ra, MCONTEXT_PC(a0) + +#ifdef __mips_hard_float +# if _MIPS_SIM == _ABI64 + s.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(a0) + +# else /* _MIPS_SIM != _ABI64 */ + s.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0) + s.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(a0) + +# endif /* _MIPS_SIM != _ABI64 */ + + cfc1 v1, fcr31 + sw v1, MCONTEXT_FPC_CSR(a0) +#endif /* __mips_hard_float */ + + REG_S a1, A1OFF(sp) + +/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */ + li a3, _NSIG8 + PTR_ADDU a2, a0, UCONTEXT_SIGMASK + PTR_ADDU a1, a1, UCONTEXT_SIGMASK + li a0, SIG_SETMASK + + li v0, SYS_ify (rt_sigprocmask) + syscall + bnez a3, 99f + + REG_L v0, A1OFF(sp) + +#ifdef __mips_hard_float +# if _MIPS_SIM == _ABI64 + l.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(v0) + +# else /* _MIPS_SIM != _ABI64 */ + l.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0) + l.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(v0) + +# endif /* _MIPS_SIM != _ABI64 */ + + lw v1, MCONTEXT_FPC_CSR(v0) + ctc1 v1, fcr31 +#endif /* __mips_hard_float */ + + /* Note the contents of argument registers will be random + unless makecontext() has been called. */ + REG_L a0, (4 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a1, (5 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a2, (6 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a3, (7 * SZREG + MCONTEXT_GREGS)(v0) +#if _MIPS_SIM != _ABIO32 + REG_L a4, (8 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a5, (9 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a6, (10 * SZREG + MCONTEXT_GREGS)(v0) + REG_L a7, (11 * SZREG + MCONTEXT_GREGS)(v0) +#endif + + REG_L s0, (16 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s1, (17 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s2, (18 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s3, (19 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s4, (20 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s5, (21 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s6, (22 * SZREG + MCONTEXT_GREGS)(v0) + REG_L s7, (23 * SZREG + MCONTEXT_GREGS)(v0) +#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32 + REG_L gp, (28 * SZREG + MCONTEXT_GREGS)(v0) +#endif + REG_L sp, (29 * SZREG + MCONTEXT_GREGS)(v0) + REG_L fp, (30 * SZREG + MCONTEXT_GREGS)(v0) + REG_L ra, (31 * SZREG + MCONTEXT_GREGS)(v0) + REG_L t9, MCONTEXT_PC(v0) + + move v0, zero + jr t9 + +99: +#ifdef __PIC__ + PTR_LA t9, JUMPTARGET (__syscall_error) + RESTORE_GP64 + PTR_ADDIU sp, FRAMESZ + jr t9 + +#else /* ! __PIC__ */ + + j JUMPTARGET (__syscall_error) +#endif /* ! __PIC__ */ +PSEUDO_END (__swapcontext) + +weak_alias (__swapcontext, swapcontext) diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/cachectl.h b/ports/sysdeps/unix/sysv/linux/mips/sys/cachectl.h new file mode 100644 index 0000000000..40743e5e3f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sys/cachectl.h @@ -0,0 +1,42 @@ +/* Copyright (C) 1995, 1996, 1997, 2000, 2009, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#include <features.h> + +/* + * Get the kernel definition for the op bits. + */ +#include <asm/cachectl.h> + +__BEGIN_DECLS + +#ifdef __USE_MISC +extern int cachectl (void *__addr, const int __nbytes, const int __op) __THROW; +#endif +extern int __cachectl (void *__addr, const int __nbytes, const int __op) __THROW; +#ifdef __USE_MISC +extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW; +#endif +extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW; + +__END_DECLS + +#endif /* sys/cachectl.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/mips/sys/procfs.h new file mode 100644 index 0000000000..9b8030df3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sys/procfs.h @@ -0,0 +1,127 @@ +/* Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somehow modelled after the file of the same name on SysVr4 + systems. It provides a definition of the core file format for ELF + used on Linux. */ + +#include <features.h> +#include <sgidefs.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/user.h> +#include <sgidefs.h> + +/* ELF register definitions */ +#define ELF_NGREG 45 +#define ELF_NFPREG 33 + +#if _MIPS_SIM == _ABIN32 +__extension__ typedef unsigned long long elf_greg_t; +#else +typedef unsigned long elf_greg_t; +#endif +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef double elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +__BEGIN_DECLS + +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + gdb doesn't really use excluded. Fields present but not used are + marked with "XXX". */ +struct elf_prstatus + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ +#if _MIPS_SIM == _ABIN32 + __extension__ unsigned long long int pr_sigpend; + __extension__ unsigned long long int pr_sighold; +#else + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ +#endif + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ +#if _MIPS_SIM == _ABIN32 + __extension__ unsigned long long int pr_flag; +#else + unsigned long int pr_flag; /* Flags. */ +#endif + long pr_uid; + long pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore habe only ine PID type. */ +typedef __pid_t lwpid_t; + + +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/sysmips.h b/ports/sysdeps/unix/sysv/linux/mips/sys/sysmips.h new file mode 100644 index 0000000000..b096dc173a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sys/sysmips.h @@ -0,0 +1,43 @@ +/* Copyright (C) 1995, 1997, 2000, 2001, 2009, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SYSMIPS_H +#define _SYS_SYSMIPS_H 1 + +#include <features.h> + +/* + * Commands for the sysmips(2) call + * + * sysmips(2) is deprecated - though some existing software uses it. + * We only support the following commands. Sysmips exists for compatibility + * purposes only so new software should avoid it. + */ +#define SETNAME 1 /* set hostname */ +#define FLUSH_CACHE 3 /* writeback and invalidate caches */ +#define MIPS_FIXADE 7 /* control address error fixing */ +#define MIPS_RDNVRAM 10 /* read NVRAM */ +#define MIPS_ATOMIC_SET 2001 /* atomically set variable */ + +__BEGIN_DECLS + +extern int sysmips (const int __cmd, ...) __THROW; + +__END_DECLS + +#endif /* sys/sysmips.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/mips/sys/ucontext.h new file mode 100644 index 0000000000..f42df8decf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sys/ucontext.h @@ -0,0 +1,113 @@ +/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006, 2009 Free Software + Foundation, Inc. This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Don't rely on this, the interface is currently messed up and may need to + be broken to be fixed. */ +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <sgidefs.h> +#include <signal.h> + +/* We need the signal context definitions even if they are not used + included in <signal.h>. */ +#include <bits/sigcontext.h> + +/* Type for general register. Even in o32 we assume 64-bit registers, + like the kernel. */ +__extension__ typedef unsigned long long int greg_t; + +/* Number of general registers. */ +#define NGREG 32 +#define NFPREG 32 + +/* Container for all general registers. */ +typedef greg_t gregset_t[NGREG]; + +/* Container for all FPU registers. */ +typedef struct fpregset { + union { + double fp_dregs[NFPREG]; + struct { + float _fp_fregs; + unsigned int _fp_pad; + } fp_fregs[NFPREG]; + } fp_r; +} fpregset_t; + + +/* Context to describe whole processor state. */ +#if _MIPS_SIM == _ABIO32 +/* Earlier versions of glibc for mips had an entirely different + definition of mcontext_t, that didn't even resemble the + corresponding kernel data structure. Fortunately, makecontext, + [gs]etcontext et all were not implemented back then, so this can + still be rectified. */ +typedef struct + { + unsigned int regmask; + unsigned int status; + greg_t pc; + gregset_t gregs; + fpregset_t fpregs; + unsigned int fp_owned; + unsigned int fpc_csr; + unsigned int fpc_eir; + unsigned int used_math; + unsigned int dsp; + greg_t mdhi; + greg_t mdlo; + unsigned long hi1; + unsigned long lo1; + unsigned long hi2; + unsigned long lo2; + unsigned long hi3; + unsigned long lo3; + } mcontext_t; +#else +typedef struct + { + gregset_t gregs; + fpregset_t fpregs; + greg_t mdhi; + greg_t hi1; + greg_t hi2; + greg_t hi3; + greg_t mdlo; + greg_t lo1; + greg_t lo2; + greg_t lo3; + greg_t pc; + unsigned int fpc_csr; + unsigned int used_math; + unsigned int dsp; + unsigned int reserved; + } mcontext_t; +#endif + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + } ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h new file mode 100644 index 0000000000..950cad7fa8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h @@ -0,0 +1,218 @@ +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_USER_H +#define _SYS_USER_H 1 + +#include <sgidefs.h> + +/* The whole purpose of this file is for GDB and GDB only. Don't read + too much into it. Don't use it for anything other than GDB unless + you know what you are doing. */ + +/* #include <asm/reg.h> */ +/* Instead of including the kernel header, that will vary depending on + whether the 32- or the 64-bit kernel is installed, we paste its + contents here. Note that the fact that the file is inline here, + instead of included separately, doesn't change in any way the + licensing status of a program that includes user.h. Since this is + for gdb alone, and gdb is GPLed, no surprises here. */ +#if _MIPS_SIM == _ABIO32 +/* + * Various register offset definitions for debuggers, core file + * examiners and whatnot. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1995, 1999 by Ralf Baechle + */ +#ifndef __ASM_MIPS_REG_H +#define __ASM_MIPS_REG_H + +/* + * This defines/structures correspond to the register layout on stack - + * if the order here is changed, it needs to be updated in + * include/asm-mips/stackframe.h + */ +#define EF_REG0 6 +#define EF_REG1 7 +#define EF_REG2 8 +#define EF_REG3 9 +#define EF_REG4 10 +#define EF_REG5 11 +#define EF_REG6 12 +#define EF_REG7 13 +#define EF_REG8 14 +#define EF_REG9 15 +#define EF_REG10 16 +#define EF_REG11 17 +#define EF_REG12 18 +#define EF_REG13 19 +#define EF_REG14 20 +#define EF_REG15 21 +#define EF_REG16 22 +#define EF_REG17 23 +#define EF_REG18 24 +#define EF_REG19 25 +#define EF_REG20 26 +#define EF_REG21 27 +#define EF_REG22 28 +#define EF_REG23 29 +#define EF_REG24 30 +#define EF_REG25 31 +/* + * k0/k1 unsaved + */ +#define EF_REG28 34 +#define EF_REG29 35 +#define EF_REG30 36 +#define EF_REG31 37 + +/* + * Saved special registers + */ +#define EF_LO 38 +#define EF_HI 39 + +#define EF_CP0_EPC 40 +#define EF_CP0_BADVADDR 41 +#define EF_CP0_STATUS 42 +#define EF_CP0_CAUSE 43 + +#define EF_SIZE 180 /* size in bytes */ + +#endif /* __ASM_MIPS_REG_H */ + +#else /* _MIPS_SIM != _ABIO32 */ + +/* + * Various register offset definitions for debuggers, core file + * examiners and whatnot. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1995, 1999 Ralf Baechle + * Copyright (C) 1995, 1999 Silicon Graphics + */ +#ifndef _ASM_REG_H +#define _ASM_REG_H + +/* + * This defines/structures correspond to the register layout on stack - + * if the order here is changed, it needs to be updated in + * include/asm-mips/stackframe.h + */ +#define EF_REG0 0 +#define EF_REG1 1 +#define EF_REG2 2 +#define EF_REG3 3 +#define EF_REG4 4 +#define EF_REG5 5 +#define EF_REG6 6 +#define EF_REG7 7 +#define EF_REG8 8 +#define EF_REG9 9 +#define EF_REG10 10 +#define EF_REG11 11 +#define EF_REG12 12 +#define EF_REG13 13 +#define EF_REG14 14 +#define EF_REG15 15 +#define EF_REG16 16 +#define EF_REG17 17 +#define EF_REG18 18 +#define EF_REG19 19 +#define EF_REG20 20 +#define EF_REG21 21 +#define EF_REG22 22 +#define EF_REG23 23 +#define EF_REG24 24 +#define EF_REG25 25 +/* + * k0/k1 unsaved + */ +#define EF_REG28 28 +#define EF_REG29 29 +#define EF_REG30 30 +#define EF_REG31 31 + +/* + * Saved special registers + */ +#define EF_LO 32 +#define EF_HI 33 + +#define EF_CP0_EPC 34 +#define EF_CP0_BADVADDR 35 +#define EF_CP0_STATUS 36 +#define EF_CP0_CAUSE 37 + +#define EF_SIZE 304 /* size in bytes */ + +#endif /* _ASM_REG_H */ + +#endif /* _MIPS_SIM != _ABIO32 */ + +#if _MIPS_SIM == _ABIO32 + +struct user +{ + unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */ + size_t u_tsize; /* text size (pages) */ + size_t u_dsize; /* data size (pages) */ + size_t u_ssize; /* stack size (pages) */ + unsigned long start_code; /* text starting address */ + unsigned long start_data; /* data starting address */ + unsigned long start_stack; /* stack starting address */ + long int signal; /* signal causing core dump */ + void* u_ar0; /* help gdb find registers */ + unsigned long magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ +}; + +#else + +struct user { + __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */ + __extension__ unsigned long u_tsize; /* text size (pages) */ + __extension__ unsigned long u_dsize; /* data size (pages) */ + __extension__ unsigned long u_ssize; /* stack size (pages) */ + __extension__ unsigned long long start_code; /* text starting address */ + __extension__ unsigned long long start_data; /* data starting address */ + __extension__ unsigned long long start_stack; /* stack starting address */ + __extension__ long long signal; /* signal causing core dump */ + __extension__ unsigned long long u_ar0; /* help gdb find registers */ + __extension__ unsigned long long magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ +}; + +#endif + +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_DATA_START_ADDR (u.start_data) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + +#endif /* _SYS_USER_H */ diff --git a/ports/sysdeps/unix/sysv/linux/mips/syscalls.list b/ports/sysdeps/unix/sysv/linux/mips/syscalls.list new file mode 100644 index 0000000000..db731b149a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -0,0 +1,31 @@ +# File name Caller Syscall name Args Strong name Weak names + +# +# Calls for compatibility with existing MIPS OS implementations and +# compilers. +# +cachectl - cachectl i:pii __cachectl cachectl +cacheflush - cacheflush i:pii _flush_cache cacheflush +sysmips - sysmips i:iiii __sysmips sysmips + +# +# Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; +# it's provided for compatibility, though. +# +accept - accept Ci:iBN __libc_accept __accept accept +bind - bind i:ipi __bind bind +connect - connect Ci:ipi __libc_connect __connect connect +getpeername - getpeername i:ipp __getpeername getpeername +getsockname - getsockname i:ipp __getsockname getsockname +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt +listen - listen i:ii __listen listen +recv - recv Ci:ibni __libc_recv __recv recv +recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom +recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg +send - send Ci:ibni __libc_send __send send +sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg +sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt +shutdown - shutdown i:ii __shutdown shutdown +socket - socket i:iii __socket socket +socketpair - socketpair i:iiif __socketpair socketpair diff --git a/ports/sysdeps/unix/sysv/linux/mips/ucontext_i.sym b/ports/sysdeps/unix/sysv/linux/mips/ucontext_i.sym new file mode 100644 index 0000000000..f14b886407 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/ucontext_i.sym @@ -0,0 +1,52 @@ +#include <inttypes.h> +#include <signal.h> +#include <stddef.h> +#include <sys/ucontext.h> + +#include <kernel_rt_sigframe.h> + +-- Constants used by the rt_sigprocmask call. + +SIG_BLOCK +SIG_SETMASK + +_NSIG8 (_NSIG / 8) + +-- Offsets of the fields in the kernel rt_sigframe_t structure. +#define rt_sigframe(member) offsetof (kernel_rt_sigframe_t, member) + +RT_SIGFRAME_UCONTEXT rt_sigframe (rs_uc) + +RT_SIGFRAME_SIZE sizeof (kernel_rt_sigframe_t) + +-- Offsets of the fields in the ucontext_t structure. +#define ucontext(member) offsetof (ucontext_t, member) +#define stack(member) ucontext (uc_stack.member) +#define mcontext(member) ucontext (uc_mcontext.member) + +UCONTEXT_FLAGS ucontext (uc_flags) +UCONTEXT_LINK ucontext (uc_link) +UCONTEXT_STACK ucontext (uc_stack) +UCONTEXT_MCONTEXT ucontext (uc_mcontext) +UCONTEXT_SIGMASK ucontext (uc_sigmask) + +STACK_SP stack (ss_sp) +STACK_SIZE stack (ss_size) +STACK_FLAGS stack (ss_flags) + +MCONTEXT_GREGS mcontext (gregs) +MCONTEXT_FPREGS mcontext (fpregs) +MCONTEXT_MDHI mcontext (mdhi) +MCONTEXT_HI1 mcontext (hi1) +MCONTEXT_HI2 mcontext (hi2) +MCONTEXT_HI3 mcontext (hi3) +MCONTEXT_MDLO mcontext (mdlo) +MCONTEXT_LO1 mcontext (lo1) +MCONTEXT_LO2 mcontext (lo2) +MCONTEXT_LO3 mcontext (lo3) +MCONTEXT_PC mcontext (pc) +MCONTEXT_FPC_CSR mcontext (fpc_csr) +MCONTEXT_USED_MATH mcontext (used_math) +MCONTEXT_DSP mcontext (dsp) + +UCONTEXT_SIZE sizeof (ucontext_t) diff --git a/ports/sysdeps/unix/sysv/linux/mips/ustat.c b/ports/sysdeps/unix/sysv/linux/mips/ustat.c new file mode 100644 index 0000000000..aa84b53624 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/ustat.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/ustat.h> +#include <sys/sysmacros.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <bp-checks.h> + +int +ustat (dev_t dev, struct ustat *ubuf) +{ + unsigned long k_dev; + + /* We must convert the value to dev_t type used by the kernel. */ + k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff); + + return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf)); +} diff --git a/ports/sysdeps/unix/sysv/linux/mips/vfork.S b/ports/sysdeps/unix/sysv/linux/mips/vfork.S new file mode 100644 index 0000000000..6d2c65ad0b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/vfork.S @@ -0,0 +1,97 @@ +/* Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* vfork() is just a special case of clone(). */ + +#include <sys/asm.h> +#include <sysdep.h> +#include <asm/unistd.h> +#include <sgidefs.h> + +#ifndef SAVE_PID +#define SAVE_PID +#endif + +#ifndef RESTORE_PID +#define RESTORE_PID +#endif + + +/* int vfork() */ + + .text +LOCALSZ= 1 +FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK +GPOFF= FRAMESZ-(1*SZREG) +NESTED(__vfork,FRAMESZ,sp) +#ifdef __PIC__ + SETUP_GP +#endif + PTR_SUBU sp, FRAMESZ + SETUP_GP64 (a5, __vfork) +#ifdef __PIC__ + SAVE_GP (GPOFF) +#endif +#ifdef PROF +# if (_MIPS_SIM != _ABIO32) + PTR_S a5, GPOFF(sp) +# endif + .set noat + move $1, ra +# if (_MIPS_SIM == _ABIO32) + subu sp,sp,8 +# endif + jal _mcount + .set at +# if (_MIPS_SIM != _ABIO32) + PTR_L a5, GPOFF(sp) +# endif +#endif + + PTR_ADDU sp, FRAMESZ + + SAVE_PID + + li a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */ + move a1, sp + + /* Do the system call */ + li v0,__NR_clone + syscall + + RESTORE_PID + + bnez a3,L(error) + + /* Successful return from the parent or child. */ + RESTORE_GP64 + ret + + /* Something bad happened -- no child created. */ +L(error): +#ifdef __PIC__ + PTR_LA t9, __syscall_error + RESTORE_GP64 + jr t9 +#else + RESTORE_GP64 + j __syscall_error +#endif + END(__vfork) + +libc_hidden_def(__vfork) +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/mips/xstatconv.c b/ports/sysdeps/unix/sysv/linux/mips/xstatconv.c new file mode 100644 index 0000000000..df4af51fb3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/mips/xstatconv.c @@ -0,0 +1,201 @@ +/* Convert between the kernel's `struct stat' format, and libc's. + Copyright (C) 1991,1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/stat.h> +#include <kernel_stat.h> + +#include <string.h> + +int +__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) +{ + switch (vers) + { + case _STAT_VER_KERNEL: + /* Nothing to do. The struct is in the form the kernel expects. + We should have short-circuted before we got here, but for + completeness... */ + *(struct kernel_stat *) ubuf = *kbuf; + break; + + case _STAT_VER_LINUX: + { + struct stat *buf = ubuf; + + /* Convert to current kernel version of `struct stat'. */ + buf->st_dev = kbuf->st_dev; + memset (&buf->st_pad1, 0, sizeof (buf->st_pad1)); + buf->st_ino = kbuf->st_ino; + /* Check for overflow. */ + if (buf->st_ino != kbuf->st_ino) + { + __set_errno (EOVERFLOW); + return -1; + } + buf->st_mode = kbuf->st_mode; + buf->st_nlink = kbuf->st_nlink; + buf->st_uid = kbuf->st_uid; + buf->st_gid = kbuf->st_gid; + buf->st_rdev = kbuf->st_rdev; + memset (&buf->st_pad2, 0, sizeof (buf->st_pad2)); + buf->st_size = kbuf->st_size; + /* Check for overflow. */ + if (buf->st_size != kbuf->st_size) + { + __set_errno (EOVERFLOW); + return -1; + } + buf->st_pad3 = 0; + buf->st_atim.tv_sec = kbuf->st_atime_sec; + buf->st_atim.tv_nsec = kbuf->st_atime_nsec; + buf->st_mtim.tv_sec = kbuf->st_mtime_sec; + buf->st_mtim.tv_nsec = kbuf->st_mtime_nsec; + buf->st_ctim.tv_sec = kbuf->st_ctime_sec; + buf->st_ctim.tv_nsec = kbuf->st_ctime_nsec; + buf->st_blksize = kbuf->st_blksize; + buf->st_blocks = kbuf->st_blocks; + /* Check for overflow. */ + if (buf->st_blocks != kbuf->st_blocks) + { + __set_errno (EOVERFLOW); + return -1; + } + memset (&buf->st_pad5, 0, sizeof (buf->st_pad5)); + } + break; + + default: + __set_errno (EINVAL); + return -1; + } + + return 0; +} + +int +__xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf) +{ +#ifdef XSTAT_IS_XSTAT64 + return xstat_conv (vers, kbuf, ubuf); +#else + switch (vers) + { + case _STAT_VER_LINUX: + { + struct stat64 *buf = ubuf; + + buf->st_dev = kbuf->st_dev; + memset (&buf->st_pad1, 0, sizeof (buf->st_pad1)); + buf->st_ino = kbuf->st_ino; + buf->st_mode = kbuf->st_mode; + buf->st_nlink = kbuf->st_nlink; + buf->st_uid = kbuf->st_uid; + buf->st_gid = kbuf->st_gid; + buf->st_rdev = kbuf->st_rdev; + memset (&buf->st_pad2, 0, sizeof (buf->st_pad2)); + buf->st_pad3 = 0; + buf->st_size = kbuf->st_size; + buf->st_blksize = kbuf->st_blksize; + buf->st_blocks = kbuf->st_blocks; + + buf->st_atim.tv_sec = kbuf->st_atime_sec; + buf->st_atim.tv_nsec = kbuf->st_atime_nsec; + buf->st_mtim.tv_sec = kbuf->st_mtime_sec; + buf->st_mtim.tv_nsec = kbuf->st_mtime_nsec; + buf->st_ctim.tv_sec = kbuf->st_ctime_sec; + buf->st_ctim.tv_nsec = kbuf->st_ctime_nsec; + + memset (&buf->st_pad4, 0, sizeof (buf->st_pad4)); + } + break; + + /* If struct stat64 is different from struct stat then + _STAT_VER_KERNEL does not make sense. */ + case _STAT_VER_KERNEL: + default: + __set_errno (EINVAL); + return -1; + } + + return 0; +#endif +} + +#if _MIPS_SIM == _ABIO32 +int +__xstat32_conv (int vers, struct stat64 *kbuf, struct stat *buf) +{ + switch (vers) + { + case _STAT_VER_LINUX: + /* Convert current kernel version of `struct stat64' to + `struct stat'. The layout of the fields in the kernel's + stat64 is the same as that in the user stat64; the only + difference is that the latter has more trailing padding. */ + buf->st_dev = kbuf->st_dev; + memset (&buf->st_pad1, 0, sizeof (buf->st_pad1)); + buf->st_ino = kbuf->st_ino; + /* Check for overflow. */ + if (buf->st_ino != kbuf->st_ino) + { + __set_errno (EOVERFLOW); + return -1; + } + buf->st_mode = kbuf->st_mode; + buf->st_nlink = kbuf->st_nlink; + buf->st_uid = kbuf->st_uid; + buf->st_gid = kbuf->st_gid; + buf->st_rdev = kbuf->st_rdev; + memset (&buf->st_pad2, 0, sizeof (buf->st_pad2)); + buf->st_size = kbuf->st_size; + /* Check for overflow. */ + if (buf->st_size != kbuf->st_size) + { + __set_errno (EOVERFLOW); + return -1; + } + buf->st_pad3 = 0; + buf->st_atim.tv_sec = kbuf->st_atim.tv_sec; + buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec; + buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec; + buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec; + buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec; + buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec; + buf->st_blksize = kbuf->st_blksize; + buf->st_blocks = kbuf->st_blocks; + /* Check for overflow. */ + if (buf->st_blocks != kbuf->st_blocks) + { + __set_errno (EOVERFLOW); + return -1; + } + memset (&buf->st_pad5, 0, sizeof (buf->st_pad5)); + break; + + /* If struct stat64 is different from struct stat then + _STAT_VER_KERNEL does not make sense. */ + case _STAT_VER_KERNEL: + default: + __set_errno (EINVAL); + return -1; + } + + return 0; +} +#endif /* _MIPS_SIM == _ABIO32 */ diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/405/Implies b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/405/Implies new file mode 100644 index 0000000000..70c0d2eda3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/405/Implies @@ -0,0 +1,2 @@ +powerpc/powerpc32/405/fpu +powerpc/powerpc32/405 diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/440/Implies b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/440/Implies new file mode 100644 index 0000000000..c3e52c5504 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/440/Implies @@ -0,0 +1,2 @@ +powerpc/powerpc32/440/fpu +powerpc/powerpc32/440 diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/464/Implies b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/464/Implies new file mode 100644 index 0000000000..2829f9ccaf --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/464/Implies @@ -0,0 +1,2 @@ +powerpc/powerpc32/464/fpu +powerpc/powerpc32/464 diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/476/Implies b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/476/Implies new file mode 100644 index 0000000000..80f917079e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/476/Implies @@ -0,0 +1,2 @@ +powerpc/powerpc32/476/fpu +powerpc/powerpc32/476 diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies new file mode 100644 index 0000000000..40836b6fb4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies @@ -0,0 +1,2 @@ +powerpc/nofpu +powerpc/soft-fp diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S new file mode 100644 index 0000000000..f0216fefab --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S @@ -0,0 +1,58 @@ +/* Save current context. + Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <rtld-global-offsets.h> +#include <shlib-compat.h> + +#define __ASSEMBLY__ +#include <asm/ptrace.h> +#include "ucontext_i.h" + +#define __CONTEXT_FUNC_NAME __getcontext +#undef __CONTEXT_ENABLE_FPRS +#undef __CONTEXT_ENABLE_VRS + +#include "getcontext-common.S" + +versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_3_4) + +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4) + +/* For the nofpu case the old/new versions are the same function. */ +strong_alias (__getcontext, __novec_getcontext) + +compat_symbol (libc, __novec_getcontext, getcontext, GLIBC_2_3_3) + +#endif + +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3) + +#define _ERRNO_H 1 +#include <bits/errno.h> + + compat_text_section +ENTRY (__getcontext_stub) + li r3,ENOSYS + b __syscall_error@local +END (__getcontext_stub) + .previous + +compat_symbol (libc, __getcontext_stub, getcontext, GLIBC_2_1) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/ld.abilist new file mode 100644 index 0000000000..d71611f027 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/ld.abilist @@ -0,0 +1,17 @@ +GLIBC_2.0 + GLIBC_2.0 A + __libc_memalign F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F +GLIBC_2.1 + GLIBC_2.1 A + __libc_stack_end D 0x4 + _dl_mcount F +GLIBC_2.3 + GLIBC_2.3 A + __tls_get_addr F +GLIBC_2.4 + GLIBC_2.4 A diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..f4ca37f44b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.0 + GLIBC_2.0 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libanl.abilist new file mode 100644 index 0000000000..c9755d8a33 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.2.3 + GLIBC_2.2.3 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist new file mode 100644 index 0000000000..43015f4e92 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist @@ -0,0 +1,2511 @@ +GCC_3.0 + GCC_3.0 A + _Unwind_Find_FDE F + __deregister_frame_info_bases F + __register_frame_info_bases F + __register_frame_info_table_bases F +GLIBC_2.0 + GLIBC_2.0 A + _IO_adjust_column F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_fsetpos F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sscanf F + _IO_stderr_ D 0x50 + _IO_stdin_ D 0x50 + _IO_stdout_ D 0x50 + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_switch_to_get_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __ashldi3 F + __ashrdi3 F + __assert_fail F + __assert_perror_fail F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __clone F + __close F + __cmpdi2 F + __cmsg_nxthdr F + __connect F + __ctype32_b D 0x4 + __ctype_b D 0x4 + __ctype_get_mb_cur_max F + __ctype_tolower D 0x4 + __ctype_toupper D 0x4 + __curbrk D 0x4 + __daylight D 0x4 + __dcgettext F + __default_morecore F + __deregister_frame F + __deregister_frame_info F + __dgettext F + __divdi3 F + __dup2 F + __environ D 0x4 + __errno_location F + __fcntl F + __ffs F + __finite F + __finitef F + __finitel F + __fixdfdi F + __fixsfdi F + __fixunsdfdi F + __fixunssfdi F + __floatdidf F + __floatdisf F + __fork F + __fpu_control D 0x4 + __frame_state_for F + __free_hook D 0x4 + __fxstat F + __getdelim F + __getpagesize F + __getpgid F + __getpid F + __gettimeofday F + __gmtime_r F + __h_errno_location F + __isinf F + __isinff F + __isinfl F + __isnan F + __isnanf F + __isnanl F + __iswctype F + __ivaliduser F + __libc_calloc F + __libc_free F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_start_main F + __libc_valloc F + __lseek F + __lshrdi3 F + __lxstat F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __memalign_hook D 0x4 + __mempcpy F + __moddi3 F + __monstartup F + __morecore D 0x4 + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __open F + __overflow F + __pipe F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __rcmd_errstr D 0x4 + __read F + __realloc_hook D 0x4 + __register_frame F + __register_frame_info F + __register_frame_info_table F + __register_frame_table F + __res_randomid F + __sbrk F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __send F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __sigpause F + __sigsetjmp F + __stpcpy F + __stpncpy F + __strcasecmp F + __strdup F + __strerror_r F + __strtod_internal F + __strtof_internal F + __strtok_r F + __strtol_internal F + __strtold_internal F + __strtoll_internal F + __strtoq_internal F + __strtoul_internal F + __strtoull_internal F + __strtouq_internal F + __sysv_signal F + __timezone D 0x4 + __tzname D 0x8 + __ucmpdi2 F + __udivdi3 F + __uflow F + __umoddi3 F + __underflow F + __vfscanf F + __vsnprintf F + __vsscanf F + __wait F + __waitpid F + __wcstod_internal F + __wcstof_internal F + __wcstol_internal F + __wcstold_internal F + __wcstoll_internal F + __wcstoul_internal F + __wcstoull_internal F + __write F + __xmknod F + __xpg_basename F + __xstat F + _environ D 0x4 + _exit F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack D 0x4 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x200 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x1ec + _sys_nerr D 0x4 + _sys_siglist D 0x80 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + access F + acct F + addmntent F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atexit F + atof F + atoi F + atol F + atoll F + authnone_create F + authunix_create F + authunix_create_default F + basename F + bcmp F + bcopy F + bdflush F + bind F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + calloc F + callrpc F + canonicalize_file_name F + catclose F + catgets F + catopen F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + delete_module F + dgettext F + difftime F + dirfd F + dirname F + div F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dysize F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endspent F + endttyent F + endusershell F + endutent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + execl F + execle F + execlp F + execv F + execve F + execvp F + exit F + fchdir F + fchflags F + fchmod F + fchown F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdopen F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + fgetc F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpwent F + fgetpwent_r F + fgets F + fgetspent F + fgetspent_r F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flock F + flockfile F + fnmatch F + fopen F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fread F + free F + freeaddrinfo F + freopen F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fsetpos F + fstatfs F + fsync F + ftell F + ftime F + ftok F + ftruncate F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + funlockfile F + fwrite F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcwd F + getdelim F + getdirentries F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getitimer F + getline F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsid F + getsockname F + getsockopt F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getw F + getwd F + glob F + glob_pattern_p F + globfree F + gmtime F + gmtime_r F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + index F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + insque F + ioctl F + iruserok F + isalnum F + isalpha F + isascii F + isatty F + isblank F + iscntrl F + isdigit F + isfdtype F + isgraph F + isinf F + isinff F + isinfl F + islower F + isnan F + isnanf F + isnanl F + isprint F + ispunct F + isspace F + isupper F + iswalnum F + iswalpha F + iswcntrl F + iswctype F + iswdigit F + iswgraph F + iswlower F + iswprint F + iswpunct F + iswspace F + iswupper F + iswxdigit F + isxdigit F + jrand48 F + jrand48_r F + kill F + killpg F + klogctl F + l64a F + labs F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + link F + listen F + llabs F + lldiv F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lsearch F + lseek F + madvise F + mallinfo F + malloc F + malloc_get_state F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + memset F + mkdir F + mkfifo F + mkstemp F + mktemp F + mktime F + mlock F + mlockall F + mmap F + modf F + modff F + modfl F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + nfsservctl F + nice F + nl_langinfo F + nrand48 F + nrand48_r F + ntohl F + ntohs F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open_memstream F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + prctl F + printf F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putpwent F + puts F + putspent F + pututline F + putw F + pvalloc F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + query_module F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rcmd F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_max_failures D 0x4 + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readdir F + readdir_r F + readlink F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + registerrpc F + remove F + remque F + rename F + res_init F + revoke F + rewind F + rewinddir F + rexec F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + ruserok F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + send F + sendmsg F + sendto F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrpcent F + setservent F + setsid F + setsockopt F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setvbuf F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigreturn F + sigsetmask F + sigstack F + sigsuspend F + sigvec F + sigwait F + sleep F + snprintf F + socket F + socketpair F + sprintf F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcat F + strchr F + strcmp F + strcoll F + strcpy F + strcspn F + strdup F + strerror F + strerror_r F + strfmon F + strfry F + strftime F + strlen F + strncasecmp F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtof F + strtok F + strtok_r F + strtol F + strtold F + strtoll F + strtoq F + strtoul F + strtoull F + strtouq F + strxfrm F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreqset F + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + swab F + swapoff F + swapon F + symlink F + sync F + sys_errlist D 0x1ec + sys_nerr D 0x4 + sys_sigabbrev D 0x80 + sys_siglist D 0x80 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + times F + timezone D 0x4 + tmpfile F + tmpnam F + tmpnam_r F + toascii F + tolower F + toupper F + towctrans F + towlower F + towupper F + tr_break F + truncate F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + uname F + ungetc F + unlink F + unsetenv F + updwtmp F + uselib F + usleep F + ustat F + utime F + utimes F + utmpname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + vfork F + vfprintf F + vfscanf F + vhangup F + vlimit F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + wait F + wait3 F + wait4 F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscat F + wcschr F + wcscmp F + wcscoll F + wcscpy F + wcscspn F + wcsdup F + wcslen F + wcsncat F + wcsncmp F + wcsncpy F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstof F + wcstok F + wcstol F + wcstold F + wcstombs F + wcstoq F + wcstoul F + wcstouq F + wcswidth F + wcsxfrm F + wctob F + wctomb F + wctrans F + wctype F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmemset F + write F + writev F + xdr_accepted_reply F + xdr_array F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_int F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_string F + xdr_u_char F + xdr_u_int F + xdr_u_long F + xdr_u_short F + xdr_union F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.1 + GLIBC_2.1 A + _IO_2_1_stderr_ D 0xa0 + _IO_2_1_stdin_ D 0xa0 + _IO_2_1_stdout_ D 0xa0 + _IO_do_write F + _IO_fclose F + _IO_fdopen F + _IO_fgetpos64 F + _IO_file_attach F + _IO_file_close_it F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_overflow F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_fopen F + _IO_fsetpos64 F + _IO_getline_info F + _IO_popen F + _IO_proc_close F + _IO_proc_open F + __asprintf F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __duplocale F + __freelocale F + __fxstat64 F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isdigit_l F + __isgraph_l F + __islower_l F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_freeres F + __libc_sa_len F + __lxstat64 F + __newlocale F + __poll F + __pread64 F + __pwrite64 F + __rawmemchr F + __signbit F + __signbitf F + __strcasecmp_l F + __strcasestr F + __strcoll_l F + __strfmon_l F + __strncasecmp_l F + __strtod_l F + __strtof_l F + __strtol_l F + __strtold_l F + __strtoll_l F + __strtoul_l F + __strtoull_l F + __strxfrm_l F + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __wcscasecmp_l F + __wcscoll_l F + __wcsncasecmp_l F + __wcstod_l F + __wcstof_l F + __wcstol_l F + __wcstold_l F + __wcstoll_l F + __wcstoul_l F + __wcstoull_l F + __wcsxfrm_l F + __wctype_l F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _sys_errlist D 0x1f4 + _sys_nerr D 0x4 + _sys_siglist D 0x100 + addseverity F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + authdes_create F + authdes_getucred F + authdes_pk_create F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + capget F + capset F + cbc_crypt F + chown F + clntunix_create F + creat64 F + des_setparity F + ecb_crypt F + endutxent F + fattach F + fclose F + fdetach F + fdopen F + ffsl F + ffsll F + fgetc_unlocked F + fgetpos64 F + fgets_unlocked F + fmtmsg F + fopen F + fopen64 F + fputs_unlocked F + fread_unlocked F + freopen64 F + fseeko F + fseeko64 F + fsetpos64 F + fstatfs64 F + fstatvfs F + fstatvfs64 F + ftello F + ftello64 F + ftruncate64 F + ftw64 F + fwrite_unlocked F + gai_strerror F + getcontext F + getdate F + getdate_err D 0x4 + getdate_r F + getmsg F + getnameinfo F + getnetname F + getpmsg F + getpt F + getrlimit64 F + getutxent F + getutxid F + getutxline F + glob64 F + globfree64 F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + host2netname F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + isastream F + iswblank F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + lockf64 F + lseek64 F + makecontext F + mempcpy F + mmap64 F + netname2host F + netname2user F + nftw F + nftw64 F + ntp_adjtime F + ntp_gettime F + open64 F + passwd2des F + pclose F + popen F + pread F + pread64 F + printf_size F + printf_size_info F + pthread_attr_init F + ptsname F + ptsname_r F + putgrent F + putmsg F + putpmsg F + pututxline F + pwrite F + pwrite64 F + rawmemchr F + readdir64 F + readdir64_r F + rtime F + scandir64 F + sendfile F + setrlimit64 F + setutxent F + sighold F + sigignore F + sigqueue F + sigrelse F + sigset F + sigtimedwait F + sigwaitinfo F + statfs64 F + statvfs F + statvfs64 F + strcasestr F + strtoimax F + strtoumax F + strverscmp F + svcunix_create F + svcunixfd_create F + swapcontext F + sys_errlist D 0x1f4 + sys_nerr D 0x4 + sys_sigabbrev D 0x100 + sys_siglist D 0x100 + sysv_signal F + tcgetsid F + tdestroy F + tmpfile F + tmpfile64 F + truncate64 F + umount2 F + unlockpt F + updwtmpx F + user2netname F + utmpxname F + versionsort F + versionsort64 F + waitid F + wcscasecmp F + wcsncasecmp F + wcsnlen F + wcstoimax F + wcstoll F + wcstoull F + wcstoumax F + wcswcs F + wordexp F + wordfree F + xdecrypt F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_getcredres F + xdr_int16_t F + xdr_int32_t F + xdr_int8_t F + xdr_netnamestr F + xdr_sizeof F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint8_t F + xdr_unixcred F +GLIBC_2.1.1 + GLIBC_2.1.1 A + _Exit F + __mempcpy_small F + __stpcpy_small F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtok_r_1c F + __strverscmp F + getutmp F + getutmpx F + imaxabs F + imaxdiv F + strchrnul F + xdr_hyper F + xdr_int64_t F + xdr_longlong_t F + xdr_u_hyper F + xdr_u_longlong_t F + xdr_uint64_t F +GLIBC_2.1.2 + GLIBC_2.1.2 A + __vfork F + getaliasbyname_r F + getaliasent_r F + getgrent_r F + getgrgid_r F + getgrnam_r F + gethostbyaddr_r F + gethostbyname2_r F + gethostbyname_r F + gethostent_r F + getnetbyaddr_r F + getnetbyname_r F + getnetent_r F + getprotobyname_r F + getprotobynumber_r F + getprotoent_r F + getpwent_r F + getpwnam_r F + getpwuid_r F + getrpcbyname_r F + getrpcbynumber_r F + getrpcent_r F + getservbyname_r F + getservbyport_r F + getservent_r F + getspent_r F + getspnam_r F +GLIBC_2.1.3 + GLIBC_2.1.3 A + __cxa_atexit F + __cxa_finalize F + __sigsuspend F +GLIBC_2.10 + GLIBC_2.10 A + __cxa_at_quick_exit F + __posix_getopt F + accept4 F + endsgent F + fallocate F + fgetsgent F + fgetsgent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + malloc_info F + preadv F + preadv64 F + psiginfo F + putsgent F + pwritev F + pwritev64 F + quick_exit F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + setsgent F + sgetsgent F + sgetsgent_r F +GLIBC_2.11 + GLIBC_2.11 A + __longjmp_chk F + execvpe F + fallocate64 F + mkostemps F + mkostemps64 F + mkstemps F + mkstemps64 F +GLIBC_2.12 + GLIBC_2.12 A + _sys_errlist D 0x21c + _sys_nerr D 0x4 + ntp_gettimex F + recvmmsg F + sys_errlist D 0x21c + sys_nerr D 0x4 +GLIBC_2.13 + GLIBC_2.13 A + fanotify_init F + fanotify_mark F + prlimit F + prlimit64 F +GLIBC_2.14 + GLIBC_2.14 A + clock_adjtime F + name_to_handle_at F + open_by_handle_at F + sendmmsg F + setns F + syncfs F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + posix_spawn F + posix_spawnp F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __mcount_internal F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F +GLIBC_2.2 + GLIBC_2.2 A + _IO_adjust_wcolumn F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_seekwmark F + _IO_sputbackwc F + _IO_sungetwc F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_unsave_wmarkers F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + __assert F + __ctype32_tolower D 0x4 + __ctype32_toupper D 0x4 + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __endmntent F + __fbufsize F + __flbf F + __fpending F + __fpurge F + __freadable F + __freading F + __fsetlocking F + __fwritable F + __fwriting F + __fxstat64 F + __getmntent_r F + __lxstat64 F + __nl_langinfo_l F + __open64 F + __res_init F + __res_nclose F + __res_ninit F + __res_state F + __setmntent F + __statfs F + __strndup F + __sysconf F + __sysctl F + __wctrans_l F + __woverflow F + __wuflow F + __wunderflow F + __xpg_sigpause F + __xstat64 F + _flushlbf F + _res_hconf D 0x30 + bind_textdomain_codeset F + dcngettext F + dngettext F + fgetpos F + fgetpos64 F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fmemopen F + fopencookie F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fsetpos F + fsetpos64 F + fwide F + fwprintf F + fwscanf F + getdirentries64 F + getloadavg F + getrlimit F + getrlimit64 F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + glob64 F + iruserok_af F + localeconv F + mcheck_check_all F + mcheck_pedantic F + memrchr F + mincore F + mkdtemp F + mkstemp64 F + moncontrol F + msgctl F + ngettext F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + rcmd_af F + readdir64 F + readdir64_r F + rexec_af F + rresvport_af F + ruserok_af F + scandir64 F + semctl F + setrlimit F + shmctl F + svc_getreq_common F + svc_getreq_poll F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + swprintf F + swscanf F + ungetwc F + vfwprintf F + vfwscanf F + vswprintf F + vswscanf F + vwprintf F + vwscanf F + wcschrnul F + wcsftime F + wmempcpy F + wprintf F + wscanf F +GLIBC_2.2.1 + GLIBC_2.2.1 A + pivot_root F + posix_openpt F +GLIBC_2.2.2 + GLIBC_2.2.2 A + __nss_hostname_digits_dots F +GLIBC_2.2.3 + GLIBC_2.2.3 A + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + fnmatch F + sprofil F +GLIBC_2.2.4 + GLIBC_2.2.4 A + dl_iterate_phdr F + getgrouplist F + sockatmark F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3 + GLIBC_2.3 A + __ctype_b_loc F + __ctype_tolower_loc F + __ctype_toupper_loc F + __isctype F + __strftime_l F + __uselocale F + __wcsftime_l F + _sys_errlist D 0x1f8 + _sys_nerr D 0x4 + duplocale F + fgetxattr F + flistxattr F + freeifaddrs F + freelocale F + fremovexattr F + fsetxattr F + futimes F + getifaddrs F + getxattr F + isalnum_l F + isalpha_l F + isblank_l F + iscntrl_l F + isctype F + isdigit_l F + isgraph_l F + islower_l F + isprint_l F + ispunct_l F + isspace_l F + isupper_l F + iswalnum_l F + iswalpha_l F + iswblank_l F + iswcntrl_l F + iswctype_l F + iswdigit_l F + iswgraph_l F + iswlower_l F + iswprint_l F + iswpunct_l F + iswspace_l F + iswupper_l F + iswxdigit_l F + isxdigit_l F + lgetxattr F + listxattr F + llistxattr F + lremovexattr F + lsetxattr F + lutimes F + newlocale F + nl_langinfo_l F + readahead F + realpath F + removexattr F + sendfile64 F + setxattr F + strcasecmp_l F + strcoll_l F + strfmon_l F + strftime_l F + strncasecmp_l F + strtod_l F + strtof_l F + strtol_l F + strtold_l F + strtoll_l F + strtoul_l F + strtoull_l F + strxfrm_l F + sys_errlist D 0x1f8 + sys_nerr D 0x4 + tolower_l F + toupper_l F + towctrans_l F + towlower_l F + towupper_l F + uselocale F + wcscasecmp_l F + wcscoll_l F + wcsftime_l F + wcsncasecmp_l F + wcstod_l F + wcstof_l F + wcstol_l F + wcstold_l F + wcstoll_l F + wcstoul_l F + wcstoull_l F + wcsxfrm_l F + wctrans_l F + wctype_l F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __adddf3 F + __addsf3 F + __divdf3 F + __divsf3 F + __eqdf2 F + __eqsf2 F + __extendsfdf2 F + __fixdfsi F + __fixsfsi F + __fixunsdfsi F + __fixunssfsi F + __floatsidf F + __floatsisf F + __gedf2 F + __gesf2 F + __ledf2 F + __lesf2 F + __muldf3 F + __mulsf3 F + __negdf2 F + __negsf2 F + __register_atfork F + __sim_disabled_exceptions D 0x4 + __sim_exceptions D 0x4 + __sim_round_mode D 0x4 + __sqrtdf2 F + __sqrtsf2 F + __subdf3 F + __subsf3 F + __truncdfsf2 F + epoll_create F + epoll_ctl F + epoll_wait F + lchmod F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + strptime_l F +GLIBC_2.3.3 + GLIBC_2.3.3 A + _sys_siglist D 0x104 + getcontext F + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + makecontext F + nftw F + nftw64 F + posix_fadvise64 F + posix_fallocate64 F + remap_file_pages F + sched_getaffinity F + sched_setaffinity F + semtimedop F + setcontext F + swapcontext F + sys_sigabbrev D 0x104 + sys_siglist D 0x104 +GLIBC_2.3.4 + GLIBC_2.3.4 A + __chk_fail F + __fprintf_chk F + __gets_chk F + __memcpy_chk F + __memmove_chk F + __mempcpy_chk F + __memset_chk F + __printf_chk F + __sigsetjmp F + __snprintf_chk F + __sprintf_chk F + __stpcpy_chk F + __strcat_chk F + __strcpy_chk F + __strncat_chk F + __strncpy_chk F + __vfprintf_chk F + __vprintf_chk F + __vsnprintf_chk F + __vsprintf_chk F + __xpg_strerror_r F + _longjmp F + _setjmp F + getcontext F + getipv4sourcefilter F + getsourcefilter F + longjmp F + makecontext F + regexec F + sched_getaffinity F + sched_setaffinity F + setcontext F + setipv4sourcefilter F + setjmp F + setsourcefilter F + siglongjmp F + swapcontext F + xdr_quad_t F + xdr_u_quad_t F +GLIBC_2.4 + GLIBC_2.4 A + _IO_fprintf F + _IO_printf F + _IO_sprintf F + _IO_sscanf F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + __asprintf F + __confstr_chk F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finitel F + __floatundidf F + __floatundisf F + __floatunsidf F + __floatunsisf F + __fprintf_chk F + __fwprintf_chk F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getwd_chk F + __gtdf2 F + __gtsf2 F + __isinfl F + __isnanl F + __ltdf2 F + __ltsf2 F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __nedf2 F + __nesf2 F + __nldbl__IO_fprintf F + __nldbl__IO_printf F + __nldbl__IO_sprintf F + __nldbl__IO_sscanf F + __nldbl__IO_vfprintf F + __nldbl__IO_vfscanf F + __nldbl__IO_vsprintf F + __nldbl___asprintf F + __nldbl___fprintf_chk F + __nldbl___fwprintf_chk F + __nldbl___printf_chk F + __nldbl___printf_fp F + __nldbl___snprintf_chk F + __nldbl___sprintf_chk F + __nldbl___strfmon_l F + __nldbl___swprintf_chk F + __nldbl___syslog_chk F + __nldbl___vfprintf_chk F + __nldbl___vfscanf F + __nldbl___vfwprintf_chk F + __nldbl___vprintf_chk F + __nldbl___vsnprintf F + __nldbl___vsnprintf_chk F + __nldbl___vsprintf_chk F + __nldbl___vsscanf F + __nldbl___vstrfmon F + __nldbl___vstrfmon_l F + __nldbl___vswprintf_chk F + __nldbl___vsyslog_chk F + __nldbl___vwprintf_chk F + __nldbl___wprintf_chk F + __nldbl_asprintf F + __nldbl_dprintf F + __nldbl_fprintf F + __nldbl_fscanf F + __nldbl_fwprintf F + __nldbl_fwscanf F + __nldbl_obstack_printf F + __nldbl_obstack_vprintf F + __nldbl_printf F + __nldbl_printf_size F + __nldbl_scanf F + __nldbl_snprintf F + __nldbl_sprintf F + __nldbl_sscanf F + __nldbl_strfmon F + __nldbl_strfmon_l F + __nldbl_swprintf F + __nldbl_swscanf F + __nldbl_syslog F + __nldbl_vasprintf F + __nldbl_vdprintf F + __nldbl_vfprintf F + __nldbl_vfscanf F + __nldbl_vfwprintf F + __nldbl_vfwscanf F + __nldbl_vprintf F + __nldbl_vscanf F + __nldbl_vsnprintf F + __nldbl_vsprintf F + __nldbl_vsscanf F + __nldbl_vswprintf F + __nldbl_vswscanf F + __nldbl_vsyslog F + __nldbl_vwprintf F + __nldbl_vwscanf F + __nldbl_wprintf F + __nldbl_wscanf F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __ptsname_r_chk F + __read_chk F + __readlink_chk F + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __signbitl F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __stpncpy_chk F + __strfmon_l F + __strtold_internal F + __strtold_l F + __swprintf_chk F + __syslog_chk F + __ttyname_r_chk F + __unorddf2 F + __unordsf2 F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscat_chk F + __wcscpy_chk F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstold_internal F + __wcstold_l F + __wcstombs_chk F + __wctomb_chk F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __wprintf_chk F + __xmknodat F + _sys_errlist D 0x210 + _sys_nerr D 0x4 + asprintf F + copysignl F + dprintf F + eaccess F + faccessat F + fchmodat F + fchownat F + fdopendir F + finitel F + fprintf F + frexpl F + fscanf F + futimesat F + fwprintf F + fwscanf F + inotify_add_watch F + inotify_init F + inotify_rm_watch F + isinfl F + isnanl F + ldexpl F + linkat F + mkdirat F + mkfifoat F + modfl F + obstack_printf F + obstack_vprintf F + open_wmemstream F + openat F + openat64 F + ppoll F + printf F + printf_size F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + readlinkat F + renameat F + scalbnl F + scanf F + snprintf F + sprintf F + sscanf F + strfmon F + strfmon_l F + strtold F + strtold_l F + swprintf F + swscanf F + symlinkat F + sys_errlist D 0x210 + sys_nerr D 0x4 + syslog F + unlinkat F + unshare F + vasprintf F + vdprintf F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vwprintf F + vwscanf F + wcstold F + wcstold_l F + wprintf F + wscanf F +GLIBC_2.5 + GLIBC_2.5 A + __readlinkat_chk F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + splice F + tee F + vmsplice F +GLIBC_2.6 + GLIBC_2.6 A + __sched_cpucount F + epoll_pwait F + futimens F + sched_getcpu F + strerror_l F + sync_file_range F + utimensat F +GLIBC_2.7 + GLIBC_2.7 A + __fread_chk F + __fread_unlocked_chk F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __nldbl___isoc99_fscanf F + __nldbl___isoc99_fwscanf F + __nldbl___isoc99_scanf F + __nldbl___isoc99_sscanf F + __nldbl___isoc99_swscanf F + __nldbl___isoc99_vfscanf F + __nldbl___isoc99_vfwscanf F + __nldbl___isoc99_vscanf F + __nldbl___isoc99_vsscanf F + __nldbl___isoc99_vswscanf F + __nldbl___isoc99_vwscanf F + __nldbl___isoc99_wscanf F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __sched_cpualloc F + __sched_cpufree F + eventfd F + eventfd_read F + eventfd_write F + mkostemp F + mkostemp64 F + signalfd F +GLIBC_2.8 + GLIBC_2.8 A + __asprintf_chk F + __dprintf_chk F + __nldbl___asprintf_chk F + __nldbl___dprintf_chk F + __nldbl___obstack_printf_chk F + __nldbl___obstack_vprintf_chk F + __nldbl___vasprintf_chk F + __nldbl___vdprintf_chk F + __obstack_printf_chk F + __obstack_vprintf_chk F + __vasprintf_chk F + __vdprintf_chk F + qsort_r F + timerfd_create F + timerfd_gettime F + timerfd_settime F +GLIBC_2.9 + GLIBC_2.9 A + dup3 F + epoll_create1 F + inotify_init1 F + pipe2 F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libcrypt.abilist new file mode 100644 index 0000000000..1df145f260 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.0 + GLIBC_2.0 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libdl.abilist new file mode 100644 index 0000000000..62e6b41edb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libdl.abilist @@ -0,0 +1,18 @@ +GLIBC_2.0 + GLIBC_2.0 A + dladdr F + dlclose F + dlerror F + dlopen F + dlsym F +GLIBC_2.1 + GLIBC_2.1 A + dlopen F + dlvsym F +GLIBC_2.3.3 + GLIBC_2.3.3 A + dladdr1 F + dlinfo F +GLIBC_2.3.4 + GLIBC_2.3.4 A + dlmopen F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libm.abilist new file mode 100644 index 0000000000..ddc8576866 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libm.abilist @@ -0,0 +1,514 @@ +GLIBC_2.0 + GLIBC_2.0 A + _LIB_VERSION D 0x4 + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cbrt F + cbrtf F + cbrtl F + ceil F + ceilf F + ceill F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + logb F + logbf F + logbl F + logf F + logl F + matherr F + modf F + modff F + modfl F + nextafter F + nextafterf F + nextafterl F + pow F + powf F + powl F + remainder F + remainderf F + remainderl F + rint F + rintf F + rintl F + scalb F + scalbf F + scalbl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.1 + GLIBC_2.1 A + __clog10 F + __clog10f F + __clog10l F + __fe_dfl_env D 0x8 + __fe_enabled_env D 0x8 + __fe_nonieee_env D 0x8 + __finite F + __finitef F + __finitel F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + fdim F + fdimf F + fdiml F + feclearexcept F + fegetenv F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log2 F + log2f F + log2l F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nexttoward F + nexttowardf F + nexttowardl F + pow10 F + pow10f F + pow10l F + remquo F + remquof F + remquol F + round F + roundf F + roundl F + scalbln F + scalblnf F + scalblnl F + sincos F + sincosf F + sincosl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __acoshl_finite F + __acosl_finite F + __asin_finite F + __asinf_finite F + __asinl_finite F + __atan2_finite F + __atan2f_finite F + __atan2l_finite F + __atanh_finite F + __atanhf_finite F + __atanhl_finite F + __cosh_finite F + __coshf_finite F + __coshl_finite F + __exp10_finite F + __exp10f_finite F + __exp10l_finite F + __exp2_finite F + __exp2f_finite F + __exp2l_finite F + __exp_finite F + __expf_finite F + __expl_finite F + __fmod_finite F + __fmodf_finite F + __fmodl_finite F + __gamma_r_finite F + __gammaf_r_finite F + __gammal_r_finite F + __hypot_finite F + __hypotf_finite F + __hypotl_finite F + __j0_finite F + __j0f_finite F + __j0l_finite F + __j1_finite F + __j1f_finite F + __j1l_finite F + __jn_finite F + __jnf_finite F + __jnl_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __lgammal_r_finite F + __log10_finite F + __log10f_finite F + __log10l_finite F + __log2_finite F + __log2f_finite F + __log2l_finite F + __log_finite F + __logf_finite F + __logl_finite F + __pow_finite F + __powf_finite F + __powl_finite F + __remainder_finite F + __remainderf_finite F + __remainderl_finite F + __scalb_finite F + __scalbf_finite F + __scalbl_finite F + __sinh_finite F + __sinhf_finite F + __sinhl_finite F + __sqrt_finite F + __sqrtf_finite F + __sqrtl_finite F + __y0_finite F + __y0f_finite F + __y0l_finite F + __y1_finite F + __y1f_finite F + __y1l_finite F + __yn_finite F + __ynf_finite F + __ynl_finite F +GLIBC_2.2 + GLIBC_2.2 A + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + feraiseexcept F + fesetenv F + fesetexceptflag F + feupdateenv F +GLIBC_2.4 + GLIBC_2.4 A + __clog10l F + __finitel F + __fpclassifyl F + __nldbl_nexttowardf F + __signbitl F + acoshl F + acosl F + asinhl F + asinl F + atan2l F + atanhl F + atanl F + cabsl F + cacoshl F + cacosl F + cargl F + casinhl F + casinl F + catanhl F + catanl F + cbrtl F + ccoshl F + ccosl F + ceill F + cexpl F + cimagl F + clog10l F + clogl F + conjl F + copysignl F + coshl F + cosl F + cpowl F + cprojl F + creall F + csinhl F + csinl F + csqrtl F + ctanhl F + ctanl F + dreml F + erfcl F + erfl F + exp10l F + exp2l F + expl F + expm1l F + fabsl F + fdiml F + finitel F + floorl F + fmal F + fmaxl F + fminl F + fmodl F + frexpl F + gammal F + hypotl F + ilogbl F + j0l F + j1l F + jnl F + ldexpl F + lgammal F + lgammal_r F + llrintl F + llroundl F + log10l F + log1pl F + log2l F + logbl F + logl F + lrintl F + lroundl F + modfl F + nanl F + nearbyintl F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow10l F + powl F + remainderl F + remquol F + rintl F + roundl F + scalbl F + scalblnl F + scalbnl F + significandl F + sincosl F + sinhl F + sinl F + sqrtl F + tanhl F + tanl F + tgammal F + truncl F + y0l F + y1l F + ynl F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libnsl.abilist new file mode 100644 index 0000000000..4241e2d887 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libnsl.abilist @@ -0,0 +1,127 @@ +GLIBC_2.0 + GLIBC_2.0 A + __yp_check F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F +GLIBC_2.1 + GLIBC_2.1 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_obj_p F +GLIBC_2.2 + GLIBC_2.2 A + xdr_ypall F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist new file mode 100644 index 0000000000..77190991dd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist @@ -0,0 +1,273 @@ +GLIBC_2.0 + GLIBC_2.0 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __lseek F + __open F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_setspecific F + __read F + __send F + __sigaction F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + msync F + nanosleep F + open F + pause F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_once F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + pthread_setspecific F + pthread_sigmask F + pthread_testcancel F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F +GLIBC_2.1 + GLIBC_2.1 A + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + pthread_attr_getguardsize F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setguardsize F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_create F + pthread_getconcurrency F + pthread_mutexattr_gettype F + pthread_mutexattr_settype F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_setconcurrency F + sem_destroy F + sem_getvalue F + sem_init F + sem_post F + sem_trywait F + sem_wait F +GLIBC_2.1.1 + GLIBC_2.1.1 A + sem_close F + sem_open F + sem_unlink F +GLIBC_2.1.2 + GLIBC_2.1.2 A + __vfork F +GLIBC_2.11 + GLIBC_2.11 A + pthread_sigqueue F +GLIBC_2.12 + GLIBC_2.12 A + pthread_getname_np F + pthread_mutex_consistent F + pthread_mutexattr_getrobust F + pthread_mutexattr_setrobust F + pthread_setname_np F +GLIBC_2.2 + GLIBC_2.2 A + __open64 F + __pread64 F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pwrite64 F + __res_state F + lseek64 F + open64 F + pread F + pread64 F + pthread_attr_getstack F + pthread_attr_setstack F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_condattr_getpshared F + pthread_condattr_setpshared F + pthread_getcpuclockid F + pthread_mutex_timedlock F + pthread_mutexattr_getpshared F + pthread_mutexattr_setpshared F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_yield F + pwrite F + pwrite64 F + sem_timedwait F +GLIBC_2.2.3 + GLIBC_2.2.3 A + pthread_getattr_np F +GLIBC_2.2.6 + GLIBC_2.2.6 A + __nanosleep F +GLIBC_2.3.2 + GLIBC_2.3.2 A + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F +GLIBC_2.3.3 + GLIBC_2.3.3 A + __pthread_cleanup_routine F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_barrierattr_getpshared F + pthread_condattr_getclock F + pthread_condattr_setclock F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_timedjoin_np F + pthread_tryjoin_np F +GLIBC_2.3.4 + GLIBC_2.3.4 A + longjmp F + pthread_attr_getaffinity_np F + pthread_attr_setaffinity_np F + pthread_getaffinity_np F + pthread_setaffinity_np F + pthread_setschedprio F + siglongjmp F +GLIBC_2.4 + GLIBC_2.4 A + pthread_mutex_consistent_np F + pthread_mutex_getprioceiling F + pthread_mutex_setprioceiling F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setrobust_np F +GLIBC_2.6 + GLIBC_2.6 A + pthread_attr_setstack F + pthread_attr_setstacksize F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libresolv.abilist new file mode 100644 index 0000000000..f68333d4a4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libresolv.abilist @@ -0,0 +1,104 @@ +GLIBC_2.0 + GLIBC_2.0 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_isourserver F + __res_mailok F + __res_nameinquery F + __res_ownok F + __res_queriesmatch F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + dn_expand F + inet_net_ntop F + inet_net_pton F + inet_neta F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_mkquery F + res_query F + res_querydomain F + res_search F + res_send_setqhook F + res_send_setrhook F +GLIBC_2.2 + GLIBC_2.2 A + __dn_expand F + __res_hostalias F + __res_mkquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_query F + __res_querydomain F + __res_search F +GLIBC_2.3.2 + GLIBC_2.3.2 A + __p_rcode F +GLIBC_2.9 + GLIBC_2.9 A + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/librt.abilist new file mode 100644 index 0000000000..af7df27cb3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/librt.abilist @@ -0,0 +1,52 @@ +GLIBC_2.1 + GLIBC_2.1 A + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + lio_listio F + lio_listio64 F +GLIBC_2.2 + GLIBC_2.2 A + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F +GLIBC_2.3.4 + GLIBC_2.3.4 A + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F +GLIBC_2.4 + GLIBC_2.4 A + lio_listio F + lio_listio64 F +GLIBC_2.7 + GLIBC_2.7 A + __mq_open_2 F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libthread_db.abilist new file mode 100644 index 0000000000..f33138067c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libthread_db.abilist @@ -0,0 +1,48 @@ +GLIBC_2.1.3 + GLIBC_2.1.3 A + td_init F + td_log F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tsd F + td_thr_validate F +GLIBC_2.2.3 + GLIBC_2.2.3 A + td_symbol_list F +GLIBC_2.3 + GLIBC_2.3 A + td_thr_tls_get_addr F +GLIBC_2.3.3 + GLIBC_2.3.3 A + td_thr_tlsbase F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libutil.abilist new file mode 100644 index 0000000000..7422687e3c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.0 + GLIBC_2.0 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S new file mode 100644 index 0000000000..216d7ffb0e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S @@ -0,0 +1,58 @@ +/* Jump to a new context. + Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <rtld-global-offsets.h> +#include <shlib-compat.h> + +#define __ASSEMBLY__ +#include <asm/ptrace.h> +#include "ucontext_i.h" + +#define __CONTEXT_FUNC_NAME __setcontext +#undef __CONTEXT_ENABLE_FPRS +#undef __CONTEXT_ENABLE_VRS + +#include "setcontext-common.S" + +versioned_symbol (libc, __setcontext, setcontext, GLIBC_2_3_4) + +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4) + +/* For the nofpu case the old/new versions are the same function. */ +strong_alias (__setcontext, __novec_setcontext) + +compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3_3) + +#endif + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_3) + +#define _ERRNO_H 1 +#include <bits/errno.h> + + compat_text_section +ENTRY (__setcontext_stub) + li r3,ENOSYS + b __syscall_error@local +END (__setcontext_stub) + .previous + +compat_symbol (libc, __setcontext_stub, setcontext, GLIBC_2_0) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S new file mode 100644 index 0000000000..6c45c526dc --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S @@ -0,0 +1,58 @@ +/* Save current context and jump to a new context. + Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <rtld-global-offsets.h> +#include <shlib-compat.h> + +#define __ASSEMBLY__ +#include <asm/ptrace.h> +#include "ucontext_i.h" + +#define __CONTEXT_FUNC_NAME __swapcontext +#undef __CONTEXT_ENABLE_FPRS +#undef __CONTEXT_ENABLE_VRS + +# include "swapcontext-common.S" + +versioned_symbol (libc, __swapcontext, swapcontext, GLIBC_2_3_4) + +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4) + +/* For the nofpu case the old/new versions are the same function. */ +strong_alias (__swapcontext, __novec_swapcontext) + +compat_symbol (libc, __novec_swapcontext, swapcontext, GLIBC_2_3_3) + +#endif + +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3) + +#define _ERRNO_H 1 +#include <bits/errno.h> + + compat_text_section +ENTRY (__swapcontext_stub) + li r3,ENOSYS + b __syscall_error@local +END (__swapcontext_stub) + .previous + +compat_symbol (libc, __swapcontext_stub, swapcontext, GLIBC_2_1) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/Makefile b/ports/sysdeps/unix/sysv/linux/tile/Makefile new file mode 100644 index 0000000000..0cbfdd0e39 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/Makefile @@ -0,0 +1,15 @@ +ifeq ($(subdir),misc) + +# <sys/reg.h> provides something like x86 compatibility. +# New code should probably use <arch/abi.h> instead. +sysdep_headers += sys/reg.h + +# MIPS-style cacheflush routine +sysdep_headers += sys/cachectl.h +sysdep_routines += cacheflush + +# Control dataplane properties of current thread. +sysdep_headers += sys/dataplane.h +sysdep_routines += set_dataplane + +endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/Versions b/ports/sysdeps/unix/sysv/linux/tile/Versions new file mode 100644 index 0000000000..1df7518c78 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/Versions @@ -0,0 +1,11 @@ +libc { + GLIBC_2.12 { + _flush_cache; + cacheflush; + fallocate64; + set_dataplane; + } + GLIBC_PRIVATE { + __syscall_error; + } +} diff --git a/ports/sysdeps/unix/sysv/linux/tile/bits/environments.h b/ports/sysdeps/unix/sysv/linux/tile/bits/environments.h new file mode 100644 index 0000000000..d984d52bd0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/bits/environments.h @@ -0,0 +1,100 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _UNISTD_H +# error "Never include this file directly. Use <unistd.h> instead" +#endif + +#include <bits/wordsize.h> + +/* This header should define the following symbols under the described + situations. A value `1' means that the model is always supported, + `-1' means it is never supported. Undefined means it cannot be + statically decided. + + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type + + The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, + _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, + _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were + used in previous versions of the Unix standard and are available + only for compatibility. +*/ + +#if __WORDSIZE == 64 + +/* Environments with 32-bit wide pointers are optionally provided. + Therefore following macros aren't defined: + # undef _POSIX_V7_ILP32_OFF32 + # undef _POSIX_V7_ILP32_OFFBIG + # undef _POSIX_V6_ILP32_OFF32 + # undef _POSIX_V6_ILP32_OFFBIG + # undef _XBS5_ILP32_OFF32 + # undef _XBS5_ILP32_OFFBIG + and users need to check at runtime. */ + +/* We also have no use (for now) for an environment with bigger pointers + and offsets. */ +# define _POSIX_V7_LPBIG_OFFBIG -1 +# define _POSIX_V6_LPBIG_OFFBIG -1 +# define _XBS5_LPBIG_OFFBIG -1 + +/* By default we have 64-bit wide `long int', pointers and `off_t'. */ +# define _POSIX_V7_LP64_OFF64 1 +# define _POSIX_V6_LP64_OFF64 1 +# define _XBS5_LP64_OFF64 1 + +#else /* __WORDSIZE == 32 */ + +/* By default we have 32-bit wide `int', `long int', pointers and `off_t' + and all platforms support LFS. */ +# define _POSIX_V7_ILP32_OFF32 1 +# define _POSIX_V7_ILP32_OFFBIG 1 +# define _POSIX_V6_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFFBIG 1 +# define _XBS5_ILP32_OFF32 1 +# define _XBS5_ILP32_OFFBIG 1 + +/* We optionally provide an environment with the above size but an 64-bit + side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ + +/* Environments with 64-bit wide pointers can be provided, + so these macros aren't defined: + # undef _POSIX_V7_LP64_OFF64 + # undef _POSIX_V7_LPBIG_OFFBIG + # undef _POSIX_V6_LP64_OFF64 + # undef _POSIX_V6_LPBIG_OFFBIG + # undef _XBS5_LP64_OFF64 + # undef _XBS5_LPBIG_OFFBIG + and sysconf tests for it at runtime. */ + +#endif /* __WORDSIZE == 32 */ + +#ifdef __tilegx__ +/* Only TILE-Gx has the ability to choose 32- or 64-bit. */ +#define __ILP32_OFF32_CFLAGS "-m32" +#define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +#define __ILP32_OFF32_LDFLAGS "-m32" +#define __ILP32_OFFBIG_LDFLAGS "-m32" +#define __LP64_OFF64_CFLAGS "-m64" +#define __LP64_OFF64_LDFLAGS "-m64" +#endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/bits/local_lim.h b/ports/sysdeps/unix/sysv/linux/tile/bits/local_lim.h new file mode 100644 index 0000000000..35c1275f0c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/bits/local_lim.h @@ -0,0 +1,100 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* The kernel header pollutes the namespace with the NR_OPEN symbol + and defines LINK_MAX although filesystems have different maxima. A + similar thing is true for OPEN_MAX: the limit can be changed at + runtime and therefore the macro must not be defined. Remove this + after including the header if necessary. */ +#ifndef NR_OPEN +# define __undef_NR_OPEN +#endif +#ifndef LINK_MAX +# define __undef_LINK_MAX +#endif +#ifndef OPEN_MAX +# define __undef_OPEN_MAX +#endif +#ifndef ARG_MAX +# define __undef_ARG_MAX +#endif + +/* The kernel sources contain a file with all the needed information. */ +#include <linux/limits.h> + +/* Have to remove NR_OPEN? */ +#ifdef __undef_NR_OPEN +# undef NR_OPEN +# undef __undef_NR_OPEN +#endif +/* Have to remove LINK_MAX? */ +#ifdef __undef_LINK_MAX +# undef LINK_MAX +# undef __undef_LINK_MAX +#endif +/* Have to remove OPEN_MAX? */ +#ifdef __undef_OPEN_MAX +# undef OPEN_MAX +# undef __undef_OPEN_MAX +#endif +/* Have to remove ARG_MAX? */ +#ifdef __undef_ARG_MAX +# undef ARG_MAX +# undef __undef_ARG_MAX +#endif + +/* The number of data keys per process. */ +#define _POSIX_THREAD_KEYS_MAX 128 +/* This is the value this implementation supports. */ +#define PTHREAD_KEYS_MAX 1024 + +/* Controlling the iterations of destructors for thread-specific data. */ +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +/* Number of iterations this implementation does. */ +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS + +/* The number of threads per process. */ +#define _POSIX_THREAD_THREADS_MAX 64 +/* We have no predefined limit on the number of threads. */ +#undef PTHREAD_THREADS_MAX + +/* Maximum amount by which a process can descrease its asynchronous I/O + priority level. */ +#define AIO_PRIO_DELTA_MAX 20 + +/* Minimum size for a thread. At least two pages for systems with 64k + pages. */ +#define PTHREAD_STACK_MIN 131072 + +/* Maximum number of timer expiration overruns. */ +#define DELAYTIMER_MAX 2147483647 + +/* Maximum tty name length. */ +#define TTY_NAME_MAX 32 + +/* Maximum login name length. This is arbitrary. */ +#define LOGIN_NAME_MAX 256 + +/* Maximum host name length. */ +#define HOST_NAME_MAX 64 + +/* Maximum message queue priority level. */ +#define MQ_PRIO_MAX 32768 + +/* Maximum value the semaphore can have. */ +#define SEM_VALUE_MAX (2147483647) diff --git a/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h b/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h new file mode 100644 index 0000000000..8287823d0a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h @@ -0,0 +1,112 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +#ifdef __USE_MISC +/* These are Linux-specific. */ +# define MAP_NONBLOCK 0x00080 /* Do not block on IO. */ +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_STACK MAP_GROWSDOWN /* Provide convenience alias. */ +# define MAP_LOCKED 0x00200 /* Lock the mapping. */ +# define MAP_NORESERVE 0x00400 /* Don't check for reservations. */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_POPULATE 0x00040 /* Populate (prefault) pagetables. */ +# define MAP_HUGETLB 0x04000 /* Create huge page mapping. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 4 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +#endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +# define MADV_REMOVE 9 /* Remove these pages and resources. */ +# define MADV_DONTFORK 10 /* Do not inherit across fork. */ +# define MADV_DOFORK 11 /* Do inherit across fork. */ +# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ +# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ +# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, + overrides the coredump filter bits. */ +# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ +# define MADV_HWPOISON 100 /* Poison a page for testing. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/bits/sigaction.h b/ports/sysdeps/unix/sysv/linux/tile/bits/sigaction.h new file mode 100644 index 0000000000..45e118d18d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/bits/sigaction.h @@ -0,0 +1,77 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include <bits/sigaction.h> directly; use <signal.h> instead." +#endif + +/* Structure describing the action to be taken when a signal arrives. */ +struct sigaction + { + /* Signal handler. */ +#ifdef __USE_POSIX199309 + union + { + /* Used if SA_SIGINFO is not set. */ + __sighandler_t sa_handler; + /* Used if SA_SIGINFO is set. */ + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction +#else + __sighandler_t sa_handler; +#endif + + /* Additional set of signals to be blocked. */ + __sigset_t sa_mask; + + /* Special flags. */ + int sa_flags; + + /* Restore handler. */ + void (*sa_restorer) (void); + }; + +/* Bits in `sa_flags'. */ +#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */ +#define SA_SIGINFO 4 /* Invoke signal-catching function with + three arguments instead of one. */ +#if defined __USE_UNIX98 || defined __USE_MISC +# define SA_NOPTRACE 0x02000000 /* Don't ptrace this signal. */ +# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ +# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when + its handler is being executed. */ +# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ +#endif +#ifdef __USE_MISC +# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ + +/* Some aliases for the SA_ constants. */ +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND +# define SA_STACK SA_ONSTACK +#endif + +/* Values for the HOW argument to `sigprocmask'. */ +#define SIG_BLOCK 0 /* Block signals. */ +#define SIG_UNBLOCK 1 /* Unblock signals. */ +#define SIG_SETMASK 2 /* Set the set of blocked signals. */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/bits/siginfo.h b/ports/sysdeps/unix/sysv/linux/tile/bits/siginfo.h new file mode 100644 index 0000000000..44ffcc04d1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/bits/siginfo.h @@ -0,0 +1,324 @@ +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _SIGNAL_H && !defined __need_siginfo_t \ + && !defined __need_sigevent_t +# error "Never include this file directly. Use <signal.h> instead" +#endif + +#include <bits/wordsize.h> + +#if (!defined __have_sigval_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t \ + || defined __need_sigevent_t)) +# define __have_sigval_t 1 + +/* Type for data associated with a signal. */ +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; +#endif + +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 + +# define __SI_MAX_SIZE 128 +# if __WORDSIZE == 64 +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) +# else +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) +# endif + +typedef struct + { + int si_signo; /* Signal number. */ + int si_errno; /* If non-zero, an errno value associated with + this signal, as defined in <errno.h>. */ + int si_code; /* Signal code. */ + + union + { + int _pad[__SI_PAD_SIZE]; + + /* kill(). */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + } _kill; + + /* POSIX.1b timers. */ + struct + { + int si_tid; /* Timer ID. */ + int si_overrun; /* Overrun count. */ + sigval_t si_sigval; /* Signal value. */ + } _timer; + + /* POSIX.1b signals. */ + struct + { + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + sigval_t si_sigval; /* Signal value. */ + } _rt; + + /* SIGCHLD. */ + struct + { + __pid_t si_pid; /* Which child. */ + __uid_t si_uid; /* Real user ID of sending process. */ + int si_status; /* Exit value or signal. */ + __clock_t si_utime; + __clock_t si_stime; + } _sigchld; + + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ + struct + { + void *si_addr; /* Faulting insn/memory ref. */ + int si_trapno; /* TRAP # which caused the signal */ + } _sigfault; + + /* SIGPOLL. */ + struct + { + long int si_band; /* Band event for SIGPOLL. */ + int si_fd; + } _sigpoll; + } _sifields; + } siginfo_t; + + +/* X/Open requires some more fields with fixed names. */ +# define si_pid _sifields._kill.si_pid +# define si_uid _sifields._kill.si_uid +# define si_timerid _sifields._timer.si_tid +# define si_overrun _sifields._timer.si_overrun +# define si_status _sifields._sigchld.si_status +# define si_utime _sifields._sigchld.si_utime +# define si_stime _sifields._sigchld.si_stime +# define si_value _sifields._rt.si_sigval +# define si_int _sifields._rt.si_sigval.sival_int +# define si_ptr _sifields._rt.si_sigval.sival_ptr +# define si_addr _sifields._sigfault.si_addr +# define si_trapno _sifields._sigfault.si_trapno +# define si_band _sifields._sigpoll.si_band +# define si_fd _sifields._sigpoll.si_fd + + +/* Values for `si_code'. Positive values are reserved for kernel-generated + signals. */ +enum +{ + SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ +# define SI_ASYNCNL SI_ASYNCNL + SI_TKILL = -6, /* Sent by tkill. */ +# define SI_TKILL SI_TKILL + SI_SIGIO, /* Sent by queued SIGIO. */ +# define SI_SIGIO SI_SIGIO + SI_ASYNCIO, /* Sent by AIO completion. */ +# define SI_ASYNCIO SI_ASYNCIO + SI_MESGQ, /* Sent by real time mesq state change. */ +# define SI_MESGQ SI_MESGQ + SI_TIMER, /* Sent by timer expiration. */ +# define SI_TIMER SI_TIMER + SI_QUEUE, /* Sent by sigqueue. */ +# define SI_QUEUE SI_QUEUE + SI_USER, /* Sent by kill, sigsend, raise. */ +# define SI_USER SI_USER + SI_KERNEL = 0x80 /* Send by kernel. */ +#define SI_KERNEL SI_KERNEL +}; + + +/* `si_code' values for SIGILL signal. */ +enum +{ + ILL_ILLOPC = 1, /* Illegal opcode. */ +# define ILL_ILLOPC ILL_ILLOPC + ILL_ILLOPN, /* Illegal operand. */ +# define ILL_ILLOPN ILL_ILLOPN + ILL_ILLADR, /* Illegal addressing mode. */ +# define ILL_ILLADR ILL_ILLADR + ILL_ILLTRP, /* Illegal trap. */ +# define ILL_ILLTRP ILL_ILLTRP + ILL_PRVOPC, /* Privileged opcode. */ +# define ILL_PRVOPC ILL_PRVOPC + ILL_PRVREG, /* Privileged register. */ +# define ILL_PRVREG ILL_PRVREG + ILL_COPROC, /* Coprocessor error. */ +# define ILL_COPROC ILL_COPROC + ILL_BADSTK, /* Internal stack error. */ +# define ILL_BADSTK ILL_BADSTK + ILL_DBLFLT, /* Double fault. */ +# define ILL_DBLFLT ILL_DBLFLT + ILL_HARDWALL /* User networks hardwall violation. */ +# define ILL_HARDWALL ILL_HARDWALL +}; + +/* `si_code' values for SIGFPE signal. */ +enum +{ + FPE_INTDIV = 1, /* Integer divide by zero. */ +# define FPE_INTDIV FPE_INTDIV + FPE_INTOVF, /* Integer overflow. */ +# define FPE_INTOVF FPE_INTOVF + FPE_FLTDIV, /* Floating point divide by zero. */ +# define FPE_FLTDIV FPE_FLTDIV + FPE_FLTOVF, /* Floating point overflow. */ +# define FPE_FLTOVF FPE_FLTOVF + FPE_FLTUND, /* Floating point underflow. */ +# define FPE_FLTUND FPE_FLTUND + FPE_FLTRES, /* Floating point inexact result. */ +# define FPE_FLTRES FPE_FLTRES + FPE_FLTINV, /* Floating point invalid operation. */ +# define FPE_FLTINV FPE_FLTINV + FPE_FLTSUB /* Subscript out of range. */ +# define FPE_FLTSUB FPE_FLTSUB +}; + +/* `si_code' values for SIGSEGV signal. */ +enum +{ + SEGV_MAPERR = 1, /* Address not mapped to object. */ +# define SEGV_MAPERR SEGV_MAPERR + SEGV_ACCERR /* Invalid permissions for mapped object. */ +# define SEGV_ACCERR SEGV_ACCERR +}; + +/* `si_code' values for SIGBUS signal. */ +enum +{ + BUS_ADRALN = 1, /* Invalid address alignment. */ +# define BUS_ADRALN BUS_ADRALN + BUS_ADRERR, /* Non-existant physical address. */ +# define BUS_ADRERR BUS_ADRERR + BUS_OBJERR /* Object specific hardware error. */ +# define BUS_OBJERR BUS_OBJERR +}; + +/* `si_code' values for SIGTRAP signal. */ +enum +{ + TRAP_BRKPT = 1, /* Process breakpoint. */ +# define TRAP_BRKPT TRAP_BRKPT + TRAP_TRACE /* Process trace trap. */ +# define TRAP_TRACE TRAP_TRACE +}; + +/* `si_code' values for SIGCHLD signal. */ +enum +{ + CLD_EXITED = 1, /* Child has exited. */ +# define CLD_EXITED CLD_EXITED + CLD_KILLED, /* Child was killed. */ +# define CLD_KILLED CLD_KILLED + CLD_DUMPED, /* Child terminated abnormally. */ +# define CLD_DUMPED CLD_DUMPED + CLD_TRAPPED, /* Traced child has trapped. */ +# define CLD_TRAPPED CLD_TRAPPED + CLD_STOPPED, /* Child has stopped. */ +# define CLD_STOPPED CLD_STOPPED + CLD_CONTINUED /* Stopped child has continued. */ +# define CLD_CONTINUED CLD_CONTINUED +}; + +/* `si_code' values for SIGPOLL signal. */ +enum +{ + POLL_IN = 1, /* Data input available. */ +# define POLL_IN POLL_IN + POLL_OUT, /* Output buffers available. */ +# define POLL_OUT POLL_OUT + POLL_MSG, /* Input message available. */ +# define POLL_MSG POLL_MSG + POLL_ERR, /* I/O error. */ +# define POLL_ERR POLL_ERR + POLL_PRI, /* High priority input available. */ +# define POLL_PRI POLL_PRI + POLL_HUP /* Device disconnected. */ +# define POLL_HUP POLL_HUP +}; + +# undef __need_siginfo_t +#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ + + +#if (defined _SIGNAL_H || defined __need_sigevent_t) \ + && !defined __have_sigevent_t +# define __have_sigevent_t 1 + +/* Structure to transport application-defined values with signals. */ +# define __SIGEV_MAX_SIZE 64 +# if __WORDSIZE == 64 +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) +# else +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) +# endif + +/* Forward declaration. */ +# ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +# endif + +typedef struct sigevent + { + sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + + union + { + int _pad[__SIGEV_PAD_SIZE]; + + /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the + thread to receive the signal. */ + __pid_t _tid; + + struct + { + void (*_function) (sigval_t); /* Function to start. */ + pthread_attr_t *_attribute; /* Thread attributes. */ + } _sigev_thread; + } _sigev_un; + } sigevent_t; + +/* POSIX names to access some of the members. */ +# define sigev_notify_function _sigev_un._sigev_thread._function +# define sigev_notify_attributes _sigev_un._sigev_thread._attribute + +/* `sigev_notify' values. */ +enum +{ + SIGEV_SIGNAL = 0, /* Notify via signal. */ +# define SIGEV_SIGNAL SIGEV_SIGNAL + SIGEV_NONE, /* Other notification: meaningless. */ +# define SIGEV_NONE SIGEV_NONE + SIGEV_THREAD, /* Deliver via thread creation. */ +# define SIGEV_THREAD SIGEV_THREAD + + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ +#define SIGEV_THREAD_ID SIGEV_THREAD_ID +}; + +#endif /* have _SIGNAL_H. */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/cacheflush.c b/ports/sysdeps/unix/sysv/linux/tile/cacheflush.c new file mode 100644 index 0000000000..df1567c8b6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/cacheflush.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> + +/* Flush cache(s). */ +int +_flush_cache (char *addr, const int nbytes, const int op) +{ +#ifdef __NR_cacheflush + return INLINE_SYSCALL (cacheflush, 3, addr, nbytes, op); +#else + __set_errno (ENOSYS); + return -1; +#endif +} +weak_alias (_flush_cache, cacheflush) diff --git a/ports/sysdeps/unix/sysv/linux/tile/configure b/ports/sysdeps/unix/sysv/linux/tile/configure new file mode 100644 index 0000000000..88b5788481 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/configure @@ -0,0 +1,4 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/tile. + +arch_minimum_kernel=2.6.32 diff --git a/ports/sysdeps/unix/sysv/linux/tile/configure.in b/ports/sysdeps/unix/sysv/linux/tile/configure.in new file mode 100644 index 0000000000..b983e28be6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/configure.in @@ -0,0 +1,4 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/tile. + +arch_minimum_kernel=2.6.32 diff --git a/ports/sysdeps/unix/sysv/linux/tile/getcontext.S b/ports/sysdeps/unix/sysv/linux/tile/getcontext.S new file mode 100644 index 0000000000..24163c28ce --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/getcontext.S @@ -0,0 +1,95 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <arch/abi.h> + +#include "ucontext_i.h" + +/* int getcontext (ucontext_t *ucp) */ + + .text +ENTRY (__getcontext) + FEEDBACK_ENTER(__getcontext) + + /* Save the callee-saved GPRs. There's no need to save the + caller-saved GPRs since the eventual setcontext() or + swapcontext() will assume those registers are all dead. + Save value "1" to uc_flags to later recognize getcontext(). */ + { movei r11, 1; ADDI_PTR r10, r0, UC_FLAGS_OFFSET } + { ST_PTR r10, r11; addli r10, r0, UC_REG(30) } + { ST r10, r30; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r31; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r32; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r33; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r34; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r35; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r36; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r37; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r38; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r39; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r40; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r41; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r42; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r43; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r44; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r45; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r46; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r47; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r48; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r49; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r50; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r51; ADDI_PTR r10, r10, REGSIZE } + { ST r10, r52; ADDI_PTR r10, r10, REGSIZE } + { ST r10, tp; ADDI_PTR r10, r10, REGSIZE } + { ST r10, sp; ADDI_PTR r10, r10, REGSIZE } + { ST r10, lr; ADDI_PTR r10, r10, REGSIZE } + lnk r11 /* Point PC at the "jrp lr" instruction. */ + addli r11, r11, .Lreturn - . + { ST r10, r11; ADDI_PTR r10, r10, REGSIZE } + mfspr r11, INTERRUPT_CRITICAL_SECTION + { + ST r10, r11 + movei r1, 0 + } + + /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG / 8) */ + { + movei r3, _NSIG / 8 + addli r2, r0, UC_SIGMASK_OFFSET + } + { + movei r0, SIG_BLOCK + moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigprocmask + } + swint1 + BNEZ r1, .Lsyscall_error + +.Lreturn: + { + movei r0, 0 + jrp lr + } + +.Lsyscall_error: + j SYSCALL_ERROR_NAME + +END (__getcontext) +.hidden __getcontext + +weak_alias (__getcontext, getcontext) diff --git a/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h b/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h new file mode 100644 index 0000000000..89929d2bc9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +/* TILE glibc support starts with 2.6.36, guaranteeing many kernel features. */ +#define __ASSUME_MMAP2_SYSCALL 1 +#define __ASSUME_STAT64_SYSCALL 1 +#define __ASSUME_FCNTL64 1 +#define __ASSUME_CLONE_THREAD_FLAGS 1 +#define __ASSUME_TGKILL 1 +#define __ASSUME_UTIMES 1 +#define __ASSUME_FADVISE64_64_SYSCALL 1 +#define __ASSUME_O_CLOEXEC 1 +#define __ASSUME_SOCK_CLOEXEC 1 +#define __ASSUME_IN_NONBLOCK 1 +#define __ASSUME_PIPE2 1 +#define __ASSUME_EVENTFD2 1 +#define __ASSUME_SIGNALFD4 1 +#define __ASSUME_ACCEPT4 1 +#define __ASSUME_DUP3 1 + +#include_next <kernel-features.h> + +/* Define this if your 32-bit syscall API requires 64-bit register + pairs to start with an even-number register. */ +#define __ASSUME_ALIGNED_REGISTER_PAIRS 1 diff --git a/ports/sysdeps/unix/sysv/linux/tile/makecontext.c b/ports/sysdeps/unix/sysv/linux/tile/makecontext.c new file mode 100644 index 0000000000..e3f66bccb0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/makecontext.c @@ -0,0 +1,67 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdarg.h> +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <ucontext.h> +#include <arch/abi.h> + +void +__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) +{ + extern void __startcontext (void); + uint_reg_t *sp, *args; + va_list ap; + int i; + + /* Initialize the top of stack. */ + sp = (uint_reg_t *) ((((intptr_t) ucp->uc_stack.ss_sp + + ucp->uc_stack.ss_size) & -16L) - 16); + + /* Allow room for memory-passed arguments if necessary. */ + if (argc > 10) + sp -= 2 + (argc - 10); + + sp[0] = sp[1] = 0; + + /* Set parameters. */ + va_start (ap, argc); + args = &ucp->uc_mcontext.gregs[0]; + for (i = 0; i < argc; i++) + { + if (i == 10) + args = &sp[2]; + *args++ = va_arg (ap, long); + } + va_end (ap); + + /* Pass (*func) to __startcontext in pc. */ + ucp->uc_mcontext.pc = (long) func; + + /* Set stack pointer. */ + ucp->uc_mcontext.sp = (long) sp; + + /* Set the return address to trampoline. */ + ucp->uc_mcontext.lr = (long) __startcontext; + + /* Pass ucp->uc_link to __start_context in r30. */ + ucp->uc_mcontext.gregs[30] = (long) ucp->uc_link; +} +weak_alias (__makecontext, makecontext) diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/Makefile b/ports/sysdeps/unix/sysv/linux/tile/nptl/Makefile new file mode 100644 index 0000000000..e98c9bd866 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/Makefile @@ -0,0 +1,2 @@ +# pull in __syscall_error routine +libpthread-routines += sysdep diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h new file mode 100644 index 0000000000..ac51e3b93c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h @@ -0,0 +1,223 @@ +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Based on work contributed by Ulrich Drepper <drepper@redhat.com>, 2002. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#include <bits/wordsize.h> + +#if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#else +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#endif + + +/* Thread identifiers. The structure of the attribute type is not + exposed on purpose. */ +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[__SIZEOF_PTHREAD_ATTR_T]; + long int __align; +}; +#ifndef __have_pthread_attr_t +typedef union pthread_attr_t pthread_attr_t; +# define __have_pthread_attr_t 1 +#endif + +#if __WORDSIZE == 64 +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; +#else +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; +#endif + + +/* Data structures for mutex handling. The structure of the attribute + type is not exposed on purpose. */ +typedef union +{ + struct __pthread_mutex_s + { + int __lock; + unsigned int __count; + int __owner; +#if __WORDSIZE == 64 + unsigned int __nusers; +#endif + /* KIND must stay at this position in the structure to maintain + binary compatibility. */ + int __kind; +#if __WORDSIZE == 64 + int __spins; + __pthread_list_t __list; +# define __PTHREAD_MUTEX_HAVE_PREV 1 +#else + unsigned int __nusers; + __extension__ union + { + int __spins; + __pthread_slist_t __list; + }; +#endif + } __data; + char __size[__SIZEOF_PTHREAD_MUTEX_T]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; + int __align; +} pthread_mutexattr_t; + + +/* Data structure for conditional variable handling. The structure of + the attribute type is not exposed on purpose. */ +typedef union +{ + struct + { + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[__SIZEOF_PTHREAD_COND_T]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_CONDATTR_T]; + int __align; +} pthread_condattr_t; + + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#if defined __USE_UNIX98 || defined __USE_XOPEN2K +/* Data structure for read-write lock variable handling. The + structure of the attribute type is not exposed on purpose. */ +typedef union +{ +# if __WORDSIZE == 64 + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + int __writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned int __flags; + } __data; +# else + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + /* FLAGS must stay at this position in the structure to maintain + binary compatibility. */ + unsigned char __flags; + unsigned char __shared; + unsigned char __pad1; + unsigned char __pad2; + int __writer; + } __data; +# endif + char __size[__SIZEOF_PTHREAD_RWLOCK_T]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; + long int __align; +} pthread_rwlockattr_t; +#endif + + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + + +/* POSIX barriers data type. The structure of the type is + deliberately not exposed. */ +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIER_T]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; + int __align; +} pthread_barrierattr_t; +#endif + + +#endif /* bits/pthreadtypes.h */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/bits/semaphore.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/bits/semaphore.h new file mode 100644 index 0000000000..8ed81da69e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/bits/semaphore.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@redhat.com>, 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SEMAPHORE_H +# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." +#endif + +#include <bits/wordsize.h> + +#if __WORDSIZE == 64 +# define __SIZEOF_SEM_T 32 +#else +# define __SIZEOF_SEM_T 16 +#endif + + +/* Value returned if `sem_open' failed. */ +#define SEM_FAILED ((sem_t *) 0) + + +typedef union +{ + char __size[__SIZEOF_SEM_T]; + long int __align; +} sem_t; diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S b/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S new file mode 100644 index 0000000000..de4fa136d3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S @@ -0,0 +1,220 @@ +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* clone() is even more special than fork() as it mucks with stacks + and invokes a function in the right context after it's all over. */ + +#include <sysdep.h> +#define _ERRNO_H 1 +#include <bits/errno.h> + +#include <asm/unistd.h> +#include <arch/abi.h> +#include <tls.h> +#include <linux/sched.h> + +/* What we save where in the stack frame; must include all callee-saves. */ +#define FRAME_NEXT_LR (0 * REGSIZE) /* reserved by ABI; not used here */ +#define FRAME_SP (1 * REGSIZE) +#define FRAME_R30 (2 * REGSIZE) +#define FRAME_R31 (3 * REGSIZE) +#define FRAME_R32 (4 * REGSIZE) +#define FRAME_SIZE (5 * REGSIZE) + +/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, + pid_t *ptid, struct user_desc *tls, pid_t *ctid); */ + + .text +ENTRY (__clone) + /* sanity check arguments */ + BEQZ r0, .Linvalid + BEQZ r1, .Linvalid + + /* Create a stack frame so we can pass callee-saves to new task. */ + { + move r10, sp + ST sp, lr + ADDI_PTR sp, sp, -FRAME_SIZE + } + cfi_offset (lr, 0) + cfi_def_cfa_offset (FRAME_SIZE) + ADDI_PTR r11, sp, FRAME_SP + { + ST r11, r10 + ADDI_PTR r11, sp, FRAME_R30 + } + { + ST r11, r30 + ADDI_PTR r11, sp, FRAME_R31 + } + cfi_offset (r30, FRAME_R30 - FRAME_SIZE) + { + ST r11, r31 + ADDI_PTR r11, sp, FRAME_R32 + } + cfi_offset (r31, FRAME_R31 - FRAME_SIZE) + ST r11, r32 + cfi_offset (r32, FRAME_R32 - FRAME_SIZE) + + /* Make sure child stack is properly aligned, and set up the + top frame so that we can call out of it immediately in the + child. Setting it up here means we fault in the parent if + it's bogus, which is probably cleaner than faulting first + thing in the child. */ + ADDI_PTR r1, r1, -C_ABI_SAVE_AREA_SIZE + andi r1, r1, -C_ABI_SAVE_AREA_SIZE + ADDI_PTR r9, r1, REGSIZE /* sp of this frame on entry, i.e. zero */ + ST r9, zero + + /* We need to switch the argument convention around from + libc to kernel: + + libc: + r0 fn + r1 child_stack + r2 flags + r3 arg + r4 ptid + r5 tls + r6 ctid + + kernel: + r0 flags + r1 child_stack [same as libc] + r2 ptid + r3 ctid + r4 tls + + Plus the callee-saves as described at .Lthread_start, below. */ + { + move r32, r0 + move r0, r2 + } + { + move r31, r3 + move r3, r6 + } + { + move r30, r2 + move r2, r4 + } + { + move r4, r5 + moveli TREG_SYSCALL_NR_NAME, __NR_clone + } + swint1 + BEQZ r0, .Lthread_start /* If in child task. */ + + /* Restore the callee-saved registers and return. */ + ADDLI_PTR lr, sp, FRAME_SIZE + { + LD lr, lr + ADDLI_PTR r30, sp, FRAME_R30 + } + { + LD r30, r30 + ADDLI_PTR r31, sp, FRAME_R31 + } + { + LD r31, r31 + ADDLI_PTR r32, sp, FRAME_R32 + } + { + LD r32, r32 + ADDI_PTR sp, sp, FRAME_SIZE + } + cfi_def_cfa_offset (0) + + BNEZ r1, .Lerror + jrp lr + +.Lerror: + j SYSCALL_ERROR_NAME + +.Linvalid: + { + movei r1, EINVAL + j SYSCALL_ERROR_NAME + } + +/* This function expects to receive: + + sp: the top of a valid stack area + r30: clone() flags + r31: the argument to pass to the user function + r32: the user function pointer */ + +.Lthread_start: + /* Check and see if we need to reset the PID, which we do if + CLONE_THREAD isn't set, i.e. we're not staying in the thread group. + If CLONE_VM is set, we're doing some kind of thread-like clone, + so we set the tid/pid to -1 to disable using the cached values + in getpid(). Otherwise (if CLONE_VM isn't set), it's a + fork-like clone, and we go ahead and write the cached values + from the true system pid (retrieved via __NR_getpid syscall). */ + cfi_def_cfa_offset (FRAME_SIZE) +#ifdef __tilegx__ + { + moveli r0, hw1_last(CLONE_VM) + moveli r1, hw1_last(CLONE_THREAD) + } + { + shl16insli r0, r0, hw0(CLONE_VM) + shl16insli r1, r1, hw0(CLONE_THREAD) + } +#else + { + moveli r0, lo16(CLONE_VM) + moveli r1, lo16(CLONE_THREAD) + } + { + auli r0, r0, ha16(CLONE_VM) + auli r1, r1, ha16(CLONE_THREAD) + } +#endif + { + and r0, r30, r0 + and r1, r30, r1 + } + BNEZ r1, .Lno_reset_pid /* CLONE_THREAD is set */ + { + movei r0, -1 + BNEZ r0, .Lgotpid /* CLONE_VM is set */ + } + moveli TREG_SYSCALL_NR_NAME, __NR_getpid + swint1 +.Lgotpid: + ADDLI_PTR r2, tp, PID_OFFSET + { + ST4 r2, r0 + ADDLI_PTR r2, tp, TID_OFFSET + } + ST4 r2, r0 +.Lno_reset_pid: + { + /* Invoke user function with specified argument. */ + move r0, r31 + jalr r32 + } + { + j HIDDEN_JUMPTARGET(_exit) + info INFO_OP_CANNOT_BACKTRACE /* Notify backtracer to stop. */ + } +PSEUDO_END (__clone) + +weak_alias (__clone, clone) diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/createthread.c b/ports/sysdeps/unix/sysv/linux/tile/nptl/createthread.c new file mode 100644 index 0000000000..3794e52dae --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/createthread.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Value passed to 'clone' for initialization of the thread register. */ +#define TLS_VALUE ((void *) (pd) \ + + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) + +/* Get the real implementation. */ +#include <sysdeps/pthread/createthread.c> diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/fork.c b/ports/sysdeps/unix/sysv/linux/tile/nptl/fork.c new file mode 100644 index 0000000000..a778238f86 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/fork.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@redhat.com>, 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sched.h> +#include <signal.h> +#include <stdio.h> +#include <sysdep.h> +#include <tls.h> + +#define ARCH_FORK() \ + INLINE_SYSCALL (clone, 4, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \ + 0, NULL, &THREAD_SELF->tid) + +#include <sysdeps/unix/sysv/linux/fork.c> diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h new file mode 100644 index 0000000000..8690c7be4a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h @@ -0,0 +1,280 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _LOWLEVELLOCK_H +#define _LOWLEVELLOCK_H 1 + +#include <time.h> +#include <sys/param.h> +#include <bits/pthreadtypes.h> +#include <atomic.h> +#include <sysdep.h> +#include <kernel-features.h> + + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#define FUTEX_TRYLOCK_PI 8 +#define FUTEX_WAIT_BITSET 9 +#define FUTEX_WAKE_BITSET 10 +#define FUTEX_PRIVATE_FLAG 128 +#define FUTEX_CLOCK_REALTIME 256 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + + +#if !defined NOT_IN_libc || defined IS_IN_rtld +/* In libc.so or ld.so all futexes are private. */ +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + ((fl) | FUTEX_PRIVATE_FLAG) +# else +# define __lll_private_flag(fl, private) \ + ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) +# endif +#else +# ifdef __ASSUME_PRIVATE_FUTEX +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# else +# define __lll_private_flag(fl, private) \ + (__builtin_constant_p (private) \ + ? ((private) == 0 \ + ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \ + : (fl)) \ + : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \ + & THREAD_GETMEM (THREAD_SELF, header.private_futex)))) +# endif +#endif + + +#define lll_futex_wait(futexp, val, private) \ + lll_futex_timed_wait (futexp, val, NULL, private) + +#define lll_futex_timed_wait(futexp, val, timespec, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAIT, private), \ + (val), (timespec)); \ + }) + +#define lll_futex_wake(futexp, nr, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ + __lll_private_flag (FUTEX_WAKE, private), \ + (nr), 0); \ + }) + +#define lll_robust_dead(futexv, private) \ + do \ + { \ + int *__futexp = &(futexv); \ + atomic_or (__futexp, FUTEX_OWNER_DIED); \ + lll_futex_wake (__futexp, 1, private); \ + } \ + while (0) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ + (nr_wake), (nr_move), (mutex), (val)); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + +/* Returns non-zero if error happened, zero if success. */ +#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret; \ + __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + (nr_wake), (nr_wake2), (futexp2), \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \ + INTERNAL_SYSCALL_ERROR_P (__ret, __err); \ + }) + + + + +static inline int __attribute__ ((always_inline)) +__lll_trylock (int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0; +} +#define lll_trylock(lock) __lll_trylock (&(lock)) + + +static inline int __attribute__ ((always_inline)) +__lll_cond_trylock (int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; +} +#define lll_cond_trylock(lock) __lll_cond_trylock (&(lock)) + + +static inline int __attribute__ ((always_inline)) +__lll_robust_trylock (int *futex, int id) +{ + return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0; +} +#define lll_robust_trylock(lock, id) \ + __lll_robust_trylock (&(lock), id) + +extern void __lll_lock_wait_private (int *futex) attribute_hidden; +extern void __lll_lock_wait (int *futex, int private) attribute_hidden; +extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden; + +static inline void __attribute__ ((always_inline)) +__lll_lock (int *futex, int private) +{ + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) + { + if (__builtin_constant_p (private) && private == LLL_PRIVATE) + __lll_lock_wait_private (futex); + else + __lll_lock_wait (futex, private); + } +} +#define lll_lock(futex, private) __lll_lock (&(futex), private) + + +static inline int __attribute__ ((always_inline)) +__lll_robust_lock (int *futex, int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_lock_wait (futex, private); + return result; +} +#define lll_robust_lock(futex, id, private) \ + __lll_robust_lock (&(futex), id, private) + + +static inline void __attribute__ ((always_inline)) +__lll_cond_lock (int *futex, int private) +{ + if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0) + __lll_lock_wait (futex, private); +} +#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private) + + +#define lll_robust_cond_lock(futex, id, private) \ + __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private) + + +extern int __lll_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; +extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, + int private) attribute_hidden; + +static inline int __attribute__ ((always_inline)) +__lll_timedlock (int *futex, const struct timespec *abstime, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0) + result = __lll_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_timedlock(futex, abstime, private) \ + __lll_timedlock (&(futex), abstime, private) + + +static inline int __attribute__ ((always_inline)) +__lll_robust_timedlock (int *futex, const struct timespec *abstime, + int id, int private) +{ + int result = 0; + if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0) + result = __lll_robust_timedlock_wait (futex, abstime, private); + return result; +} +#define lll_robust_timedlock(futex, abstime, id, private) \ + __lll_robust_timedlock (&(futex), abstime, id, private) + + +#define __lll_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval > 1, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_unlock(futex, private) __lll_unlock(&(futex), private) + + +#define __lll_robust_unlock(futex, private) \ + (void) \ + ({ int *__futex = (futex); \ + int __oldval = atomic_exchange_rel (__futex, 0); \ + if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \ + lll_futex_wake (__futex, 1, private); \ + }) +#define lll_robust_unlock(futex, private) \ + __lll_robust_unlock(&(futex), private) + + +#define lll_islocked(futex) \ + (futex != 0) + +/* Initializers for lock. */ +#define LLL_LOCK_INITIALIZER (0) +#define LLL_LOCK_INITIALIZER_LOCKED (1) + + +/* The kernel notifies a process which uses CLONE_CLEARTID via futex + wakeup when the clone terminates. The memory location contains the + thread ID while the clone is running and is reset to zero + afterwards. */ +#define lll_wait_tid(tid) \ + do { \ + __typeof (tid) __tid; \ + while ((__tid = (tid)) != 0) \ + lll_futex_wait (&(tid), __tid, LLL_SHARED); \ + } while (0) + +extern int __lll_timedwait_tid (int *, const struct timespec *) + attribute_hidden; + +#define lll_timedwait_tid(tid, abstime) \ + ({ \ + int __res = 0; \ + if ((tid) != 0) \ + __res = __lll_timedwait_tid (&(tid), (abstime)); \ + __res; \ + }) + +#endif /* lowlevellock.h */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/tile/nptl/pt-vfork.S new file mode 100644 index 0000000000..a6ccb1f51f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/pt-vfork.S @@ -0,0 +1,2 @@ +#define PT_VFORK 1 /* pid is never zero */ +#include "vfork.S" diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/pthread_once.c b/ports/sysdeps/unix/sysv/linux/tile/nptl/pthread_once.c new file mode 100644 index 0000000000..93ac29b24c --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/pthread_once.c @@ -0,0 +1,94 @@ +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Jakub Jelinek <jakub@redhat.com>, 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <nptl/pthreadP.h> +#include <lowlevellock.h> + + +unsigned long int __fork_generation attribute_hidden; + + +static void +clear_once_control (void *arg) +{ + pthread_once_t *once_control = (pthread_once_t *) arg; + + *once_control = 0; + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); +} + + +int +__pthread_once (once_control, init_routine) + pthread_once_t *once_control; + void (*init_routine) (void); +{ + while (1) + { + int oldval, val, newval; + + val = *once_control; + do + { + /* Check if the initialized has already been done. */ + if ((val & 2) != 0) + return 0; + + oldval = val; + newval = (oldval & 3) | __fork_generation | 1; + val = atomic_compare_and_exchange_val_acq (once_control, newval, + oldval); + } + while (__builtin_expect (val != oldval, 0)); + + /* Check if another thread already runs the initializer. */ + if ((oldval & 1) != 0) + { + /* Check whether the initializer execution was interrupted + by a fork. */ + if (((oldval ^ newval) & -4) == 0) + { + /* Same generation, some other thread was faster. Wait. */ + lll_futex_wait (once_control, newval, LLL_PRIVATE); + continue; + } + } + + /* This thread is the first here. Do the initialization. + Register a cleanup handler so that in case the thread gets + interrupted the initialization can be restarted. */ + pthread_cleanup_push (clear_once_control, once_control); + + init_routine (); + + pthread_cleanup_pop (0); + + + /* Add one to *once_control. */ + atomic_increment (once_control); + + /* Wake up all other threads. */ + lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE); + break; + } + + return 0; +} +weak_alias (__pthread_once, pthread_once) +hidden_def (__pthread_once) diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/sysdep-cancel.h new file mode 100644 index 0000000000..8db7a40a54 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/sysdep-cancel.h @@ -0,0 +1,154 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <tls.h> +#ifndef __ASSEMBLER__ +# include <nptl/pthreadP.h> +#endif + +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +/* Allow hacking in some extra code if desired. */ +#ifndef PSEUDO_EXTRA +#define PSEUDO_EXTRA +#endif + +#undef PSEUDO +#define PSEUDO(name, syscall_name, args) \ + ENTRY(__##syscall_name##_nocancel); \ + PSEUDO_EXTRA \ + moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \ + swint1; \ + BNEZ r1, 0f; \ + jrp lr; \ + END(__##syscall_name##_nocancel); \ + ENTRY (name) \ + SINGLE_THREAD_P(r11); \ + BEQZ r11, L(pseudo_cancel); \ + PSEUDO_EXTRA \ + moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \ + swint1; \ + BNEZ r1, 0f; \ + jrp lr; \ + L(pseudo_cancel): \ + { \ + move r11, sp; \ + ST sp, lr; \ + ADDI_PTR sp, sp, -STKSPACE; \ + }; \ + cfi_offset (lr, 0); \ + cfi_def_cfa_offset (STKSPACE); \ + { \ + ADDI_PTR r12, sp, REGSIZE; \ + ADDI_PTR r13, sp, 2 * REGSIZE; /* set up for PUSHARGS_0 */ \ + }; \ + ST r12, r11; \ + PUSHARGS_##args /* save syscall args */ \ + CENABLE; \ + ADDI_PTR r12, sp, 10 * REGSIZE; \ + { \ + ST r12, r0; /* save mask */ \ + ADDI_PTR r13, sp, 2 * REGSIZE; /* set up for POPARGS_0 */ \ + }; \ + POPARGS_##args /* restore syscall args */ \ + PSEUDO_EXTRA \ + moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \ + swint1; \ + ADDI_PTR r12, sp, 12 * REGSIZE; \ + { \ + ST r12, r1; /* save syscall result */ \ + ADDI_PTR r12, sp, 11 * REGSIZE; \ + }; \ + { \ + ST r12, r0; \ + ADDI_PTR r13, sp, 10 * REGSIZE; \ + }; \ + LD r0, r13; /* pass mask as arg1 */ \ + CDISABLE; \ + { \ + ADDI_PTR lr, sp, STKSPACE; \ + ADDI_PTR r0, sp, 11 * REGSIZE; \ + }; \ + { \ + LD r0, r0; \ + ADDI_PTR r1, sp, 12 * REGSIZE; \ + }; \ + LD r1, r1; \ + { \ + LD lr, lr; \ + ADDI_PTR sp, sp, STKSPACE; \ + }; \ + cfi_def_cfa_offset (0); \ + BNEZ r1, 0f + +# define PUSHARGS_0 /* nothing to do */ +# define PUSHARGS_1 PUSHARGS_0 { ADDI_PTR r14, sp, 3 * REGSIZE; ST r13, r0 }; +# define PUSHARGS_2 PUSHARGS_1 { ADDI_PTR r13, sp, 4 * REGSIZE; ST r14, r1 }; +# define PUSHARGS_3 PUSHARGS_2 { ADDI_PTR r14, sp, 5 * REGSIZE; ST r13, r2 }; +# define PUSHARGS_4 PUSHARGS_3 { ADDI_PTR r13, sp, 6 * REGSIZE; ST r14, r3 }; +# define PUSHARGS_5 PUSHARGS_4 { ADDI_PTR r14, sp, 7 * REGSIZE; ST r13, r4 }; +# define PUSHARGS_6 PUSHARGS_5 { ADDI_PTR r13, sp, 8 * REGSIZE; ST r14, r5 }; +# define PUSHARGS_7 PUSHARGS_6 { ADDI_PTR r14, sp, 9 * REGSIZE; ST r13, r6 }; + +# define POPARGS_0 /* nothing to do */ +# define POPARGS_1 POPARGS_0 { ADDI_PTR r14, sp, 3 * REGSIZE; LD r0, r13 }; +# define POPARGS_2 POPARGS_1 { ADDI_PTR r13, sp, 4 * REGSIZE; LD r1, r14 }; +# define POPARGS_3 POPARGS_2 { ADDI_PTR r14, sp, 5 * REGSIZE; LD r2, r13 }; +# define POPARGS_4 POPARGS_3 { ADDI_PTR r13, sp, 6 * REGSIZE; LD r3, r14 }; +# define POPARGS_5 POPARGS_4 { ADDI_PTR r14, sp, 7 * REGSIZE; LD r4, r13 }; +# define POPARGS_6 POPARGS_5 { ADDI_PTR r13, sp, 8 * REGSIZE; LD r5, r14 }; +# define POPARGS_7 POPARGS_6 { ADDI_PTR r14, sp, 9 * REGSIZE; LD r6, r13 }; + +# define STKSPACE (13 * REGSIZE) + +# ifdef IS_IN_libpthread +# define CENABLE jal __pthread_enable_asynccancel +# define CDISABLE jal __pthread_disable_asynccancel +# elif defined IS_IN_librt +# define CENABLE jal __librt_enable_asynccancel +# define CDISABLE jal __librt_disable_asynccancel +# else +# define CENABLE jal __libc_enable_asynccancel +# define CDISABLE jal __libc_disable_asynccancel +# endif + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) \ + == 0, 1) +# else +# define SINGLE_THREAD_P(reg) \ + ADDLI_PTR reg, tp, MULTIPLE_THREADS_OFFSET; \ + LD reg, reg; \ + CMPEQI reg, reg, 0 +#endif + +#elif !defined __ASSEMBLER__ + +# define SINGLE_THREAD_P 1 +# define NO_CANCELLATION 1 + +#endif + +#ifndef __ASSEMBLER__ +# define RTLD_SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +#endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/tile/nptl/vfork.S new file mode 100644 index 0000000000..ddf9a7ae6e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/vfork.S @@ -0,0 +1,80 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#define __ASSEMBLY__ /* for kernel headers */ +#include <linux/sched.h> +#include <asm/signal.h> +#include <tcb-offsets.h> + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + + .text +ENTRY (__vfork) + { + addli r11, tp, PID_OFFSET /* Point at PID. */ + movei r13, 1 + } + { + LD4U r12, r11 /* Load the saved PID. */ + shli r13, r13, 31 /* Build 0x80000000. */ + } + sub r12, zero, r12 /* Negate it. */ +#ifndef PT_VFORK + CMOVEQZ r12, r12, r13 /* Replace zero pids. */ +#endif + ST4 r11, r12 /* Store the temporary PID. */ + + { + moveli r0, CLONE_VFORK | CLONE_VM | SIGCHLD + move r1, zero + } + { + move r2, zero + move r3, zero + } + moveli TREG_SYSCALL_NR_NAME, __NR_clone + swint1 + + BEQZ r0, 1f /* If we are the parent... */ + { + addli r11, tp, PID_OFFSET /* Point at PID. */ + movei r13, 1 + } + { + LD4U r12, r11 /* Load the saved PID. */ + shli r13, r13, 31 /* Build 0x80000000. */ + } + { + CMPEQ r13, r12, r12 /* Test for that value. */ + sub r12, zero, r12 /* Re-negate it. */ + } +#ifndef PT_VFORK + CMOVNEZ r12, r13, zero /* Replace zero pids. */ +#endif + ST4 r11, r12 /* Restore the PID. */ +1: + BNEZ r1, 0f + jrp lr +PSEUDO_END (__vfork) +libc_hidden_def (__vfork) + +weak_alias (__vfork, vfork) diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/waitpid.S b/ports/sysdeps/unix/sysv/linux/tile/nptl/waitpid.S new file mode 100644 index 0000000000..9aa793e12b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/nptl/waitpid.S @@ -0,0 +1,20 @@ +/* +extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden; +*/ +#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt + +/* Call __NR_wait4, providing fourth argument (struct rusage *) as NULL. */ +#define PSEUDO_EXTRA move r3, zero; +#include <sysdep-cancel.h> + +PSEUDO (__waitpid, wait4, 3) +ret +PSEUDO_END(__waitpid) + +libc_hidden_def (__waitpid) +weak_alias (__waitpid, waitpid) +libc_hidden_weak (waitpid) +weak_alias (__waitpid, __libc_waitpid) +libc_hidden_weak (__libc_waitpid) + +#endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/profil-counter.h b/ports/sysdeps/unix/sysv/linux/tile/profil-counter.h new file mode 100644 index 0000000000..602c3f06a0 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/profil-counter.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <signal.h> +#include <sigcontextinfo.h> + +static void +profil_counter (int signo, SIGCONTEXT scp) +{ + profil_count ((void *) GET_PC (scp)); +} diff --git a/ports/sysdeps/unix/sysv/linux/tile/set_dataplane.c b/ports/sysdeps/unix/sysv/linux/tile/set_dataplane.c new file mode 100644 index 0000000000..1354ee62dd --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/set_dataplane.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <stddef.h> +#include <unistd.h> +#ifdef __NR_set_dataplane +#include <sys/dataplane.h> +#endif + +/* Request dataplane modes from the kernel. */ +int +set_dataplane (int flags) +{ +#ifdef __NR_set_dataplane + return INLINE_SYSCALL (set_dataplane, 1, flags); +#else + __set_errno (ENOSYS); + return -1; +#endif +} diff --git a/ports/sysdeps/unix/sysv/linux/tile/setcontext.S b/ports/sysdeps/unix/sysv/linux/tile/setcontext.S new file mode 100644 index 0000000000..f95ad7ccaa --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/setcontext.S @@ -0,0 +1,201 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <asm/errno.h> +#include <arch/spr_def.h> +#include <arch/abi.h> + +#include "ucontext_i.h" + +/* PL to return to via iret in setcontext */ +#define RETURN_PL 0 + +/* int setcontext (const ucontext_t *ucp) */ + + .text +ENTRY (__setcontext) + FEEDBACK_ENTER(__setcontext) + + /* See if this is a true signal context (flags == 0). + If so, restore by invoking rt_sigreturn(). */ +#if UC_FLAGS_OFFSET != 0 +# error "Add offset to r0 prior to load." +#endif + LD_PTR r10, r0 + { + BEQZ r10, .Lsigreturn + addi r10, r10, -1 /* Confirm that it has value "1". */ + } + BNEZ r10, .Lbadcontext + + /* Save lr and r0 briefly on the stack and set the signal mask: + rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG / 8). */ + { + ST sp, lr + ADDI_PTR r11, sp, -(2 * REGSIZE) + move r10, sp + } + ADDI_PTR sp, sp, -(3 * REGSIZE) + cfi_def_cfa_offset (3 * REGSIZE) + cfi_offset (lr, 0) + { + ST r11, r10 + ADDI_PTR r10, sp, (2 * REGSIZE) + } + { + ST r10, r0 + ADDLI_PTR r1, r0, UC_SIGMASK_OFFSET + } + cfi_offset (r0, -REGSIZE) + { + movei r3, _NSIG / 8 + movei r2, 0 + } + { + movei r0, SIG_SETMASK + moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigprocmask + } + swint1 + ADDI_PTR r11, sp, 2 * REGSIZE /* Restore uc_context to r11. */ + { + LD r11, r11 + ADDI_PTR sp, sp, 3 * REGSIZE + } + cfi_def_cfa_offset (0) + LD lr, sp + { + ADDI_PTR r10, r11, UC_REG(0) + BNEZ r1, .Lsyscall_error + } + + /* Restore the argument registers; note they will be random + unless makecontext() has been called. */ + { LD r0, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r1, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r2, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r3, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r4, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r5, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r6, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r7, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r8, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r9, r10; ADDLI_PTR r10, r10, UC_REG(30) - UC_REG(9) } + + /* Restore the callee-saved GPRs. */ + { LD r30, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r31, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r32, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r33, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r34, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r35, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r36, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r37, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r38, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r39, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r40, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r41, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r42, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r43, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r44, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r45, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r46, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r47, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r48, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r49, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r50, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r51, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r52, r10; ADDI_PTR r10, r10, REGSIZE * 2 } + /* Skip tp since it must not change for a given thread. */ + { LD sp, r10; ADDI_PTR r10, r10, REGSIZE } + { LD lr, r10; ADDI_PTR r10, r10, REGSIZE } + { LD r11, r10; ADDI_PTR r10, r10, REGSIZE } + + /* Construct an iret context; we set ICS so we can validly load + EX_CONTEXT for iret without being interrupted halfway through. */ + { + LD r12, r10 + movei r13, 1 + } + { + mtspr INTERRUPT_CRITICAL_SECTION, r13 + shli r12, r12, SPR_EX_CONTEXT_0_1__ICS_SHIFT + } + { + mtspr EX_CONTEXT_0_0, r11 + ori r12, r12, RETURN_PL + } + mtspr EX_CONTEXT_0_1, r12 + iret + jrp lr /* keep the backtracer happy */ + +.Lsigreturn: + /* This is a context obtained from a signal handler. + Perform a full restore by pushing the context + passed onto a simulated signal frame on the stack + and call the signal return syscall as if a signal + handler exited normally. */ + { + ADDLI_PTR sp, sp, -(C_ABI_SAVE_AREA_SIZE + SI_MAX_SIZE + UC_SIZE) + ADDLI_PTR r1, sp, -UC_SIZE + } + cfi_def_cfa_offset (C_ABI_SAVE_AREA_SIZE + SI_MAX_SIZE + UC_SIZE) + moveli r2, UC_SIZE / REGSIZE +0: { + LD r10, r0 + ADDI_PTR r0, r0, REGSIZE + } + { + ST r1, r10 + ADDI_PTR r1, r1, REGSIZE + addi r2, r2, -1 + } + BNEZ r2, 0b + moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigreturn + swint1 + + /* Restore the stack and fall through to the error + path. Successful rt_sigreturn never returns to + its calling place. */ + ADDLI_PTR sp, sp, (C_ABI_SAVE_AREA_SIZE + SI_MAX_SIZE + UC_SIZE) + cfi_def_cfa_offset (0) + +.Lsyscall_error: + j SYSCALL_ERROR_NAME + +.Lbadcontext: + { + movei r1, EINVAL + j SYSCALL_ERROR_NAME + } + +END (__setcontext) + +.hidden __setcontext +weak_alias (__setcontext, setcontext) + +ENTRY (__startcontext) + FEEDBACK_ENTER(__startcontext) + BEQZ r30, 1f + { + move r0, r30 + jal __setcontext + } +1: j HIDDEN_JUMPTARGET(exit) +END (__startcontext) +.hidden __startcontext diff --git a/ports/sysdeps/unix/sysv/linux/tile/sigcontextinfo.h b/ports/sysdeps/unix/sysv/linux/tile/sigcontextinfo.h new file mode 100644 index 0000000000..f1dba47ca9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sigcontextinfo.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <arch/abi.h> + +#define SIGCONTEXT siginfo_t *_si, struct ucontext * +#define SIGCONTEXT_EXTRA_ARGS _si, +#define GET_PC(ctx) ((void *) (long) ctx->uc_mcontext.pc) +#define GET_FRAME(ctx) ((void *) (long) ctx->uc_mcontext.regs[TREG_FP]) +#define GET_STACK(ctx) ((void *) (long) ctx->uc_mcontext.sp) +#define CALL_SIGHANDLER(handler, signo, ctx) \ + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) diff --git a/ports/sysdeps/unix/sysv/linux/tile/swapcontext.S b/ports/sysdeps/unix/sysv/linux/tile/swapcontext.S new file mode 100644 index 0000000000..e2b3d70709 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/swapcontext.S @@ -0,0 +1,89 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#include "ucontext_i.h" + +/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */ + + .text +ENTRY (__swapcontext) + FEEDBACK_ENTER(__swapcontext) + /* Set up a frame and save r0 and r1. */ + { + ST sp, lr + ADDI_PTR r11, sp, -(3 * REGSIZE) + move r10, sp + } + ADDI_PTR sp, sp, -(4 * REGSIZE) + cfi_def_cfa_offset (4 * REGSIZE) + cfi_offset (lr, 0) + { + ST r11, r10 + ADDI_PTR r10, sp, (2 * REGSIZE) + } + { + ST r10, r0 + ADDI_PTR r10, sp, (3 * REGSIZE) + } + ST r10, r1 + + /* Save the current context. */ + jal __getcontext + + /* Tear down the frame and restore r0, r1, and lr. */ + { + BNEZ r0, .Lerror + ADDI_PTR r1, sp, 3 * REGSIZE + } + { + LD r1, r1 + ADDI_PTR r0, sp, 2 * REGSIZE + } + { + LD r0, r0 + ADDI_PTR sp, sp, 4 * REGSIZE + } + cfi_def_cfa_offset (0) + { + LD lr, sp + ADDLI_PTR r10, r0, UC_REG(54) + } + + /* Update the stored sp and lr. */ + { + ST r10, sp + ADDLI_PTR r10, r0, UC_REG(55) + } + ST r10, lr + + /* Tail-call setcontext to finish up. */ + { + move r0, r1 + j __setcontext + } + +.Lerror: + ADDI_PTR sp, sp, 4 * REGSIZE + cfi_def_cfa_offset (0) + LD lr, sp + jrp lr +END (__swapcontext) + +weak_alias (__swapcontext, swapcontext) diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/cachectl.h b/ports/sysdeps/unix/sysv/linux/tile/sys/cachectl.h new file mode 100644 index 0000000000..dcab61e979 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/cachectl.h @@ -0,0 +1,36 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_CACHECTL_H +#define _SYS_CACHECTL_H 1 + +#include <features.h> + +/* Get the kernel definition for the op bits. */ +#include <asm/cachectl.h> + +__BEGIN_DECLS + +#ifdef __USE_MISC +extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW; +#endif +extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW; + +__END_DECLS + +#endif /* sys/cachectl.h */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/dataplane.h b/ports/sysdeps/unix/sysv/linux/tile/sys/dataplane.h new file mode 100644 index 0000000000..fcea96ed1e --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/dataplane.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_DATAPLANE_H +#define _SYS_DATAPLANE_H 1 + +#include <features.h> + +/* Get the kernel definition for the flag bits. */ +#include <asm/dataplane.h> + +__BEGIN_DECLS + +extern int set_dataplane (int flags); + +__END_DECLS + +#endif /* sys/dataplane.h */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h new file mode 100644 index 0000000000..295ae50aa6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h @@ -0,0 +1,128 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somewhat modelled after the file of the same name on SVR4 + systems. It provides a definition of the core file format for ELF + used on Linux. It doesn't have anything to do with the /proc file + system, even though Linux has one. + + Anyway, the whole purpose of this file is for GDB and GDB only. + Don't read too much into it. Don't use it for anything other than + GDB unless you know what you are doing. */ + +#include <features.h> +#include <sys/time.h> +#include <sys/types.h> + +#define __need_int_reg_t +#include <arch/abi.h> + +__BEGIN_DECLS + +/* Type for a general-purpose register. */ +typedef __uint_reg_t elf_greg_t; + +/* And the whole bunch of them. We could have used `struct pt_regs' + from <asm/ptrace.h> directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG 64 +#define ELF_NFPREG 0 +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +typedef elf_greg_t elf_fpregset_t[ELF_NFPREG]; + +/* Signal info. */ +struct elf_siginfo + { + int si_signo; /* Signal number. */ + int si_code; /* Extra code. */ + int si_errno; /* Errno. */ + }; + + +/* Definitions to generate Intel SVR4-like core files. These mostly + have the same names as the SVR4 types with "elf_" tacked on the + front to prevent clashes with Linux definitions, and the typedef + forms have been avoided. This is mostly like the SVR4 structure, + but more Linuxy, with things that Linux does not support and which + GDB doesn't really use excluded. */ + +struct elf_prstatus + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned long int pr_sigpend; /* Set of pending signals. */ + unsigned long int pr_sighold; /* Set of held signals. */ + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct timeval pr_utime; /* User time. */ + struct timeval pr_stime; /* System time. */ + struct timeval pr_cutime; /* Cumulative user time. */ + struct timeval pr_cstime; /* Cumulative system time. */ + elf_gregset_t pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + + +#define ELF_PRARGSZ (80) /* Number of chars for args. */ + +struct elf_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long int pr_flag; /* Flags. */ + unsigned int pr_uid; + unsigned int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + + +/* The rest of this file provides the types for emulation of the + Solaris <proc_service.h> interfaces that should be implemented by + users of libthread_db. */ + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; + +/* Provide dummy declaration here; we don't have FP registers. */ +typedef int prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore have only one PID type. */ +typedef __pid_t lwpid_t; + +/* Process status and info. In the end we do provide typedefs for them. */ +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/ptrace.h b/ports/sysdeps/unix/sysv/linux/tile/sys/ptrace.h new file mode 100644 index 0000000000..702f19e41f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/ptrace.h @@ -0,0 +1,144 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PTRACE_H +#define _SYS_PTRACE_H 1 + +#include <features.h> + +__BEGIN_DECLS + +/* Type of the REQUEST argument to `ptrace.' */ +enum __ptrace_request +{ + /* Indicate that the process making this request should be traced. + All signals received by this process can be intercepted by its + parent, and its parent can use the other `ptrace' requests. */ + PTRACE_TRACEME = 0, +#define PT_TRACE_ME PTRACE_TRACEME + + /* Return the word in the process's text space at address ADDR. */ + PTRACE_PEEKTEXT = 1, +#define PT_READ_I PTRACE_PEEKTEXT + + /* Return the word in the process's data space at address ADDR. */ + PTRACE_PEEKDATA = 2, +#define PT_READ_D PTRACE_PEEKDATA + + /* Return the word in the process's user area at offset ADDR. */ + PTRACE_PEEKUSER = 3, +#define PT_READ_U PTRACE_PEEKUSER + + /* Write the word DATA into the process's text space at address ADDR. */ + PTRACE_POKETEXT = 4, +#define PT_WRITE_I PTRACE_POKETEXT + + /* Write the word DATA into the process's data space at address ADDR. */ + PTRACE_POKEDATA = 5, +#define PT_WRITE_D PTRACE_POKEDATA + + /* Write the word DATA into the process's user area at offset ADDR. */ + PTRACE_POKEUSER = 6, +#define PT_WRITE_U PTRACE_POKEUSER + + /* Continue the process. */ + PTRACE_CONT = 7, +#define PT_CONTINUE PTRACE_CONT + + /* Kill the process. */ + PTRACE_KILL = 8, +#define PT_KILL PTRACE_KILL + + /* Single step the process. */ + PTRACE_SINGLESTEP = 9, +#define PT_STEP PTRACE_SINGLESTEP + + /* Get all general purpose registers used by a processes. */ + PTRACE_GETREGS = 12, +#define PT_GETREGS PTRACE_GETREGS + + /* Set all general purpose registers used by a processes. */ + PTRACE_SETREGS = 13, +#define PT_SETREGS PTRACE_SETREGS + + /* Attach to a process that is already running. */ + PTRACE_ATTACH = 16, +#define PT_ATTACH PTRACE_ATTACH + + /* Detach from a process attached to with PTRACE_ATTACH. */ + PTRACE_DETACH = 17, +#define PT_DETACH PTRACE_DETACH + + /* Continue and stop at the next (return from) syscall. */ + PTRACE_SYSCALL = 24, +#define PT_SYSCALL PTRACE_SYSCALL + + /* Set ptrace filter options. */ + PTRACE_SETOPTIONS = 0x4200, +#define PT_SETOPTIONS PTRACE_SETOPTIONS + + /* Get last ptrace message. */ + PTRACE_GETEVENTMSG = 0x4201, +#define PT_GETEVENTMSG PTRACE_GETEVENTMSG + + /* Get siginfo for process. */ + PTRACE_GETSIGINFO = 0x4202, +#define PT_GETSIGINFO PTRACE_GETSIGINFO + + /* Set new siginfo for process. */ + PTRACE_SETSIGINFO = 0x4203 +#define PT_SETSIGINFO PTRACE_SETSIGINFO +}; + + +/* Options set using PTRACE_SETOPTIONS. */ +enum __ptrace_setoptions { + PTRACE_O_TRACESYSGOOD = 0x00000001, + PTRACE_O_TRACEFORK = 0x00000002, + PTRACE_O_TRACEVFORK = 0x00000004, + PTRACE_O_TRACECLONE = 0x00000008, + PTRACE_O_TRACEEXEC = 0x00000010, + PTRACE_O_TRACEVFORKDONE = 0x00000020, + PTRACE_O_TRACEEXIT = 0x00000040, + PTRACE_O_MASK = 0x0000007f +}; + +/* Wait extended result codes for the above trace options. */ +enum __ptrace_eventcodes { + PTRACE_EVENT_FORK = 1, + PTRACE_EVENT_VFORK = 2, + PTRACE_EVENT_CLONE = 3, + PTRACE_EVENT_EXEC = 4, + PTRACE_EVENT_VFORK_DONE = 5, + PTRACE_EVENT_EXIT = 6 +}; + +/* Perform process tracing functions. REQUEST is one of the values + above, and determines the action to be taken. + For all requests except PTRACE_TRACEME, PID specifies the process to be + traced. + + PID and the other arguments described above for the various requests should + appear (those that are used for the particular request) as: + pid_t PID, void *ADDR, int DATA, void *ADDR2 + after REQUEST. */ +extern long int ptrace (enum __ptrace_request __request, ...) __THROW; + +__END_DECLS + +#endif /* _SYS_PTRACE_H */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/reg.h b/ports/sysdeps/unix/sysv/linux/tile/sys/reg.h new file mode 100644 index 0000000000..1ab17ce82a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/reg.h @@ -0,0 +1,2 @@ +/* The traditional purpose of "sys/reg.h" is satisfied by "arch/abi.h". */ +#include <arch/abi.h> diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/ucontext.h b/ports/sysdeps/unix/sysv/linux/tile/sys/ucontext.h new file mode 100644 index 0000000000..ca8ca229d2 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/ucontext.h @@ -0,0 +1,70 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> + +/* We need the signal context definitions even if they are not used + included in <signal.h>. */ +#include <bits/sigcontext.h> + +/* Get register type and register names. */ +#include <arch/abi.h> + +/* Type for general register. */ +typedef uint_reg_t greg_t; + +/* Number of general registers. Must agree with <asm/ptrace.h>. */ +#define NGREG 64 + +/* Container for all general registers. */ +typedef greg_t gregset_t[NGREG]; + +#ifdef __USE_GNU +/* Names for interesting registers in the `gregset_t' array. */ +enum +{ + /* ... r0 through r51 are just 0 through 51 ... */ + REG_FP = TREG_FP, +# define REG_FP REG_FP + REG_TP = TREG_TP, +# define REG_TP REG_TP + REG_SP = TREG_SP, +# define REG_SP REG_SP + REG_LR = TREG_LR, +# define REG_LR REG_LR +}; +#endif + +/* A machine context is exactly a sigcontext. */ +typedef struct sigcontext mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + } ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/user.h b/ports/sysdeps/unix/sysv/linux/tile/sys/user.h new file mode 100644 index 0000000000..c871f1a03d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/user.h @@ -0,0 +1 @@ +/* This file is not needed, but in practice gdb might try to include it. */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/syscall.S b/ports/sysdeps/unix/sysv/linux/tile/syscall.S new file mode 100644 index 0000000000..a3fb32f71d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/syscall.S @@ -0,0 +1,32 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <arch/abi.h> + + .text +ENTRY (syscall) + FEEDBACK_ENTER(syscall) + { move TREG_SYSCALL_NR_NAME, r0; move r0, r1 } + { move r1, r2; move r2, r3 } + { move r3, r4; move r4, r5 } + { move r5, r6; move r6, r7 } + swint1 + BNEZ r1, 0f + jrp lr +PSEUDO_END (syscall) diff --git a/ports/sysdeps/unix/sysv/linux/tile/sysdep.c b/ports/sysdeps/unix/sysv/linux/tile/sysdep.c new file mode 100644 index 0000000000..7573e8a352 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sysdep.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <errno.h> + +int __syscall_error (int dummy, int err); +hidden_proto (__syscall_error) + +/* This routine is jumped to by all the syscall handlers, to stash + an error number into errno. */ +int +__syscall_error (int dummy, int err) +{ + __set_errno (err); + return -1; +} +hidden_def (__syscall_error) diff --git a/ports/sysdeps/unix/sysv/linux/tile/sysdep.h b/ports/sysdeps/unix/sysv/linux/tile/sysdep.h new file mode 100644 index 0000000000..b2c018f83a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/sysdep.h @@ -0,0 +1,223 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <asm/unistd.h> +#include <sysdeps/tile/sysdep.h> +#include <sysdeps/unix/sysv/linux/generic/sysdep.h> +#include <sys/syscall.h> + +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + + +#ifdef __ASSEMBLER__ + +/* The actual implementation of doing a syscall. */ +#define DO_CALL(syscall_name, args) \ + moveli TREG_SYSCALL_NR_NAME, SYS_ify(syscall_name); \ + swint1 + +/* TILE Linux returns the result in r0 (or a negative errno). + The kernel "owns" the code to decide if a given value is an error, + and puts errno in r1 if so, or otherwise zero. */ +#define PSEUDO(name, syscall_name, args) \ + ENTRY (name); \ + DO_CALL(syscall_name, args); \ + BNEZ r1, 0f + +#define ret jrp lr + +#ifndef PIC +/* For static code, on error jump to __syscall_error directly. */ +# define SYSCALL_ERROR_NAME __syscall_error +#elif !defined NOT_IN_libc || defined IS_IN_libpthread +/* Use the internal name for libc/libpthread shared objects. */ +# define SYSCALL_ERROR_NAME __GI___syscall_error +#else +/* Otherwise, on error do a full PLT jump. */ +# define SYSCALL_ERROR_NAME plt(__syscall_error) +#endif + +#define PSEUDO_END(name) \ +0: \ + j SYSCALL_ERROR_NAME; \ + END (name) + +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + ENTRY (name); \ + DO_CALL(syscall_name, args) + +#define ret_NOERRNO jrp lr + +#define PSEUDO_END_NOERRNO(name) \ + END (name) + +/* Convenience wrappers. */ +#define SYSCALL__(name, args) PSEUDO (__##name, name, args) +#define SYSCALL(name, args) PSEUDO (name, name, args) + +#else /* not __ASSEMBLER__ */ + +#include <errno.h> + +/* Define a macro which expands inline into the wrapper code for a system + call. */ +# undef INLINE_SYSCALL +# define INLINE_SYSCALL(name, nr, args...) \ + ({ \ + INTERNAL_SYSCALL_DECL (err); \ + unsigned long val = INTERNAL_SYSCALL (name, err, nr, args); \ + if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (val, err), 0)) \ + { \ + __set_errno (INTERNAL_SYSCALL_ERRNO (val, err)); \ + val = -1; \ + } \ + (long) val; }) + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + internal_syscall##nr (SYS_ify (name), err, args) + +#undef INTERNAL_SYSCALL_NCS +#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ + internal_syscall##nr (number, err, args) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) int err + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) ({ (void) (val); (err) != 0; }) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) ({ (void) (val); (err); }) + +#define internal_syscall0(num, err, dummy...) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#define internal_syscall1(num, err, arg0) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num), "R00" (arg0) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#define internal_syscall2(num, err, arg0, arg1) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num), "R00" (arg0), "R01" (arg1) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#define internal_syscall3(num, err, arg0, arg1, arg2) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#define internal_syscall4(num, err, arg0, arg1, arg2, arg3) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2), \ + "R03" (arg3) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#define internal_syscall5(num, err, arg0, arg1, arg2, arg3, arg4) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2), \ + "R03" (arg3), "R04" (arg4) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#define internal_syscall6(num, err, arg0, arg1, arg2, arg3, arg4, arg5) \ + ({ \ + long _sys_result, __SYSCALL_CLOBBER_DECLS; \ + __asm__ __volatile__ ( \ + "swint1" \ + : "=R00" (_sys_result), "=R01" (err), __SYSCALL_CLOBBER_OUTPUTS \ + : "R10" (num), "R00" (arg0), "R01" (arg1), "R02" (arg2), \ + "R03" (arg3), "R04" (arg4), "R05" (arg5) \ + : __SYSCALL_CLOBBERS); \ + _sys_result; \ + }) + +#undef __SYSCALL_CLOBBERS +#define __SYSCALL_CLOBBERS \ + "r6", "r7", \ + "r8", "r9", "r11", "r12", "r13", "r14", "r15", \ + "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ + "r24", "r25", "r26", "r27", "r28", "r29", "memory" + +/* gcc doesn't seem to allow an input operand to be clobbered, so we + fake it with dummy outputs. */ +#define __SYSCALL_CLOBBER_DECLS \ + _clobber_r2, _clobber_r3, _clobber_r4, _clobber_r5, _clobber_r10 + +#define __SYSCALL_CLOBBER_OUTPUTS \ + "=R02" (_clobber_r2), "=R03" (_clobber_r3), "=R04" (_clobber_r4), \ + "=R05" (_clobber_r5), "=R10" (_clobber_r10) + +#endif /* not __ASSEMBLER__ */ + +/* Pointer mangling support. */ +#if defined NOT_IN_libc && defined IS_IN_rtld +/* We cannot use the thread descriptor because in ld.so we use setjmp + earlier than the descriptor is initialized. */ +#else +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(reg, tmpreg) \ + ADDLI_PTR tmpreg, pt, POINTER_GUARD; \ + LD tmpreg, tmpreg; \ + xor reg, tmpreg, reg +# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) +# else +# define PTR_MANGLE(var) \ + (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) +# define PTR_DEMANGLE(var) PTR_MANGLE (var) +# endif +#endif diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/Makefile b/ports/sysdeps/unix/sysv/linux/tile/tilegx/Makefile new file mode 100644 index 0000000000..4f101f334a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/Makefile @@ -0,0 +1,6 @@ +# Provide biarch definitions. +abi-variants := 64 32 +abi-64-options := -D__LP64__ +abi-64-condition := __WORDSIZE == 64 +abi-32-options := -U__LP64__ +abi-32-condition := __WORDSIZE == 32 diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S b/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S new file mode 100644 index 0000000000..e966c4d891 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S @@ -0,0 +1,41 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + + +/* TILE-Gx specifies that "unsigned int" is sign extended in the high + 32 bits. But since the userspace API claims to be "unsigned long", + calls into __ioctl() will not be sign extended, but rather pass all + 64 bits of the argument. Therefore, when we pass the "request" + value to the kernel, we must explicitly sign-extend it to match the + kernel's internal use of "unsigned int" as the second argument, + which we do by casting to "unsigned int". */ + +#include <sysdep.h> + + .text +ENTRY (__ioctl) + FEEDBACK_ENTER(__ioctl) + { + addxi r1, r1, 0 + moveli TREG_SYSCALL_NR_NAME, __NR_ioctl + } + swint1 + BNEZ r1, 0f + jrp lr +PSEUDO_END (__ioctl) +weak_alias (__ioctl, ioctl) diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h b/ports/sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h new file mode 100644 index 0000000000..a7995b7751 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/ldconfig.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/generic/ldconfig.h> + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib/ld.so.1", FLAG_ELF_LIBC6 }, \ + { "/lib32/ld.so.1", FLAG_ELF_LIBC6 }, +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h b/ports/sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h new file mode 100644 index 0000000000..d5d06f719b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/register-dump.h @@ -0,0 +1,123 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <_itoa.h> + +/* We will print the register dump in this format: + + R0: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R4: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R8: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R12: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R16: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R20: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R24: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R28: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R32: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R36: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R40: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R44: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R48: XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX + R52: XXXXXXXXXXXXXXXX TP: XXXXXXXXXXXXXXXX + SP: XXXXXXXXXXXXXXXX LR: XXXXXXXXXXXXXXXX + + PC: XXXXXXXXXXXXXXXX ICS: X FAULTNUM: XX + + */ + +static void +hexvalue (unsigned long int value, char *buf, size_t len) +{ + char *cp = _itoa_word (value, buf + len, 16, 0); + while (cp > buf) + *--cp = '0'; +} + +static void +register_dump (int fd, mcontext_t *ctx) +{ + char regs[59][16]; + struct iovec iov[132]; + size_t nr = 0; + unsigned int i; + +#define ADD_STRING(str) \ + iov[nr].iov_base = (char *) str; \ + iov[nr].iov_len = strlen (str); \ + ++nr +#define ADD_MEM(str, len) \ + iov[nr].iov_base = str; \ + iov[nr].iov_len = len; \ + ++nr + + /* Generate strings of register contents. */ + for (i = 0; i < 56; ++i) + hexvalue (ctx->gregs[i], regs[i], 16); + hexvalue (ctx->pc, regs[56], 16); + hexvalue (ctx->ics, regs[57], 1); + hexvalue (ctx->faultnum, regs[58], 2); + + /* Generate the output. */ + for (i = 0; i < 56;) + { + const char *prefixes[] = { + "Register dump:\n\n R0: ", + "\n R4: ", + "\n R8: ", + "\n R12: ", + "\n R16: ", + "\n R20: ", + "\n R24: ", + "\n R28: ", + "\n R32: ", + "\n R36: ", + "\n R40: ", + "\n R44: ", + "\n R48: " + }; + ADD_STRING (prefixes[i / 4]); + do + { + ADD_MEM (regs[i], 16); + ADD_STRING (" "); + } + while (++i % 4); + } + ADD_STRING ("\n R52: "); + ADD_MEM (regs[52], 16); + ADD_STRING (" TP: "); + ADD_MEM (regs[53], 16); + ADD_STRING ("\n SP: "); + ADD_MEM (regs[54], 16); + ADD_STRING (" LR: "); + ADD_MEM (regs[55], 16); + ADD_STRING ("\n\n PC: "); + ADD_MEM (regs[56], 16); + ADD_STRING (" ICS: "); + ADD_MEM (regs[57], 1); + ADD_STRING (" FAULTNUM: "); + ADD_MEM (regs[58], 2); + ADD_STRING ("\n"); + + /* Write the stuff out. */ + writev (fd, iov, nr); +} + + +#define REGISTER_DUMP register_dump (fd, &ctx->uc_mcontext) diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies new file mode 100644 index 0000000000..9090d3fb8b --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Implies @@ -0,0 +1,4 @@ +unix/sysv/linux/tile/tilegx +unix/sysv/linux/tile +unix/sysv/linux/generic/wordsize-32 +unix/sysv/linux/generic diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile new file mode 100644 index 0000000000..1e9d29be31 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/Makefile @@ -0,0 +1 @@ +default-abi := 32 diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/ld.abilist new file mode 100644 index 0000000000..4367346594 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/ld.abilist @@ -0,0 +1,11 @@ +GLIBC_2.12 + GLIBC_2.12 A + __libc_memalign F + __libc_stack_end D 0x4 + __tls_get_addr F + _dl_mcount F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..4af9128544 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.12 + GLIBC_2.12 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libanl.abilist new file mode 100644 index 0000000000..29e602a75a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.12 + GLIBC_2.12 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist new file mode 100644 index 0000000000..eed3b4937f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist @@ -0,0 +1,2082 @@ +GLIBC_2.12 + GLIBC_2.12 A + _Exit F + _IO_2_1_stderr_ D 0xa0 + _IO_2_1_stdin_ D 0xa0 + _IO_2_1_stdout_ D 0xa0 + _IO_adjust_column F + _IO_adjust_wcolumn F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_getline_info F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_seekwmark F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sputbackwc F + _IO_sscanf F + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_sungetwc F + _IO_switch_to_get_mode F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_unsave_wmarkers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + ___brk_addr D 0x4 + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __asprintf F + __asprintf_chk F + __assert F + __assert_fail F + __assert_perror_fail F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __chk_fail F + __clone F + __close F + __cmsg_nxthdr F + __confstr_chk F + __connect F + __ctype_b_loc F + __ctype_get_mb_cur_max F + __ctype_tolower_loc F + __ctype_toupper_loc F + __curbrk D 0x4 + __cxa_at_quick_exit F + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __daylight D 0x4 + __dcgettext F + __default_morecore F + __dgettext F + __dprintf_chk F + __dup2 F + __duplocale F + __endmntent F + __environ D 0x4 + __errno_location F + __fbufsize F + __fcntl F + __ffs F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finite F + __finitef F + __flbf F + __fork F + __fpending F + __fprintf_chk F + __fpu_control D 0x4 + __fpurge F + __fread_chk F + __fread_unlocked_chk F + __freadable F + __freading F + __free_hook D 0x4 + __freelocale F + __fsetlocking F + __fwprintf_chk F + __fwritable F + __fwriting F + __fxstat F + __fxstat64 F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdelim F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getmntent_r F + __getpagesize F + __getpgid F + __getpid F + __gets_chk F + __gettimeofday F + __getwd_chk F + __gmtime_r F + __h_errno_location F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isctype F + __isdigit_l F + __isgraph_l F + __isinf F + __isinff F + __islower_l F + __isnan F + __isnanf F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __ivaliduser F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_calloc F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_free F + __libc_freeres F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_sa_len F + __libc_start_main F + __libc_valloc F + __longjmp_chk F + __lseek F + __lxstat F + __lxstat64 F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __mcount F + __memalign_hook D 0x4 + __memcpy_chk F + __memmove_chk F + __mempcpy F + __mempcpy_chk F + __mempcpy_small F + __memset_chk F + __monstartup F + __morecore D 0x4 + __nanosleep F + __newlocale F + __nl_langinfo_l F + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hostname_digits_dots F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __obstack_printf_chk F + __obstack_vprintf_chk F + __open F + __open64 F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __overflow F + __pipe F + __poll F + __posix_getopt F + __pread64 F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __ptsname_r_chk F + __pwrite64 F + __rawmemchr F + __rcmd_errstr D 0x4 + __read F + __read_chk F + __readlink_chk F + __readlinkat_chk F + __realloc_hook D 0x4 + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __register_atfork F + __res_init F + __res_nclose F + __res_ninit F + __res_randomid F + __res_state F + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + __sbrk F + __sched_cpualloc F + __sched_cpucount F + __sched_cpufree F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __setmntent F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __signbit F + __signbitf F + __sigpause F + __sigsetjmp F + __sigsuspend F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __statfs F + __stpcpy F + __stpcpy_chk F + __stpcpy_small F + __stpncpy F + __stpncpy_chk F + __strcasecmp F + __strcasecmp_l F + __strcasestr F + __strcat_chk F + __strcoll_l F + __strcpy_chk F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strdup F + __strerror_r F + __strfmon_l F + __strftime_l F + __strncasecmp_l F + __strncat_chk F + __strncpy_chk F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_internal F + __strtod_l F + __strtof_internal F + __strtof_l F + __strtok_r F + __strtok_r_1c F + __strtol_internal F + __strtol_l F + __strtold_internal F + __strtold_l F + __strtoll_internal F + __strtoll_l F + __strtoul_internal F + __strtoul_l F + __strtoull_internal F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __swprintf_chk F + __sysconf F + __syslog_chk F + __sysv_signal F + __timezone D 0x4 + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __ttyname_r_chk F + __tzname D 0x8 + __uflow F + __underflow F + __uselocale F + __vasprintf_chk F + __vdprintf_chk F + __vfork F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wait F + __waitpid F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscasecmp_l F + __wcscat_chk F + __wcscoll_l F + __wcscpy_chk F + __wcsftime_l F + __wcsncasecmp_l F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstod_internal F + __wcstod_l F + __wcstof_internal F + __wcstof_l F + __wcstol_internal F + __wcstol_l F + __wcstold_internal F + __wcstold_l F + __wcstoll_internal F + __wcstoll_l F + __wcstombs_chk F + __wcstoul_internal F + __wcstoul_l F + __wcstoull_internal F + __wcstoull_l F + __wcsxfrm_l F + __wctomb_chk F + __wctrans_l F + __wctype_l F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __woverflow F + __wprintf_chk F + __write F + __wuflow F + __wunderflow F + __xmknod F + __xmknodat F + __xpg_basename F + __xpg_sigpause F + __xpg_strerror_r F + __xstat F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _environ D 0x4 + _exit F + _flush_cache F + _flushlbf F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x200 + _res_hconf D 0x30 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x21c + _sys_nerr D 0x4 + _sys_siglist D 0x104 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + accept4 F + access F + acct F + addmntent F + addseverity F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atof F + atoi F + atol F + atoll F + authdes_create F + authdes_getucred F + authdes_pk_create F + authnone_create F + authunix_create F + authunix_create_default F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + basename F + bcmp F + bcopy F + bdflush F + bind F + bind_textdomain_codeset F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + capget F + capset F + catclose F + catgets F + catopen F + cbc_crypt F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clntunix_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + creat64 F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + dcngettext F + delete_module F + des_setparity F + dgettext F + difftime F + dirfd F + dirname F + div F + dl_iterate_phdr F + dngettext F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dup3 F + duplocale F + dysize F + eaccess F + ecb_crypt F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endsgent F + endspent F + endttyent F + endusershell F + endutent F + endutxent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + epoll_create F + epoll_create1 F + epoll_ctl F + epoll_pwait F + epoll_wait F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + eventfd F + eventfd_read F + eventfd_write F + execl F + execle F + execlp F + execv F + execve F + execvp F + execvpe F + exit F + faccessat F + fallocate F + fallocate64 F + fattach F + fchdir F + fchflags F + fchmod F + fchmodat F + fchown F + fchownat F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdetach F + fdopen F + fdopendir F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + ffsl F + ffsll F + fgetc F + fgetc_unlocked F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpos64 F + fgetpwent F + fgetpwent_r F + fgets F + fgets_unlocked F + fgetsgent F + fgetsgent_r F + fgetspent F + fgetspent_r F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fgetxattr F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flistxattr F + flock F + flockfile F + fmemopen F + fmtmsg F + fnmatch F + fopen F + fopen64 F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread F + fread_unlocked F + free F + freeaddrinfo F + freeifaddrs F + freelocale F + fremovexattr F + freopen F + freopen64 F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fsetxattr F + fstatfs F + fstatfs64 F + fstatvfs F + fstatvfs64 F + fsync F + ftell F + ftello F + ftello64 F + ftime F + ftok F + ftruncate F + ftruncate64 F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + ftw64 F + funlockfile F + futimens F + futimes F + futimesat F + fwide F + fwprintf F + fwrite F + fwrite_unlocked F + fwscanf F + gai_strerror F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcontext F + getcwd F + getdate F + getdate_err D 0x4 + getdate_r F + getdelim F + getdirentries F + getdirentries64 F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgrouplist F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getifaddrs F + getipv4sourcefilter F + getitimer F + getline F + getloadavg F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getmsg F + getnameinfo F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getnetname F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getpmsg F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpt F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrlimit64 F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + getsid F + getsockname F + getsockopt F + getsourcefilter F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getw F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + getwd F + getxattr F + glob F + glob64 F + glob_pattern_p F + globfree F + globfree64 F + gmtime F + gmtime_r F + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + host2netname F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + index F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + inotify_add_watch F + inotify_init F + inotify_init1 F + inotify_rm_watch F + insque F + ioctl F + iruserok F + iruserok_af F + isalnum F + isalnum_l F + isalpha F + isalpha_l F + isascii F + isastream F + isatty F + isblank F + isblank_l F + iscntrl F + iscntrl_l F + isctype F + isdigit F + isdigit_l F + isfdtype F + isgraph F + isgraph_l F + isinf F + isinff F + isinfl F + islower F + islower_l F + isnan F + isnanf F + isnanl F + isprint F + isprint_l F + ispunct F + ispunct_l F + isspace F + isspace_l F + isupper F + isupper_l F + iswalnum F + iswalnum_l F + iswalpha F + iswalpha_l F + iswblank F + iswblank_l F + iswcntrl F + iswcntrl_l F + iswctype F + iswctype_l F + iswdigit F + iswdigit_l F + iswgraph F + iswgraph_l F + iswlower F + iswlower_l F + iswprint F + iswprint_l F + iswpunct F + iswpunct_l F + iswspace F + iswspace_l F + iswupper F + iswupper_l F + iswxdigit F + iswxdigit_l F + isxdigit F + isxdigit_l F + jrand48 F + jrand48_r F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + kill F + killpg F + klogctl F + l64a F + labs F + lchmod F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + lgetxattr F + link F + linkat F + listen F + listxattr F + llabs F + lldiv F + llistxattr F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + lockf64 F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lremovexattr F + lsearch F + lseek F + lseek64 F + lsetxattr F + lutimes F + madvise F + makecontext F + mallinfo F + malloc F + malloc_get_state F + malloc_info F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcheck_check_all F + mcheck_pedantic F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + mempcpy F + memrchr F + memset F + mincore F + mkdir F + mkdirat F + mkdtemp F + mkfifo F + mkfifoat F + mkostemp F + mkostemp64 F + mkostemps F + mkostemps64 F + mkstemp F + mkstemp64 F + mkstemps F + mkstemps64 F + mktemp F + mktime F + mlock F + mlockall F + mmap F + mmap64 F + modf F + modff F + modfl F + moncontrol F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + netname2host F + netname2user F + newlocale F + nfsservctl F + nftw F + nftw64 F + ngettext F + nice F + nl_langinfo F + nl_langinfo_l F + nrand48 F + nrand48_r F + ntohl F + ntohs F + ntp_adjtime F + ntp_gettime F + ntp_gettimex F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open64 F + open_memstream F + open_wmemstream F + openat F + openat64 F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + passwd2des F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pipe2 F + pivot_root F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_openpt F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + ppoll F + prctl F + pread F + pread64 F + preadv F + preadv64 F + printf F + printf_size F + printf_size_info F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psiginfo F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + ptsname F + ptsname_r F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putgrent F + putmsg F + putpmsg F + putpwent F + puts F + putsgent F + putspent F + pututline F + pututxline F + putw F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pvalloc F + pwrite F + pwrite64 F + pwritev F + pwritev64 F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + qsort_r F + query_module F + quick_exit F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rawmemchr F + rcmd F + rcmd_af F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readahead F + readdir F + readdir64 F + readdir64_r F + readdir_r F + readlink F + readlinkat F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmmsg F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + registerrpc F + remap_file_pages F + remove F + removexattr F + remque F + rename F + renameat F + revoke F + rewind F + rewinddir F + rexec F + rexec_af F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + rresvport_af F + rtime F + ruserok F + ruserok_af F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scandir64 F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getaffinity F + sched_getcpu F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setaffinity F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + semtimedop F + send F + sendfile F + sendfile64 F + sendmsg F + sendto F + set_dataplane F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setipv4sourcefilter F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrlimit64 F + setrpcent F + setservent F + setsgent F + setsid F + setsockopt F + setsourcefilter F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setutxent F + setvbuf F + setxattr F + sgetsgent F + sgetsgent_r F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + sighold F + sigignore F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + signalfd F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigqueue F + sigrelse F + sigreturn F + sigset F + sigsetmask F + sigstack F + sigsuspend F + sigtimedwait F + sigvec F + sigwait F + sigwaitinfo F + sleep F + snprintf F + sockatmark F + socket F + socketpair F + splice F + sprintf F + sprofil F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + statfs64 F + statvfs F + statvfs64 F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcasecmp_l F + strcasestr F + strcat F + strchr F + strchrnul F + strcmp F + strcoll F + strcoll_l F + strcpy F + strcspn F + strdup F + strerror F + strerror_l F + strerror_r F + strfmon F + strfmon_l F + strfry F + strftime F + strftime_l F + strlen F + strncasecmp F + strncasecmp_l F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strptime_l F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtod_l F + strtof F + strtof_l F + strtoimax F + strtok F + strtok_r F + strtol F + strtol_l F + strtold F + strtold_l F + strtoll F + strtoll_l F + strtoq F + strtoul F + strtoul_l F + strtoull F + strtoull_l F + strtoumax F + strtouq F + strverscmp F + strxfrm F + strxfrm_l F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreq_common F + svc_getreq_poll F + svc_getreqset F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + svcunix_create F + svcunixfd_create F + swab F + swapcontext F + swapoff F + swapon F + swprintf F + swscanf F + symlink F + symlinkat F + sync F + sync_file_range F + sys_errlist D 0x21c + sys_nerr D 0x4 + sys_sigabbrev D 0x104 + sys_siglist D 0x104 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + sysv_signal F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcgetsid F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + tdestroy F + tee F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + timerfd_create F + timerfd_gettime F + timerfd_settime F + times F + timezone D 0x4 + tmpfile F + tmpfile64 F + tmpnam F + tmpnam_r F + toascii F + tolower F + tolower_l F + toupper F + toupper_l F + towctrans F + towctrans_l F + towlower F + towlower_l F + towupper F + towupper_l F + tr_break F + truncate F + truncate64 F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + umount2 F + uname F + ungetc F + ungetwc F + unlink F + unlinkat F + unlockpt F + unsetenv F + unshare F + updwtmp F + updwtmpx F + uselib F + uselocale F + user2netname F + usleep F + ustat F + utime F + utimensat F + utimes F + utmpname F + utmpxname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + versionsort F + versionsort64 F + vfork F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vhangup F + vlimit F + vmsplice F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + vwprintf F + vwscanf F + wait F + wait3 F + wait4 F + waitid F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscasecmp F + wcscasecmp_l F + wcscat F + wcschr F + wcschrnul F + wcscmp F + wcscoll F + wcscoll_l F + wcscpy F + wcscspn F + wcsdup F + wcsftime F + wcsftime_l F + wcslen F + wcsncasecmp F + wcsncasecmp_l F + wcsncat F + wcsncmp F + wcsncpy F + wcsnlen F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstod_l F + wcstof F + wcstof_l F + wcstoimax F + wcstok F + wcstol F + wcstol_l F + wcstold F + wcstold_l F + wcstoll F + wcstoll_l F + wcstombs F + wcstoq F + wcstoul F + wcstoul_l F + wcstoull F + wcstoull_l F + wcstoumax F + wcstouq F + wcswcs F + wcswidth F + wcsxfrm F + wcsxfrm_l F + wctob F + wctomb F + wctrans F + wctrans_l F + wctype F + wctype_l F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmempcpy F + wmemset F + wordexp F + wordfree F + wprintf F + write F + writev F + wscanf F + xdecrypt F + xdr_accepted_reply F + xdr_array F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_getcredres F + xdr_hyper F + xdr_int F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_longlong_t F + xdr_netnamestr F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_quad_t F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_sizeof F + xdr_string F + xdr_u_char F + xdr_u_hyper F + xdr_u_int F + xdr_u_long F + xdr_u_longlong_t F + xdr_u_quad_t F + xdr_u_short F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_union F + xdr_unixcred F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + clock_adjtime F + fanotify_init F + fanotify_mark F + name_to_handle_at F + open_by_handle_at F + posix_spawn F + posix_spawnp F + prlimit F + prlimit64 F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F + sendmmsg F + setns F + syncfs F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libcrypt.abilist new file mode 100644 index 0000000000..608e5df0b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.12 + GLIBC_2.12 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libdl.abilist new file mode 100644 index 0000000000..27a72281b7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libdl.abilist @@ -0,0 +1,11 @@ +GLIBC_2.12 + GLIBC_2.12 A + dladdr F + dladdr1 F + dlclose F + dlerror F + dlinfo F + dlmopen F + dlopen F + dlsym F + dlvsym F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libm.abilist new file mode 100644 index 0000000000..601b505ead --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libm.abilist @@ -0,0 +1,369 @@ +GLIBC_2.12 + GLIBC_2.12 A + _LIB_VERSION D 0x4 + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + cbrt F + cbrtf F + cbrtl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + ceil F + ceilf F + ceill F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + log2 F + log2f F + log2l F + logb F + logbf F + logbl F + logf F + logl F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + matherr F + modf F + modff F + modfl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nextafter F + nextafterf F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow F + pow10 F + pow10f F + pow10l F + powf F + powl F + remainder F + remainderf F + remainderl F + remquo F + remquof F + remquol F + rint F + rintf F + rintl F + round F + roundf F + roundl F + scalb F + scalbf F + scalbl F + scalbln F + scalblnf F + scalblnl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sincos F + sincosf F + sincosl F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __asin_finite F + __asinf_finite F + __atan2_finite F + __atan2f_finite F + __atanh_finite F + __atanhf_finite F + __cosh_finite F + __coshf_finite F + __exp10_finite F + __exp10f_finite F + __exp2_finite F + __exp2f_finite F + __exp_finite F + __expf_finite F + __fmod_finite F + __fmodf_finite F + __gamma_r_finite F + __gammaf_r_finite F + __hypot_finite F + __hypotf_finite F + __j0_finite F + __j0f_finite F + __j1_finite F + __j1f_finite F + __jn_finite F + __jnf_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __log10_finite F + __log10f_finite F + __log2_finite F + __log2f_finite F + __log_finite F + __logf_finite F + __pow_finite F + __powf_finite F + __remainder_finite F + __remainderf_finite F + __scalb_finite F + __scalbf_finite F + __sinh_finite F + __sinhf_finite F + __sqrt_finite F + __sqrtf_finite F + __y0_finite F + __y0f_finite F + __y1_finite F + __y1f_finite F + __yn_finite F + __ynf_finite F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libnsl.abilist new file mode 100644 index 0000000000..e4217934c8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libnsl.abilist @@ -0,0 +1,123 @@ +GLIBC_2.12 + GLIBC_2.12 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + __yp_check F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_obj_p F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypall F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist new file mode 100644 index 0000000000..3ab004605a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist @@ -0,0 +1,225 @@ +GLIBC_2.12 + GLIBC_2.12 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __lseek F + __nanosleep F + __open F + __open64 F + __pread64 F + __pthread_cleanup_routine F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pthread_setspecific F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + __pwrite64 F + __read F + __res_state F + __send F + __sigaction F + __vfork F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + lseek64 F + msync F + nanosleep F + open F + open64 F + pause F + pread F + pread64 F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getaffinity_np F + pthread_attr_getdetachstate F + pthread_attr_getguardsize F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setaffinity_np F + pthread_attr_setdetachstate F + pthread_attr_setguardsize F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_getpshared F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_getclock F + pthread_condattr_getpshared F + pthread_condattr_init F + pthread_condattr_setclock F + pthread_condattr_setpshared F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getaffinity_np F + pthread_getattr_np F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_getname_np F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_consistent F + pthread_mutex_consistent_np F + pthread_mutex_destroy F + pthread_mutex_getprioceiling F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_setprioceiling F + pthread_mutex_timedlock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getpshared F + pthread_mutexattr_getrobust F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_gettype F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setpshared F + pthread_mutexattr_setrobust F + pthread_mutexattr_setrobust_np F + pthread_mutexattr_settype F + pthread_once F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_self F + pthread_setaffinity_np F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setconcurrency F + pthread_setname_np F + pthread_setschedparam F + pthread_setschedprio F + pthread_setspecific F + pthread_sigmask F + pthread_sigqueue F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_testcancel F + pthread_timedjoin_np F + pthread_tryjoin_np F + pthread_yield F + pwrite F + pwrite64 F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libresolv.abilist new file mode 100644 index 0000000000..64826160a1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libresolv.abilist @@ -0,0 +1,93 @@ +GLIBC_2.12 + GLIBC_2.12 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_expand F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_rcode F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_hostalias F + __res_isourserver F + __res_mailok F + __res_mkquery F + __res_nameinquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_ownok F + __res_queriesmatch F + __res_query F + __res_querydomain F + __res_search F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + inet_net_ntop F + inet_net_pton F + inet_neta F + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_send_setqhook F + res_send_setrhook F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/librt.abilist new file mode 100644 index 0000000000..87fec065af --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/librt.abilist @@ -0,0 +1,42 @@ +GLIBC_2.12 + GLIBC_2.12 A + __mq_open_2 F + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libthread_db.abilist new file mode 100644 index 0000000000..934ce9acd6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libthread_db.abilist @@ -0,0 +1,42 @@ +GLIBC_2.12 + GLIBC_2.12 A + td_init F + td_log F + td_symbol_list F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tls_get_addr F + td_thr_tlsbase F + td_thr_tsd F + td_thr_validate F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libutil.abilist new file mode 100644 index 0000000000..50c312a7c6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.12 + GLIBC_2.12 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies new file mode 100644 index 0000000000..e4e0800c0a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Implies @@ -0,0 +1,4 @@ +unix/sysv/linux/tile/tilegx +unix/sysv/linux/tile +unix/sysv/linux/generic +unix/sysv/linux/wordsize-64 diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile new file mode 100644 index 0000000000..c8991d31e4 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Makefile @@ -0,0 +1 @@ +default-abi := 64 diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/ld.abilist new file mode 100644 index 0000000000..f914e4b82d --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/ld.abilist @@ -0,0 +1,11 @@ +GLIBC_2.12 + GLIBC_2.12 A + __libc_memalign F + __libc_stack_end D 0x8 + __tls_get_addr F + _dl_mcount F + _r_debug D 0x28 + calloc F + free F + malloc F + realloc F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..4af9128544 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.12 + GLIBC_2.12 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libanl.abilist new file mode 100644 index 0000000000..29e602a75a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.12 + GLIBC_2.12 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist new file mode 100644 index 0000000000..2dbce23ec9 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist @@ -0,0 +1,2082 @@ +GLIBC_2.12 + GLIBC_2.12 A + _Exit F + _IO_2_1_stderr_ D 0xe0 + _IO_2_1_stdin_ D 0xe0 + _IO_2_1_stdout_ D 0xe0 + _IO_adjust_column F + _IO_adjust_wcolumn F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0xa8 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_getline_info F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_link_in F + _IO_list_all D 0x8 + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_seekwmark F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sputbackwc F + _IO_sscanf F + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_sungetwc F + _IO_switch_to_get_mode F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_unsave_wmarkers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0xa8 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + ___brk_addr D 0x8 + __adjtimex F + __after_morecore_hook D 0x8 + __argz_count F + __argz_next F + __argz_stringify F + __asprintf F + __asprintf_chk F + __assert F + __assert_fail F + __assert_perror_fail F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __chk_fail F + __clone F + __close F + __cmsg_nxthdr F + __confstr_chk F + __connect F + __ctype_b_loc F + __ctype_get_mb_cur_max F + __ctype_tolower_loc F + __ctype_toupper_loc F + __curbrk D 0x8 + __cxa_at_quick_exit F + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __daylight D 0x4 + __dcgettext F + __default_morecore F + __dgettext F + __dprintf_chk F + __dup2 F + __duplocale F + __endmntent F + __environ D 0x8 + __errno_location F + __fbufsize F + __fcntl F + __ffs F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finite F + __finitef F + __flbf F + __fork F + __fpending F + __fprintf_chk F + __fpu_control D 0x4 + __fpurge F + __fread_chk F + __fread_unlocked_chk F + __freadable F + __freading F + __free_hook D 0x8 + __freelocale F + __fsetlocking F + __fwprintf_chk F + __fwritable F + __fwriting F + __fxstat F + __fxstat64 F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdelim F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getmntent_r F + __getpagesize F + __getpgid F + __getpid F + __gets_chk F + __gettimeofday F + __getwd_chk F + __gmtime_r F + __h_errno_location F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isctype F + __isdigit_l F + __isgraph_l F + __isinf F + __isinff F + __islower_l F + __isnan F + __isnanf F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __ivaliduser F + __key_decryptsession_pk_LOCAL D 0x8 + __key_encryptsession_pk_LOCAL D 0x8 + __key_gendes_LOCAL D 0x8 + __libc_allocate_rtsig F + __libc_calloc F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_free F + __libc_freeres F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_sa_len F + __libc_start_main F + __libc_valloc F + __longjmp_chk F + __lseek F + __lxstat F + __lxstat64 F + __malloc_hook D 0x8 + __malloc_initialize_hook D 0x8 + __mbrlen F + __mbrtowc F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __mcount F + __memalign_hook D 0x8 + __memcpy_chk F + __memmove_chk F + __mempcpy F + __mempcpy_chk F + __mempcpy_small F + __memset_chk F + __monstartup F + __morecore D 0x8 + __nanosleep F + __newlocale F + __nl_langinfo_l F + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hostname_digits_dots F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __obstack_printf_chk F + __obstack_vprintf_chk F + __open F + __open64 F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __overflow F + __pipe F + __poll F + __posix_getopt F + __pread64 F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __profile_frequency F + __progname D 0x8 + __progname_full D 0x8 + __ptsname_r_chk F + __pwrite64 F + __rawmemchr F + __rcmd_errstr D 0x8 + __read F + __read_chk F + __readlink_chk F + __readlinkat_chk F + __realloc_hook D 0x8 + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __register_atfork F + __res_init F + __res_nclose F + __res_ninit F + __res_randomid F + __res_state F + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + __sbrk F + __sched_cpualloc F + __sched_cpucount F + __sched_cpufree F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __setmntent F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __signbit F + __signbitf F + __sigpause F + __sigsetjmp F + __sigsuspend F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __statfs F + __stpcpy F + __stpcpy_chk F + __stpcpy_small F + __stpncpy F + __stpncpy_chk F + __strcasecmp F + __strcasecmp_l F + __strcasestr F + __strcat_chk F + __strcoll_l F + __strcpy_chk F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strdup F + __strerror_r F + __strfmon_l F + __strftime_l F + __strncasecmp_l F + __strncat_chk F + __strncpy_chk F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_internal F + __strtod_l F + __strtof_internal F + __strtof_l F + __strtok_r F + __strtok_r_1c F + __strtol_internal F + __strtol_l F + __strtold_internal F + __strtold_l F + __strtoll_internal F + __strtoll_l F + __strtoul_internal F + __strtoul_l F + __strtoull_internal F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __swprintf_chk F + __sysconf F + __syslog_chk F + __sysv_signal F + __timezone D 0x8 + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __ttyname_r_chk F + __tzname D 0x10 + __uflow F + __underflow F + __uselocale F + __vasprintf_chk F + __vdprintf_chk F + __vfork F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wait F + __waitpid F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscasecmp_l F + __wcscat_chk F + __wcscoll_l F + __wcscpy_chk F + __wcsftime_l F + __wcsncasecmp_l F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstod_internal F + __wcstod_l F + __wcstof_internal F + __wcstof_l F + __wcstol_internal F + __wcstol_l F + __wcstold_internal F + __wcstold_l F + __wcstoll_internal F + __wcstoll_l F + __wcstombs_chk F + __wcstoul_internal F + __wcstoul_l F + __wcstoull_internal F + __wcstoull_l F + __wcsxfrm_l F + __wctomb_chk F + __wctrans_l F + __wctype_l F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __woverflow F + __wprintf_chk F + __write F + __wuflow F + __wunderflow F + __xmknod F + __xmknodat F + __xpg_basename F + __xpg_sigpause F + __xpg_strerror_r F + __xstat F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _environ D 0x8 + _exit F + _flush_cache F + _flushlbf F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x8 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0x18 + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x238 + _res_hconf D 0x48 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x438 + _sys_nerr D 0x4 + _sys_siglist D 0x208 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + accept4 F + access F + acct F + addmntent F + addseverity F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x8 + argp_program_version D 0x8 + argp_program_version_hook D 0x8 + argp_state_help F + argp_usage F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atof F + atoi F + atol F + atoll F + authdes_create F + authdes_getucred F + authdes_pk_create F + authnone_create F + authunix_create F + authunix_create_default F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + basename F + bcmp F + bcopy F + bdflush F + bind F + bind_textdomain_codeset F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + capget F + capset F + catclose F + catgets F + catopen F + cbc_crypt F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clntunix_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + creat64 F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + dcngettext F + delete_module F + des_setparity F + dgettext F + difftime F + dirfd F + dirname F + div F + dl_iterate_phdr F + dngettext F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dup3 F + duplocale F + dysize F + eaccess F + ecb_crypt F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endsgent F + endspent F + endttyent F + endusershell F + endutent F + endutxent F + environ D 0x8 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + epoll_create F + epoll_create1 F + epoll_ctl F + epoll_pwait F + epoll_wait F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x8 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + eventfd F + eventfd_read F + eventfd_write F + execl F + execle F + execlp F + execv F + execve F + execvp F + execvpe F + exit F + faccessat F + fallocate F + fallocate64 F + fattach F + fchdir F + fchflags F + fchmod F + fchmodat F + fchown F + fchownat F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdetach F + fdopen F + fdopendir F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + ffsl F + ffsll F + fgetc F + fgetc_unlocked F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpos64 F + fgetpwent F + fgetpwent_r F + fgets F + fgets_unlocked F + fgetsgent F + fgetsgent_r F + fgetspent F + fgetspent_r F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fgetxattr F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flistxattr F + flock F + flockfile F + fmemopen F + fmtmsg F + fnmatch F + fopen F + fopen64 F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread F + fread_unlocked F + free F + freeaddrinfo F + freeifaddrs F + freelocale F + fremovexattr F + freopen F + freopen64 F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fsetxattr F + fstatfs F + fstatfs64 F + fstatvfs F + fstatvfs64 F + fsync F + ftell F + ftello F + ftello64 F + ftime F + ftok F + ftruncate F + ftruncate64 F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + ftw64 F + funlockfile F + futimens F + futimes F + futimesat F + fwide F + fwprintf F + fwrite F + fwrite_unlocked F + fwscanf F + gai_strerror F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcontext F + getcwd F + getdate F + getdate_err D 0x4 + getdate_r F + getdelim F + getdirentries F + getdirentries64 F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgrouplist F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getifaddrs F + getipv4sourcefilter F + getitimer F + getline F + getloadavg F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getmsg F + getnameinfo F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getnetname F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getpmsg F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpt F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrlimit64 F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + getsid F + getsockname F + getsockopt F + getsourcefilter F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getw F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + getwd F + getxattr F + glob F + glob64 F + glob_pattern_p F + globfree F + globfree64 F + gmtime F + gmtime_r F + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + group_member F + gsignal F + gtty F + h_errlist D 0x28 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + host2netname F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + index F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + inotify_add_watch F + inotify_init F + inotify_init1 F + inotify_rm_watch F + insque F + ioctl F + iruserok F + iruserok_af F + isalnum F + isalnum_l F + isalpha F + isalpha_l F + isascii F + isastream F + isatty F + isblank F + isblank_l F + iscntrl F + iscntrl_l F + isctype F + isdigit F + isdigit_l F + isfdtype F + isgraph F + isgraph_l F + isinf F + isinff F + isinfl F + islower F + islower_l F + isnan F + isnanf F + isnanl F + isprint F + isprint_l F + ispunct F + ispunct_l F + isspace F + isspace_l F + isupper F + isupper_l F + iswalnum F + iswalnum_l F + iswalpha F + iswalpha_l F + iswblank F + iswblank_l F + iswcntrl F + iswcntrl_l F + iswctype F + iswctype_l F + iswdigit F + iswdigit_l F + iswgraph F + iswgraph_l F + iswlower F + iswlower_l F + iswprint F + iswprint_l F + iswpunct F + iswpunct_l F + iswspace F + iswspace_l F + iswupper F + iswupper_l F + iswxdigit F + iswxdigit_l F + isxdigit F + isxdigit_l F + jrand48 F + jrand48_r F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + kill F + killpg F + klogctl F + l64a F + labs F + lchmod F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + lgetxattr F + link F + linkat F + listen F + listxattr F + llabs F + lldiv F + llistxattr F + llseek F + loc1 D 0x8 + loc2 D 0x8 + localeconv F + localtime F + localtime_r F + lockf F + lockf64 F + locs D 0x8 + longjmp F + lrand48 F + lrand48_r F + lremovexattr F + lsearch F + lseek F + lseek64 F + lsetxattr F + lutimes F + madvise F + makecontext F + mallinfo F + malloc F + malloc_get_state F + malloc_info F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x8 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcheck_check_all F + mcheck_pedantic F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + mempcpy F + memrchr F + memset F + mincore F + mkdir F + mkdirat F + mkdtemp F + mkfifo F + mkfifoat F + mkostemp F + mkostemp64 F + mkostemps F + mkostemps64 F + mkstemp F + mkstemp64 F + mkstemps F + mkstemps64 F + mktemp F + mktime F + mlock F + mlockall F + mmap F + mmap64 F + modf F + modff F + modfl F + moncontrol F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + netname2host F + netname2user F + newlocale F + nfsservctl F + nftw F + nftw64 F + ngettext F + nice F + nl_langinfo F + nl_langinfo_l F + nrand48 F + nrand48_r F + ntohl F + ntohs F + ntp_adjtime F + ntp_gettime F + ntp_gettimex F + obstack_alloc_failed_handler D 0x8 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open64 F + open_memstream F + open_wmemstream F + openat F + openat64 F + opendir F + openlog F + optarg D 0x8 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + passwd2des F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pipe2 F + pivot_root F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_openpt F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + ppoll F + prctl F + pread F + pread64 F + preadv F + preadv64 F + printf F + printf_size F + printf_size_info F + profil F + program_invocation_name D 0x8 + program_invocation_short_name D 0x8 + pselect F + psiginfo F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + ptsname F + ptsname_r F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putgrent F + putmsg F + putpmsg F + putpwent F + puts F + putsgent F + putspent F + pututline F + pututxline F + putw F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pvalloc F + pwrite F + pwrite64 F + pwritev F + pwritev64 F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + qsort_r F + query_module F + quick_exit F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rawmemchr F + rcmd F + rcmd_af F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x8 + read F + readahead F + readdir F + readdir64 F + readdir64_r F + readdir_r F + readlink F + readlinkat F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmmsg F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + registerrpc F + remap_file_pages F + remove F + removexattr F + remque F + rename F + renameat F + revoke F + rewind F + rewinddir F + rexec F + rexec_af F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x20 + rpmatch F + rresvport F + rresvport_af F + rtime F + ruserok F + ruserok_af F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scandir64 F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getaffinity F + sched_getcpu F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setaffinity F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + semtimedop F + send F + sendfile F + sendfile64 F + sendmsg F + sendto F + set_dataplane F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setipv4sourcefilter F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrlimit64 F + setrpcent F + setservent F + setsgent F + setsid F + setsockopt F + setsourcefilter F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setutxent F + setvbuf F + setxattr F + sgetsgent F + sgetsgent_r F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + sighold F + sigignore F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + signalfd F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigqueue F + sigrelse F + sigreturn F + sigset F + sigsetmask F + sigstack F + sigsuspend F + sigtimedwait F + sigvec F + sigwait F + sigwaitinfo F + sleep F + snprintf F + sockatmark F + socket F + socketpair F + splice F + sprintf F + sprofil F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + statfs64 F + statvfs F + statvfs64 F + stderr D 0x8 + stdin D 0x8 + stdout D 0x8 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcasecmp_l F + strcasestr F + strcat F + strchr F + strchrnul F + strcmp F + strcoll F + strcoll_l F + strcpy F + strcspn F + strdup F + strerror F + strerror_l F + strerror_r F + strfmon F + strfmon_l F + strfry F + strftime F + strftime_l F + strlen F + strncasecmp F + strncasecmp_l F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strptime_l F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtod_l F + strtof F + strtof_l F + strtoimax F + strtok F + strtok_r F + strtol F + strtol_l F + strtold F + strtold_l F + strtoll F + strtoll_l F + strtoq F + strtoul F + strtoul_l F + strtoull F + strtoull_l F + strtoumax F + strtouq F + strverscmp F + strxfrm F + strxfrm_l F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreq_common F + svc_getreq_poll F + svc_getreqset F + svc_max_pollfd D 0x4 + svc_pollfd D 0x8 + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0x18 + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + svcunix_create F + svcunixfd_create F + swab F + swapcontext F + swapoff F + swapon F + swprintf F + swscanf F + symlink F + symlinkat F + sync F + sync_file_range F + sys_errlist D 0x438 + sys_nerr D 0x4 + sys_sigabbrev D 0x208 + sys_siglist D 0x208 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + sysv_signal F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcgetsid F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + tdestroy F + tee F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + timerfd_create F + timerfd_gettime F + timerfd_settime F + times F + timezone D 0x8 + tmpfile F + tmpfile64 F + tmpnam F + tmpnam_r F + toascii F + tolower F + tolower_l F + toupper F + toupper_l F + towctrans F + towctrans_l F + towlower F + towlower_l F + towupper F + towupper_l F + tr_break F + truncate F + truncate64 F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x10 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + umount2 F + uname F + ungetc F + ungetwc F + unlink F + unlinkat F + unlockpt F + unsetenv F + unshare F + updwtmp F + updwtmpx F + uselib F + uselocale F + user2netname F + usleep F + ustat F + utime F + utimensat F + utimes F + utmpname F + utmpxname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + versionsort F + versionsort64 F + vfork F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vhangup F + vlimit F + vmsplice F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + vwprintf F + vwscanf F + wait F + wait3 F + wait4 F + waitid F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscasecmp F + wcscasecmp_l F + wcscat F + wcschr F + wcschrnul F + wcscmp F + wcscoll F + wcscoll_l F + wcscpy F + wcscspn F + wcsdup F + wcsftime F + wcsftime_l F + wcslen F + wcsncasecmp F + wcsncasecmp_l F + wcsncat F + wcsncmp F + wcsncpy F + wcsnlen F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstod_l F + wcstof F + wcstof_l F + wcstoimax F + wcstok F + wcstol F + wcstol_l F + wcstold F + wcstold_l F + wcstoll F + wcstoll_l F + wcstombs F + wcstoq F + wcstoul F + wcstoul_l F + wcstoull F + wcstoull_l F + wcstoumax F + wcstouq F + wcswcs F + wcswidth F + wcsxfrm F + wcsxfrm_l F + wctob F + wctomb F + wctrans F + wctrans_l F + wctype F + wctype_l F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmempcpy F + wmemset F + wordexp F + wordfree F + wprintf F + write F + writev F + wscanf F + xdecrypt F + xdr_accepted_reply F + xdr_array F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_getcredres F + xdr_hyper F + xdr_int F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_longlong_t F + xdr_netnamestr F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_quad_t F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_sizeof F + xdr_string F + xdr_u_char F + xdr_u_hyper F + xdr_u_int F + xdr_u_long F + xdr_u_longlong_t F + xdr_u_quad_t F + xdr_u_short F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_union F + xdr_unixcred F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + clock_adjtime F + fanotify_init F + fanotify_mark F + name_to_handle_at F + open_by_handle_at F + posix_spawn F + posix_spawnp F + prlimit F + prlimit64 F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F + sendmmsg F + setns F + syncfs F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libcrypt.abilist new file mode 100644 index 0000000000..608e5df0b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.12 + GLIBC_2.12 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libdl.abilist new file mode 100644 index 0000000000..27a72281b7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libdl.abilist @@ -0,0 +1,11 @@ +GLIBC_2.12 + GLIBC_2.12 A + dladdr F + dladdr1 F + dlclose F + dlerror F + dlinfo F + dlmopen F + dlopen F + dlsym F + dlvsym F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libm.abilist new file mode 100644 index 0000000000..601b505ead --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libm.abilist @@ -0,0 +1,369 @@ +GLIBC_2.12 + GLIBC_2.12 A + _LIB_VERSION D 0x4 + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + cbrt F + cbrtf F + cbrtl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + ceil F + ceilf F + ceill F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + log2 F + log2f F + log2l F + logb F + logbf F + logbl F + logf F + logl F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + matherr F + modf F + modff F + modfl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nextafter F + nextafterf F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow F + pow10 F + pow10f F + pow10l F + powf F + powl F + remainder F + remainderf F + remainderl F + remquo F + remquof F + remquol F + rint F + rintf F + rintl F + round F + roundf F + roundl F + scalb F + scalbf F + scalbl F + scalbln F + scalblnf F + scalblnl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sincos F + sincosf F + sincosl F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __asin_finite F + __asinf_finite F + __atan2_finite F + __atan2f_finite F + __atanh_finite F + __atanhf_finite F + __cosh_finite F + __coshf_finite F + __exp10_finite F + __exp10f_finite F + __exp2_finite F + __exp2f_finite F + __exp_finite F + __expf_finite F + __fmod_finite F + __fmodf_finite F + __gamma_r_finite F + __gammaf_r_finite F + __hypot_finite F + __hypotf_finite F + __j0_finite F + __j0f_finite F + __j1_finite F + __j1f_finite F + __jn_finite F + __jnf_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __log10_finite F + __log10f_finite F + __log2_finite F + __log2f_finite F + __log_finite F + __logf_finite F + __pow_finite F + __powf_finite F + __remainder_finite F + __remainderf_finite F + __scalb_finite F + __scalbf_finite F + __sinh_finite F + __sinhf_finite F + __sqrt_finite F + __sqrtf_finite F + __y0_finite F + __y0f_finite F + __y1_finite F + __y1f_finite F + __yn_finite F + __ynf_finite F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libnsl.abilist new file mode 100644 index 0000000000..e4217934c8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libnsl.abilist @@ -0,0 +1,123 @@ +GLIBC_2.12 + GLIBC_2.12 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + __yp_check F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_obj_p F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypall F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist new file mode 100644 index 0000000000..3ab004605a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist @@ -0,0 +1,225 @@ +GLIBC_2.12 + GLIBC_2.12 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __lseek F + __nanosleep F + __open F + __open64 F + __pread64 F + __pthread_cleanup_routine F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pthread_setspecific F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + __pwrite64 F + __read F + __res_state F + __send F + __sigaction F + __vfork F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + lseek64 F + msync F + nanosleep F + open F + open64 F + pause F + pread F + pread64 F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getaffinity_np F + pthread_attr_getdetachstate F + pthread_attr_getguardsize F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setaffinity_np F + pthread_attr_setdetachstate F + pthread_attr_setguardsize F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_getpshared F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_getclock F + pthread_condattr_getpshared F + pthread_condattr_init F + pthread_condattr_setclock F + pthread_condattr_setpshared F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getaffinity_np F + pthread_getattr_np F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_getname_np F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_consistent F + pthread_mutex_consistent_np F + pthread_mutex_destroy F + pthread_mutex_getprioceiling F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_setprioceiling F + pthread_mutex_timedlock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getpshared F + pthread_mutexattr_getrobust F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_gettype F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setpshared F + pthread_mutexattr_setrobust F + pthread_mutexattr_setrobust_np F + pthread_mutexattr_settype F + pthread_once F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_self F + pthread_setaffinity_np F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setconcurrency F + pthread_setname_np F + pthread_setschedparam F + pthread_setschedprio F + pthread_setspecific F + pthread_sigmask F + pthread_sigqueue F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_testcancel F + pthread_timedjoin_np F + pthread_tryjoin_np F + pthread_yield F + pwrite F + pwrite64 F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libresolv.abilist new file mode 100644 index 0000000000..dcb82acc01 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libresolv.abilist @@ -0,0 +1,93 @@ +GLIBC_2.12 + GLIBC_2.12 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_expand F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0xa8 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_rcode F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x450 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_hostalias F + __res_isourserver F + __res_mailok F + __res_mkquery F + __res_nameinquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_ownok F + __res_queriesmatch F + __res_query F + __res_querydomain F + __res_search F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x80 + _sethtent F + inet_net_ntop F + inet_net_pton F + inet_neta F + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_send_setqhook F + res_send_setrhook F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/librt.abilist new file mode 100644 index 0000000000..87fec065af --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/librt.abilist @@ -0,0 +1,42 @@ +GLIBC_2.12 + GLIBC_2.12 A + __mq_open_2 F + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libthread_db.abilist new file mode 100644 index 0000000000..934ce9acd6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libthread_db.abilist @@ -0,0 +1,42 @@ +GLIBC_2.12 + GLIBC_2.12 A + td_init F + td_log F + td_symbol_list F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tls_get_addr F + td_thr_tlsbase F + td_thr_tsd F + td_thr_validate F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libutil.abilist new file mode 100644 index 0000000000..50c312a7c6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.12 + GLIBC_2.12 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/Implies b/ports/sysdeps/unix/sysv/linux/tile/tilepro/Implies new file mode 100644 index 0000000000..0023bb77aa --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/Implies @@ -0,0 +1,3 @@ +unix/sysv/linux/tile +unix/sysv/linux/generic/wordsize-32 +unix/sysv/linux/generic diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h b/ports/sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h new file mode 100644 index 0000000000..eebd715bdb --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/ldconfig.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdeps/generic/ldconfig.h> + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib/ld.so.1", FLAG_ELF_LIBC6 }, +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/ld.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/ld.abilist new file mode 100644 index 0000000000..4367346594 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/ld.abilist @@ -0,0 +1,11 @@ +GLIBC_2.12 + GLIBC_2.12 A + __libc_memalign F + __libc_stack_end D 0x4 + __tls_get_addr F + _dl_mcount F + _r_debug D 0x14 + calloc F + free F + malloc F + realloc F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libBrokenLocale.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libBrokenLocale.abilist new file mode 100644 index 0000000000..4af9128544 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libBrokenLocale.abilist @@ -0,0 +1,3 @@ +GLIBC_2.12 + GLIBC_2.12 A + __ctype_get_mb_cur_max F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libanl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libanl.abilist new file mode 100644 index 0000000000..29e602a75a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libanl.abilist @@ -0,0 +1,6 @@ +GLIBC_2.12 + GLIBC_2.12 A + gai_cancel F + gai_error F + gai_suspend F + getaddrinfo_a F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist new file mode 100644 index 0000000000..eed3b4937f --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist @@ -0,0 +1,2082 @@ +GLIBC_2.12 + GLIBC_2.12 A + _Exit F + _IO_2_1_stderr_ D 0xa0 + _IO_2_1_stdin_ D 0xa0 + _IO_2_1_stdout_ D 0xa0 + _IO_adjust_column F + _IO_adjust_wcolumn F + _IO_default_doallocate F + _IO_default_finish F + _IO_default_pbackfail F + _IO_default_uflow F + _IO_default_xsgetn F + _IO_default_xsputn F + _IO_do_write F + _IO_doallocbuf F + _IO_fclose F + _IO_fdopen F + _IO_feof F + _IO_ferror F + _IO_fflush F + _IO_fgetpos F + _IO_fgetpos64 F + _IO_fgets F + _IO_file_attach F + _IO_file_close F + _IO_file_close_it F + _IO_file_doallocate F + _IO_file_finish F + _IO_file_fopen F + _IO_file_init F + _IO_file_jumps D 0x54 + _IO_file_open F + _IO_file_overflow F + _IO_file_read F + _IO_file_seek F + _IO_file_seekoff F + _IO_file_setbuf F + _IO_file_stat F + _IO_file_sync F + _IO_file_underflow F + _IO_file_write F + _IO_file_xsputn F + _IO_flockfile F + _IO_flush_all F + _IO_flush_all_linebuffered F + _IO_fopen F + _IO_fprintf F + _IO_fputs F + _IO_fread F + _IO_free_backup_area F + _IO_free_wbackup_area F + _IO_fsetpos F + _IO_fsetpos64 F + _IO_ftell F + _IO_ftrylockfile F + _IO_funlockfile F + _IO_fwrite F + _IO_getc F + _IO_getline F + _IO_getline_info F + _IO_gets F + _IO_init F + _IO_init_marker F + _IO_init_wmarker F + _IO_iter_begin F + _IO_iter_end F + _IO_iter_file F + _IO_iter_next F + _IO_least_wmarker F + _IO_link_in F + _IO_list_all D 0x4 + _IO_list_lock F + _IO_list_resetlock F + _IO_list_unlock F + _IO_marker_delta F + _IO_marker_difference F + _IO_padn F + _IO_peekc_locked F + _IO_popen F + _IO_printf F + _IO_proc_close F + _IO_proc_open F + _IO_putc F + _IO_puts F + _IO_remove_marker F + _IO_seekmark F + _IO_seekoff F + _IO_seekpos F + _IO_seekwmark F + _IO_setb F + _IO_setbuffer F + _IO_setvbuf F + _IO_sgetn F + _IO_sprintf F + _IO_sputbackc F + _IO_sputbackwc F + _IO_sscanf F + _IO_str_init_readonly F + _IO_str_init_static F + _IO_str_overflow F + _IO_str_pbackfail F + _IO_str_seekoff F + _IO_str_underflow F + _IO_sungetc F + _IO_sungetwc F + _IO_switch_to_get_mode F + _IO_switch_to_main_wget_area F + _IO_switch_to_wbackup_area F + _IO_switch_to_wget_mode F + _IO_un_link F + _IO_ungetc F + _IO_unsave_markers F + _IO_unsave_wmarkers F + _IO_vfprintf F + _IO_vfscanf F + _IO_vsprintf F + _IO_wdefault_doallocate F + _IO_wdefault_finish F + _IO_wdefault_pbackfail F + _IO_wdefault_uflow F + _IO_wdefault_xsgetn F + _IO_wdefault_xsputn F + _IO_wdo_write F + _IO_wdoallocbuf F + _IO_wfile_jumps D 0x54 + _IO_wfile_overflow F + _IO_wfile_seekoff F + _IO_wfile_sync F + _IO_wfile_underflow F + _IO_wfile_xsputn F + _IO_wmarker_delta F + _IO_wsetb F + ___brk_addr D 0x4 + __adjtimex F + __after_morecore_hook D 0x4 + __argz_count F + __argz_next F + __argz_stringify F + __asprintf F + __asprintf_chk F + __assert F + __assert_fail F + __assert_perror_fail F + __backtrace F + __backtrace_symbols F + __backtrace_symbols_fd F + __bsd_getpgrp F + __bzero F + __check_rhosts_file D 0x4 + __chk_fail F + __clone F + __close F + __cmsg_nxthdr F + __confstr_chk F + __connect F + __ctype_b_loc F + __ctype_get_mb_cur_max F + __ctype_tolower_loc F + __ctype_toupper_loc F + __curbrk D 0x4 + __cxa_at_quick_exit F + __cxa_atexit F + __cxa_finalize F + __cyg_profile_func_enter F + __cyg_profile_func_exit F + __daylight D 0x4 + __dcgettext F + __default_morecore F + __dgettext F + __dprintf_chk F + __dup2 F + __duplocale F + __endmntent F + __environ D 0x4 + __errno_location F + __fbufsize F + __fcntl F + __ffs F + __fgets_chk F + __fgets_unlocked_chk F + __fgetws_chk F + __fgetws_unlocked_chk F + __finite F + __finitef F + __flbf F + __fork F + __fpending F + __fprintf_chk F + __fpu_control D 0x4 + __fpurge F + __fread_chk F + __fread_unlocked_chk F + __freadable F + __freading F + __free_hook D 0x4 + __freelocale F + __fsetlocking F + __fwprintf_chk F + __fwritable F + __fwriting F + __fxstat F + __fxstat64 F + __fxstatat F + __fxstatat64 F + __getcwd_chk F + __getdelim F + __getdomainname_chk F + __getgroups_chk F + __gethostname_chk F + __getlogin_r_chk F + __getmntent_r F + __getpagesize F + __getpgid F + __getpid F + __gets_chk F + __gettimeofday F + __getwd_chk F + __gmtime_r F + __h_errno_location F + __isalnum_l F + __isalpha_l F + __isascii_l F + __isblank_l F + __iscntrl_l F + __isctype F + __isdigit_l F + __isgraph_l F + __isinf F + __isinff F + __islower_l F + __isnan F + __isnanf F + __isoc99_fscanf F + __isoc99_fwscanf F + __isoc99_scanf F + __isoc99_sscanf F + __isoc99_swscanf F + __isoc99_vfscanf F + __isoc99_vfwscanf F + __isoc99_vscanf F + __isoc99_vsscanf F + __isoc99_vswscanf F + __isoc99_vwscanf F + __isoc99_wscanf F + __isprint_l F + __ispunct_l F + __isspace_l F + __isupper_l F + __iswalnum_l F + __iswalpha_l F + __iswblank_l F + __iswcntrl_l F + __iswctype F + __iswctype_l F + __iswdigit_l F + __iswgraph_l F + __iswlower_l F + __iswprint_l F + __iswpunct_l F + __iswspace_l F + __iswupper_l F + __iswxdigit_l F + __isxdigit_l F + __ivaliduser F + __key_decryptsession_pk_LOCAL D 0x4 + __key_encryptsession_pk_LOCAL D 0x4 + __key_gendes_LOCAL D 0x4 + __libc_allocate_rtsig F + __libc_calloc F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __libc_free F + __libc_freeres F + __libc_init_first F + __libc_mallinfo F + __libc_malloc F + __libc_mallopt F + __libc_memalign F + __libc_pvalloc F + __libc_realloc F + __libc_sa_len F + __libc_start_main F + __libc_valloc F + __longjmp_chk F + __lseek F + __lxstat F + __lxstat64 F + __malloc_hook D 0x4 + __malloc_initialize_hook D 0x4 + __mbrlen F + __mbrtowc F + __mbsnrtowcs_chk F + __mbsrtowcs_chk F + __mbstowcs_chk F + __mcount F + __memalign_hook D 0x4 + __memcpy_chk F + __memmove_chk F + __mempcpy F + __mempcpy_chk F + __mempcpy_small F + __memset_chk F + __monstartup F + __morecore D 0x4 + __nanosleep F + __newlocale F + __nl_langinfo_l F + __nss_configure_lookup F + __nss_database_lookup F + __nss_group_lookup F + __nss_hostname_digits_dots F + __nss_hosts_lookup F + __nss_next F + __nss_passwd_lookup F + __obstack_printf_chk F + __obstack_vprintf_chk F + __open F + __open64 F + __open64_2 F + __open_2 F + __openat64_2 F + __openat_2 F + __overflow F + __pipe F + __poll F + __posix_getopt F + __pread64 F + __pread64_chk F + __pread_chk F + __printf_chk F + __printf_fp F + __profile_frequency F + __progname D 0x4 + __progname_full D 0x4 + __ptsname_r_chk F + __pwrite64 F + __rawmemchr F + __rcmd_errstr D 0x4 + __read F + __read_chk F + __readlink_chk F + __readlinkat_chk F + __realloc_hook D 0x4 + __realpath_chk F + __recv_chk F + __recvfrom_chk F + __register_atfork F + __res_init F + __res_nclose F + __res_ninit F + __res_randomid F + __res_state F + __rpc_thread_createerr F + __rpc_thread_svc_fdset F + __rpc_thread_svc_max_pollfd F + __rpc_thread_svc_pollfd F + __sbrk F + __sched_cpualloc F + __sched_cpucount F + __sched_cpufree F + __sched_get_priority_max F + __sched_get_priority_min F + __sched_getparam F + __sched_getscheduler F + __sched_setscheduler F + __sched_yield F + __secure_getenv F + __select F + __setmntent F + __setpgid F + __sigaction F + __sigaddset F + __sigdelset F + __sigismember F + __signbit F + __signbitf F + __sigpause F + __sigsetjmp F + __sigsuspend F + __snprintf_chk F + __sprintf_chk F + __stack_chk_fail F + __statfs F + __stpcpy F + __stpcpy_chk F + __stpcpy_small F + __stpncpy F + __stpncpy_chk F + __strcasecmp F + __strcasecmp_l F + __strcasestr F + __strcat_chk F + __strcoll_l F + __strcpy_chk F + __strcpy_small F + __strcspn_c1 F + __strcspn_c2 F + __strcspn_c3 F + __strdup F + __strerror_r F + __strfmon_l F + __strftime_l F + __strncasecmp_l F + __strncat_chk F + __strncpy_chk F + __strndup F + __strpbrk_c2 F + __strpbrk_c3 F + __strsep_1c F + __strsep_2c F + __strsep_3c F + __strsep_g F + __strspn_c1 F + __strspn_c2 F + __strspn_c3 F + __strtod_internal F + __strtod_l F + __strtof_internal F + __strtof_l F + __strtok_r F + __strtok_r_1c F + __strtol_internal F + __strtol_l F + __strtold_internal F + __strtold_l F + __strtoll_internal F + __strtoll_l F + __strtoul_internal F + __strtoul_l F + __strtoull_internal F + __strtoull_l F + __strverscmp F + __strxfrm_l F + __swprintf_chk F + __sysconf F + __syslog_chk F + __sysv_signal F + __timezone D 0x4 + __toascii_l F + __tolower_l F + __toupper_l F + __towctrans F + __towctrans_l F + __towlower_l F + __towupper_l F + __ttyname_r_chk F + __tzname D 0x8 + __uflow F + __underflow F + __uselocale F + __vasprintf_chk F + __vdprintf_chk F + __vfork F + __vfprintf_chk F + __vfscanf F + __vfwprintf_chk F + __vprintf_chk F + __vsnprintf F + __vsnprintf_chk F + __vsprintf_chk F + __vsscanf F + __vswprintf_chk F + __vsyslog_chk F + __vwprintf_chk F + __wait F + __waitpid F + __wcpcpy_chk F + __wcpncpy_chk F + __wcrtomb_chk F + __wcscasecmp_l F + __wcscat_chk F + __wcscoll_l F + __wcscpy_chk F + __wcsftime_l F + __wcsncasecmp_l F + __wcsncat_chk F + __wcsncpy_chk F + __wcsnrtombs_chk F + __wcsrtombs_chk F + __wcstod_internal F + __wcstod_l F + __wcstof_internal F + __wcstof_l F + __wcstol_internal F + __wcstol_l F + __wcstold_internal F + __wcstold_l F + __wcstoll_internal F + __wcstoll_l F + __wcstombs_chk F + __wcstoul_internal F + __wcstoul_l F + __wcstoull_internal F + __wcstoull_l F + __wcsxfrm_l F + __wctomb_chk F + __wctrans_l F + __wctype_l F + __wmemcpy_chk F + __wmemmove_chk F + __wmempcpy_chk F + __wmemset_chk F + __woverflow F + __wprintf_chk F + __write F + __wuflow F + __wunderflow F + __xmknod F + __xmknodat F + __xpg_basename F + __xpg_sigpause F + __xpg_strerror_r F + __xstat F + __xstat64 F + _authenticate F + _dl_mcount_wrapper F + _dl_mcount_wrapper_check F + _environ D 0x4 + _exit F + _flush_cache F + _flushlbf F + _libc_intl_domainname D 0x5 + _longjmp F + _mcleanup F + _mcount F + _nl_default_dirname D 0x12 + _nl_domain_bindings D 0x4 + _nl_msg_cat_cntr D 0x4 + _null_auth D 0xc + _obstack_allocated_p F + _obstack_begin F + _obstack_begin_1 F + _obstack_free F + _obstack_memory_used F + _obstack_newchunk F + _res D 0x200 + _res_hconf D 0x30 + _rpc_dtablesize F + _seterr_reply F + _setjmp F + _sys_errlist D 0x21c + _sys_nerr D 0x4 + _sys_siglist D 0x104 + _tolower F + _toupper F + a64l F + abort F + abs F + accept F + accept4 F + access F + acct F + addmntent F + addseverity F + adjtime F + adjtimex F + advance F + alarm F + alphasort F + alphasort64 F + argp_err_exit_status D 0x4 + argp_error F + argp_failure F + argp_help F + argp_parse F + argp_program_bug_address D 0x4 + argp_program_version D 0x4 + argp_program_version_hook D 0x4 + argp_state_help F + argp_usage F + argz_add F + argz_add_sep F + argz_append F + argz_count F + argz_create F + argz_create_sep F + argz_delete F + argz_extract F + argz_insert F + argz_next F + argz_replace F + argz_stringify F + asctime F + asctime_r F + asprintf F + atof F + atoi F + atol F + atoll F + authdes_create F + authdes_getucred F + authdes_pk_create F + authnone_create F + authunix_create F + authunix_create_default F + backtrace F + backtrace_symbols F + backtrace_symbols_fd F + basename F + bcmp F + bcopy F + bdflush F + bind F + bind_textdomain_codeset F + bindresvport F + bindtextdomain F + brk F + bsd_signal F + bsearch F + btowc F + bzero F + cacheflush F + calloc F + callrpc F + canonicalize_file_name F + capget F + capset F + catclose F + catgets F + catopen F + cbc_crypt F + cfgetispeed F + cfgetospeed F + cfmakeraw F + cfree F + cfsetispeed F + cfsetospeed F + cfsetspeed F + chdir F + chflags F + chmod F + chown F + chroot F + clearenv F + clearerr F + clearerr_unlocked F + clnt_broadcast F + clnt_create F + clnt_pcreateerror F + clnt_perrno F + clnt_perror F + clnt_spcreateerror F + clnt_sperrno F + clnt_sperror F + clntraw_create F + clnttcp_create F + clntudp_bufcreate F + clntudp_create F + clntunix_create F + clock F + clone F + close F + closedir F + closelog F + confstr F + connect F + copysign F + copysignf F + copysignl F + creat F + creat64 F + create_module F + ctermid F + ctime F + ctime_r F + cuserid F + daemon F + daylight D 0x4 + dcgettext F + dcngettext F + delete_module F + des_setparity F + dgettext F + difftime F + dirfd F + dirname F + div F + dl_iterate_phdr F + dngettext F + dprintf F + drand48 F + drand48_r F + dup F + dup2 F + dup3 F + duplocale F + dysize F + eaccess F + ecb_crypt F + ecvt F + ecvt_r F + endaliasent F + endfsent F + endgrent F + endhostent F + endmntent F + endnetent F + endnetgrent F + endprotoent F + endpwent F + endrpcent F + endservent F + endsgent F + endspent F + endttyent F + endusershell F + endutent F + endutxent F + environ D 0x4 + envz_add F + envz_entry F + envz_get F + envz_merge F + envz_remove F + envz_strip F + epoll_create F + epoll_create1 F + epoll_ctl F + epoll_pwait F + epoll_wait F + erand48 F + erand48_r F + err F + error F + error_at_line F + error_message_count D 0x4 + error_one_per_line D 0x4 + error_print_progname D 0x4 + errx F + ether_aton F + ether_aton_r F + ether_hostton F + ether_line F + ether_ntoa F + ether_ntoa_r F + ether_ntohost F + euidaccess F + eventfd F + eventfd_read F + eventfd_write F + execl F + execle F + execlp F + execv F + execve F + execvp F + execvpe F + exit F + faccessat F + fallocate F + fallocate64 F + fattach F + fchdir F + fchflags F + fchmod F + fchmodat F + fchown F + fchownat F + fclose F + fcloseall F + fcntl F + fcvt F + fcvt_r F + fdatasync F + fdetach F + fdopen F + fdopendir F + feof F + feof_unlocked F + ferror F + ferror_unlocked F + fexecve F + fflush F + fflush_unlocked F + ffs F + ffsl F + ffsll F + fgetc F + fgetc_unlocked F + fgetgrent F + fgetgrent_r F + fgetpos F + fgetpos64 F + fgetpwent F + fgetpwent_r F + fgets F + fgets_unlocked F + fgetsgent F + fgetsgent_r F + fgetspent F + fgetspent_r F + fgetwc F + fgetwc_unlocked F + fgetws F + fgetws_unlocked F + fgetxattr F + fileno F + fileno_unlocked F + finite F + finitef F + finitel F + flistxattr F + flock F + flockfile F + fmemopen F + fmtmsg F + fnmatch F + fopen F + fopen64 F + fopencookie F + fork F + fpathconf F + fprintf F + fputc F + fputc_unlocked F + fputs F + fputs_unlocked F + fputwc F + fputwc_unlocked F + fputws F + fputws_unlocked F + fread F + fread_unlocked F + free F + freeaddrinfo F + freeifaddrs F + freelocale F + fremovexattr F + freopen F + freopen64 F + frexp F + frexpf F + frexpl F + fscanf F + fseek F + fseeko F + fseeko64 F + fsetpos F + fsetpos64 F + fsetxattr F + fstatfs F + fstatfs64 F + fstatvfs F + fstatvfs64 F + fsync F + ftell F + ftello F + ftello64 F + ftime F + ftok F + ftruncate F + ftruncate64 F + ftrylockfile F + fts_children F + fts_close F + fts_open F + fts_read F + fts_set F + ftw F + ftw64 F + funlockfile F + futimens F + futimes F + futimesat F + fwide F + fwprintf F + fwrite F + fwrite_unlocked F + fwscanf F + gai_strerror F + gcvt F + get_avphys_pages F + get_current_dir_name F + get_kernel_syms F + get_myaddress F + get_nprocs F + get_nprocs_conf F + get_phys_pages F + getaddrinfo F + getaliasbyname F + getaliasbyname_r F + getaliasent F + getaliasent_r F + getc F + getc_unlocked F + getchar F + getchar_unlocked F + getcontext F + getcwd F + getdate F + getdate_err D 0x4 + getdate_r F + getdelim F + getdirentries F + getdirentries64 F + getdomainname F + getdtablesize F + getegid F + getenv F + geteuid F + getfsent F + getfsfile F + getfsspec F + getgid F + getgrent F + getgrent_r F + getgrgid F + getgrgid_r F + getgrnam F + getgrnam_r F + getgrouplist F + getgroups F + gethostbyaddr F + gethostbyaddr_r F + gethostbyname F + gethostbyname2 F + gethostbyname2_r F + gethostbyname_r F + gethostent F + gethostent_r F + gethostid F + gethostname F + getifaddrs F + getipv4sourcefilter F + getitimer F + getline F + getloadavg F + getlogin F + getlogin_r F + getmntent F + getmntent_r F + getmsg F + getnameinfo F + getnetbyaddr F + getnetbyaddr_r F + getnetbyname F + getnetbyname_r F + getnetent F + getnetent_r F + getnetgrent F + getnetgrent_r F + getnetname F + getopt F + getopt_long F + getopt_long_only F + getpagesize F + getpass F + getpeername F + getpgid F + getpgrp F + getpid F + getpmsg F + getppid F + getpriority F + getprotobyname F + getprotobyname_r F + getprotobynumber F + getprotobynumber_r F + getprotoent F + getprotoent_r F + getpt F + getpublickey F + getpw F + getpwent F + getpwent_r F + getpwnam F + getpwnam_r F + getpwuid F + getpwuid_r F + getresgid F + getresuid F + getrlimit F + getrlimit64 F + getrpcbyname F + getrpcbyname_r F + getrpcbynumber F + getrpcbynumber_r F + getrpcent F + getrpcent_r F + getrpcport F + getrusage F + gets F + getsecretkey F + getservbyname F + getservbyname_r F + getservbyport F + getservbyport_r F + getservent F + getservent_r F + getsgent F + getsgent_r F + getsgnam F + getsgnam_r F + getsid F + getsockname F + getsockopt F + getsourcefilter F + getspent F + getspent_r F + getspnam F + getspnam_r F + getsubopt F + gettext F + gettimeofday F + getttyent F + getttynam F + getuid F + getusershell F + getutent F + getutent_r F + getutid F + getutid_r F + getutline F + getutline_r F + getutmp F + getutmpx F + getutxent F + getutxid F + getutxline F + getw F + getwc F + getwc_unlocked F + getwchar F + getwchar_unlocked F + getwd F + getxattr F + glob F + glob64 F + glob_pattern_p F + globfree F + globfree64 F + gmtime F + gmtime_r F + gnu_dev_major F + gnu_dev_makedev F + gnu_dev_minor F + gnu_get_libc_release F + gnu_get_libc_version F + grantpt F + group_member F + gsignal F + gtty F + h_errlist D 0x14 + h_nerr D 0x4 + hasmntopt F + hcreate F + hcreate_r F + hdestroy F + hdestroy_r F + herror F + host2netname F + hsearch F + hsearch_r F + hstrerror F + htonl F + htons F + iconv F + iconv_close F + iconv_open F + if_freenameindex F + if_indextoname F + if_nameindex F + if_nametoindex F + imaxabs F + imaxdiv F + in6addr_any D 0x10 + in6addr_loopback D 0x10 + index F + inet6_opt_append F + inet6_opt_find F + inet6_opt_finish F + inet6_opt_get_val F + inet6_opt_init F + inet6_opt_next F + inet6_opt_set_val F + inet6_option_alloc F + inet6_option_append F + inet6_option_find F + inet6_option_init F + inet6_option_next F + inet6_option_space F + inet6_rth_add F + inet6_rth_getaddr F + inet6_rth_init F + inet6_rth_reverse F + inet6_rth_segments F + inet6_rth_space F + inet_addr F + inet_aton F + inet_lnaof F + inet_makeaddr F + inet_netof F + inet_network F + inet_nsap_addr F + inet_nsap_ntoa F + inet_ntoa F + inet_ntop F + inet_pton F + init_module F + initgroups F + initstate F + initstate_r F + innetgr F + inotify_add_watch F + inotify_init F + inotify_init1 F + inotify_rm_watch F + insque F + ioctl F + iruserok F + iruserok_af F + isalnum F + isalnum_l F + isalpha F + isalpha_l F + isascii F + isastream F + isatty F + isblank F + isblank_l F + iscntrl F + iscntrl_l F + isctype F + isdigit F + isdigit_l F + isfdtype F + isgraph F + isgraph_l F + isinf F + isinff F + isinfl F + islower F + islower_l F + isnan F + isnanf F + isnanl F + isprint F + isprint_l F + ispunct F + ispunct_l F + isspace F + isspace_l F + isupper F + isupper_l F + iswalnum F + iswalnum_l F + iswalpha F + iswalpha_l F + iswblank F + iswblank_l F + iswcntrl F + iswcntrl_l F + iswctype F + iswctype_l F + iswdigit F + iswdigit_l F + iswgraph F + iswgraph_l F + iswlower F + iswlower_l F + iswprint F + iswprint_l F + iswpunct F + iswpunct_l F + iswspace F + iswspace_l F + iswupper F + iswupper_l F + iswxdigit F + iswxdigit_l F + isxdigit F + isxdigit_l F + jrand48 F + jrand48_r F + key_decryptsession F + key_decryptsession_pk F + key_encryptsession F + key_encryptsession_pk F + key_gendes F + key_get_conv F + key_secretkey_is_set F + key_setnet F + key_setsecret F + kill F + killpg F + klogctl F + l64a F + labs F + lchmod F + lchown F + lckpwdf F + lcong48 F + lcong48_r F + ldexp F + ldexpf F + ldexpl F + ldiv F + lfind F + lgetxattr F + link F + linkat F + listen F + listxattr F + llabs F + lldiv F + llistxattr F + llseek F + loc1 D 0x4 + loc2 D 0x4 + localeconv F + localtime F + localtime_r F + lockf F + lockf64 F + locs D 0x4 + longjmp F + lrand48 F + lrand48_r F + lremovexattr F + lsearch F + lseek F + lseek64 F + lsetxattr F + lutimes F + madvise F + makecontext F + mallinfo F + malloc F + malloc_get_state F + malloc_info F + malloc_set_state F + malloc_stats F + malloc_trim F + malloc_usable_size F + mallopt F + mallwatch D 0x4 + mblen F + mbrlen F + mbrtowc F + mbsinit F + mbsnrtowcs F + mbsrtowcs F + mbstowcs F + mbtowc F + mcheck F + mcheck_check_all F + mcheck_pedantic F + mcount F + memalign F + memccpy F + memchr F + memcmp F + memcpy F + memfrob F + memmem F + memmove F + mempcpy F + memrchr F + memset F + mincore F + mkdir F + mkdirat F + mkdtemp F + mkfifo F + mkfifoat F + mkostemp F + mkostemp64 F + mkostemps F + mkostemps64 F + mkstemp F + mkstemp64 F + mkstemps F + mkstemps64 F + mktemp F + mktime F + mlock F + mlockall F + mmap F + mmap64 F + modf F + modff F + modfl F + moncontrol F + monstartup F + mount F + mprobe F + mprotect F + mrand48 F + mrand48_r F + mremap F + msgctl F + msgget F + msgrcv F + msgsnd F + msync F + mtrace F + munlock F + munlockall F + munmap F + muntrace F + nanosleep F + netname2host F + netname2user F + newlocale F + nfsservctl F + nftw F + nftw64 F + ngettext F + nice F + nl_langinfo F + nl_langinfo_l F + nrand48 F + nrand48_r F + ntohl F + ntohs F + ntp_adjtime F + ntp_gettime F + ntp_gettimex F + obstack_alloc_failed_handler D 0x4 + obstack_exit_failure D 0x4 + obstack_free F + obstack_printf F + obstack_vprintf F + on_exit F + open F + open64 F + open_memstream F + open_wmemstream F + openat F + openat64 F + opendir F + openlog F + optarg D 0x4 + opterr D 0x4 + optind D 0x4 + optopt D 0x4 + parse_printf_format F + passwd2des F + pathconf F + pause F + pclose F + perror F + personality F + pipe F + pipe2 F + pivot_root F + pmap_getmaps F + pmap_getport F + pmap_rmtcall F + pmap_set F + pmap_unset F + poll F + popen F + posix_fadvise F + posix_fadvise64 F + posix_fallocate F + posix_fallocate64 F + posix_madvise F + posix_memalign F + posix_openpt F + posix_spawn F + posix_spawn_file_actions_addclose F + posix_spawn_file_actions_adddup2 F + posix_spawn_file_actions_addopen F + posix_spawn_file_actions_destroy F + posix_spawn_file_actions_init F + posix_spawnattr_destroy F + posix_spawnattr_getflags F + posix_spawnattr_getpgroup F + posix_spawnattr_getschedparam F + posix_spawnattr_getschedpolicy F + posix_spawnattr_getsigdefault F + posix_spawnattr_getsigmask F + posix_spawnattr_init F + posix_spawnattr_setflags F + posix_spawnattr_setpgroup F + posix_spawnattr_setschedparam F + posix_spawnattr_setschedpolicy F + posix_spawnattr_setsigdefault F + posix_spawnattr_setsigmask F + posix_spawnp F + ppoll F + prctl F + pread F + pread64 F + preadv F + preadv64 F + printf F + printf_size F + printf_size_info F + profil F + program_invocation_name D 0x4 + program_invocation_short_name D 0x4 + pselect F + psiginfo F + psignal F + pthread_attr_destroy F + pthread_attr_getdetachstate F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_init F + pthread_attr_setdetachstate F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_init F + pthread_equal F + pthread_exit F + pthread_getschedparam F + pthread_mutex_destroy F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_unlock F + pthread_self F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setschedparam F + ptrace F + ptsname F + ptsname_r F + putc F + putc_unlocked F + putchar F + putchar_unlocked F + putenv F + putgrent F + putmsg F + putpmsg F + putpwent F + puts F + putsgent F + putspent F + pututline F + pututxline F + putw F + putwc F + putwc_unlocked F + putwchar F + putwchar_unlocked F + pvalloc F + pwrite F + pwrite64 F + pwritev F + pwritev64 F + qecvt F + qecvt_r F + qfcvt F + qfcvt_r F + qgcvt F + qsort F + qsort_r F + query_module F + quick_exit F + quotactl F + raise F + rand F + rand_r F + random F + random_r F + rawmemchr F + rcmd F + rcmd_af F + re_comp F + re_compile_fastmap F + re_compile_pattern F + re_exec F + re_match F + re_match_2 F + re_search F + re_search_2 F + re_set_registers F + re_set_syntax F + re_syntax_options D 0x4 + read F + readahead F + readdir F + readdir64 F + readdir64_r F + readdir_r F + readlink F + readlinkat F + readv F + realloc F + realpath F + reboot F + recv F + recvfrom F + recvmmsg F + recvmsg F + regcomp F + regerror F + regexec F + regfree F + register_printf_function F + register_printf_modifier F + register_printf_specifier F + register_printf_type F + registerrpc F + remap_file_pages F + remove F + removexattr F + remque F + rename F + renameat F + revoke F + rewind F + rewinddir F + rexec F + rexec_af F + rexecoptions D 0x4 + rindex F + rmdir F + rpc_createerr D 0x10 + rpmatch F + rresvport F + rresvport_af F + rtime F + ruserok F + ruserok_af F + ruserpass F + sbrk F + scalbn F + scalbnf F + scalbnl F + scandir F + scandir64 F + scanf F + sched_get_priority_max F + sched_get_priority_min F + sched_getaffinity F + sched_getcpu F + sched_getparam F + sched_getscheduler F + sched_rr_get_interval F + sched_setaffinity F + sched_setparam F + sched_setscheduler F + sched_yield F + seed48 F + seed48_r F + seekdir F + select F + semctl F + semget F + semop F + semtimedop F + send F + sendfile F + sendfile64 F + sendmsg F + sendto F + set_dataplane F + setaliasent F + setbuf F + setbuffer F + setcontext F + setdomainname F + setegid F + setenv F + seteuid F + setfsent F + setfsgid F + setfsuid F + setgid F + setgrent F + setgroups F + sethostent F + sethostid F + sethostname F + setipv4sourcefilter F + setitimer F + setjmp F + setlinebuf F + setlocale F + setlogin F + setlogmask F + setmntent F + setnetent F + setnetgrent F + setpgid F + setpgrp F + setpriority F + setprotoent F + setpwent F + setregid F + setresgid F + setresuid F + setreuid F + setrlimit F + setrlimit64 F + setrpcent F + setservent F + setsgent F + setsid F + setsockopt F + setsourcefilter F + setspent F + setstate F + setstate_r F + settimeofday F + setttyent F + setuid F + setusershell F + setutent F + setutxent F + setvbuf F + setxattr F + sgetsgent F + sgetsgent_r F + sgetspent F + sgetspent_r F + shmat F + shmctl F + shmdt F + shmget F + shutdown F + sigaction F + sigaddset F + sigaltstack F + sigandset F + sigblock F + sigdelset F + sigemptyset F + sigfillset F + siggetmask F + sighold F + sigignore F + siginterrupt F + sigisemptyset F + sigismember F + siglongjmp F + signal F + signalfd F + sigorset F + sigpause F + sigpending F + sigprocmask F + sigqueue F + sigrelse F + sigreturn F + sigset F + sigsetmask F + sigstack F + sigsuspend F + sigtimedwait F + sigvec F + sigwait F + sigwaitinfo F + sleep F + snprintf F + sockatmark F + socket F + socketpair F + splice F + sprintf F + sprofil F + srand F + srand48 F + srand48_r F + srandom F + srandom_r F + sscanf F + ssignal F + sstk F + statfs F + statfs64 F + statvfs F + statvfs64 F + stderr D 0x4 + stdin D 0x4 + stdout D 0x4 + step F + stime F + stpcpy F + stpncpy F + strcasecmp F + strcasecmp_l F + strcasestr F + strcat F + strchr F + strchrnul F + strcmp F + strcoll F + strcoll_l F + strcpy F + strcspn F + strdup F + strerror F + strerror_l F + strerror_r F + strfmon F + strfmon_l F + strfry F + strftime F + strftime_l F + strlen F + strncasecmp F + strncasecmp_l F + strncat F + strncmp F + strncpy F + strndup F + strnlen F + strpbrk F + strptime F + strptime_l F + strrchr F + strsep F + strsignal F + strspn F + strstr F + strtod F + strtod_l F + strtof F + strtof_l F + strtoimax F + strtok F + strtok_r F + strtol F + strtol_l F + strtold F + strtold_l F + strtoll F + strtoll_l F + strtoq F + strtoul F + strtoul_l F + strtoull F + strtoull_l F + strtoumax F + strtouq F + strverscmp F + strxfrm F + strxfrm_l F + stty F + svc_exit F + svc_fdset D 0x80 + svc_getreq F + svc_getreq_common F + svc_getreq_poll F + svc_getreqset F + svc_max_pollfd D 0x4 + svc_pollfd D 0x4 + svc_register F + svc_run F + svc_sendreply F + svc_unregister F + svcauthdes_stats D 0xc + svcerr_auth F + svcerr_decode F + svcerr_noproc F + svcerr_noprog F + svcerr_progvers F + svcerr_systemerr F + svcerr_weakauth F + svcfd_create F + svcraw_create F + svctcp_create F + svcudp_bufcreate F + svcudp_create F + svcudp_enablecache F + svcunix_create F + svcunixfd_create F + swab F + swapcontext F + swapoff F + swapon F + swprintf F + swscanf F + symlink F + symlinkat F + sync F + sync_file_range F + sys_errlist D 0x21c + sys_nerr D 0x4 + sys_sigabbrev D 0x104 + sys_siglist D 0x104 + syscall F + sysconf F + sysctl F + sysinfo F + syslog F + system F + sysv_signal F + tcdrain F + tcflow F + tcflush F + tcgetattr F + tcgetpgrp F + tcgetsid F + tcsendbreak F + tcsetattr F + tcsetpgrp F + tdelete F + tdestroy F + tee F + telldir F + tempnam F + textdomain F + tfind F + time F + timegm F + timelocal F + timerfd_create F + timerfd_gettime F + timerfd_settime F + times F + timezone D 0x4 + tmpfile F + tmpfile64 F + tmpnam F + tmpnam_r F + toascii F + tolower F + tolower_l F + toupper F + toupper_l F + towctrans F + towctrans_l F + towlower F + towlower_l F + towupper F + towupper_l F + tr_break F + truncate F + truncate64 F + tsearch F + ttyname F + ttyname_r F + ttyslot F + twalk F + tzname D 0x8 + tzset F + ualarm F + ulckpwdf F + ulimit F + umask F + umount F + umount2 F + uname F + ungetc F + ungetwc F + unlink F + unlinkat F + unlockpt F + unsetenv F + unshare F + updwtmp F + updwtmpx F + uselib F + uselocale F + user2netname F + usleep F + ustat F + utime F + utimensat F + utimes F + utmpname F + utmpxname F + valloc F + vasprintf F + vdprintf F + verr F + verrx F + versionsort F + versionsort64 F + vfork F + vfprintf F + vfscanf F + vfwprintf F + vfwscanf F + vhangup F + vlimit F + vmsplice F + vprintf F + vscanf F + vsnprintf F + vsprintf F + vsscanf F + vswprintf F + vswscanf F + vsyslog F + vtimes F + vwarn F + vwarnx F + vwprintf F + vwscanf F + wait F + wait3 F + wait4 F + waitid F + waitpid F + warn F + warnx F + wcpcpy F + wcpncpy F + wcrtomb F + wcscasecmp F + wcscasecmp_l F + wcscat F + wcschr F + wcschrnul F + wcscmp F + wcscoll F + wcscoll_l F + wcscpy F + wcscspn F + wcsdup F + wcsftime F + wcsftime_l F + wcslen F + wcsncasecmp F + wcsncasecmp_l F + wcsncat F + wcsncmp F + wcsncpy F + wcsnlen F + wcsnrtombs F + wcspbrk F + wcsrchr F + wcsrtombs F + wcsspn F + wcsstr F + wcstod F + wcstod_l F + wcstof F + wcstof_l F + wcstoimax F + wcstok F + wcstol F + wcstol_l F + wcstold F + wcstold_l F + wcstoll F + wcstoll_l F + wcstombs F + wcstoq F + wcstoul F + wcstoul_l F + wcstoull F + wcstoull_l F + wcstoumax F + wcstouq F + wcswcs F + wcswidth F + wcsxfrm F + wcsxfrm_l F + wctob F + wctomb F + wctrans F + wctrans_l F + wctype F + wctype_l F + wcwidth F + wmemchr F + wmemcmp F + wmemcpy F + wmemmove F + wmempcpy F + wmemset F + wordexp F + wordfree F + wprintf F + write F + writev F + wscanf F + xdecrypt F + xdr_accepted_reply F + xdr_array F + xdr_authdes_cred F + xdr_authdes_verf F + xdr_authunix_parms F + xdr_bool F + xdr_bytes F + xdr_callhdr F + xdr_callmsg F + xdr_char F + xdr_cryptkeyarg F + xdr_cryptkeyarg2 F + xdr_cryptkeyres F + xdr_des_block F + xdr_double F + xdr_enum F + xdr_float F + xdr_free F + xdr_getcredres F + xdr_hyper F + xdr_int F + xdr_int16_t F + xdr_int32_t F + xdr_int64_t F + xdr_int8_t F + xdr_key_netstarg F + xdr_key_netstres F + xdr_keybuf F + xdr_keystatus F + xdr_long F + xdr_longlong_t F + xdr_netnamestr F + xdr_netobj F + xdr_opaque F + xdr_opaque_auth F + xdr_pmap F + xdr_pmaplist F + xdr_pointer F + xdr_quad_t F + xdr_reference F + xdr_rejected_reply F + xdr_replymsg F + xdr_rmtcall_args F + xdr_rmtcallres F + xdr_short F + xdr_sizeof F + xdr_string F + xdr_u_char F + xdr_u_hyper F + xdr_u_int F + xdr_u_long F + xdr_u_longlong_t F + xdr_u_quad_t F + xdr_u_short F + xdr_uint16_t F + xdr_uint32_t F + xdr_uint64_t F + xdr_uint8_t F + xdr_union F + xdr_unixcred F + xdr_vector F + xdr_void F + xdr_wrapstring F + xdrmem_create F + xdrrec_create F + xdrrec_endofrecord F + xdrrec_eof F + xdrrec_skiprecord F + xdrstdio_create F + xencrypt F + xprt_register F + xprt_unregister F +GLIBC_2.15 + GLIBC_2.15 A + __fdelt_chk F + __fdelt_warn F + clock_adjtime F + fanotify_init F + fanotify_mark F + name_to_handle_at F + open_by_handle_at F + posix_spawn F + posix_spawnp F + prlimit F + prlimit64 F + process_vm_readv F + process_vm_writev F + scandirat F + scandirat64 F + sendmmsg F + setns F + syncfs F +GLIBC_2.16 + GLIBC_2.16 A + __getauxval F + __poll_chk F + __ppoll_chk F + aligned_alloc F + c16rtomb F + c32rtomb F + getauxval F + mbrtoc16 F + mbrtoc32 F + timespec_get F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libcrypt.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libcrypt.abilist new file mode 100644 index 0000000000..608e5df0b1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libcrypt.abilist @@ -0,0 +1,9 @@ +GLIBC_2.12 + GLIBC_2.12 A + crypt F + crypt_r F + encrypt F + encrypt_r F + fcrypt F + setkey F + setkey_r F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libdl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libdl.abilist new file mode 100644 index 0000000000..27a72281b7 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libdl.abilist @@ -0,0 +1,11 @@ +GLIBC_2.12 + GLIBC_2.12 A + dladdr F + dladdr1 F + dlclose F + dlerror F + dlinfo F + dlmopen F + dlopen F + dlsym F + dlvsym F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libm.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libm.abilist new file mode 100644 index 0000000000..601b505ead --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libm.abilist @@ -0,0 +1,369 @@ +GLIBC_2.12 + GLIBC_2.12 A + _LIB_VERSION D 0x4 + __clog10 F + __clog10f F + __clog10l F + __finite F + __finitef F + __fpclassify F + __fpclassifyf F + __signbit F + __signbitf F + acos F + acosf F + acosh F + acoshf F + acoshl F + acosl F + asin F + asinf F + asinh F + asinhf F + asinhl F + asinl F + atan F + atan2 F + atan2f F + atan2l F + atanf F + atanh F + atanhf F + atanhl F + atanl F + cabs F + cabsf F + cabsl F + cacos F + cacosf F + cacosh F + cacoshf F + cacoshl F + cacosl F + carg F + cargf F + cargl F + casin F + casinf F + casinh F + casinhf F + casinhl F + casinl F + catan F + catanf F + catanh F + catanhf F + catanhl F + catanl F + cbrt F + cbrtf F + cbrtl F + ccos F + ccosf F + ccosh F + ccoshf F + ccoshl F + ccosl F + ceil F + ceilf F + ceill F + cexp F + cexpf F + cexpl F + cimag F + cimagf F + cimagl F + clog F + clog10 F + clog10f F + clog10l F + clogf F + clogl F + conj F + conjf F + conjl F + copysign F + copysignf F + copysignl F + cos F + cosf F + cosh F + coshf F + coshl F + cosl F + cpow F + cpowf F + cpowl F + cproj F + cprojf F + cprojl F + creal F + crealf F + creall F + csin F + csinf F + csinh F + csinhf F + csinhl F + csinl F + csqrt F + csqrtf F + csqrtl F + ctan F + ctanf F + ctanh F + ctanhf F + ctanhl F + ctanl F + drem F + dremf F + dreml F + erf F + erfc F + erfcf F + erfcl F + erff F + erfl F + exp F + exp10 F + exp10f F + exp10l F + exp2 F + exp2f F + exp2l F + expf F + expl F + expm1 F + expm1f F + expm1l F + fabs F + fabsf F + fabsl F + fdim F + fdimf F + fdiml F + feclearexcept F + fedisableexcept F + feenableexcept F + fegetenv F + fegetexcept F + fegetexceptflag F + fegetround F + feholdexcept F + feraiseexcept F + fesetenv F + fesetexceptflag F + fesetround F + fetestexcept F + feupdateenv F + finite F + finitef F + finitel F + floor F + floorf F + floorl F + fma F + fmaf F + fmal F + fmax F + fmaxf F + fmaxl F + fmin F + fminf F + fminl F + fmod F + fmodf F + fmodl F + frexp F + frexpf F + frexpl F + gamma F + gammaf F + gammal F + hypot F + hypotf F + hypotl F + ilogb F + ilogbf F + ilogbl F + j0 F + j0f F + j0l F + j1 F + j1f F + j1l F + jn F + jnf F + jnl F + ldexp F + ldexpf F + ldexpl F + lgamma F + lgamma_r F + lgammaf F + lgammaf_r F + lgammal F + lgammal_r F + llrint F + llrintf F + llrintl F + llround F + llroundf F + llroundl F + log F + log10 F + log10f F + log10l F + log1p F + log1pf F + log1pl F + log2 F + log2f F + log2l F + logb F + logbf F + logbl F + logf F + logl F + lrint F + lrintf F + lrintl F + lround F + lroundf F + lroundl F + matherr F + modf F + modff F + modfl F + nan F + nanf F + nanl F + nearbyint F + nearbyintf F + nearbyintl F + nextafter F + nextafterf F + nextafterl F + nexttoward F + nexttowardf F + nexttowardl F + pow F + pow10 F + pow10f F + pow10l F + powf F + powl F + remainder F + remainderf F + remainderl F + remquo F + remquof F + remquol F + rint F + rintf F + rintl F + round F + roundf F + roundl F + scalb F + scalbf F + scalbl F + scalbln F + scalblnf F + scalblnl F + scalbn F + scalbnf F + scalbnl F + signgam D 0x4 + significand F + significandf F + significandl F + sin F + sincos F + sincosf F + sincosl F + sinf F + sinh F + sinhf F + sinhl F + sinl F + sqrt F + sqrtf F + sqrtl F + tan F + tanf F + tanh F + tanhf F + tanhl F + tanl F + tgamma F + tgammaf F + tgammal F + trunc F + truncf F + truncl F + y0 F + y0f F + y0l F + y1 F + y1f F + y1l F + yn F + ynf F + ynl F +GLIBC_2.15 + GLIBC_2.15 A + __acos_finite F + __acosf_finite F + __acosh_finite F + __acoshf_finite F + __asin_finite F + __asinf_finite F + __atan2_finite F + __atan2f_finite F + __atanh_finite F + __atanhf_finite F + __cosh_finite F + __coshf_finite F + __exp10_finite F + __exp10f_finite F + __exp2_finite F + __exp2f_finite F + __exp_finite F + __expf_finite F + __fmod_finite F + __fmodf_finite F + __gamma_r_finite F + __gammaf_r_finite F + __hypot_finite F + __hypotf_finite F + __j0_finite F + __j0f_finite F + __j1_finite F + __j1f_finite F + __jn_finite F + __jnf_finite F + __lgamma_r_finite F + __lgammaf_r_finite F + __log10_finite F + __log10f_finite F + __log2_finite F + __log2f_finite F + __log_finite F + __logf_finite F + __pow_finite F + __powf_finite F + __remainder_finite F + __remainderf_finite F + __scalb_finite F + __scalbf_finite F + __sinh_finite F + __sinhf_finite F + __sqrt_finite F + __sqrtf_finite F + __y0_finite F + __y0f_finite F + __y1_finite F + __y1f_finite F + __yn_finite F + __ynf_finite F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libnsl.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libnsl.abilist new file mode 100644 index 0000000000..e4217934c8 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libnsl.abilist @@ -0,0 +1,123 @@ +GLIBC_2.12 + GLIBC_2.12 A + __free_fdresult F + __nis_default_access F + __nis_default_group F + __nis_default_owner F + __nis_default_ttl F + __nis_finddirectory F + __nis_hash F + __nisbind_connect F + __nisbind_create F + __nisbind_destroy F + __nisbind_next F + __yp_check F + nis_add F + nis_add_entry F + nis_addmember F + nis_checkpoint F + nis_clone_directory F + nis_clone_object F + nis_clone_result F + nis_creategroup F + nis_destroy_object F + nis_destroygroup F + nis_dir_cmp F + nis_domain_of F + nis_domain_of_r F + nis_first_entry F + nis_free_directory F + nis_free_object F + nis_free_request F + nis_freenames F + nis_freeresult F + nis_freeservlist F + nis_freetags F + nis_getnames F + nis_getservlist F + nis_ismember F + nis_leaf_of F + nis_leaf_of_r F + nis_lerror F + nis_list F + nis_local_directory F + nis_local_group F + nis_local_host F + nis_local_principal F + nis_lookup F + nis_mkdir F + nis_modify F + nis_modify_entry F + nis_name_of F + nis_name_of_r F + nis_next_entry F + nis_perror F + nis_ping F + nis_print_directory F + nis_print_entry F + nis_print_group F + nis_print_group_entry F + nis_print_link F + nis_print_object F + nis_print_result F + nis_print_rights F + nis_print_table F + nis_read_obj F + nis_remove F + nis_remove_entry F + nis_removemember F + nis_rmdir F + nis_servstate F + nis_sperrno F + nis_sperror F + nis_sperror_r F + nis_stats F + nis_verifygroup F + nis_write_obj F + readColdStartFile F + writeColdStartFile F + xdr_cback_data F + xdr_domainname F + xdr_keydat F + xdr_mapname F + xdr_obj_p F + xdr_peername F + xdr_valdat F + xdr_yp_buf F + xdr_ypall F + xdr_ypbind_binding F + xdr_ypbind_resp F + xdr_ypbind_resptype F + xdr_ypbind_setdom F + xdr_ypdelete_args F + xdr_ypmap_parms F + xdr_ypmaplist F + xdr_yppush_status F + xdr_yppushresp_xfr F + xdr_ypreq_key F + xdr_ypreq_nokey F + xdr_ypreq_xfr F + xdr_ypresp_all F + xdr_ypresp_key_val F + xdr_ypresp_maplist F + xdr_ypresp_master F + xdr_ypresp_order F + xdr_ypresp_val F + xdr_ypresp_xfr F + xdr_ypstat F + xdr_ypupdate_args F + xdr_ypxfrstat F + yp_all F + yp_bind F + yp_first F + yp_get_default_domain F + yp_maplist F + yp_master F + yp_match F + yp_next F + yp_order F + yp_unbind F + yp_update F + ypbinderr_string F + yperr_string F + ypprot_err F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist new file mode 100644 index 0000000000..3ab004605a --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist @@ -0,0 +1,225 @@ +GLIBC_2.12 + GLIBC_2.12 A + _IO_flockfile F + _IO_ftrylockfile F + _IO_funlockfile F + __close F + __connect F + __errno_location F + __fcntl F + __fork F + __h_errno_location F + __libc_allocate_rtsig F + __libc_current_sigrtmax F + __libc_current_sigrtmin F + __lseek F + __nanosleep F + __open F + __open64 F + __pread64 F + __pthread_cleanup_routine F + __pthread_getspecific F + __pthread_key_create F + __pthread_mutex_destroy F + __pthread_mutex_init F + __pthread_mutex_lock F + __pthread_mutex_trylock F + __pthread_mutex_unlock F + __pthread_mutexattr_destroy F + __pthread_mutexattr_init F + __pthread_mutexattr_settype F + __pthread_once F + __pthread_register_cancel F + __pthread_register_cancel_defer F + __pthread_rwlock_destroy F + __pthread_rwlock_init F + __pthread_rwlock_rdlock F + __pthread_rwlock_tryrdlock F + __pthread_rwlock_trywrlock F + __pthread_rwlock_unlock F + __pthread_rwlock_wrlock F + __pthread_setspecific F + __pthread_unregister_cancel F + __pthread_unregister_cancel_restore F + __pthread_unwind_next F + __pwrite64 F + __read F + __res_state F + __send F + __sigaction F + __vfork F + __wait F + __write F + _pthread_cleanup_pop F + _pthread_cleanup_pop_restore F + _pthread_cleanup_push F + _pthread_cleanup_push_defer F + accept F + close F + connect F + fcntl F + flockfile F + fork F + fsync F + ftrylockfile F + funlockfile F + longjmp F + lseek F + lseek64 F + msync F + nanosleep F + open F + open64 F + pause F + pread F + pread64 F + pthread_atfork F + pthread_attr_destroy F + pthread_attr_getaffinity_np F + pthread_attr_getdetachstate F + pthread_attr_getguardsize F + pthread_attr_getinheritsched F + pthread_attr_getschedparam F + pthread_attr_getschedpolicy F + pthread_attr_getscope F + pthread_attr_getstack F + pthread_attr_getstackaddr F + pthread_attr_getstacksize F + pthread_attr_init F + pthread_attr_setaffinity_np F + pthread_attr_setdetachstate F + pthread_attr_setguardsize F + pthread_attr_setinheritsched F + pthread_attr_setschedparam F + pthread_attr_setschedpolicy F + pthread_attr_setscope F + pthread_attr_setstack F + pthread_attr_setstackaddr F + pthread_attr_setstacksize F + pthread_barrier_destroy F + pthread_barrier_init F + pthread_barrier_wait F + pthread_barrierattr_destroy F + pthread_barrierattr_getpshared F + pthread_barrierattr_init F + pthread_barrierattr_setpshared F + pthread_cancel F + pthread_cond_broadcast F + pthread_cond_destroy F + pthread_cond_init F + pthread_cond_signal F + pthread_cond_timedwait F + pthread_cond_wait F + pthread_condattr_destroy F + pthread_condattr_getclock F + pthread_condattr_getpshared F + pthread_condattr_init F + pthread_condattr_setclock F + pthread_condattr_setpshared F + pthread_create F + pthread_detach F + pthread_equal F + pthread_exit F + pthread_getaffinity_np F + pthread_getattr_np F + pthread_getconcurrency F + pthread_getcpuclockid F + pthread_getname_np F + pthread_getschedparam F + pthread_getspecific F + pthread_join F + pthread_key_create F + pthread_key_delete F + pthread_kill F + pthread_kill_other_threads_np F + pthread_mutex_consistent F + pthread_mutex_consistent_np F + pthread_mutex_destroy F + pthread_mutex_getprioceiling F + pthread_mutex_init F + pthread_mutex_lock F + pthread_mutex_setprioceiling F + pthread_mutex_timedlock F + pthread_mutex_trylock F + pthread_mutex_unlock F + pthread_mutexattr_destroy F + pthread_mutexattr_getkind_np F + pthread_mutexattr_getprioceiling F + pthread_mutexattr_getprotocol F + pthread_mutexattr_getpshared F + pthread_mutexattr_getrobust F + pthread_mutexattr_getrobust_np F + pthread_mutexattr_gettype F + pthread_mutexattr_init F + pthread_mutexattr_setkind_np F + pthread_mutexattr_setprioceiling F + pthread_mutexattr_setprotocol F + pthread_mutexattr_setpshared F + pthread_mutexattr_setrobust F + pthread_mutexattr_setrobust_np F + pthread_mutexattr_settype F + pthread_once F + pthread_rwlock_destroy F + pthread_rwlock_init F + pthread_rwlock_rdlock F + pthread_rwlock_timedrdlock F + pthread_rwlock_timedwrlock F + pthread_rwlock_tryrdlock F + pthread_rwlock_trywrlock F + pthread_rwlock_unlock F + pthread_rwlock_wrlock F + pthread_rwlockattr_destroy F + pthread_rwlockattr_getkind_np F + pthread_rwlockattr_getpshared F + pthread_rwlockattr_init F + pthread_rwlockattr_setkind_np F + pthread_rwlockattr_setpshared F + pthread_self F + pthread_setaffinity_np F + pthread_setcancelstate F + pthread_setcanceltype F + pthread_setconcurrency F + pthread_setname_np F + pthread_setschedparam F + pthread_setschedprio F + pthread_setspecific F + pthread_sigmask F + pthread_sigqueue F + pthread_spin_destroy F + pthread_spin_init F + pthread_spin_lock F + pthread_spin_trylock F + pthread_spin_unlock F + pthread_testcancel F + pthread_timedjoin_np F + pthread_tryjoin_np F + pthread_yield F + pwrite F + pwrite64 F + raise F + read F + recv F + recvfrom F + recvmsg F + sem_close F + sem_destroy F + sem_getvalue F + sem_init F + sem_open F + sem_post F + sem_timedwait F + sem_trywait F + sem_unlink F + sem_wait F + send F + sendmsg F + sendto F + sigaction F + siglongjmp F + sigwait F + system F + tcdrain F + vfork F + wait F + waitpid F + write F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libresolv.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libresolv.abilist new file mode 100644 index 0000000000..64826160a1 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libresolv.abilist @@ -0,0 +1,93 @@ +GLIBC_2.12 + GLIBC_2.12 A + __b64_ntop F + __b64_pton F + __dn_comp F + __dn_count_labels F + __dn_expand F + __dn_skipname F + __fp_nquery F + __fp_query F + __fp_resstat F + __hostalias F + __loc_aton F + __loc_ntoa F + __p_cdname F + __p_cdnname F + __p_class F + __p_class_syms D 0x54 + __p_fqname F + __p_fqnname F + __p_option F + __p_query F + __p_rcode F + __p_secstodate F + __p_time F + __p_type F + __p_type_syms D 0x228 + __putlong F + __putshort F + __res_close F + __res_dnok F + __res_hnok F + __res_hostalias F + __res_isourserver F + __res_mailok F + __res_mkquery F + __res_nameinquery F + __res_nmkquery F + __res_nquery F + __res_nquerydomain F + __res_nsearch F + __res_nsend F + __res_ownok F + __res_queriesmatch F + __res_query F + __res_querydomain F + __res_search F + __res_send F + __sym_ntop F + __sym_ntos F + __sym_ston F + _gethtbyaddr F + _gethtbyname F + _gethtbyname2 F + _gethtent F + _getlong F + _getshort F + _res_opcodes D 0x40 + _sethtent F + inet_net_ntop F + inet_net_pton F + inet_neta F + ns_datetosecs F + ns_format_ttl F + ns_get16 F + ns_get32 F + ns_initparse F + ns_makecanon F + ns_msg_getflag F + ns_name_compress F + ns_name_ntol F + ns_name_ntop F + ns_name_pack F + ns_name_pton F + ns_name_rollback F + ns_name_skip F + ns_name_uncompress F + ns_name_unpack F + ns_parse_ttl F + ns_parserr F + ns_put16 F + ns_put32 F + ns_samedomain F + ns_samename F + ns_skiprr F + ns_sprintrr F + ns_sprintrrf F + ns_subdomain F + res_gethostbyaddr F + res_gethostbyname F + res_gethostbyname2 F + res_send_setqhook F + res_send_setrhook F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/librt.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/librt.abilist new file mode 100644 index 0000000000..87fec065af --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/librt.abilist @@ -0,0 +1,42 @@ +GLIBC_2.12 + GLIBC_2.12 A + __mq_open_2 F + aio_cancel F + aio_cancel64 F + aio_error F + aio_error64 F + aio_fsync F + aio_fsync64 F + aio_init F + aio_read F + aio_read64 F + aio_return F + aio_return64 F + aio_suspend F + aio_suspend64 F + aio_write F + aio_write64 F + clock_getcpuclockid F + clock_getres F + clock_gettime F + clock_nanosleep F + clock_settime F + lio_listio F + lio_listio64 F + mq_close F + mq_getattr F + mq_notify F + mq_open F + mq_receive F + mq_send F + mq_setattr F + mq_timedreceive F + mq_timedsend F + mq_unlink F + shm_open F + shm_unlink F + timer_create F + timer_delete F + timer_getoverrun F + timer_gettime F + timer_settime F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libthread_db.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libthread_db.abilist new file mode 100644 index 0000000000..934ce9acd6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libthread_db.abilist @@ -0,0 +1,42 @@ +GLIBC_2.12 + GLIBC_2.12 A + td_init F + td_log F + td_symbol_list F + td_ta_clear_event F + td_ta_delete F + td_ta_enable_stats F + td_ta_event_addr F + td_ta_event_getmsg F + td_ta_get_nthreads F + td_ta_get_ph F + td_ta_get_stats F + td_ta_map_id2thr F + td_ta_map_lwp2thr F + td_ta_new F + td_ta_reset_stats F + td_ta_set_event F + td_ta_setconcurrency F + td_ta_thr_iter F + td_ta_tsd_iter F + td_thr_clear_event F + td_thr_dbresume F + td_thr_dbsuspend F + td_thr_event_enable F + td_thr_event_getmsg F + td_thr_get_info F + td_thr_getfpregs F + td_thr_getgregs F + td_thr_getxregs F + td_thr_getxregsize F + td_thr_set_event F + td_thr_setfpregs F + td_thr_setgregs F + td_thr_setprio F + td_thr_setsigpending F + td_thr_setxregs F + td_thr_sigsetmask F + td_thr_tls_get_addr F + td_thr_tlsbase F + td_thr_tsd F + td_thr_validate F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libutil.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libutil.abilist new file mode 100644 index 0000000000..50c312a7c6 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libutil.abilist @@ -0,0 +1,8 @@ +GLIBC_2.12 + GLIBC_2.12 A + forkpty F + login F + login_tty F + logout F + logwtmp F + openpty F diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h b/ports/sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h new file mode 100644 index 0000000000..9907bbf241 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/register-dump.h @@ -0,0 +1,111 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <_itoa.h> + +/* We will print the register dump in this format: + + R0: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R8: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R16: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R24: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R32: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R40: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R48: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + R52: XXXXXXXX TP: XXXXXXXX SP: XXXXXXXX LR: XXXXXXXX + + PC: XXXXXXXX ICS: X FAULTNUM: XX + + */ + +static void +hexvalue (unsigned long int value, char *buf, size_t len) +{ + char *cp = _itoa_word (value, buf + len, 16, 0); + while (cp > buf) + *--cp = '0'; +} + +static void +register_dump (int fd, mcontext_t *ctx) +{ + char regs[59][8]; + struct iovec iov[143]; + size_t nr = 0; + unsigned int i; + +#define ADD_STRING(str) \ + iov[nr].iov_base = (char *) str; \ + iov[nr].iov_len = strlen (str); \ + ++nr +#define ADD_MEM(str, len) \ + iov[nr].iov_base = str; \ + iov[nr].iov_len = len; \ + ++nr + + /* Generate strings of register contents. */ + for (i = 0; i < 56; ++i) + hexvalue (ctx->gregs[i], regs[i], 8); + hexvalue (ctx->pc, regs[56], 8); + hexvalue (ctx->ics, regs[57], 1); + hexvalue (ctx->faultnum, regs[58], 2); + + /* Generate the output. */ + for (i = 0; i < 52;) + { + const char *prefixes[] = { + "Register dump:\n\n R0: ", + "\n R8: ", + "\n R16: ", + "\n R24: ", + "\n R32: ", + "\n R40: ", + "\n R48: " + }; + ADD_STRING (prefixes[i / 8]); + do + { + ADD_MEM (regs[i], 8); + ADD_STRING (" "); + } + while (++i % 8 && i < 52); + } + ADD_STRING ("\n R52: "); + ADD_MEM (regs[52], 8); + ADD_STRING (" TP: "); + ADD_MEM (regs[53], 8); + ADD_STRING (" SP: "); + ADD_MEM (regs[54], 8); + ADD_STRING (" LR: "); + ADD_MEM (regs[55], 8); + ADD_STRING ("\n\n PC: "); + ADD_MEM (regs[56], 8); + ADD_STRING (" ICS: "); + ADD_MEM (regs[57], 1); + ADD_STRING (" FAULTNUM: "); + ADD_MEM (regs[58], 2); + ADD_STRING ("\n"); + + /* Write the stuff out. */ + writev (fd, iov, nr); +} + + +#define REGISTER_DUMP register_dump (fd, &ctx->uc_mcontext) diff --git a/ports/sysdeps/unix/sysv/linux/tile/ucontext_i.h b/ports/sysdeps/unix/sysv/linux/tile/ucontext_i.h new file mode 100644 index 0000000000..f8ae9c9f16 --- /dev/null +++ b/ports/sysdeps/unix/sysv/linux/tile/ucontext_i.h @@ -0,0 +1,42 @@ +/* Copyright (C) 2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Definitions of offsets within the ucontext_t structure. Note + that for convenience we use __SIZEOF_POINTER__ for "long" and + "ssize_t" fields (and their unsigned counterparts) as well. */ + +#define UC_FLAGS_OFFSET 0 +#define UC_LINK_OFFSET (UC_FLAGS_OFFSET + __SIZEOF_POINTER__) +#define UC_STACK_SP_OFFSET (UC_LINK_OFFSET + __SIZEOF_POINTER__) +#define UC_STACK_FLAGS_OFFSET (UC_STACK_SP_OFFSET + __SIZEOF_POINTER__) +#define UC_STACK_SIZE_OFFSET (UC_STACK_FLAGS_OFFSET + __SIZEOF_POINTER__) +#define UC_STACK_MCONTEXT_OFFSET \ + ((UC_STACK_SIZE_OFFSET + __SIZEOF_POINTER__ + REGSIZE - 1) & -REGSIZE) +#define UC_REG(i) (UC_STACK_MCONTEXT_OFFSET + ((i) * REGSIZE)) +#define UC_NREGS 64 +#define UC_SIGMASK_OFFSET UC_REG(UC_NREGS) +#define UC_SIZE (UC_SIGMASK_OFFSET + (_NSIG / 8)) + +/* From <asm/siginfo.h> */ +#define SI_MAX_SIZE 128 + +/* From <asm/signal.h> */ +#define _NSIG 64 +#define SIG_BLOCK 0 /* for blocking signals */ +#define SIG_UNBLOCK 1 /* for unblocking signals */ +#define SIG_SETMASK 2 /* for setting the signal mask */ |