diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 00:54:02 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 00:54:02 +0000 |
| commit | 5eb1fae2a97ffc88d136502ace050662e57ef34a (patch) | |
| tree | df1087921ff9a88aa8a47ddfd55dc15a793fec56 /libc/sysdeps/linux/hppa | |
| parent | dc0e95c67d350ca9e950abb5f75a63833380af9f (diff) | |
| download | uClibc-alpine-5eb1fae2a97ffc88d136502ace050662e57ef34a.tar.bz2 uClibc-alpine-5eb1fae2a97ffc88d136502ace050662e57ef34a.tar.xz | |
Merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/hppa')
| -rw-r--r-- | libc/sysdeps/linux/hppa/__longjmp.S | 3 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/__syscall_error.c | 25 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/bits/fenv.h | 78 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/bits/kernel_sigaction.h | 3 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/bits/kernel_stat.h | 2 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h | 41 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/brk.c | 12 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/clone.S | 13 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/crt1.S | 77 | ||||
| -rw-r--r-- | libc/sysdeps/linux/hppa/mmap.c | 11 |
10 files changed, 205 insertions, 60 deletions
diff --git a/libc/sysdeps/linux/hppa/__longjmp.S b/libc/sysdeps/linux/hppa/__longjmp.S index 62026635f..750863e95 100644 --- a/libc/sysdeps/linux/hppa/__longjmp.S +++ b/libc/sysdeps/linux/hppa/__longjmp.S @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <features.h> #define _SETJMP_H #define _ASM #include <bits/setjmp.h> @@ -69,3 +70,5 @@ __longjmp: bv,n %r0(%r2) .procend + +libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/hppa/__syscall_error.c b/libc/sysdeps/linux/hppa/__syscall_error.c index de65a1f39..5e109a83b 100644 --- a/libc/sysdeps/linux/hppa/__syscall_error.c +++ b/libc/sysdeps/linux/hppa/__syscall_error.c @@ -1,28 +1,17 @@ /* Wrapper for setting errno. - Copyright (C) 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + * + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include <errno.h> #include <features.h> /* This routine is jumped to by all the syscall handlers, to stash * an error number into errno. */ -int attribute_hidden __syscall_error(int err_no) +int __syscall_error(int err_no) attribute_hidden; +int __syscall_error(int err_no) { __set_errno(err_no); return -1; diff --git a/libc/sysdeps/linux/hppa/bits/fenv.h b/libc/sysdeps/linux/hppa/bits/fenv.h new file mode 100644 index 000000000..c5f8c4345 --- /dev/null +++ b/libc/sysdeps/linux/hppa/bits/fenv.h @@ -0,0 +1,78 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Huggins-Daines <dhd@debian.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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _FENV_H +# error "Never use <bits/fenv.h> directly; include <fenv.h> instead." +#endif + +/* Define bits representing the exception. We use the values of the + appropriate enable bits in the FPU status word (which, + coincidentally, are the same as the flag bits, but shifted right by + 27 bits). */ +enum +{ + FE_INVALID = 1<<4, /* V */ +#define FE_INVALID FE_INVALID + FE_DIVBYZERO = 1<<3, /* Z */ +#define FE_DIVBYZERO FE_DIVBYZERO + FE_OVERFLOW = 1<<2, /* O */ +#define FE_OVERFLOW FE_OVERFLOW + FE_UNDERFLOW = 1<<1, /* U */ +#define FE_UNDERFLOW FE_UNDERFLOW + FE_INEXACT = 1<<0, /* I */ +#define FE_INEXACT FE_INEXACT +}; + +#define FE_ALL_EXCEPT \ + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) + +/* The PA-RISC FPU supports all of the four defined rounding modes. + We use the values of the RM field in the floating point status + register for the appropriate macros. */ +enum + { + FE_TONEAREST = 0 << 9, +#define FE_TONEAREST FE_TONEAREST + FE_TOWARDZERO = 1 << 9, +#define FE_TOWARDZERO FE_TOWARDZERO + FE_UPWARD = 2 << 9, +#define FE_UPWARD FE_UPWARD + FE_DOWNWARD = 3 << 9, +#define FE_DOWNWARD FE_DOWNWARD + }; + +/* Type representing exception flags. */ +typedef unsigned int fexcept_t; + +/* Type representing floating-point environment. This structure + corresponds to the layout of the status and exception words in the + register file. */ +typedef struct +{ + unsigned int __status_word; + unsigned int __exception[7]; +} fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((fenv_t *) -1) + +#ifdef __USE_GNU +/* Floating-point environment where none of the exceptions are masked. */ +# define FE_NOMASK_ENV ((fenv_t *) -2) +#endif diff --git a/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h b/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h index af048cbe7..cccaabbb9 100644 --- a/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h +++ b/libc/sysdeps/linux/hppa/bits/kernel_sigaction.h @@ -16,3 +16,6 @@ struct kernel_sigaction { unsigned long sa_flags; sigset_t sa_mask; }; + +extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, + struct kernel_sigaction *__unbounded, size_t); diff --git a/libc/sysdeps/linux/hppa/bits/kernel_stat.h b/libc/sysdeps/linux/hppa/bits/kernel_stat.h index 3d5be0352..c64392037 100644 --- a/libc/sysdeps/linux/hppa/bits/kernel_stat.h +++ b/libc/sysdeps/linux/hppa/bits/kernel_stat.h @@ -4,8 +4,6 @@ #ifndef _PARISC_STAT_H #define _PARISC_STAT_H -#include <linux/types.h> - struct kernel_stat { unsigned int st_dev; /* dev_t is 32 bits on parisc */ ino_t st_ino; /* 32 bits */ diff --git a/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h b/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h new file mode 100644 index 000000000..bf048d3b8 --- /dev/null +++ b/libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h @@ -0,0 +1,41 @@ +/* + * Track misc arch-specific features that aren't config options + */ + +#ifndef _BITS_UCLIBC_ARCH_FEATURES_H +#define _BITS_UCLIBC_ARCH_FEATURES_H + +/* instruction used when calling abort() to kill yourself */ +#define __UCLIBC_ABORT_INSTRUCTION__ "iitlbp %r0,(%sr0,%r0)" + +/* can your target use syscall6() for mmap ? */ +#undef __UCLIBC_MMAP_HAS_6_ARGS__ + +/* does your target use syscall4() for truncate64 ? (32bit arches only) */ +#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__ + +/* does your target have a broken create_module() ? */ +#undef __UCLIBC_BROKEN_CREATE_MODULE__ + +/* does your target prefix all symbols with an _ ? */ +#define __UCLIBC_NO_UNDERSCORES__ + +/* does your target have an asm .set ? */ +#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__ + +/* define if target doesn't like .global */ +#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__ + +/* define if target supports .weak */ +#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__ + +/* define if target supports .weakext */ +#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__ + +/* needed probably only for ppc64 */ +#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__ + +/* define if target supports IEEE signed zero floats */ +#define __UCLIBC_HAVE_SIGNED_ZERO__ + +#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */ diff --git a/libc/sysdeps/linux/hppa/brk.c b/libc/sysdeps/linux/hppa/brk.c index f50360aa5..52d0b4c74 100644 --- a/libc/sysdeps/linux/hppa/brk.c +++ b/libc/sysdeps/linux/hppa/brk.c @@ -19,12 +19,18 @@ #include <errno.h> #include <sys/syscall.h> +#include <unistd.h> + +libc_hidden_proto(brk) /* This must be initialized data because commons can't have aliases. */ +extern void *__curbrk; +libc_hidden_proto(__curbrk) void *__curbrk = 0; +libc_hidden_data_def(__curbrk) -int attribute_hidden -__brk (void *addr) +int +brk (void *addr) { void *newbrk; @@ -38,4 +44,4 @@ __brk (void *addr) return 0; } -strong_alias(__brk,brk) +libc_hidden_def(brk) diff --git a/libc/sysdeps/linux/hppa/clone.S b/libc/sysdeps/linux/hppa/clone.S index 8395cdada..f6e5568d0 100644 --- a/libc/sysdeps/linux/hppa/clone.S +++ b/libc/sysdeps/linux/hppa/clone.S @@ -29,9 +29,9 @@ /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */ .text -.global __clone -.type __clone,%function -__clone: +.global clone +.type clone,%function +clone: /* FIXME: I have no idea how profiling works on hppa. */ /* Sanity check arguments. */ @@ -90,13 +90,10 @@ thread_start: bl $$dyncall,%r31 copy %r31,%rp - bl _exit_internal,%rp + bl HIDDEN_JUMPTARGET(_exit),%rp copy %ret0,%arg0 /* Die horribly. */ iitlbp %r0,(%r0) -.size __clone,.-__clone - -.weak clone - clone = __clone +.size clone,.-clone diff --git a/libc/sysdeps/linux/hppa/crt1.S b/libc/sysdeps/linux/hppa/crt1.S index 413f875a1..8b42dacde 100644 --- a/libc/sysdeps/linux/hppa/crt1.S +++ b/libc/sysdeps/linux/hppa/crt1.S @@ -34,16 +34,32 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ - .text - - .align 4 - .import main, code .import $global$, data .import __uClibc_main, code +#if defined(__UCLIBC_CTOR_DTOR__) .import _fini, code .import _init, code +#else + .weak _fini + .weak _init +#endif + + /* Have the linker create plabel words + so we get PLABEL32 relocs and not 21/14 */ + .section .rodata + .align 4 +.Lpmain: + .word P%main +.Lp__uClibc_main: + .word P%__uClibc_main +.Lp_fini: + .word P%_fini +.Lp_init: + .word P%_init + .text + .align 4 .globl _start .export _start, ENTRY .type _start,@function @@ -52,28 +68,41 @@ _start: .proc .callinfo - /* load main */ - ldil LP%main, %r26 - ldo RP%main(%r26), %r26 - - /* argc and argv should be in 25 and 24 */ - /* Expand the stack to store the 5th through 7th args */ ldo 64(%sp), %sp - - /* void (*rtld_fini) (void) (actually the 6th arg) */ - stw %r23, -56(%sp) - - /* void (*init) (void) */ - ldil LP%_init, %r23 - ldo RP%_init(%r23), %r23 - - /* void (*fini) (void) */ - ldil LP%_fini, %r22 - ldo RP%_fini(%r22), %r22 + /* TODO: Follow ABI? Place more things on the stack here... */ + +#ifdef __PIC__ + /* load main (1st argument) */ + addil LR'.Lpmain, %r19 + ldw RR'.Lpmain(%r1), %r26 + ldw 0(%r26),%r26 + /* argc and argv should be in 25 and 24 (2nd and 3rd argument) */ + /* void (*init) (void) (4th argument) */ + addil LR'.Lp_init, %r19 + ldw RR'.Lp_init(%r1), %r23 + ldw 0(%r23), %r23 + /* void (*fini) (void) (5th argument) */ + addil LR'.Lp_fini, %r19 + ldw RR'.Lp_fini(%r1), %r22 + ldw 0(%r22), %r22 +#else + /* load main (1st argument) */ + ldil LR'.Lpmain, %r26 + ldw RR'.Lpmain(%r26), %r26 + /* argc and argv should be in 25 and 24 (2nd and 3rd argument) */ + /* void (*init) (void) (4th argument) */ + ldil LR'.Lp_init, %r23 + ldw RR'.Lp_init(%r23), %r23 + /* void (*fini) (void) (5th argument) */ + ldil LR'.Lp_fini, %r22 + ldw RR'.Lp_fini(%r22), %r22 +#endif + /* Store 5th argument */ stw %r22, -52(%sp) - - /* void *stack_end */ + /* void (*rtld_fini) (void) (6th argument) */ + stw %r23, -56(%sp) + /* void *stack_end (7th argument) */ stw %sp, -60(%sp) /* load global */ @@ -83,7 +112,7 @@ _start: bl __uClibc_main,%r2 nop /* die horribly if it returned (it shouldn't) */ - iitlbp %r0,(%r0) + iitlbp %r0,(%sr0,%r0) nop .procend diff --git a/libc/sysdeps/linux/hppa/mmap.c b/libc/sysdeps/linux/hppa/mmap.c index f14f1b6f9..baaee6847 100644 --- a/libc/sysdeps/linux/hppa/mmap.c +++ b/libc/sysdeps/linux/hppa/mmap.c @@ -2,10 +2,10 @@ /* * mmap() for uClibc/x86_64 * - * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org> + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org> * - * GNU Library General Public License (LGPL) version 2 or later. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <errno.h> @@ -13,7 +13,8 @@ #include <sys/mman.h> #include <sys/syscall.h> -#define __NR___mmap __NR_mmap -attribute_hidden _syscall6(void *, __mmap, void *, start, size_t, length, int, prot, +libc_hidden_proto(mmap) + +_syscall6(void *, mmap, void *, start, size_t, length, int, prot, int, flags, int, fd, off_t, offset); -strong_alias(__mmap,mmap) +libc_hidden_def(mmap) |
