summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/frv
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/frv')
-rw-r--r--libc/sysdeps/linux/frv/Makefile59
-rw-r--r--libc/sysdeps/linux/frv/Makefile.arch11
-rw-r--r--libc/sysdeps/linux/frv/__init_brk.c2
-rw-r--r--libc/sysdeps/linux/frv/__longjmp.S4
-rw-r--r--libc/sysdeps/linux/frv/bits/elf-fdpic.h5
-rw-r--r--libc/sysdeps/linux/frv/bits/endian.h2
-rw-r--r--libc/sysdeps/linux/frv/bits/fcntl.h18
-rw-r--r--libc/sysdeps/linux/frv/bits/kernel_stat.h26
-rw-r--r--libc/sysdeps/linux/frv/bits/kernel_types.h3
-rw-r--r--libc/sysdeps/linux/frv/bits/mman.h76
-rw-r--r--libc/sysdeps/linux/frv/bits/setjmp.h12
-rw-r--r--libc/sysdeps/linux/frv/bits/stackinfo.h5
-rw-r--r--libc/sysdeps/linux/frv/bits/stat.h43
-rw-r--r--libc/sysdeps/linux/frv/bits/syscalls.h183
-rw-r--r--libc/sysdeps/linux/frv/bits/uClibc_arch_features.h17
-rw-r--r--libc/sysdeps/linux/frv/bits/uClibc_page.h4
-rw-r--r--libc/sysdeps/linux/frv/bits/wordsize.h5
-rw-r--r--libc/sysdeps/linux/frv/brk.c1
-rw-r--r--libc/sysdeps/linux/frv/clone.S5
-rw-r--r--libc/sysdeps/linux/frv/crt1.S (renamed from libc/sysdeps/linux/frv/crt0.S)12
-rw-r--r--libc/sysdeps/linux/frv/crti.S3
-rw-r--r--libc/sysdeps/linux/frv/crtn.S5
-rw-r--r--libc/sysdeps/linux/frv/crtreloc.c55
-rw-r--r--libc/sysdeps/linux/frv/dl-iterate-phdr.c3
-rw-r--r--libc/sysdeps/linux/frv/fstat.c3
-rw-r--r--libc/sysdeps/linux/frv/fstat64.c7
-rw-r--r--libc/sysdeps/linux/frv/jmpbuf-unwind.h12
-rw-r--r--libc/sysdeps/linux/frv/lstat.c3
-rw-r--r--libc/sysdeps/linux/frv/lstat64.c7
-rw-r--r--libc/sysdeps/linux/frv/mmap.c51
-rw-r--r--libc/sysdeps/linux/frv/sbrk.c1
-rw-r--r--libc/sysdeps/linux/frv/stat.c3
-rw-r--r--libc/sysdeps/linux/frv/stat64.c7
-rw-r--r--libc/sysdeps/linux/frv/sys/procfs.h5
-rw-r--r--libc/sysdeps/linux/frv/sys/ptrace.h5
-rw-r--r--libc/sysdeps/linux/frv/sys/ucontext.h3
-rw-r--r--libc/sysdeps/linux/frv/syscall.c6
-rw-r--r--libc/sysdeps/linux/frv/sysdep.c5
-rw-r--r--libc/sysdeps/linux/frv/vfork.S13
39 files changed, 210 insertions, 480 deletions
diff --git a/libc/sysdeps/linux/frv/Makefile b/libc/sysdeps/linux/frv/Makefile
index 554fdb0f4..3970f6263 100644
--- a/libc/sysdeps/linux/frv/Makefile
+++ b/libc/sysdeps/linux/frv/Makefile
@@ -1,58 +1,13 @@
# Makefile for uClibc
#
# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-# ported to FR-V by Alexandre Oliva <aoliva@redhat.com>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
-TOPDIR=../../../../
-include $(TOPDIR)Rules.mak
-
-CRT_SRC := crt0.S
-CRT_OBJ := crt0.o crt1.o
-SCRT_OBJ := $(patsubst %,S%, $(CRT_OBJ))
-
-CTOR_TARGETS := crti.o crtn.o
-
-SSRC := __longjmp.S setjmp.S clone.S vfork.S
-SOBJ := $(patsubst %.S,%.o, $(SSRC))
-
-CSRC = mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
-CSRC += xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
-COBJ := $(patsubst %.c,%.o, $(CSRC))
-
-OBJS := $(SOBJ) $(COBJ)
-
-OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
-
-all: $(OBJ_LIST)
-
-$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS)
- $(STRIPTOOL) -x -R .note -R .comment $^
- $(INSTALL) -d $(TOPDIR)lib/
- cp $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
- echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
-
-$(CRT_OBJ): $(CRT_SRC) crtreloc.o
- $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $^ -o $*.o
-
-crtreloc.o: crtreloc.c
- $(CC) $(CFLAGS) -c $< -o $@
-
-$(SCRT_OBJ): $(CRT_SRC) Scrtreloc.o
- $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $^ -o $*.o
-
-Scrtreloc.o: crtreloc.c
- $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
-
-$(CTOR_TARGETS): %.o : %.S
- $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
-
-$(SOBJ): %.o : %.S
- $(CC) $(ASFLAGS) -c $< -o $@
-
-$(COBJ): %.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
-
-clean:
- $(RM) *.o *~ core
+top_srcdir=../../../../
+top_builddir=../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.arch
+include $(top_srcdir)Makerules
diff --git a/libc/sysdeps/linux/frv/Makefile.arch b/libc/sysdeps/linux/frv/Makefile.arch
new file mode 100644
index 000000000..be48fd007
--- /dev/null
+++ b/libc/sysdeps/linux/frv/Makefile.arch
@@ -0,0 +1,11 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+# ported to FR-V by Alexandre Oliva <aoliva@redhat.com>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+CSRC-y := sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
+
+SSRC-y := __longjmp.S setjmp.S clone.S vfork.S
+
diff --git a/libc/sysdeps/linux/frv/__init_brk.c b/libc/sysdeps/linux/frv/__init_brk.c
index 07cf32022..7e4c8d13f 100644
--- a/libc/sysdeps/linux/frv/__init_brk.c
+++ b/libc/sysdeps/linux/frv/__init_brk.c
@@ -7,7 +7,7 @@
void * __curbrk attribute_hidden = 0;
#define __NR__brk __NR_brk
-attribute_hidden _syscall1(void *, _brk, void *, ptr);
+attribute_hidden _syscall1(void *, _brk, void *, ptr)
extern int __init_brk(void) attribute_hidden;
int
diff --git a/libc/sysdeps/linux/frv/__longjmp.S b/libc/sysdeps/linux/frv/__longjmp.S
index c3145c84f..d186ab18e 100644
--- a/libc/sysdeps/linux/frv/__longjmp.S
+++ b/libc/sysdeps/linux/frv/__longjmp.S
@@ -4,10 +4,6 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
# setjmp/longjmp for Frv. The jmpbuf looks like this:
#
# Register jmpbuf offset
diff --git a/libc/sysdeps/linux/frv/bits/elf-fdpic.h b/libc/sysdeps/linux/frv/bits/elf-fdpic.h
index 905648054..dddf82ccc 100644
--- a/libc/sysdeps/linux/frv/bits/elf-fdpic.h
+++ b/libc/sysdeps/linux/frv/bits/elf-fdpic.h
@@ -22,8 +22,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, see <http://www.gnu.org/licenses/>. */
#ifndef _BITS_ELF_FDPIC_H
#define _BITS_ELF_FDPIC_H
@@ -64,7 +63,7 @@ struct elf32_fdpic_loadaddr {
/* Map a pointer's VMA to its corresponding address according to the
load map. */
-inline static void *
+static __always_inline void *
__reloc_pointer (void *p,
const struct elf32_fdpic_loadmap *map)
{
diff --git a/libc/sysdeps/linux/frv/bits/endian.h b/libc/sysdeps/linux/frv/bits/endian.h
index 0564c5921..3ce83c592 100644
--- a/libc/sysdeps/linux/frv/bits/endian.h
+++ b/libc/sysdeps/linux/frv/bits/endian.h
@@ -1,4 +1,4 @@
-/* frv is little-endian. */
+/* frv is big-endian. */
#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h
index 49da6279d..0581f2bf3 100644
--- a/libc/sysdeps/linux/frv/bits/fcntl.h
+++ b/libc/sysdeps/linux/frv/bits/fcntl.h
@@ -13,9 +13,8 @@
Lesser General Public License 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. */
+ 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."
@@ -23,6 +22,9 @@
#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 */
@@ -45,7 +47,9 @@
# define O_DIRECT 040000 /* Direct disk access. */
# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
-# define O_STREAMING 04000000/* streaming access */
+# define O_NOATIME 01000000 /* don't set atime */
+# define O_CLOEXEC 02000000 /* set close_on_exec */
+# define O_PATH 010000000 /* Resolve pathname but do not open file. */
#endif
/* For now Linux has synchronisity options for data and read operations.
@@ -95,6 +99,8 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set on new fd. */
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
#endif
/* For F_[GET|SET]FL. */
@@ -164,7 +170,7 @@ struct flock64
#endif
-#ifdef __USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Flags for SYNC_FILE_RANGE. */
# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
in the range before performing the
@@ -187,7 +193,7 @@ struct flock64
__BEGIN_DECLS
-#ifdef __USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
diff --git a/libc/sysdeps/linux/frv/bits/kernel_stat.h b/libc/sysdeps/linux/frv/bits/kernel_stat.h
index 8b80a2608..1cf521044 100644
--- a/libc/sysdeps/linux/frv/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/frv/bits/kernel_stat.h
@@ -1,10 +1,6 @@
#ifndef _BITS_STAT_STRUCT_H
#define _BITS_STAT_STRUCT_H
-#ifndef _LIBC
-#error bits/kernel_stat.h is for internal uClibc use only!
-#endif
-
/* This file provides whatever this particular arch's kernel thinks
* struct kernel_stat should look like... It turns out each arch has a
* different opinion on the subject... */
@@ -38,14 +34,9 @@ struct kernel_stat {
unsigned long __pad10; /* future possible st_blocks high bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __unused1;
- unsigned long st_atime;
-
- unsigned long __unused2;
- unsigned long st_mtime;
-
- unsigned long __unused3;
- unsigned long st_ctime;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long __unused4;
};
@@ -73,14 +64,9 @@ struct kernel_stat64 {
unsigned long __pad4; /* future possible st_blocks high bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __unused1;
- unsigned long st_atime;
-
- unsigned long __unused2;
- unsigned long st_mtime;
-
- unsigned long __unused3; /* will be high 32 bits of ctime someday */
- unsigned long st_ctime;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
unsigned long long __unused4;
};
diff --git a/libc/sysdeps/linux/frv/bits/kernel_types.h b/libc/sysdeps/linux/frv/bits/kernel_types.h
index 8403fd3e8..be4fe224f 100644
--- a/libc/sysdeps/linux/frv/bits/kernel_types.h
+++ b/libc/sysdeps/linux/frv/bits/kernel_types.h
@@ -31,6 +31,9 @@ typedef unsigned int __kernel_gid32_t;
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
typedef long long __kernel_loff_t;
+typedef __kernel_dev_t __kernel_old_dev_t;
+typedef long __kernel_long_t;
+typedef unsigned long __kernel_ulong_t;
typedef struct {
#ifdef __USE_ALL
diff --git a/libc/sysdeps/linux/frv/bits/mman.h b/libc/sysdeps/linux/frv/bits/mman.h
deleted file mode 100644
index 0802005f4..000000000
--- a/libc/sysdeps/linux/frv/bits/mman.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Definitions for POSIX memory map interface. Linux/frv version.
- 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#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. */
-
-/* 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
-# define MREMAP_FIXED 2
-#endif
diff --git a/libc/sysdeps/linux/frv/bits/setjmp.h b/libc/sysdeps/linux/frv/bits/setjmp.h
index d49ad7b71..76800ff43 100644
--- a/libc/sysdeps/linux/frv/bits/setjmp.h
+++ b/libc/sysdeps/linux/frv/bits/setjmp.h
@@ -12,9 +12,8 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* Define the machine-dependent type `jmp_buf'. FRV version. */
@@ -35,7 +34,6 @@
#define __SETJMP_FP (__SETJMP_SP+1)
-#ifndef _ASM
typedef struct
/* Demand 64-bit alignment such that we can use std/ldd in
setjmp/longjmp. */
@@ -48,11 +46,5 @@ __attribute__((__aligned__(8)))
unsigned long __sp; /* stack pointer */
unsigned long __fp; /* frame pointer */
} __jmp_buf[1];
-#endif
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)->__sp)
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/frv/bits/stackinfo.h b/libc/sysdeps/linux/frv/bits/stackinfo.h
index 03412e009..6ebdf9f1f 100644
--- a/libc/sysdeps/linux/frv/bits/stackinfo.h
+++ b/libc/sysdeps/linux/frv/bits/stackinfo.h
@@ -12,9 +12,8 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* This file contains a bit of information about the stack allocation
of the processor. */
diff --git a/libc/sysdeps/linux/frv/bits/stat.h b/libc/sysdeps/linux/frv/bits/stat.h
index ae5f059f7..e6a1944bb 100644
--- a/libc/sysdeps/linux/frv/bits/stat.h
+++ b/libc/sysdeps/linux/frv/bits/stat.h
@@ -12,9 +12,8 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_STAT_H
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
@@ -71,6 +70,20 @@ struct stat
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
#endif
+#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
unsigned long int __unused1;
__time_t st_atime; /* Time of last access. */
@@ -79,7 +92,7 @@ struct stat
unsigned long int __unused3;
__time_t st_ctime; /* Time of last status change. */
-
+#endif
unsigned long long __unused4;
};
@@ -104,7 +117,20 @@ struct stat64
__blksize_t st_blksize; /* Optimal block size for I/O. */
__blkcnt64_t st_blocks; /* Number 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. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
unsigned long int __unused1;
__time_t st_atime; /* Time of last access. */
@@ -113,7 +139,7 @@ struct stat64
unsigned long int __unused3;
__time_t st_ctime; /* Time of last status change. */
-
+#endif
unsigned long long __unused4;
};
#endif
@@ -151,4 +177,9 @@ struct stat64
#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/libc/sysdeps/linux/frv/bits/syscalls.h b/libc/sysdeps/linux/frv/bits/syscalls.h
index eea3050ba..b03e8dbe0 100644
--- a/libc/sysdeps/linux/frv/bits/syscalls.h
+++ b/libc/sysdeps/linux/frv/bits/syscalls.h
@@ -10,130 +10,71 @@
#define SYS_ify(syscall_name) (__NR_##syscall_name)
-/* user-visible error numbers are in the range -1 - -4095: see <asm-frv/errno.h> */
-#if defined _LIBC && !defined __set_errno
-# define __syscall_return(type, res) \
-do { \
- unsigned long __sr2 = (res); \
- if (__builtin_expect ((unsigned long)(__sr2) \
- >= (unsigned long)(-4095), 0)) { \
- extern int __syscall_error (int); \
- return (type) __syscall_error (__sr2); \
- } \
- return (type) (__sr2); \
-} while (0)
-#else
-# define __syscall_return(type, res) \
-do { \
- unsigned long __sr2 = (res); \
- if (__builtin_expect ((unsigned long)(__sr2) \
- >= (unsigned long)(-4095), 0)) { \
- __set_errno (-__sr2); \
- __sr2 = -1; \
- } \
- return (type) (__sr2); \
-} while (0)
-#endif
-
-#ifndef __set_errno
-# define __set_errno(val) ((*__errno_location ()) = (val))
-#endif
-
-/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
-
-#define _syscall0(type,name) \
-type name(void) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8"); \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "=r" (__sc0) \
- : "r" (__scnum)); \
-__syscall_return(type,__sc0); \
-}
-
-#define _syscall1(type,name,type1,arg1) \
-type name(type1 arg1) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "+r" (__sc0) \
- : "r" (__scnum)); \
-__syscall_return(type,__sc0); \
-}
-
-#define _syscall2(type,name,type1,arg1,type2,arg2) \
-type name(type1 arg1,type2 arg2) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
-register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "+r" (__sc0) \
- : "r" (__scnum), "r" (__sc1)); \
-__syscall_return(type,__sc0); \
-}
-
-#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
-type name(type1 arg1,type2 arg2,type3 arg3) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
-register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
-register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "+r" (__sc0) \
- : "r" (__scnum), "r" (__sc1), "r" (__sc2)); \
-__syscall_return(type,__sc0); \
-}
+#define INLINE_SYSCALL_NCS(name, nr, args...) \
+(__extension__ \
+ ({ \
+ unsigned int _inline_sys_result = INTERNAL_SYSCALL_NCS (name, , nr, args);\
+ if (unlikely (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, ))) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, )); \
+ _inline_sys_result = (unsigned int) -1; \
+ } \
+ (int) _inline_sys_result; \
+ }) \
+)
-#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
-register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
-register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
-register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "+r" (__sc0) \
- : "r" (__scnum), "r" (__sc1), "r" (__sc2), "r" (__sc3)); \
-__syscall_return(type,__sc0); \
-}
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+(__extension__ \
+ ({unsigned int __internal_sys_result; \
+ { \
+ register int __a1 __asm__ ("gr8"); \
+ register int _nr __asm__ ("gr7"); \
+ LOAD_ARGS_##nr (args) \
+ _nr = (name); \
+ __asm__ __volatile__ ("tra gr0,gr0" \
+ : "=r" (__a1) \
+ : "r" (_nr) ASM_ARGS_##nr \
+ : "memory"); \
+ __internal_sys_result = __a1; \
+ } \
+ (int) __internal_sys_result; }) \
+)
-#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
-type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
-register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
-register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
-register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
-register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5; \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "+r" (__sc0) \
- : "r" (__scnum), "r" (__sc1), "r" (__sc2), \
- "r" (__sc3), "r" (__sc4)); \
-__syscall_return(type,__sc0); \
-}
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned int) (val) >= 0xfffff001u)
-#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \
-type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
-{ \
-register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
-register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
-register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
-register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
-register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
-register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5; \
-register unsigned long __sc5 __asm__ ("gr13") = (unsigned long) arg6; \
-__asm__ __volatile__ ("tra gr0,gr0" \
- : "+r" (__sc0) \
- : "r" (__scnum), "r" (__sc1), "r" (__sc2), \
- "r" (__sc3), "r" (__sc4), "r" (__sc5)); \
-__syscall_return(type,__sc0); \
-}
+#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__ ("gr8") = __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__ ("gr9") = __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__ ("gr10") = __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__ ("gr11") = __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__ ("gr12") = __v2tmp;
+#define ASM_ARGS_6 ASM_ARGS_5, "r" (__v2)
#endif /* __ASSEMBLER__ */
#endif /* _BITS_SYSCALLS_H */
diff --git a/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h b/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
index f4adaf5ad..f660fd223 100644
--- a/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
@@ -12,28 +12,31 @@
/* 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 align 64bit values in register pairs ? (32bit arches only) */
+#undef __UCLIBC_SYSCALL_ALIGN_64BIT__
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
+/* does your target have to worry about older [gs]etrlimit() ? */
+#undef __UCLIBC_HANDLE_OLDER_RLIMIT__
+
/* 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 CFI pseudo ops */
+#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
/* define if target supports IEEE signed zero floats */
#define __UCLIBC_HAVE_SIGNED_ZERO__
+/* only weird assemblers generally need this */
+#define __UCLIBC_ASM_LINE_SEP__ !
+
#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/libc/sysdeps/linux/frv/bits/uClibc_page.h b/libc/sysdeps/linux/frv/bits/uClibc_page.h
index 51a6e15d3..02f619cdc 100644
--- a/libc/sysdeps/linux/frv/bits/uClibc_page.h
+++ b/libc/sysdeps/linux/frv/bits/uClibc_page.h
@@ -11,8 +11,8 @@
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/>.
*/
/* Supply an architecture specific value for PAGE_SIZE and friends. */
diff --git a/libc/sysdeps/linux/frv/bits/wordsize.h b/libc/sysdeps/linux/frv/bits/wordsize.h
index ba643b60a..ca82fd7d4 100644
--- a/libc/sysdeps/linux/frv/bits/wordsize.h
+++ b/libc/sysdeps/linux/frv/bits/wordsize.h
@@ -12,8 +12,7 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define __WORDSIZE 32
diff --git a/libc/sysdeps/linux/frv/brk.c b/libc/sysdeps/linux/frv/brk.c
index c69c97ad6..a98cd5446 100644
--- a/libc/sysdeps/linux/frv/brk.c
+++ b/libc/sysdeps/linux/frv/brk.c
@@ -13,7 +13,6 @@ extern void * __curbrk attribute_hidden;
extern int __init_brk (void) attribute_hidden;
extern void *_brk(void *ptr) attribute_hidden;
-libc_hidden_proto(brk)
int brk(void * end_data_seg)
{
if (__init_brk () == 0)
diff --git a/libc/sysdeps/linux/frv/clone.S b/libc/sysdeps/linux/frv/clone.S
index 145615734..9b7074394 100644
--- a/libc/sysdeps/linux/frv/clone.S
+++ b/libc/sysdeps/linux/frv/clone.S
@@ -13,9 +13,8 @@
Lesser General Public License 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. */
+ 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. */
diff --git a/libc/sysdeps/linux/frv/crt0.S b/libc/sysdeps/linux/frv/crt1.S
index a1d07bb69..0827feae7 100644
--- a/libc/sysdeps/linux/frv/crt0.S
+++ b/libc/sysdeps/linux/frv/crt1.S
@@ -22,8 +22,7 @@ into another program.)
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, see <http://www.gnu.org/licenses/>. */
/* Based on ../i386/crt0.S and newlib's libgloss/frv/crt0.S */
@@ -45,13 +44,10 @@ Cambridge, MA 02139, USA. */
.text
.global _start
.type _start,%function
-#if defined L_crt0 || defined L_Scrt0 || ! defined __UCLIBC_CTOR_DTOR__
- .type __uClibc_main,%function
-#else
.weak _init
.weak _fini
- .type __uClibc_start_main,%function
-#endif
+ .type __uClibc_main,%function
+
_start:
/* Make sure the stack pointer is properly aligned. Save the
original value in gr21 such that we can get to arguments and
@@ -105,7 +101,7 @@ _start:
ld.p @(gr11, gr17), gr11
mov gr17, gr15
ld.p @(gr12, gr17), gr12
- call __uClibc_start_main
+ call __uClibc_main
#else
mov.p gr17, gr15
call __uClibc_main
diff --git a/libc/sysdeps/linux/frv/crti.S b/libc/sysdeps/linux/frv/crti.S
index 178852467..094044366 100644
--- a/libc/sysdeps/linux/frv/crti.S
+++ b/libc/sysdeps/linux/frv/crti.S
@@ -22,8 +22,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, see <http://www.gnu.org/licenses/>. */
.section .init,"x"
.p2align 2
diff --git a/libc/sysdeps/linux/frv/crtn.S b/libc/sysdeps/linux/frv/crtn.S
index 1d58c0207..10f93e4f0 100644
--- a/libc/sysdeps/linux/frv/crtn.S
+++ b/libc/sysdeps/linux/frv/crtn.S
@@ -22,8 +22,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, see <http://www.gnu.org/licenses/>. */
.section .init,"x"
.globl _init
@@ -32,7 +31,6 @@ Cambridge, MA 02139, USA. */
ld @(sp,gr0), fp
addi sp,#16,sp
jmpl @(gr5,gr0)
- .size _init, .-_init
.section .fini,"x"
.globl _fini
@@ -41,4 +39,3 @@ Cambridge, MA 02139, USA. */
ld @(sp,gr0), fp
addi sp,#16,sp
jmpl @(gr5,gr0)
- .size _fini, .-_fini
diff --git a/libc/sysdeps/linux/frv/crtreloc.c b/libc/sysdeps/linux/frv/crtreloc.c
index e025b619f..b1d542395 100644
--- a/libc/sysdeps/linux/frv/crtreloc.c
+++ b/libc/sysdeps/linux/frv/crtreloc.c
@@ -23,8 +23,9 @@ Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef __FRV_FDPIC__
#include <sys/types.h>
#include <link.h>
@@ -34,7 +35,7 @@ Cambridge, MA 02139, USA. */
/* Compute the runtime address of pointer in the range [p,e), and then
map the pointer pointed by it. */
-inline static void ***
+static __always_inline void ***
reloc_range_indirect (void ***p, void ***e,
const struct elf32_fdpic_loadmap *map)
{
@@ -62,7 +63,7 @@ reloc_range_indirect (void ***p, void ***e,
/* Call __reloc_range_indirect for the given range except for the last
entry, whose contents are only relocated. It's expected to hold
the GOT value. */
-void* attribute_hidden
+attribute_hidden void*
__self_reloc (const struct elf32_fdpic_loadmap *map,
void ***p, void ***e)
{
@@ -73,48 +74,4 @@ __self_reloc (const struct elf32_fdpic_loadmap *map,
return __reloc_pointer (*p, map);
}
-
-#if 0
-/* These are other functions that might be useful, but that we don't
- need. */
-
-/* Remap pointers in [p,e). */
-inline static void**
-reloc_range (void **p, void **e,
- const struct elf32_fdpic_loadmap *map)
-{
- while (p < e)
- {
- *p = __reloc_pointer (*p, map);
- p++;
- }
- return p;
-}
-
-/* Remap p, adjust e by the same offset, then map the pointers in the
- range determined by them. */
-void attribute_hidden
-__reloc_range (const struct elf32_fdpic_loadmap *map,
- void **p, void **e)
-{
- void **old = p;
-
- p = __reloc_pointer (p, map);
- e += p - old;
- reloc_range (p, e, map);
-}
-
-/* Remap p, adjust e by the same offset, then map pointers referenced
- by the (unadjusted) pointers in the range. Return the relocated
- value of the last pointer in the range. */
-void* attribute_hidden
-__reloc_range_indirect (const struct elf32_fdpic_loadmap *map,
- void ***p, void ***e)
-{
- void ***old = p;
-
- p = __reloc_pointer (p, map);
- e += p - old;
- return reloc_range_indirect (p, e, map);
-}
-#endif
+#endif /* __FRV_FDPIC__ */
diff --git a/libc/sysdeps/linux/frv/dl-iterate-phdr.c b/libc/sysdeps/linux/frv/dl-iterate-phdr.c
index 144e4c145..59051e513 100644
--- a/libc/sysdeps/linux/frv/dl-iterate-phdr.c
+++ b/libc/sysdeps/linux/frv/dl-iterate-phdr.c
@@ -13,8 +13,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, see <http://www.gnu.org/licenses/>. */
#include <link.h>
diff --git a/libc/sysdeps/linux/frv/fstat.c b/libc/sysdeps/linux/frv/fstat.c
index fc8a25af5..45d2746b3 100644
--- a/libc/sysdeps/linux/frv/fstat.c
+++ b/libc/sysdeps/linux/frv/fstat.c
@@ -13,6 +13,5 @@
#include <unistd.h>
#include <sys/stat.h>
-libc_hidden_proto(fstat)
-_syscall2(int, fstat, int, fd, struct stat *, buf);
+_syscall2(int, fstat, int, fd, struct stat *, buf)
libc_hidden_def(fstat)
diff --git a/libc/sysdeps/linux/frv/fstat64.c b/libc/sysdeps/linux/frv/fstat64.c
index dcb9b922c..75383b272 100644
--- a/libc/sysdeps/linux/frv/fstat64.c
+++ b/libc/sysdeps/linux/frv/fstat64.c
@@ -9,12 +9,9 @@
* Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
+#include <_lfs_64.h>
#include <sys/syscall.h>
-#include <unistd.h>
#include <sys/stat.h>
-#ifdef __UCLIBC_HAS_LFS__
-libc_hidden_proto(fstat64)
-_syscall2(int, fstat64, int, fd, struct stat64 *, buf);
+_syscall2(int, fstat64, int, fd, struct stat64 *, buf)
libc_hidden_def(fstat64)
-#endif
diff --git a/libc/sysdeps/linux/frv/jmpbuf-unwind.h b/libc/sysdeps/linux/frv/jmpbuf-unwind.h
new file mode 100644
index 000000000..c22ab2409
--- /dev/null
+++ b/libc/sysdeps/linux/frv/jmpbuf-unwind.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <setjmp.h>
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)->__sp)
diff --git a/libc/sysdeps/linux/frv/lstat.c b/libc/sysdeps/linux/frv/lstat.c
index 7a0297bfa..94f722f42 100644
--- a/libc/sysdeps/linux/frv/lstat.c
+++ b/libc/sysdeps/linux/frv/lstat.c
@@ -13,6 +13,5 @@
#include <unistd.h>
#include <sys/stat.h>
-libc_hidden_proto(lstat)
-_syscall2(int, lstat, const char *, file_name, struct stat *, buf);
+_syscall2(int, lstat, const char *, file_name, struct stat *, buf)
libc_hidden_def(lstat)
diff --git a/libc/sysdeps/linux/frv/lstat64.c b/libc/sysdeps/linux/frv/lstat64.c
index e95653ed5..e84581c1e 100644
--- a/libc/sysdeps/linux/frv/lstat64.c
+++ b/libc/sysdeps/linux/frv/lstat64.c
@@ -9,12 +9,9 @@
* Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
+#include <_lfs_64.h>
#include <sys/syscall.h>
-#include <unistd.h>
#include <sys/stat.h>
-#ifdef __UCLIBC_HAS_LFS__
-libc_hidden_proto(lstat64)
-_syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf);
+_syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf)
libc_hidden_def(lstat64)
-#endif
diff --git a/libc/sysdeps/linux/frv/mmap.c b/libc/sysdeps/linux/frv/mmap.c
deleted file mode 100644
index f251babbb..000000000
--- a/libc/sysdeps/linux/frv/mmap.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Daniel Jacobowitz <dan@debian.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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Massivly hacked up for uClibc by Erik Andersen */
-
-/* Extracted from ../common/mmap64.c by Alexandre Oliva <aoliva@redhat.com>
-
- We don't want to use the old mmap interface. */
-
-#include <features.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-#include <sys/mman.h>
-
-libc_hidden_proto(mmap)
-
-#define __NR___syscall_mmap2 __NR_mmap2
-static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
- size_t, len, int, prot, int, flags, int, fd, off_t, offset);
-
-/* This is always 12, even on architectures where PAGE_SHIFT != 12. */
-# ifndef MMAP2_PAGE_SHIFT
-# define MMAP2_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 << MMAP2_PAGE_SHIFT) - 1)) {
- __set_errno (EINVAL);
- return MAP_FAILED;
- }
- return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
-}
-libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/frv/sbrk.c b/libc/sysdeps/linux/frv/sbrk.c
index a1ff2a148..2dc719a16 100644
--- a/libc/sysdeps/linux/frv/sbrk.c
+++ b/libc/sysdeps/linux/frv/sbrk.c
@@ -8,7 +8,6 @@ extern void * __curbrk attribute_hidden;
extern int __init_brk (void) attribute_hidden;
extern void *_brk(void *ptr) attribute_hidden;
-libc_hidden_proto(sbrk)
void *
sbrk(intptr_t increment)
{
diff --git a/libc/sysdeps/linux/frv/stat.c b/libc/sysdeps/linux/frv/stat.c
index 6c3f0b962..74e310071 100644
--- a/libc/sysdeps/linux/frv/stat.c
+++ b/libc/sysdeps/linux/frv/stat.c
@@ -13,6 +13,5 @@
#include <unistd.h>
#include <sys/stat.h>
-libc_hidden_proto(stat)
-_syscall2(int, stat, const char *, file_name, struct stat *, buf);
+_syscall2(int, stat, const char *, file_name, struct stat *, buf)
libc_hidden_def(stat)
diff --git a/libc/sysdeps/linux/frv/stat64.c b/libc/sysdeps/linux/frv/stat64.c
index 659ad8ae2..a13d1c35d 100644
--- a/libc/sysdeps/linux/frv/stat64.c
+++ b/libc/sysdeps/linux/frv/stat64.c
@@ -9,12 +9,9 @@
* Adapted to FR-V by Alexandre Oliva <aoliva@redhat.com>
*/
+#include <_lfs_64.h>
#include <sys/syscall.h>
-#include <unistd.h>
#include <sys/stat.h>
-#ifdef __UCLIBC_HAS_LFS__
-libc_hidden_proto(stat64)
-_syscall2(int, stat64, const char *, file_name, struct stat64 *, buf);
+_syscall2(int, stat64, const char *, file_name, struct stat64 *, buf)
libc_hidden_def(stat64)
-#endif
diff --git a/libc/sysdeps/linux/frv/sys/procfs.h b/libc/sysdeps/linux/frv/sys/procfs.h
index f07523342..025637695 100644
--- a/libc/sysdeps/linux/frv/sys/procfs.h
+++ b/libc/sysdeps/linux/frv/sys/procfs.h
@@ -12,9 +12,8 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_PROCFS_H
#define _SYS_PROCFS_H 1
diff --git a/libc/sysdeps/linux/frv/sys/ptrace.h b/libc/sysdeps/linux/frv/sys/ptrace.h
index 6b0eca7b0..d80b047f6 100644
--- a/libc/sysdeps/linux/frv/sys/ptrace.h
+++ b/libc/sysdeps/linux/frv/sys/ptrace.h
@@ -14,9 +14,8 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_PTRACE_H
#define _SYS_PTRACE_H 1
diff --git a/libc/sysdeps/linux/frv/sys/ucontext.h b/libc/sysdeps/linux/frv/sys/ucontext.h
index 487c9ee02..6a01fc26b 100644
--- a/libc/sysdeps/linux/frv/sys/ucontext.h
+++ b/libc/sysdeps/linux/frv/sys/ucontext.h
@@ -13,8 +13,7 @@
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ see <http://www.gnu.org/licenses/>. */
#ifndef _SYS_UCONTEXT_H
#define _SYS_UCONTEXT_H 1
diff --git a/libc/sysdeps/linux/frv/syscall.c b/libc/sysdeps/linux/frv/syscall.c
index 7b416e87d..a98cf3832 100644
--- a/libc/sysdeps/linux/frv/syscall.c
+++ b/libc/sysdeps/linux/frv/syscall.c
@@ -13,8 +13,8 @@
* 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
+ * along with this program; see the file COPYING.LIB. If not, see
+ * <http://www.gnu.org/licenses/>.
*/
#include <features.h>
@@ -37,5 +37,5 @@ long syscall(long sysnum, long arg1, long arg2, long arg3,
: "+r" (__sc0)
: "r" (__scnum), "r" (__sc1), "r" (__sc2),
"r" (__sc3), "r" (__sc4), "r" (__sc5));
- __syscall_return(long,__sc0);
+ return (long) __sc0;
}
diff --git a/libc/sysdeps/linux/frv/sysdep.c b/libc/sysdeps/linux/frv/sysdep.c
index 7387d1162..bfae12100 100644
--- a/libc/sysdeps/linux/frv/sysdep.c
+++ b/libc/sysdeps/linux/frv/sysdep.c
@@ -12,9 +12,8 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
diff --git a/libc/sysdeps/linux/frv/vfork.S b/libc/sysdeps/linux/frv/vfork.S
index 8935a12f8..02ee7a739 100644
--- a/libc/sysdeps/linux/frv/vfork.S
+++ b/libc/sysdeps/linux/frv/vfork.S
@@ -13,15 +13,10 @@
Lesser General Public License 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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
-#include <features.h>
-
-#include <asm/unistd.h>
-#define _ERRNO_H 1
-#include <bits/errno.h>
+#include <sys/syscall.h>
.text
.globl __vfork
@@ -44,4 +39,4 @@ __vfork:
.size __vfork,.-__vfork
weak_alias(__vfork,vfork)
-libc_hidden_weak(vfork)
+libc_hidden_def(vfork)