diff options
Diffstat (limited to 'libc/sysdeps/linux')
75 files changed, 8130 insertions, 319 deletions
diff --git a/libc/sysdeps/linux/alpha/bits/mathdef.h b/libc/sysdeps/linux/alpha/bits/mathdef.h index 2e5258230..615eb9db6 100644 --- a/libc/sysdeps/linux/alpha/bits/mathdef.h +++ b/libc/sysdeps/linux/alpha/bits/mathdef.h @@ -44,12 +44,12 @@ typedef double double_t; /* Due to an ABI change, we need to remap the complex float symbols. */ # define _Mdouble_ float # define __MATHCALL(function, args) \ - __MATHDECL (_Complex float, function, args) + __MATHDECL(_Complex float, function, args) # define __MATHDECL(type, function, args) \ - __MATHDECL_1(type, function##f, args, __c1_##function##f); \ - __MATHDECL_1(type, __##function##f, args, __c1_##function##f) + __MATHDECL_1(type, function##f, args, __c1_##function##f); \ + __MATHDECL_1(type, __##function##f, args, __c1_##function##f) # define __MATHDECL_1(type, function, args, alias) \ - extern type function args __asm__(#alias) __THROW + extern type function args __asm__(#alias) __THROW # include <bits/cmathcalls.h> diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 4222912fc..8a4add813 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -49,6 +49,11 @@ CSRC := $(filter-out waitpid.c, $(CSRC)) endif endif +ifneq ($(ARCH_USE_MMU),y) +# stubbed out in mman.h +CSRC := $(filter-out msync.c, $(CSRC)) +endif + ifneq ($(UCLIBC_BSD_SPECIFIC),y) # we need these internally: getdomainname.c CSRC := $(filter-out mincore.c setdomainname.c,$(CSRC)) diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c index 79b94adef..a7ab8fb61 100644 --- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c +++ b/libc/sysdeps/linux/common/__rt_sigtimedwait.c @@ -12,11 +12,7 @@ #include <signal.h> #include <string.h> -libc_hidden_proto(memcpy) - #ifdef __NR_rt_sigtimedwait -#include <string.h> -libc_hidden_proto(memcpy) # ifdef __UCLIBC_HAS_THREADS_NATIVE__ # include <sysdep-cancel.h> diff --git a/libc/sysdeps/linux/common/__rt_sigwaitinfo.c b/libc/sysdeps/linux/common/__rt_sigwaitinfo.c index c8953bfbc..92a11c9b6 100644 --- a/libc/sysdeps/linux/common/__rt_sigwaitinfo.c +++ b/libc/sysdeps/linux/common/__rt_sigwaitinfo.c @@ -12,12 +12,8 @@ #include <signal.h> #include <string.h> -libc_hidden_proto(memcpy) - #ifdef __NR_rt_sigtimedwait -#include <string.h> - # ifdef __UCLIBC_HAS_THREADS_NATIVE__ # include <sysdep-cancel.h> diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h index 3772b7d0d..1e92b527e 100644 --- a/libc/sysdeps/linux/common/bits/mathcalls.h +++ b/libc/sysdeps/linux/common/bits/mathcalls.h @@ -48,11 +48,16 @@ #endif -/* __MATHCALLX and __MATHCALLI include libm_hidden_def +/* __MATHCALLX(type,function,[suffix],args,attrib) and + * __MATHCALLI(type,function,[suffix],args) include libm_hidden_def * (for "double" versions only, xxxf and xxxl do not get this treatment). - * __MATHCALL does not. - * __MATHDECL_PRIV includes libm_hidden_def (always) - * and declares __foo, not foo. + * + * __MATHDECL(type,function,[suffix],args) does not. + * __MATHCALL(function,[suffix],args) also does not + * (it is just a shortcut to __MATHDECL(_Mdouble_,function,[suffix],args)). + * + * __MATHDECL_PRIV(type,function,[suffix],args,attrib) + * includes libm_hidden_def (always) and declares __foo, not foo. */ diff --git a/libc/sysdeps/linux/common/bits/sigset.h b/libc/sysdeps/linux/common/bits/sigset.h index 2f67a4ebf..4ef22311a 100644 --- a/libc/sysdeps/linux/common/bits/sigset.h +++ b/libc/sysdeps/linux/common/bits/sigset.h @@ -53,10 +53,6 @@ typedef struct { #if !defined _SIGSET_H_fns && defined _SIGNAL_H # define _SIGSET_H_fns 1 -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif - /* Return a mask that includes the bit for SIG only. */ /* Unsigned cast ensures shift/mask insns are used. */ # define __sigmask(sig) \ @@ -156,20 +152,30 @@ typedef struct { /* These functions needn't check for a bogus signal number -- error checking is done in the non __ versions. */ +# if !defined __USE_EXTERN_INLINES || defined __PROVIDE_OUT_OF_LINE_SIGSETFN extern int __sigismember (__const __sigset_t *, int); libc_hidden_proto(__sigismember) extern int __sigaddset (__sigset_t *, int); libc_hidden_proto(__sigaddset) extern int __sigdelset (__sigset_t *, int); libc_hidden_proto(__sigdelset) +# endif # ifdef __USE_EXTERN_INLINES +# undef _EXTERN_INLINE +# ifdef __PROVIDE_OUT_OF_LINE_SIGSETFN +# define _EXTERN_INLINE +# else /* normal case */ + /* dropped extern below: otherwise every module with __USE_EXTERN_INLINES + * will have its own copy of out-of line function emitted. */ +# define _EXTERN_INLINE /*extern*/ __always_inline +# endif # define __SIGSETFN(NAME, BODY, CONST) \ _EXTERN_INLINE int \ NAME (CONST __sigset_t *__set, int __sig) \ { \ unsigned long __mask = __sigmask (__sig); \ - unsigned long __word = __sigword (__sig); \ + unsigned __word = __sigword (__sig); \ return BODY; \ } @@ -180,5 +186,38 @@ __SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) # undef __SIGSETFN # endif +# ifdef _LIBC +/* It's far too much PITA to __USE_EXTERN_INLINES from within libc. + * Especially since we want to inline only calls with const sig, + * but __USE_EXTERN_INLINES will inline all calls! + */ +static __always_inline unsigned long +const_sigismember(const __sigset_t *set, int sig) +{ + unsigned long mask = __sigmask(sig); + unsigned word = __sigword(sig); + return (set->__val[word] & mask); +} +# define __sigismember(set, sig) \ + (__builtin_constant_p(sig) ? (const_sigismember(set, sig) != 0) : __sigismember(set, sig)) +static __always_inline void +const_sigaddset(__sigset_t *set, int sig) +{ + unsigned long mask = __sigmask(sig); + unsigned word = __sigword(sig); + set->__val[word] |= mask; +} +# define __sigaddset(set, sig) \ + (__builtin_constant_p(sig) ? (const_sigaddset(set, sig), 0) : __sigaddset(set, sig)) +static __always_inline void +const_sigdelset(__sigset_t *set, int sig) +{ + unsigned long mask = __sigmask(sig); + unsigned word = __sigword(sig); + set->__val[word] &= ~mask; +} +# define __sigdelset(set, sig) \ + (__builtin_constant_p(sig) ? (const_sigdelset(set, sig), 0) : __sigdelset(set, sig)) +# endif #endif /* ! _SIGSET_H_fns. */ diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c index 33eb409c6..ab16fa73c 100644 --- a/libc/sysdeps/linux/common/pause.c +++ b/libc/sysdeps/linux/common/pause.c @@ -25,7 +25,7 @@ __libc_pause (void) { sigset_t set; - __sigemptyset (&set); + /*__sigemptyset (&set); - why? */ sigprocmask (SIG_BLOCK, NULL, &set); /* pause is a cancellation point, but so is sigsuspend. diff --git a/libc/sysdeps/linux/i386/bits/mathinline.h b/libc/sysdeps/linux/i386/bits/mathinline.h index 53cbcb2b3..9e67182d5 100644 --- a/libc/sysdeps/linux/i386/bits/mathinline.h +++ b/libc/sysdeps/linux/i386/bits/mathinline.h @@ -206,7 +206,7 @@ __NTH (__signbitl (long double __x)) __MATH_INLINE float_type __NTH (func (float_type __x)) \ { \ register float_type __result; \ - __asm__ __volatile__ (op : "=t" (__result) : params); \ + __asm__ __volatile__ (op : "=t" (__result) : params); \ return __result; \ } diff --git a/libc/sysdeps/linux/microblaze/Makefile b/libc/sysdeps/linux/microblaze/Makefile index a7a832b24..338abc086 100644 --- a/libc/sysdeps/linux/microblaze/Makefile +++ b/libc/sysdeps/linux/microblaze/Makefile @@ -1,67 +1,25 @@ # Makefile for uClibc # -# Copyright (C) 2001,2002 NEC Corporation -# Copyright (C) 2001,2002 Miles Bader <miles@gnu.org> +# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> # -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - -TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -#FIXME -- this arch should include its own crti.S and crtn.S -UCLIBC_CTOR_DTOR=n - -CFLAGS += -I.. -ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl - -TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) - -CRT_SRC := crt0.S -CRT_OBJ := crt0.o crt1.o -CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC := setjmp.S __longjmp.S vfork.S -SOBJ := $(patsubst %.S,%.o, $(SSRC)) - -CSRC := mmap.c syscall.c clone.c -COBJ := $(patsubst %.c,%.o, $(CSRC)) - -OBJS := $(SOBJ) $(COBJ) - -OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) $(CTOR_TARGETS) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) - $(STRIPTOOL) -x -R .note -R .comment $^ - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(TOPDIR)lib/ - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - -$(SOBJ): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - -$(COBJ): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - -ifeq ($(UCLIBC_CTOR_DTOR),y) -$(TOPDIR)lib/crti.o: crti.S - $(INSTALL) -d $(TOPDIR)lib/ - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ - -$(TOPDIR)lib/crtn.o: crtn.S - $(INSTALL) -d $(TOPDIR)lib/ - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -else -$(CTOR_TARGETS): - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $@ -endif +# This program 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. +# +# This program is distributed in the hope that 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 this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -headers: +top_srcdir=../../../../ +top_builddir=../../../../ +all: objs -clean: - $(RM) *.o *~ core +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/microblaze/Makefile.arch b/libc/sysdeps/linux/microblaze/Makefile.arch new file mode 100644 index 000000000..ecbd80141 --- /dev/null +++ b/libc/sysdeps/linux/microblaze/Makefile.arch @@ -0,0 +1,14 @@ +# Makefile for uClibc +# +# Copyright (C) 2001,2002 NEC Corporation +# Copyright (C) 2001,2002 Miles Bader <miles@gnu.org> +# +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + +CSRC := mmap.c clone.c fixdfsi.c + +SSRC := setjmp.S __longjmp.S vfork.S + +ARCH_HEADERS := floatlib.h + +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/microblaze/__longjmp.S b/libc/sysdeps/linux/microblaze/__longjmp.S index 2752f0bd3..c4423bec5 100644 --- a/libc/sysdeps/linux/microblaze/__longjmp.S +++ b/libc/sysdeps/linux/microblaze/__longjmp.S @@ -16,30 +16,34 @@ #define _ASM #include <bits/setjmp.h> -#include <clinkage.h> +#include <libc-symbols.h> .text -C_ENTRY(__longjmp): + .globl C_SYMBOL_NAME(__longjmp) + .align 4 +C_SYMBOL_NAME(__longjmp): /* load registers from memory to r5 (arg0) */ lwi r1, r5, 0 lwi r15, r5, 4 - lwi r18, r5, 8 - lwi r19, r5, 12 - lwi r20, r5, 16 - lwi r21, r5, 20 - lwi r22, r5, 24 - lwi r23, r5, 28 - lwi r24, r5, 32 - lwi r25, r5, 36 - lwi r26, r5, 40 - lwi r27, r5, 44 - lwi r28, r5, 48 - lwi r29, r5, 52 - lwi r30, r5, 56 + lwi r2, r5, 8 + lwi r13, r5, 12 + lwi r18, r5, 16 + lwi r19, r5, 20 + lwi r20, r5, 24 + lwi r21, r5, 28 + lwi r22, r5, 32 + lwi r23, r5, 36 + lwi r24, r5, 40 + lwi r25, r5, 44 + lwi r26, r5, 48 + lwi r27, r5, 52 + lwi r28, r5, 56 + lwi r29, r5, 60 + lwi r30, r5, 64 + lwi r31, r5, 68 |