devel
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
September 2014
- 3 participants
- 19 discussions
Update sys/ptrace.h to latest glibc release for a lot of missing
definitions.
Signed-off-by: Gustavo Zacarias <gustavo(a)zacarias.com.ar>
---
libc/sysdeps/linux/powerpc/sys/ptrace.h | 93 ++++++++++++++++++++++++++++++++-
1 file changed, 91 insertions(+), 2 deletions(-)
diff --git a/libc/sysdeps/linux/powerpc/sys/ptrace.h b/libc/sysdeps/linux/powerpc/sys/ptrace.h
index 02c303c..dd81efc 100644
--- a/libc/sysdeps/linux/powerpc/sys/ptrace.h
+++ b/libc/sysdeps/linux/powerpc/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#define _SYS_PTRACE_H 1
#include <features.h>
+#include <bits/types.h>
__BEGIN_DECLS
@@ -78,8 +79,96 @@ enum __ptrace_request
#define PT_DETACH PTRACE_DETACH
/* Continue and stop at the next (return from) syscall. */
- PTRACE_SYSCALL = 24
+ 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,
+#define PTRACE_LISTEN PTRACE_LISTEN
+
+ PTRACE_PEEKSIGINFO = 0x4209
+#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+};
+
+
+/* Flag for PTRACE_LISTEN. */
+enum __ptrace_flags
+{
+ PTRACE_SEIZE_DEVEL = 0x80000000
+};
+
+/* 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_TRACESECCOMP = 0x00000080,
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
+};
+
+/* 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,
+ PTRACE_EVENT_SECCOMP = 7
+};
+
+/* Arguments for PTRACE_PEEKSIGINFO. */
+struct __ptrace_peeksiginfo_args
+{
+ __uint64_t off; /* From which siginfo to start. */
+ __uint32_t flags; /* Flags for peeksiginfo. */
+ __int32_t nr; /* How many siginfos to take. */
+};
+
+enum __ptrace_peeksiginfo_flags
+{
+ /* Read signals from a shared (process wide) queue. */
+ PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
};
/* Perform process tracing functions. REQUEST is one of the values
--
1.8.5.5
2
2
uClibc-ng - small C library for embedded systems branch master updated. def0d92193606e184d356c4d2d1752526573f87c
by wbx@helium.waldemar-brodkorb.de 09 Sep '14
by wbx@helium.waldemar-brodkorb.de 09 Sep '14
09 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via def0d92193606e184d356c4d2d1752526573f87c (commit)
via 62d3a427afdea136c82bb599a18a593d9b32c533 (commit)
via 33a12b5540b8abbc4ee0ecb3a51912b3c7868517 (commit)
from 032f47c7fd7580087d71f2e938dc4f95cc94ce92 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit def0d92193606e184d356c4d2d1752526573f87c
Merge: 032f47c 62d3a42
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Tue Sep 9 21:20:07 2014 +0200
Merge remote-tracking branch 'origin/upstream'
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 2 +-
extra/Configs/Config.in | 4 +-
include/fcntl.h | 32 ++++
libc/sysdeps/linux/common/Makefile.in | 4 +
.../common/{posix_fallocate.c => fallocate.c} | 25 +--
.../common/{posix_fallocate64.c => fallocate64.c} | 22 ++-
libc/sysdeps/linux/common/posix_fallocate.c | 22 +--
libc/sysdeps/linux/common/posix_fallocate64.c | 12 +-
test/.gitignore | 2 +
test/unistd/Makefile.in | 12 +-
test/unistd/tst-fallocate.c | 166 ++++++++++++++++++++
test/unistd/tst-fallocate64.c | 2 +
12 files changed, 255 insertions(+), 50 deletions(-)
copy libc/sysdeps/linux/common/{posix_fallocate.c => fallocate.c} (54%)
copy libc/sysdeps/linux/common/{posix_fallocate64.c => fallocate64.c} (53%)
create mode 100644 test/unistd/tst-fallocate.c
create mode 100644 test/unistd/tst-fallocate64.c
diff --git a/Rules.mak b/Rules.mak
index 71eaae1..02687d9 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -255,7 +255,7 @@ ARFLAGS:=cr
# Note: The check for -nostdlib has to be before all calls to check_ld
$(eval $(call check-gcc-var,-nostdlib))
# deliberately not named CFLAG-fuse-ld since unchecked and from user
-LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(call qstrip,$(UCLIBC_EXTRA_CFLAGS)))
# failed to merge target specific data of file /dev/null
# Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well.
$(eval $(call check-ld-var,--no-warn-mismatch))
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 7789002..0f68a9b 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -1014,8 +1014,8 @@ config UCLIBC_LINUX_SPECIFIC
default y
help
accept4(), bdflush(),
- capget(), capset(), eventfd(), fstatfs(),
- inotify_*(), ioperm(), iopl(),
+ capget(), capset(), eventfd(), fallocate(),
+ fstatfs(), inotify_*(), ioperm(), iopl(),
madvise(), modify_ldt(), pipe2(), personality(),
prctl()/arch_prctl(), pivot_root(), modify_ldt(),
ppoll(), readahead(), reboot(), remap_file_pages(),
diff --git a/include/fcntl.h b/include/fcntl.h
index c749ad5..04fc2c0 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -239,6 +239,38 @@ extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
# endif
#endif
+#if (defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU) || defined _LIBC
+/* Reserve storage for the data of a file associated with FD. This function
+ is Linux-specific. For the portable version, use posix_fallocate().
+ Unlike the latter, fallocate can operate in different modes. The default
+ mode = 0 is equivalent to posix_fallocate().
+
+ Note: These declarations are used in posix_fallocate.c and
+ posix_fallocate64.c, so we expose them internally.
+ */
+
+/* Flags for fallocate's mode. */
+# define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file
+ even if offset + len is
+ greater than file size. */
+# define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */
+
+# 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
+#endif
+
__END_DECLS
#endif /* fcntl.h */
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index dc3a4b7..8562154 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -62,6 +62,10 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
vmsplice.c
CSRC-$(if $(findstring yy,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_LFS)),y) += \
sendfile64.c
+# posix_fallocate() needs __libc_fallocate() from fallocate.c
+# posix_fallocate64() needs __libc_fallocate64() from fallocate64.c
+CSRC-$(if $(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_ADVANCED_REALTIME),y,) += \
+ fallocate.c $(filter fallocate64.c,$(CSRC-y))
# NPTL needs these internally: madvise.c
CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/fallocate.c
similarity index 54%
copy from libc/sysdeps/linux/common/posix_fallocate.c
copy to libc/sysdeps/linux/common/fallocate.c
index 9aaa6ce..b231226 100644
--- a/libc/sysdeps/linux/common/posix_fallocate.c
+++ b/libc/sysdeps/linux/common/fallocate.c
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * posix_fallocate() for uClibc
+ * fallocate() for uClibc - Based off of posix_fallocate() by Erik Andersen
* http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.ht…
*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
@@ -14,7 +14,8 @@
#include <stdint.h>
#if defined __NR_fallocate
-int posix_fallocate(int fd, __off_t offset, __off_t len)
+extern __typeof(fallocate) __libc_fallocate attribute_hidden;
+int attribute_hidden __libc_fallocate(int fd, int mode, __off_t offset, __off_t len)
{
int ret;
@@ -24,20 +25,24 @@ int posix_fallocate(int fd, __off_t offset, __off_t len)
/* may assert that these >>31 are 0 */
uint32_t zero = 0;
INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
__LONG_LONG_PAIR (zero, off_low),
__LONG_LONG_PAIR (zero, len_low)));
# elif __WORDSIZE == 64
INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, mode, offset, len));
# else
# error your machine is neither 32 bit or 64 bit ... it must be magical
-#endif
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+# endif
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
}
-# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
-strong_alias(posix_fallocate,posix_fallocate64)
+
+# if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+strong_alias(__libc_fallocate,fallocate)
+# if __WORDSIZE == 64
+strong_alias(__libc_fallocate,fallocate64)
+# endif
# endif
#endif
diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/fallocate64.c
similarity index 53%
copy from libc/sysdeps/linux/common/posix_fallocate64.c
copy to libc/sysdeps/linux/common/fallocate64.c
index 76dc9b8..cf75693 100644
--- a/libc/sysdeps/linux/common/posix_fallocate64.c
+++ b/libc/sysdeps/linux/common/fallocate64.c
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * posix_fallocate() for uClibc
+ * fallocate() for uClibc - based off posix_fallocate() by Erik Andersen
* http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.ht…
*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
@@ -9,6 +9,7 @@
*/
#include <sys/syscall.h>
+
#include <fcntl.h>
#include <bits/kernel-features.h>
#include <stdint.h>
@@ -16,18 +17,25 @@
#if defined __NR_fallocate
# if __WORDSIZE == 64
-/* Can use normal posix_fallocate() */
+/* Can use normal fallocate() */
# elif __WORDSIZE == 32
-int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
+extern __typeof(fallocate64) __libc_fallocate64 attribute_hidden;
+int attribute_hidden __libc_fallocate64(int fd, int mode, __off64_t offset,
+ __off64_t len)
{
int ret;
INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
OFF64_HI_LO (offset), OFF64_HI_LO (len)));
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
}
+
+# if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+strong_alias(__libc_fallocate64,fallocate64)
+# endif
+
# else
# error your machine is neither 32 bit or 64 bit ... it must be magical
# endif
diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
index 9aaa6ce..76771e3 100644
--- a/libc/sysdeps/linux/common/posix_fallocate.c
+++ b/libc/sysdeps/linux/common/posix_fallocate.c
@@ -14,28 +14,10 @@
#include <stdint.h>
#if defined __NR_fallocate
+extern __typeof(fallocate) __libc_fallocate attribute_hidden;
int posix_fallocate(int fd, __off_t offset, __off_t len)
{
- int ret;
-
-# if __WORDSIZE == 32
- uint32_t off_low = offset;
- uint32_t len_low = len;
- /* may assert that these >>31 are 0 */
- uint32_t zero = 0;
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
- __LONG_LONG_PAIR (zero, off_low),
- __LONG_LONG_PAIR (zero, len_low)));
-# elif __WORDSIZE == 64
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
-# else
-# error your machine is neither 32 bit or 64 bit ... it must be magical
-#endif
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ return __libc_fallocate(fd, 0, offset, len);
}
# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
strong_alias(posix_fallocate,posix_fallocate64)
diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
index 76dc9b8..12ddbc2 100644
--- a/libc/sysdeps/linux/common/posix_fallocate64.c
+++ b/libc/sysdeps/linux/common/posix_fallocate64.c
@@ -14,21 +14,15 @@
#include <stdint.h>
#if defined __NR_fallocate
-
# if __WORDSIZE == 64
/* Can use normal posix_fallocate() */
# elif __WORDSIZE == 32
+extern __typeof(fallocate64) __libc_fallocate64 attribute_hidden;
int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
{
- int ret;
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
- OFF64_HI_LO (offset), OFF64_HI_LO (len)));
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ return __libc_fallocate64(fd, 0, offset, len);
}
# else
-# error your machine is neither 32 bit or 64 bit ... it must be magical
+# error your machine is neither 32 bit or 64 bit ... it must be magical
# endif
#endif
diff --git a/test/.gitignore b/test/.gitignore
index 85161da..8f32031 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -320,6 +320,8 @@ unistd/getcwd
unistd/getopt
unistd/getopt_long
unistd/tstgetopt
+unistd/tst-fallocate
+unistd/tst-fallocate64
unistd/tst-posix_fallocate
unistd/tst-posix_fallocate64
unistd/tst-preadwrite
diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
index cfef22e..ed33d9a 100644
--- a/test/unistd/Makefile.in
+++ b/test/unistd/Makefile.in
@@ -1,12 +1,22 @@
# uClibc unistd tests
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+# If LFS is not set, get rid of all *64 tests up front
ifeq ($(UCLIBC_HAS_LFS),)
-TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64 tst-fallocate64
endif
+
+# If we don't have LINUX_SPECIFIC, then get rid of tst-fallocate
+ifeq ($(UCLIBC_LINUX_SPECIFIC),)
+TESTS_DISABLED += tst-fallocate
+endif
+
+# The logic is similar for HAS_ADVANCED_REALTIME and
+# tst-posix_fallocate/tst-posix_fallocate64
ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
TESTS_DISABLED += tst-posix_fallocate
endif
+
OPTS_getopt := -abcXXX -9
OPTS_getopt_long := --add XXX --delete YYY --verbose
ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
diff --git a/test/unistd/tst-fallocate.c b/test/unistd/tst-fallocate.c
new file mode 100644
index 0000000..fc81781
--- /dev/null
+++ b/test/unistd/tst-fallocate.c
@@ -0,0 +1,166 @@
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#ifndef TST_FALLOCATE64
+# define stat64 stat
+# define fstat64 fstat
+# else
+# ifndef O_LARGEFILE
+# error no O_LARGEFILE but you want to test with LFS enabled
+# endif
+#endif
+
+static void do_prepare(void);
+static int do_test(void);
+#define PREPARE(argc, argv) do_prepare ()
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static int fd;
+static void
+do_prepare (void)
+{
+ fd = create_temp_file ("tst-fallocate.", NULL);
+ if (fd == -1)
+ {
+ printf ("cannot create temporary file: %m\n");
+ exit (1);
+ }
+}
+
+
+static int
+do_test (void)
+{
+ struct stat64 st;
+ int c;
+ char garbage[4096];
+ blkcnt_t blksb4;
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("1st fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 0)
+ {
+ puts ("file not created with size 0");
+ return 1;
+ }
+
+ /* This is the default mode which is identical to posix_fallocate().
+ Note: we need a few extra blocks for FALLOC_FL_PUNCH_HOLE below.
+ While block sizes vary, we'll assume eight 4K blocks for good measure. */
+ if (fallocate (fd, 0, 8 * 4096, 128) != 0)
+ {
+ puts ("1st fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("2nd fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 8 * 4096 + 128)
+ {
+ printf ("file size after 1st fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 8u * 4096u + 128u);
+ return 1;
+ }
+
+ /* Without FALLOC_FL_KEEP_SIZE, this would increaste the size of the file. */
+ if (fallocate (fd, FALLOC_FL_KEEP_SIZE, 0, 16 * 4096) != 0)
+ {
+ puts ("2nd fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("3rd fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 8 * 4096 + 128)
+ {
+ printf ("file size changed in 2nd fallocate call to %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 8u * 4096u + 128u);
+ return 1;
+ }
+
+ /* Let's fill up the first eight 4k blocks with 'x' to force some allocations. */
+
+ memset(garbage, 'x', 4096);
+ for(c=0; c < 8; c++)
+ if(write(fd, garbage, 4096) == -1)
+ {
+ puts ("write failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("4th fstat failed");
+ return 1;
+ }
+
+ blksb4 = st.st_blocks;
+
+ /* Let's punch a hole in the entire file, turning it effectively into a sparse file. */
+ if (fallocate (fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 8 * 4096 + 128) != 0)
+ {
+ puts ("3rd fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("5th fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 8 * 4096 + 128)
+ {
+ printf ("file size after 3rd fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 8u * 4096u + 128u);
+ return 1;
+ }
+
+ /* The number of allocated blocks should decrease. I hope this works on
+ all filesystems! */
+ if (st.st_blocks >= blksb4)
+ {
+ printf ("number of blocks after 3rd fallocate call is %lu, expected less than %lu\n",
+ (unsigned long int) st.st_blocks, blksb4);
+ return 1;
+ }
+
+#ifdef TST_FALLOCATE64
+ /* We'll just do a mode = 0 test for fallocate64() */
+ if (fallocate64 (fd, 0, 4097ULL, 4294967295ULL + 2ULL) != 0)
+ {
+ puts ("1st fallocate64 call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("6th fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
+ {
+ printf ("file size after 1st fallocate64 call is %llu, expected %llu\n",
+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
+ return 1;
+ }
+#endif
+ close (fd);
+
+ return 0;
+}
+
diff --git a/test/unistd/tst-fallocate64.c b/test/unistd/tst-fallocate64.c
new file mode 100644
index 0000000..720428f
--- /dev/null
+++ b/test/unistd/tst-fallocate64.c
@@ -0,0 +1,2 @@
+#define TST_FALLOCATE64
+#include "tst-fallocate.c"
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch upstream updated. 62d3a427afdea136c82bb599a18a593d9b32c533
by wbx@helium.waldemar-brodkorb.de 09 Sep '14
by wbx@helium.waldemar-brodkorb.de 09 Sep '14
09 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, upstream has been updated
via 62d3a427afdea136c82bb599a18a593d9b32c533 (commit)
via 33a12b5540b8abbc4ee0ecb3a51912b3c7868517 (commit)
from 7efe10ec5fc772f5328b35ba6716bde815212b45 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 62d3a427afdea136c82bb599a18a593d9b32c533
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Sep 9 13:49:34 2014 +0200
buildsys: Fix typo
LDFLAG-fuse-ld looked at a non-existing var, use the correct one
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 33a12b5540b8abbc4ee0ecb3a51912b3c7868517
Author: Anthony G. Basile <blueness(a)gentoo.org>
Date: Sun Sep 7 15:33:46 2014 -0400
libc: add fallocate() and fallocate64()
We add the Linux-specific function fallocate() which allows the user to
directly manipulate allocate space for a file. fallocate() can operate
in different modes, but the default mode is equivalent to posix_fallocate()
which is specified in POSIX.1.
Recent releases of e2fsprogs 1.42.11 and above expect fallocate64() to be
available.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 2 +-
extra/Configs/Config.in | 4 +-
include/fcntl.h | 32 ++++
libc/sysdeps/linux/common/Makefile.in | 4 +
.../common/{posix_fallocate.c => fallocate.c} | 25 +--
.../common/{posix_fallocate64.c => fallocate64.c} | 22 ++-
libc/sysdeps/linux/common/posix_fallocate.c | 22 +--
libc/sysdeps/linux/common/posix_fallocate64.c | 12 +-
test/.gitignore | 2 +
test/unistd/Makefile.in | 12 +-
test/unistd/tst-fallocate.c | 166 ++++++++++++++++++++
test/unistd/tst-fallocate64.c | 2 +
12 files changed, 255 insertions(+), 50 deletions(-)
copy libc/sysdeps/linux/common/{posix_fallocate.c => fallocate.c} (54%)
copy libc/sysdeps/linux/common/{posix_fallocate64.c => fallocate64.c} (53%)
create mode 100644 test/unistd/tst-fallocate.c
create mode 100644 test/unistd/tst-fallocate64.c
diff --git a/Rules.mak b/Rules.mak
index cb65700..20da428 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -255,7 +255,7 @@ ARFLAGS:=cr
# Note: The check for -nostdlib has to be before all calls to check_ld
$(eval $(call check-gcc-var,-nostdlib))
# deliberately not named CFLAG-fuse-ld since unchecked and from user
-LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(call qstrip,$(UCLIBC_EXTRA_CFLAGS)))
# failed to merge target specific data of file /dev/null
# Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well.
$(eval $(call check-ld-var,--no-warn-mismatch))
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 7789002..0f68a9b 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -1014,8 +1014,8 @@ config UCLIBC_LINUX_SPECIFIC
default y
help
accept4(), bdflush(),
- capget(), capset(), eventfd(), fstatfs(),
- inotify_*(), ioperm(), iopl(),
+ capget(), capset(), eventfd(), fallocate(),
+ fstatfs(), inotify_*(), ioperm(), iopl(),
madvise(), modify_ldt(), pipe2(), personality(),
prctl()/arch_prctl(), pivot_root(), modify_ldt(),
ppoll(), readahead(), reboot(), remap_file_pages(),
diff --git a/include/fcntl.h b/include/fcntl.h
index c749ad5..04fc2c0 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -239,6 +239,38 @@ extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
# endif
#endif
+#if (defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU) || defined _LIBC
+/* Reserve storage for the data of a file associated with FD. This function
+ is Linux-specific. For the portable version, use posix_fallocate().
+ Unlike the latter, fallocate can operate in different modes. The default
+ mode = 0 is equivalent to posix_fallocate().
+
+ Note: These declarations are used in posix_fallocate.c and
+ posix_fallocate64.c, so we expose them internally.
+ */
+
+/* Flags for fallocate's mode. */
+# define FALLOC_FL_KEEP_SIZE 1 /* Don't extend size of file
+ even if offset + len is
+ greater than file size. */
+# define FALLOC_FL_PUNCH_HOLE 2 /* Create a hole in the file. */
+
+# 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
+#endif
+
__END_DECLS
#endif /* fcntl.h */
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index dc3a4b7..8562154 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -62,6 +62,10 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
vmsplice.c
CSRC-$(if $(findstring yy,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_LFS)),y) += \
sendfile64.c
+# posix_fallocate() needs __libc_fallocate() from fallocate.c
+# posix_fallocate64() needs __libc_fallocate64() from fallocate64.c
+CSRC-$(if $(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_ADVANCED_REALTIME),y,) += \
+ fallocate.c $(filter fallocate64.c,$(CSRC-y))
# NPTL needs these internally: madvise.c
CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/fallocate.c
similarity index 54%
copy from libc/sysdeps/linux/common/posix_fallocate.c
copy to libc/sysdeps/linux/common/fallocate.c
index 9aaa6ce..b231226 100644
--- a/libc/sysdeps/linux/common/posix_fallocate.c
+++ b/libc/sysdeps/linux/common/fallocate.c
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * posix_fallocate() for uClibc
+ * fallocate() for uClibc - Based off of posix_fallocate() by Erik Andersen
* http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.ht…
*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
@@ -14,7 +14,8 @@
#include <stdint.h>
#if defined __NR_fallocate
-int posix_fallocate(int fd, __off_t offset, __off_t len)
+extern __typeof(fallocate) __libc_fallocate attribute_hidden;
+int attribute_hidden __libc_fallocate(int fd, int mode, __off_t offset, __off_t len)
{
int ret;
@@ -24,20 +25,24 @@ int posix_fallocate(int fd, __off_t offset, __off_t len)
/* may assert that these >>31 are 0 */
uint32_t zero = 0;
INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
__LONG_LONG_PAIR (zero, off_low),
__LONG_LONG_PAIR (zero, len_low)));
# elif __WORDSIZE == 64
INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, mode, offset, len));
# else
# error your machine is neither 32 bit or 64 bit ... it must be magical
-#endif
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+# endif
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
}
-# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
-strong_alias(posix_fallocate,posix_fallocate64)
+
+# if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+strong_alias(__libc_fallocate,fallocate)
+# if __WORDSIZE == 64
+strong_alias(__libc_fallocate,fallocate64)
+# endif
# endif
#endif
diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/fallocate64.c
similarity index 53%
copy from libc/sysdeps/linux/common/posix_fallocate64.c
copy to libc/sysdeps/linux/common/fallocate64.c
index 76dc9b8..cf75693 100644
--- a/libc/sysdeps/linux/common/posix_fallocate64.c
+++ b/libc/sysdeps/linux/common/fallocate64.c
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * posix_fallocate() for uClibc
+ * fallocate() for uClibc - based off posix_fallocate() by Erik Andersen
* http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.ht…
*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
@@ -9,6 +9,7 @@
*/
#include <sys/syscall.h>
+
#include <fcntl.h>
#include <bits/kernel-features.h>
#include <stdint.h>
@@ -16,18 +17,25 @@
#if defined __NR_fallocate
# if __WORDSIZE == 64
-/* Can use normal posix_fallocate() */
+/* Can use normal fallocate() */
# elif __WORDSIZE == 32
-int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
+extern __typeof(fallocate64) __libc_fallocate64 attribute_hidden;
+int attribute_hidden __libc_fallocate64(int fd, int mode, __off64_t offset,
+ __off64_t len)
{
int ret;
INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
OFF64_HI_LO (offset), OFF64_HI_LO (len)));
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
+ return INTERNAL_SYSCALL_ERRNO (ret, err);
+ return 0;
}
+
+# if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+strong_alias(__libc_fallocate64,fallocate64)
+# endif
+
# else
# error your machine is neither 32 bit or 64 bit ... it must be magical
# endif
diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
index 9aaa6ce..76771e3 100644
--- a/libc/sysdeps/linux/common/posix_fallocate.c
+++ b/libc/sysdeps/linux/common/posix_fallocate.c
@@ -14,28 +14,10 @@
#include <stdint.h>
#if defined __NR_fallocate
+extern __typeof(fallocate) __libc_fallocate attribute_hidden;
int posix_fallocate(int fd, __off_t offset, __off_t len)
{
- int ret;
-
-# if __WORDSIZE == 32
- uint32_t off_low = offset;
- uint32_t len_low = len;
- /* may assert that these >>31 are 0 */
- uint32_t zero = 0;
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
- __LONG_LONG_PAIR (zero, off_low),
- __LONG_LONG_PAIR (zero, len_low)));
-# elif __WORDSIZE == 64
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
-# else
-# error your machine is neither 32 bit or 64 bit ... it must be magical
-#endif
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ return __libc_fallocate(fd, 0, offset, len);
}
# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
strong_alias(posix_fallocate,posix_fallocate64)
diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
index 76dc9b8..12ddbc2 100644
--- a/libc/sysdeps/linux/common/posix_fallocate64.c
+++ b/libc/sysdeps/linux/common/posix_fallocate64.c
@@ -14,21 +14,15 @@
#include <stdint.h>
#if defined __NR_fallocate
-
# if __WORDSIZE == 64
/* Can use normal posix_fallocate() */
# elif __WORDSIZE == 32
+extern __typeof(fallocate64) __libc_fallocate64 attribute_hidden;
int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
{
- int ret;
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
- OFF64_HI_LO (offset), OFF64_HI_LO (len)));
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ return __libc_fallocate64(fd, 0, offset, len);
}
# else
-# error your machine is neither 32 bit or 64 bit ... it must be magical
+# error your machine is neither 32 bit or 64 bit ... it must be magical
# endif
#endif
diff --git a/test/.gitignore b/test/.gitignore
index 85161da..8f32031 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -320,6 +320,8 @@ unistd/getcwd
unistd/getopt
unistd/getopt_long
unistd/tstgetopt
+unistd/tst-fallocate
+unistd/tst-fallocate64
unistd/tst-posix_fallocate
unistd/tst-posix_fallocate64
unistd/tst-preadwrite
diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
index cfef22e..ed33d9a 100644
--- a/test/unistd/Makefile.in
+++ b/test/unistd/Makefile.in
@@ -1,12 +1,22 @@
# uClibc unistd tests
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+# If LFS is not set, get rid of all *64 tests up front
ifeq ($(UCLIBC_HAS_LFS),)
-TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64 tst-fallocate64
endif
+
+# If we don't have LINUX_SPECIFIC, then get rid of tst-fallocate
+ifeq ($(UCLIBC_LINUX_SPECIFIC),)
+TESTS_DISABLED += tst-fallocate
+endif
+
+# The logic is similar for HAS_ADVANCED_REALTIME and
+# tst-posix_fallocate/tst-posix_fallocate64
ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
TESTS_DISABLED += tst-posix_fallocate
endif
+
OPTS_getopt := -abcXXX -9
OPTS_getopt_long := --add XXX --delete YYY --verbose
ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
diff --git a/test/unistd/tst-fallocate.c b/test/unistd/tst-fallocate.c
new file mode 100644
index 0000000..fc81781
--- /dev/null
+++ b/test/unistd/tst-fallocate.c
@@ -0,0 +1,166 @@
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#ifndef TST_FALLOCATE64
+# define stat64 stat
+# define fstat64 fstat
+# else
+# ifndef O_LARGEFILE
+# error no O_LARGEFILE but you want to test with LFS enabled
+# endif
+#endif
+
+static void do_prepare(void);
+static int do_test(void);
+#define PREPARE(argc, argv) do_prepare ()
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static int fd;
+static void
+do_prepare (void)
+{
+ fd = create_temp_file ("tst-fallocate.", NULL);
+ if (fd == -1)
+ {
+ printf ("cannot create temporary file: %m\n");
+ exit (1);
+ }
+}
+
+
+static int
+do_test (void)
+{
+ struct stat64 st;
+ int c;
+ char garbage[4096];
+ blkcnt_t blksb4;
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("1st fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 0)
+ {
+ puts ("file not created with size 0");
+ return 1;
+ }
+
+ /* This is the default mode which is identical to posix_fallocate().
+ Note: we need a few extra blocks for FALLOC_FL_PUNCH_HOLE below.
+ While block sizes vary, we'll assume eight 4K blocks for good measure. */
+ if (fallocate (fd, 0, 8 * 4096, 128) != 0)
+ {
+ puts ("1st fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("2nd fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 8 * 4096 + 128)
+ {
+ printf ("file size after 1st fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 8u * 4096u + 128u);
+ return 1;
+ }
+
+ /* Without FALLOC_FL_KEEP_SIZE, this would increaste the size of the file. */
+ if (fallocate (fd, FALLOC_FL_KEEP_SIZE, 0, 16 * 4096) != 0)
+ {
+ puts ("2nd fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("3rd fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 8 * 4096 + 128)
+ {
+ printf ("file size changed in 2nd fallocate call to %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 8u * 4096u + 128u);
+ return 1;
+ }
+
+ /* Let's fill up the first eight 4k blocks with 'x' to force some allocations. */
+
+ memset(garbage, 'x', 4096);
+ for(c=0; c < 8; c++)
+ if(write(fd, garbage, 4096) == -1)
+ {
+ puts ("write failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("4th fstat failed");
+ return 1;
+ }
+
+ blksb4 = st.st_blocks;
+
+ /* Let's punch a hole in the entire file, turning it effectively into a sparse file. */
+ if (fallocate (fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 8 * 4096 + 128) != 0)
+ {
+ puts ("3rd fallocate call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("5th fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 8 * 4096 + 128)
+ {
+ printf ("file size after 3rd fallocate call is %llu, expected %u\n",
+ (unsigned long long int) st.st_size, 8u * 4096u + 128u);
+ return 1;
+ }
+
+ /* The number of allocated blocks should decrease. I hope this works on
+ all filesystems! */
+ if (st.st_blocks >= blksb4)
+ {
+ printf ("number of blocks after 3rd fallocate call is %lu, expected less than %lu\n",
+ (unsigned long int) st.st_blocks, blksb4);
+ return 1;
+ }
+
+#ifdef TST_FALLOCATE64
+ /* We'll just do a mode = 0 test for fallocate64() */
+ if (fallocate64 (fd, 0, 4097ULL, 4294967295ULL + 2ULL) != 0)
+ {
+ puts ("1st fallocate64 call failed");
+ return 1;
+ }
+
+ if (fstat64 (fd, &st) != 0)
+ {
+ puts ("6th fstat failed");
+ return 1;
+ }
+
+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
+ {
+ printf ("file size after 1st fallocate64 call is %llu, expected %llu\n",
+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
+ return 1;
+ }
+#endif
+ close (fd);
+
+ return 0;
+}
+
diff --git a/test/unistd/tst-fallocate64.c b/test/unistd/tst-fallocate64.c
new file mode 100644
index 0000000..720428f
--- /dev/null
+++ b/test/unistd/tst-fallocate64.c
@@ -0,0 +1,2 @@
+#define TST_FALLOCATE64
+#include "tst-fallocate.c"
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch master updated. 032f47c7fd7580087d71f2e938dc4f95cc94ce92
by wbx@helium.waldemar-brodkorb.de 09 Sep '14
by wbx@helium.waldemar-brodkorb.de 09 Sep '14
09 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 032f47c7fd7580087d71f2e938dc4f95cc94ce92 (commit)
via 90298bc4fb1303151d6213d13beefcf9b378c5e1 (commit)
from 469594cd898d0386f226f6703ae34d0332a2cfe6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 032f47c7fd7580087d71f2e938dc4f95cc94ce92
Author: Gustavo Zacarias <gustavo(a)zacarias.com.ar>
Date: Mon Sep 8 09:54:26 2014 -0300
sparc: update ptrace.h to latest from glibc
Update sys/ptrace.h to latest glibc release for a lot of missing
definitions.
Signed-off-by: Gustavo Zacarias <gustavo(a)zacarias.com.ar>
commit 90298bc4fb1303151d6213d13beefcf9b378c5e1
Author: Gustavo Zacarias <gustavo(a)zacarias.com.ar>
Date: Mon Sep 8 09:54:25 2014 -0300
powerpc: update ptrace.h to latest from glibc
Update sys/ptrace.h to latest glibc release for a lot of missing
definitions.
Signed-off-by: Gustavo Zacarias <gustavo(a)zacarias.com.ar>
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/powerpc/sys/ptrace.h | 93 ++++++++++++++++++++++++++++-
libc/sysdeps/linux/sparc/sys/ptrace.h | 97 +++++++++++++++++++++++++++++--
2 files changed, 183 insertions(+), 7 deletions(-)
diff --git a/libc/sysdeps/linux/powerpc/sys/ptrace.h b/libc/sysdeps/linux/powerpc/sys/ptrace.h
index 02c303c..dd81efc 100644
--- a/libc/sysdeps/linux/powerpc/sys/ptrace.h
+++ b/libc/sysdeps/linux/powerpc/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#define _SYS_PTRACE_H 1
#include <features.h>
+#include <bits/types.h>
__BEGIN_DECLS
@@ -78,8 +79,96 @@ enum __ptrace_request
#define PT_DETACH PTRACE_DETACH
/* Continue and stop at the next (return from) syscall. */
- PTRACE_SYSCALL = 24
+ 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,
+#define PTRACE_LISTEN PTRACE_LISTEN
+
+ PTRACE_PEEKSIGINFO = 0x4209
+#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+};
+
+
+/* Flag for PTRACE_LISTEN. */
+enum __ptrace_flags
+{
+ PTRACE_SEIZE_DEVEL = 0x80000000
+};
+
+/* 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_TRACESECCOMP = 0x00000080,
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
+};
+
+/* 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,
+ PTRACE_EVENT_SECCOMP = 7
+};
+
+/* Arguments for PTRACE_PEEKSIGINFO. */
+struct __ptrace_peeksiginfo_args
+{
+ __uint64_t off; /* From which siginfo to start. */
+ __uint32_t flags; /* Flags for peeksiginfo. */
+ __int32_t nr; /* How many siginfos to take. */
+};
+
+enum __ptrace_peeksiginfo_flags
+{
+ /* Read signals from a shared (process wide) queue. */
+ PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
};
/* Perform process tracing functions. REQUEST is one of the values
diff --git a/libc/sysdeps/linux/sparc/sys/ptrace.h b/libc/sysdeps/linux/sparc/sys/ptrace.h
index 26fa4b3..0f6c2cc 100644
--- a/libc/sysdeps/linux/sparc/sys/ptrace.h
+++ b/libc/sysdeps/linux/sparc/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux/SPARC version.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#define _SYS_PTRACE_H 1
#include <features.h>
-
+#include <bits/types.h>
#include <bits/wordsize.h>
/* Linux/SPARC kernels up to 2.3.18 do not care much
@@ -147,12 +147,11 @@ enum __ptrace_request
#endif
/* Continue and stop at the next (return from) syscall. */
- PTRACE_SYSCALL = 24
+ PTRACE_SYSCALL = 24,
#define PTRACE_SYSCALL PTRACE_SYSCALL
#if __WORDSIZE == 64
- ,
/* Get all floating point registers used by a processes.
This is not supported on all machines. */
PTRACE_GETFPREGS = 25,
@@ -160,10 +159,98 @@ enum __ptrace_request
/* Set all floating point registers used by a processes.
This is not supported on all machines. */
- PTRACE_SETFPREGS = 26
+ PTRACE_SETFPREGS = 26,
#define PT_SETFPREGS PTRACE_SETFPREGS
#endif
+
+ /* 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,
+#define PTRACE_LISTEN PTRACE_LISTEN
+
+ PTRACE_PEEKSIGINFO = 0x4209
+#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
+};
+
+
+/* Flag for PTRACE_LISTEN. */
+enum __ptrace_flags
+{
+ PTRACE_SEIZE_DEVEL = 0x80000000
+};
+
+/* 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_TRACESECCOMP = 0x00000080,
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
+};
+
+/* 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,
+ PTRACE_EVENT_SECCOMP = 7
+};
+
+/* Arguments for PTRACE_PEEKSIGINFO. */
+struct __ptrace_peeksiginfo_args
+{
+ __uint64_t off; /* From which siginfo to start. */
+ __uint32_t flags; /* Flags for peeksiginfo. */
+ __int32_t nr; /* How many siginfos to take. */
+};
+
+enum __ptrace_peeksiginfo_flags
+{
+ /* Read signals from a shared (process wide) queue. */
+ PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
};
/* Perform process tracing functions. REQUEST is one of the values
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch master updated. 469594cd898d0386f226f6703ae34d0332a2cfe6
by wbx@helium.waldemar-brodkorb.de 08 Sep '14
by wbx@helium.waldemar-brodkorb.de 08 Sep '14
08 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 469594cd898d0386f226f6703ae34d0332a2cfe6 (commit)
from b38f6240891f78af59e2c5d25361ab67a73e000f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 469594cd898d0386f226f6703ae34d0332a2cfe6
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Mon Sep 8 09:11:43 2014 +0200
bump version to 1.0.0
prepare for stable release.
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 6 +++---
test/nptl/tst-unload.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Rules.mak b/Rules.mak
index cb65700..71eaae1 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -127,9 +127,9 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
# Now config hard core
-MAJOR_VERSION := 0
-MINOR_VERSION := 9
-SUBLEVEL := 34
+MAJOR_VERSION := 1
+MINOR_VERSION := 0
+SUBLEVEL := 0
EXTRAVERSION :=-git
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)
diff --git a/test/nptl/tst-unload.c b/test/nptl/tst-unload.c
index c7de2cb..74a714e 100644
--- a/test/nptl/tst-unload.c
+++ b/test/nptl/tst-unload.c
@@ -23,17 +23,17 @@
static int
do_test (void)
{
- void *p = dlopen ("libpthread.so.0", RTLD_LAZY);
+ void *p = dlopen ("libpthread.so.1", RTLD_LAZY);
if (p == NULL)
{
- puts ("failed to load libpthread.so.0");
+ puts ("failed to load libpthread.so.1");
return 1;
}
if (dlclose (p) != 0)
{
- puts ("dlclose (libpthread.so.0) failed");
+ puts ("dlclose (libpthread.so.1) failed");
return 1;
}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch master updated. b38f6240891f78af59e2c5d25361ab67a73e000f
by wbx@helium.waldemar-brodkorb.de 08 Sep '14
by wbx@helium.waldemar-brodkorb.de 08 Sep '14
08 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via b38f6240891f78af59e2c5d25361ab67a73e000f (commit)
via 7efe10ec5fc772f5328b35ba6716bde815212b45 (commit)
from 36043b37739dffdaea8d31457570810e492268d7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b38f6240891f78af59e2c5d25361ab67a73e000f
Merge: 36043b3 7efe10e
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Mon Sep 8 09:10:31 2014 +0200
Merge remote-tracking branch 'origin/upstream'
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/common/Makefile.in | 3 +-
libc/sysdeps/linux/common/epoll.c | 40 +++++++++++---------
.../__syscall_error.c => common/epoll_create.c} | 13 ++-----
.../{arc/__syscall_error.c => common/epoll_ctl.c} | 13 ++-----
.../__syscall_error.c => common/epoll_pwait.c} | 13 ++-----
.../{arc/__syscall_error.c => common/epoll_wait.c} | 13 ++-----
6 files changed, 36 insertions(+), 59 deletions(-)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_create.c} (50%)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_ctl.c} (50%)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_pwait.c} (50%)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_wait.c} (50%)
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index 13dd77b..dc3a4b7 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -90,7 +90,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_adjtime.c clock_getres.c clock_gettime.c cl
CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
posix_fallocate.c posix_fallocate64.c
CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
-CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+CSRC- += epoll.c # multi-source
+CSRC-$(UCLIBC_HAS_EPOLL) += epoll_create.c epoll_ctl.c epoll_wait.c epoll_pwait.c
CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c
CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c
diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
index 5f1e589..d7b7ca7 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -11,36 +11,28 @@
#include <sys/epoll.h>
#include <cancel.h>
-#ifdef __NR_epoll_create
+#ifdef L_epoll_create
+# ifdef __NR_epoll_create
_syscall1(int, epoll_create, int, size)
-#endif
+# endif
-#ifdef __NR_epoll_create1
+# ifdef __NR_epoll_create1
_syscall1(int, epoll_create1, int, flags)
-#endif
+# endif
-#if defined __NR_epoll_create1 && !defined __NR_epoll_create
+# if defined __NR_epoll_create1 && !defined __NR_epoll_create
int epoll_create(int size)
{
return INLINE_SYSCALL(epoll_create1, 1, 0);
}
-
+# endif
#endif
-#ifdef __NR_epoll_ctl
+#if defined L_epoll_ctl && defined __NR_epoll_ctl
_syscall4(int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
#endif
-#ifdef __NR_epoll_wait
-static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout)
-{
- return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
-}
-CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout),
- (epfd, events, maxevents, timeout))
-#endif
-
-#ifdef __NR_epoll_pwait
+#if defined L_epoll_pwait && defined __NR_epoll_pwait
# include <signal.h>
# define __NR___syscall_epoll_pwait __NR_epoll_pwait
@@ -55,11 +47,23 @@ static int __NC(epoll_pwait)(int epfd, struct epoll_event *events, int maxevents
CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event *events, int maxevents, int timeout,
const sigset_t *set),
(epfd, events, maxevents, timeout, set))
+#endif
+
+#if defined L_epoll_wait
+# if defined __NR_epoll_wait
+static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+ return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
+}
+CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout),
+ (epfd, events, maxevents, timeout))
+
+
+# elif /* !defined L_epoll_wait && */ defined __NR_epoll_pwait
/*
* If epoll_wait is not defined, then call epoll_pwait instead using NULL
* for sigmask argument
*/
-# ifndef __NR_epoll_wait
# include <stddef.h>
int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
{
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_create.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_create.c
index 962d743..80896f6 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_create.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_create
+#include "epoll.c"
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_ctl.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_ctl.c
index 962d743..53868cc 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_ctl.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_ctl
+#include "epoll.c"
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_pwait.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_pwait.c
index 962d743..07461f9 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_pwait.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_pwait
+#include "epoll.c"
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_wait.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_wait.c
index 962d743..6963447 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_wait.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_wait
+#include "epoll.c"
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch upstream updated. 7efe10ec5fc772f5328b35ba6716bde815212b45
by wbx@helium.waldemar-brodkorb.de 08 Sep '14
by wbx@helium.waldemar-brodkorb.de 08 Sep '14
08 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, upstream has been updated
via 7efe10ec5fc772f5328b35ba6716bde815212b45 (commit)
from 6d550ddd129b18cf800eab604f74536754526cd8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7efe10ec5fc772f5328b35ba6716bde815212b45
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Fri Sep 5 13:59:28 2014 +0200
libc: split multi-source epoll.c
We cannot override individual functions on a per-arch basis otherwise
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/common/Makefile.in | 3 +-
libc/sysdeps/linux/common/epoll.c | 40 +++++++++++---------
.../__syscall_error.c => common/epoll_create.c} | 13 ++-----
.../{arc/__syscall_error.c => common/epoll_ctl.c} | 13 ++-----
.../__syscall_error.c => common/epoll_pwait.c} | 13 ++-----
.../{arc/__syscall_error.c => common/epoll_wait.c} | 13 ++-----
6 files changed, 36 insertions(+), 59 deletions(-)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_create.c} (50%)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_ctl.c} (50%)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_pwait.c} (50%)
copy libc/sysdeps/linux/{arc/__syscall_error.c => common/epoll_wait.c} (50%)
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index 13dd77b..dc3a4b7 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -90,7 +90,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_adjtime.c clock_getres.c clock_gettime.c cl
CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
posix_fallocate.c posix_fallocate64.c
CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
-CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+CSRC- += epoll.c # multi-source
+CSRC-$(UCLIBC_HAS_EPOLL) += epoll_create.c epoll_ctl.c epoll_wait.c epoll_pwait.c
CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c
CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c
diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
index 5f1e589..d7b7ca7 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -11,36 +11,28 @@
#include <sys/epoll.h>
#include <cancel.h>
-#ifdef __NR_epoll_create
+#ifdef L_epoll_create
+# ifdef __NR_epoll_create
_syscall1(int, epoll_create, int, size)
-#endif
+# endif
-#ifdef __NR_epoll_create1
+# ifdef __NR_epoll_create1
_syscall1(int, epoll_create1, int, flags)
-#endif
+# endif
-#if defined __NR_epoll_create1 && !defined __NR_epoll_create
+# if defined __NR_epoll_create1 && !defined __NR_epoll_create
int epoll_create(int size)
{
return INLINE_SYSCALL(epoll_create1, 1, 0);
}
-
+# endif
#endif
-#ifdef __NR_epoll_ctl
+#if defined L_epoll_ctl && defined __NR_epoll_ctl
_syscall4(int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
#endif
-#ifdef __NR_epoll_wait
-static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout)
-{
- return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
-}
-CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout),
- (epfd, events, maxevents, timeout))
-#endif
-
-#ifdef __NR_epoll_pwait
+#if defined L_epoll_pwait && defined __NR_epoll_pwait
# include <signal.h>
# define __NR___syscall_epoll_pwait __NR_epoll_pwait
@@ -55,11 +47,23 @@ static int __NC(epoll_pwait)(int epfd, struct epoll_event *events, int maxevents
CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event *events, int maxevents, int timeout,
const sigset_t *set),
(epfd, events, maxevents, timeout, set))
+#endif
+
+#if defined L_epoll_wait
+# if defined __NR_epoll_wait
+static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+ return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
+}
+CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout),
+ (epfd, events, maxevents, timeout))
+
+
+# elif /* !defined L_epoll_wait && */ defined __NR_epoll_pwait
/*
* If epoll_wait is not defined, then call epoll_pwait instead using NULL
* for sigmask argument
*/
-# ifndef __NR_epoll_wait
# include <stddef.h>
int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
{
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_create.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_create.c
index 962d743..80896f6 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_create.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_create
+#include "epoll.c"
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_ctl.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_ctl.c
index 962d743..53868cc 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_ctl.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_ctl
+#include "epoll.c"
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_pwait.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_pwait.c
index 962d743..07461f9 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_pwait.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_pwait
+#include "epoll.c"
diff --git a/libc/sysdeps/linux/arc/__syscall_error.c b/libc/sysdeps/linux/common/epoll_wait.c
similarity index 50%
copy from libc/sysdeps/linux/arc/__syscall_error.c
copy to libc/sysdeps/linux/common/epoll_wait.c
index 962d743..6963447 100644
--- a/libc/sysdeps/linux/arc/__syscall_error.c
+++ b/libc/sysdeps/linux/common/epoll_wait.c
@@ -1,15 +1,8 @@
-/* Wrapper for setting errno.
- *
+/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
* Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
*/
-#include <errno.h>
-#include <sys/syscall.h>
-
-int __syscall_error(int err_no)
-{
- __set_errno(-err_no);
- return -1;
-}
+#define L_epoll_wait
+#include "epoll.c"
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch master updated. 36043b37739dffdaea8d31457570810e492268d7
by wbx@helium.waldemar-brodkorb.de 04 Sep '14
by wbx@helium.waldemar-brodkorb.de 04 Sep '14
04 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 36043b37739dffdaea8d31457570810e492268d7 (commit)
via 6d550ddd129b18cf800eab604f74536754526cd8 (commit)
via b212e3804fb155cb418852dd70abad9a3d2354cc (commit)
via bc23c6440d34d85c8e6bb04656beb233bba47cb8 (commit)
via ff48662bbadd3d49fabe6fdfeb8e8181d4c80b06 (commit)
via 7a3acb243bc09f253a77faee7ee097a781f3eebe (commit)
via 5c0c667fb21c74b4a9ac0554418a553bf1e11c1c (commit)
via 61ae023e5bb93f05b2b30b31f299efc64bcd420e (commit)
via 88041f133f06d81a9bf6c72fc6e41a604eddf4b8 (commit)
via 512fd3804b963a6738ce59d25dd44a7d9143b8b7 (commit)
via 697dbb016e4bc63d20a7c871a9580e7dce32d1b0 (commit)
via 5a89f1c6964cc938c439d992f187bc87cdd4eb07 (commit)
via ad687dda63a43d5ea5ed834475cec5e0a618ebf5 (commit)
via 23abbfa633f7e017a7939aa3966e0d7d24df480d (commit)
via 68d700d66bfe498eeccd03ba44dd2081e34441d0 (commit)
via 10d05ca07c4632e8dfca4877a8fc6a458b8f5810 (commit)
via 789fca90bff0b0bcd658444cea6afd4cdb43dc5d (commit)
via c09e41ef92e48356e62c795384864ee792ac7fe6 (commit)
from a5352e212fcd4da83c8ff4fe542ef23c8e3187f8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 36043b37739dffdaea8d31457570810e492268d7
Merge: a5352e2 6d550dd
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Sep 4 15:18:54 2014 +0200
Merge remote-tracking branch 'origin/upstream'
-----------------------------------------------------------------------
Summary of changes:
Makerules | 4 +-
Rules.mak | 7 +-
extra/Configs/Config.sparc | 6 -
extra/scripts/none.lds | 13 +
ldso/ldso/dl-elf.c | 2 +-
libc/stdlib/system.c | 13 +-
libc/string/sparc/sparc64/memchr.S | 258 ------
libc/string/sparc/sparc64/memcpy.S | 922 --------------------
libc/string/sparc/sparc64/memset.S | 316 -------
libc/string/sparc/sparc64/sparcv9b/memcpy.S | 611 -------------
libc/string/sparc/sparc64/stpcpy.S | 270 ------
libc/string/sparc/sparc64/strcat.S | 338 -------
libc/string/sparc/sparc64/strchr.S | 485 ----------
libc/string/sparc/sparc64/strcmp.S | 278 ------
libc/string/sparc/sparc64/strcpy.S | 244 ------
libc/string/sparc/sparc64/strlen.S | 172 ----
libc/sysdeps/linux/m68k/bits/huge_vall.h | 2 +-
libc/sysdeps/linux/sparc/bits/setjmp.h | 31 -
libc/sysdeps/linux/sparc/bits/sigcontext.h | 35 -
libc/sysdeps/linux/sparc/crt1.S | 11 -
libc/sysdeps/linux/sparc/fork.S | 2 +-
libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 25 +-
libc/sysdeps/linux/sparc/pipe.S | 2 +-
libc/sysdeps/linux/sparc/qp_ops.c | 8 -
libc/sysdeps/linux/sparc/sparcv9/clone.S | 101 ---
libc/sysdeps/linux/sparc/sparcv9/rem.S | 20 -
libc/sysdeps/linux/sparc/sparcv9/sdiv.S | 18 -
libc/sysdeps/linux/sparc/sparcv9/udiv.S | 15 -
libc/sysdeps/linux/sparc/sparcv9/umul.S | 15 -
libc/sysdeps/linux/sparc/sparcv9/urem.S | 17 -
libc/sysdeps/linux/sparc/sys/procfs.h | 88 --
libc/sysdeps/linux/sparc/vfork.S | 2 +-
.../linuxthreads.old/sysdeps/sparc/pt-machine.h | 86 +-
.../sysdeps/sparc/sparc32/pt-machine.h | 82 --
.../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
libpthread/linuxthreads/sysdeps/sparc/pspinlock.c | 95 +-
libpthread/linuxthreads/sysdeps/sparc/pt-machine.h | 86 +-
.../linuxthreads/sysdeps/sparc/sparc32/pspinlock.c | 87 --
.../sysdeps/sparc/sparc32/pt-machine.h | 82 --
.../sysdeps/sparc/sparc32/sparcv9/pspinlock.c | 93 --
.../linuxthreads/sysdeps/sparc/sparc64/pspinlock.c | 92 --
.../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
.../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 100 ---
.../unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c | 1 -
.../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 99 ---
.../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 63 --
.../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 102 ++-
.../unix/sysv/linux/sparc/{sparc32 => }/vfork.S | 0
.../sysdeps/{sparc/sparc32 => }/jmpbuf-unwind.h | 0
.../{sparc/sparc32 => }/pthread_spin_lock.c | 0
.../{sparc/sparc32 => }/pthread_spin_trylock.c | 0
.../nptl/sysdeps/{sparc/sparc32 => }/pthreaddef.h | 0
libpthread/nptl/sysdeps/sparc/Makefile.arch | 3 -
libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h | 32 +-
.../sparc/{sparc32 => }/pthread_spin_lock.c | 0
.../sparc/{sparc32 => }/pthread_spin_trylock.c | 0
libpthread/nptl/sysdeps/sparc/pthreaddef.h | 44 +-
.../sparc/sparc32/sparcv9/pthread_spin_lock.c | 38 -
.../sparc/sparc32/sparcv9/pthread_spin_trylock.c | 1 -
.../sparc/sparc32/sparcv9/pthread_spin_unlock.c | 1 -
.../nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h | 27 -
.../nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c | 38 -
.../sysdeps/sparc/sparc64/pthread_spin_trylock.c | 33 -
.../sysdeps/sparc/sparc64/pthread_spin_unlock.c | 29 -
libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h | 39 -
.../nptl/sysdeps/unix/sysv/linux/sparc/clone.S | 7 +-
.../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S | 49 +-
.../unix/sysv/linux/sparc/pthread_barrier_wait.c | 94 +-
.../unix/sysv/linux/sparc/{sparc32 => }/sem_post.c | 0
.../sysv/linux/sparc/{sparc32 => }/sem_timedwait.c | 0
.../sysv/linux/sparc/{sparc32 => }/sem_trywait.c | 0
.../unix/sysv/linux/sparc/{sparc32 => }/sem_wait.c | 0
.../sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 2 -
.../unix/sysv/linux/sparc/sparc32/pt-vfork.S | 44 -
.../linux/sparc/sparc32/pthread_barrier_wait.c | 93 --
.../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 111 ---
.../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 48 -
.../sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 2 -
.../unix/sysv/linux/sparc/sparc64/pt-vfork.S | 44 -
.../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 109 ---
.../unix/sysv/linux/sparc/sparc64/timer_create.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_delete.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_getoverr.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_gettime.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_settime.c | 1 -
.../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 48 -
.../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 114 ++-
.../nptl/sysdeps/unix/sysv/linux/sparc/vfork.S | 53 +-
test/Makefile | 2 +-
test/README | 5 +-
test/librt/Makefile.in | 4 +
test/math/Makefile.in | 3 +
test/nptl/tst-cancel4.c | 28 +-
test/nptl/tst-sem3.c | 33 +-
test/nptl/tst-sem4.c | 7 +-
test/time/Makefile.in | 2 +-
96 files changed, 804 insertions(+), 5995 deletions(-)
create mode 100644 extra/scripts/none.lds
delete mode 100644 libc/string/sparc/sparc64/memchr.S
delete mode 100644 libc/string/sparc/sparc64/memcpy.S
delete mode 100644 libc/string/sparc/sparc64/memset.S
delete mode 100644 libc/string/sparc/sparc64/sparcv9b/memcpy.S
delete mode 100644 libc/string/sparc/sparc64/stpcpy.S
delete mode 100644 libc/string/sparc/sparc64/strcat.S
delete mode 100644 libc/string/sparc/sparc64/strchr.S
delete mode 100644 libc/string/sparc/sparc64/strcmp.S
delete mode 100644 libc/string/sparc/sparc64/strcpy.S
delete mode 100644 libc/string/sparc/sparc64/strlen.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/clone.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/rem.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/sdiv.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/udiv.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/umul.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/urem.S
delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
rename libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/vfork.S (100%)
rename libpthread/nptl/sysdeps/{sparc/sparc32 => }/jmpbuf-unwind.h (100%)
copy libpthread/nptl/sysdeps/{sparc/sparc32 => }/pthread_spin_lock.c (100%)
copy libpthread/nptl/sysdeps/{sparc/sparc32 => }/pthread_spin_trylock.c (100%)
rename libpthread/nptl/sysdeps/{sparc/sparc32 => }/pthreaddef.h (100%)
rename libpthread/nptl/sysdeps/sparc/{sparc32 => }/pthread_spin_lock.c (100%)
rename libpthread/nptl/sysdeps/sparc/{sparc32 => }/pthread_spin_trylock.c (100%)
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_post.c (100%)
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_timedwait.c (100%)
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_trywait.c (100%)
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_wait.c (100%)
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
diff --git a/Makerules b/Makerules
index 5030205..05d9548 100644
--- a/Makerules
+++ b/Makerules
@@ -240,7 +240,7 @@ cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) \
cmd_compile.i = $(cmd_compile.c:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
cmd_compile.s = $(cmd_compile.c:-c=-S)
cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
-cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
+cmd_compile.S = $(filter-out -std=%, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
@@ -303,7 +303,7 @@ define create-lds
$(Q)$(CC) -nostdlib -nostartfiles -shared -Wl,-z,combreloc \
-Wl,-z,relro -Wl,--hash-style=gnu -Wl,-z,defs \
-Wl,--verbose 2>&1 | LC_ALL=C \
- sed -e '/^=========/,/^=========/!d;/^=========/d' \
+ $(SED) -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = .* + SIZEOF_HEADERS;/& $(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds
endef
diff --git a/Rules.mak b/Rules.mak
index 19cc38a..cb65700 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -201,7 +201,7 @@ check_as=$(shell \
if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
then echo "-Wa,$(1)"; fi)
check_ld=$(shell \
- if $(CC) $(LDFLAG-fuse-ld) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
+ if $(CC) $(LDFLAG-fuse-ld) $(CFLAG_-Wl--no-warn-mismatch) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
then echo "$(1)"; fi)
# Use variable indirection here so that we can have variable
@@ -254,8 +254,11 @@ ARFLAGS:=cr
# Note: The check for -nostdlib has to be before all calls to check_ld
$(eval $(call check-gcc-var,-nostdlib))
-LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
# deliberately not named CFLAG-fuse-ld since unchecked and from user
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
+# failed to merge target specific data of file /dev/null
+# Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well.
+$(eval $(call check-ld-var,--no-warn-mismatch))
# Flags in OPTIMIZATION are used only for non-debug builds
diff --git a/extra/Configs/Config.sparc b/extra/Configs/Config.sparc
index c6180c8..47c8ac2 100644
--- a/extra/Configs/Config.sparc
+++ b/extra/Configs/Config.sparc
@@ -26,10 +26,4 @@ config CONFIG_SPARC_V7
config CONFIG_SPARC_V8
bool "SPARC v8"
-config CONFIG_SPARC_V9
- bool "SPARC v9"
-
-config CONFIG_SPARC_V9B
- bool "SPARC v9b"
-
endchoice
diff --git a/extra/scripts/none.lds b/extra/scripts/none.lds
new file mode 100644
index 0000000..d6bd05a
--- /dev/null
+++ b/extra/scripts/none.lds
@@ -0,0 +1,13 @@
+/* GNU ld script
+ * Used by the build system to probe flags.
+ * Discards all output to avoid error
+ * "failed to merge target specific data of file %B". */
+TARGET(binary)
+INPUT(/dev/null)
+/* We could as well omit the whole SECTIONS block.
+ * This redundancy is just for clarity. */
+SECTIONS
+{
+ /DISCARD/ : { *(*) }
+}
+
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 1b06bc1..54501d1 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -728,7 +728,7 @@ struct elf_resolve *_dl_load_elf_shared_library(unsigned rflags,
void *new_addr;
new_addr = map_writeable (infile, ppnt, piclib, flags, libaddr);
if (!new_addr) {
- _dl_dprintf(_dl_debug_file, "Can't modify %s's text section.",
+ _dl_dprintf(2, "Can't modify %s's text section.",
libname);
_dl_exit(1);
}
diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c
index 151a229..8c5d25d 100644
--- a/libc/stdlib/system.c
+++ b/libc/stdlib/system.c
@@ -18,13 +18,14 @@
#include <sysdep-cancel.h>
#endif
-extern __typeof(system) __libc_system;
-
-/* TODO: the cancellable version breaks on sparc currently,
- * need to figure out why still
- */
-#if !defined __UCLIBC_HAS_THREADS_NATIVE__ || defined __sparc__
+#if !defined __UCLIBC_HAS_THREADS_NATIVE__
+/* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
+#include <sys/syscall.h>
+#ifndef __NR_vfork
+# define vfork fork
+#endif
+extern __typeof(system) __libc_system;
int __libc_system(const char *command)
{
int wait_val, pid;
diff --git a/libc/string/sparc/sparc64/memchr.S b/libc/string/sparc/sparc64/memchr.S
deleted file mode 100644
index 6467f7f..0000000
--- a/libc/string/sparc/sparc64/memchr.S
+++ /dev/null
@@ -1,258 +0,0 @@
-/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
- than N.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
- This version is developed using the same algorithm as the fast C
- version which carries the following introduction:
- Based on strlen implementation by Torbjorn Granlund (tege(a)sics.se)
- with help from Dan Sahlin (dan(a)sics.se) and
- commentary by Jim Blandy (jimb(a)ai.mit.edu)
- adaptation to memchr suggested by Dick Karpinski (dick(a)cca.ucsf.edu)
- and implemented by Roland McGrath (roland(a)ai.mit.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/>. */
-
-#include <asm/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(memchr)
- and %o1, 0xff, %o1 /* IEU0 Group */
-#ifdef USE_BPR
- brz,pn %o2, 12f /* CTI+IEU1 */
-#else
- tst %o2 /* IEU1 */
- be,pn %XCC, 12f /* CTI */
-#endif
- sll %o1, 8, %g3 /* IEU0 Group */
- add %o0, %o2, %o2 /* IEU1 */
-
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- or %g3, %o1, %g3 /* IEU1 */
- ldub [%o0], %o3 /* Load */
- sllx %g3, 16, %g5 /* IEU0 Group */
-
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
- sllx %g1, 32, %g2 /* IEU0 Group */
- or %g3, %g5, %g3 /* IEU1 */
- sllx %g3, 32, %g5 /* IEU0 Group */
-
- cmp %o3, %o1 /* IEU1 */
- be,pn %xcc, 13f /* CTI */
- or %g1, %g2, %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
-
- bne,a,pn %icc, 21f /* CTI */
- add %o0, 1, %o0 /* IEU0 Group */
- ldx [%o0], %o3 /* Load Group */
- sllx %g1, 7, %g2 /* IEU0 */
-
- or %g3, %g5, %g3 /* IEU1 */
-1: add %o0, 8, %o0 /* IEU0 Group */
- xor %o3, %g3, %o4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080088080808080 *
- * %g3 = c c c c c c c c *
- * %o3 = value *
- * %o4 = value XOR c */
-2: cmp %o0, %o2 /* IEU1 Group */
-
- bg,pn %XCC, 11f /* CTI */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- sub %o4, %g1, %o5 /* IEU0 Group */
- add %o0, 8, %o0 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o5, %o4, %o5 /* IEU0 Group */
-#endif
-
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- srlx %o4, 56, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 3f /* CTI */
- srlx %o4, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- srlx %o4, 24, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %o4, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 8f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- bne,pt %icc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- retl /* CTI+IEU1 Group */
-
- add %o0, -9, %o0 /* IEU0 */
-
- .align 16
-3: retl /* CTI+IEU1 Group */
- add %o0, -16, %o0 /* IEU0 */
-4: retl /* CTI+IEU1 Group */
- add %o0, -15, %o0 /* IEU0 */
-
-5: retl /* CTI+IEU1 Group */
- add %o0, -14, %o0 /* IEU0 */
-6: retl /* CTI+IEU1 Group */
- add %o0, -13, %o0 /* IEU0 */
-
-7: retl /* CTI+IEU1 Group */
- add %o0, -12, %o0 /* IEU0 */
-8: retl /* CTI+IEU1 Group */
- add %o0, -11, %o0 /* IEU0 */
-
-9: retl /* CTI+IEU1 Group */
- add %o0, -10, %o0 /* IEU0 */
-11: sub %o4, %g1, %o5 /* IEU0 Group */
- sub %o0, 8, %o0 /* IEU1 */
-
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 12f /* CTI */
- sub %o2, %o0, %o2 /* IEU0 */
- tst %o2 /* IEU1 Group */
-
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 13f /* CTI */
-
- cmp %o2, 1 /* IEU0 */
- be,pn %XCC, 12f /* CTI Group */
- srlx %o4, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 14f /* CTI */
- cmp %o2, 2 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 15f /* CTI */
- cmp %o2, 3 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
-
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
- cmp %o2, 4 /* IEU1 Group */
-
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 17f /* CTI */
-
- cmp %o2, 5 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 18f /* CTI */
- cmp %o2, 6 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- nop /* IEU0 */
-12: retl /* CTI+IEU1 Group */
-
- clr %o0 /* IEU0 */
- nop /* Stub */
-13: retl /* CTI+IEU1 Group */
- nop /* IEU0 */
-
-14: retl /* CTI+IEU1 Group */
- add %o0, 1, %o0 /* IEU0 */
-15: retl /* CTI+IEU1 Group */
- add %o0, 2, %o0 /* IEU0 */
-
-16: retl /* CTI+IEU1 Group */
- add %o0, 3, %o0 /* IEU0 */
-17: retl /* CTI+IEU1 Group */
- add %o0, 4, %o0 /* IEU0 */
-
-18: retl /* CTI+IEU1 Group */
- add %o0, 5, %o0 /* IEU0 */
-19: retl /* CTI+IEU1 Group */
- add %o0, 6, %o0 /* IEU0 */
-
-21: cmp %o0, %o2 /* IEU1 */
- be,pn %XCC, 12b /* CTI */
- sllx %g1, 7, %g2 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
-
- or %g3, %g5, %g3 /* IEU1 */
-22: andcc %o0, 7, %g0 /* IEU1 Group */
- be,a,pn %icc, 1b /* CTI */
- ldx [%o0], %o3 /* Load */
-
- cmp %o3, %o1 /* IEU1 Group */
- be,pn %xcc, 23f /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- cmp %o0, %o2 /* IEU1 Group */
-
- bne,a,pt %XCC, 22b /* CTI */
- ldub [%o0], %o3 /* Load */
- retl /* CTI+IEU1 Group */
- clr %o0 /* IEU0 */
-
-23: retl /* CTI+IEU1 Group */
- add %o0, -1, %o0 /* IEU0 */
-END(memchr)
-
-libc_hidden_def(memchr)
-weak_alias(memchr,__ubp_memchr)
diff --git a/libc/string/sparc/sparc64/memcpy.S b/libc/string/sparc/sparc64/memcpy.S
deleted file mode 100644
index df3e2d3..0000000
--- a/libc/string/sparc/sparc64/memcpy.S
+++ /dev/null
@@ -1,922 +0,0 @@
-/* Copy SIZE bytes from SRC to DEST.
- For UltraSPARC.
- Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller (davem(a)caip.rutgers.edu) and
- Jakub Jelinek (jakub(a)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 <features.h>
-#include <asm/asi.h>
-#ifndef XCC
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#define XCC xcc
-#endif
-#define FPRS_FEF 4
-
-#define FREG_FROB(f1, f2, f3, f4, f5, f6, f7, f8, f9) \
- faligndata %f1, %f2, %f48; \
- faligndata %f2, %f3, %f50; \
- faligndata %f3, %f4, %f52; \
- faligndata %f4, %f5, %f54; \
- faligndata %f5, %f6, %f56; \
- faligndata %f6, %f7, %f58; \
- faligndata %f7, %f8, %f60; \
- faligndata %f8, %f9, %f62;
-
-#define MAIN_LOOP_CHUNK(src, dest, fdest, fsrc, len, jmptgt) \
- ldda [%src] %asi, %fdest; \
- add %src, 0x40, %src; \
- add %dest, 0x40, %dest; \
- subcc %len, 0x40, %len; \
- be,pn %xcc, jmptgt; \
- stda %fsrc, [%dest - 0x40] %asi;
-
-#define LOOP_CHUNK1(src, dest, len, branch_dest) \
- MAIN_LOOP_CHUNK(src, dest, f0, f48, len, branch_dest)
-#define LOOP_CHUNK2(src, dest, len, branch_dest) \
- MAIN_LOOP_CHUNK(src, dest, f16, f48, len, branch_dest)
-#define LOOP_CHUNK3(src, dest, len, branch_dest) \
- MAIN_LOOP_CHUNK(src, dest, f32, f48, len, branch_dest)
-
-#define STORE_SYNC(dest, fsrc) \
- stda %fsrc, [%dest] %asi; \
- add %dest, 0x40, %dest;
-
-#define STORE_JUMP(dest, fsrc, target) \
- stda %fsrc, [%dest] %asi; \
- add %dest, 0x40, %dest; \
- ba,pt %xcc, target;
-
-#define VISLOOP_PAD nop; nop; nop; nop; \
- nop; nop; nop; nop; \
- nop; nop; nop; nop; \
- nop; nop; nop;
-
-#define FINISH_VISCHUNK(dest, f0, f1, left) \
- subcc %left, 8, %left; \
- bl,pn %xcc, 205f; \
- faligndata %f0, %f1, %f48; \
- std %f48, [%dest]; \
- add %dest, 8, %dest;
-
-#define UNEVEN_VISCHUNK(dest, f0, f1, left) \
- subcc %left, 8, %left; \
- bl,pn %xcc, 205f; \
- fsrc1 %f0, %f1; \
- ba,a,pt %xcc, 204f;
-
- /* Macros for non-VIS memcpy code. */
-#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- ldx [%src + offset + 0x10], %t2; \
- ldx [%src + offset + 0x18], %t3; \
- stw %t0, [%dst + offset + 0x04]; \
- srlx %t0, 32, %t0; \
- stw %t0, [%dst + offset + 0x00]; \
- stw %t1, [%dst + offset + 0x0c]; \
- srlx %t1, 32, %t1; \
- stw %t1, [%dst + offset + 0x08]; \
- stw %t2, [%dst + offset + 0x14]; \
- srlx %t2, 32, %t2; \
- stw %t2, [%dst + offset + 0x10]; \
- stw %t3, [%dst + offset + 0x1c]; \
- srlx %t3, 32, %t3; \
- stw %t3, [%dst + offset + 0x18];
-
-#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- ldx [%src + offset + 0x10], %t2; \
- ldx [%src + offset + 0x18], %t3; \
- stx %t0, [%dst + offset + 0x00]; \
- stx %t1, [%dst + offset + 0x08]; \
- stx %t2, [%dst + offset + 0x10]; \
- stx %t3, [%dst + offset + 0x18]; \
- ldx [%src + offset + 0x20], %t0; \
- ldx [%src + offset + 0x28], %t1; \
- ldx [%src + offset + 0x30], %t2; \
- ldx [%src + offset + 0x38], %t3; \
- stx %t0, [%dst + offset + 0x20]; \
- stx %t1, [%dst + offset + 0x28]; \
- stx %t2, [%dst + offset + 0x30]; \
- stx %t3, [%dst + offset + 0x38];
-
-#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x10], %t0; \
- ldx [%src - offset - 0x08], %t1; \
- stw %t0, [%dst - offset - 0x0c]; \
- srlx %t0, 32, %t2; \
- stw %t2, [%dst - offset - 0x10]; \
- stw %t1, [%dst - offset - 0x04]; \
- srlx %t1, 32, %t3; \
- stw %t3, [%dst - offset - 0x08];
-
-#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- ldx [%src - offset - 0x10], %t0; \
- ldx [%src - offset - 0x08], %t1; \
- stx %t0, [%dst - offset - 0x10]; \
- stx %t1, [%dst - offset - 0x08];
-
- /* Macros for non-VIS memmove code. */
-#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stw %t0, [%dst - offset - 0x1c]; \
- srlx %t0, 32, %t0; \
- stw %t0, [%dst - offset - 0x20]; \
- stw %t1, [%dst - offset - 0x14]; \
- srlx %t1, 32, %t1; \
- stw %t1, [%dst - offset - 0x18]; \
- stw %t2, [%dst - offset - 0x0c]; \
- srlx %t2, 32, %t2; \
- stw %t2, [%dst - offset - 0x10]; \
- stw %t3, [%dst - offset - 0x04]; \
- srlx %t3, 32, %t3; \
- stw %t3, [%dst - offset - 0x08];
-
-#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stx %t0, [%dst - offset - 0x20]; \
- stx %t1, [%dst - offset - 0x18]; \
- stx %t2, [%dst - offset - 0x10]; \
- stx %t3, [%dst - offset - 0x08]; \
- ldx [%src - offset - 0x40], %t0; \
- ldx [%src - offset - 0x38], %t1; \
- ldx [%src - offset - 0x30], %t2; \
- ldx [%src - offset - 0x28], %t3; \
- stx %t0, [%dst - offset - 0x40]; \
- stx %t1, [%dst - offset - 0x38]; \
- stx %t2, [%dst - offset - 0x30]; \
- stx %t3, [%dst - offset - 0x28];
-
-#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stw %t0, [%dst + offset + 0x04]; \
- srlx %t0, 32, %t2; \
- stw %t2, [%dst + offset + 0x00]; \
- stw %t1, [%dst + offset + 0x0c]; \
- srlx %t1, 32, %t3; \
- stw %t3, [%dst + offset + 0x08];
-
-#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stx %t0, [%dst + offset + 0x00]; \
- stx %t1, [%dst + offset + 0x08];
-
- .text
- .align 32
-
-#ifdef __UCLIBC_SUSV3_LEGACY__
-ENTRY(bcopy)
- sub %o1, %o0, %o4 /* IEU0 Group */
- mov %o0, %g3 /* IEU1 */
- cmp %o4, %o2 /* IEU1 Group */
- mov %o1, %o0 /* IEU0 */
- bgeu,pt %XCC, 210f /* CTI */
- mov %g3, %o1 /* IEU0 Group */
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 */
-#endif
- brnz,pn %o2, 220f /* CTI Group */
- add %o0, %o2, %o0 /* IEU0 */
- retl
- nop
-END(bcopy)
-#endif
-
- .align 32
-200: be,pt %xcc, 201f /* CTI */
- andcc %o0, 0x38, %g5 /* IEU1 Group */
- mov 8, %g1 /* IEU0 */
- sub %g1, %g2, %g2 /* IEU0 Group */
- andcc %o0, 1, %g0 /* IEU1 */
- be,pt %icc, 2f /* CTI */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1], %o5 /* Load Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- be,pn %xcc, 3f /* CTI */
- stb %o5, [%o0 - 1] /* Store */
-2: ldub [%o1], %o5 /* Load Group */
- add %o0, 2, %o0 /* IEU0 */
- ldub [%o1 + 1], %g3 /* Load Group */
- subcc %g2, 2, %g2 /* IEU1 Group */
- stb %o5, [%o0 - 2] /* Store */
- add %o1, 2, %o1 /* IEU0 */
- bne,pt %xcc, 2b /* CTI Group */
- stb %g3, [%o0 - 1] /* Store */
-3: andcc %o0, 0x38, %g5 /* IEU1 Group */
-201: be,pt %icc, 202f /* CTI */
- mov 64, %g1 /* IEU0 */
- fmovd %f0, %f2 /* FPU */
- sub %g1, %g5, %g5 /* IEU0 Group */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
- sub %o2, %g5, %o2 /* IEU0 */
-1: ldd [%g1 + 0x8], %f6 /* Load Group */
- add %g1, 0x8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 202f /* CTI */
- add %o0, 8, %o0 /* IEU1 */
- ldd [%g1 + 0x8], %f4 /* Load Group */
- add %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 */
- bne,pt %xcc, 1b /* CTI Group */
- add %o0, 8, %o0 /* IEU0 */
-202: membar #LoadStore | #StoreStore | #StoreLoad /* LSU Group */
- wr %g0, ASI_BLK_P, %asi /* LSU Group */
- subcc %o2, 0x40, %g6 /* IEU1 Group */
- mov %o1, %g1 /* IEU0 */
- andncc %g6, (0x40 - 1), %g6 /* IEU1 Group */
- srl %g1, 3, %g2 /* IEU0 */
- sub %o2, %g6, %g3 /* IEU0 Group */
- andn %o1, (0x40 - 1), %o1 /* IEU1 */
- and %g2, 7, %g2 /* IEU0 Group */
- andncc %g3, 0x7, %g3 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- sub %g3, 0x10, %g3 /* IEU0 Group */
- sub %o2, %g6, %o2 /* IEU1 */
- alignaddr %g1, %g0, %g0 /* GRU Group */
- add %g1, %g6, %g1 /* IEU0 Group */
- subcc %o2, %g3, %o2 /* IEU1 */
- ldda [%o1 + 0x00] %asi, %f0 /* LSU Group */
- add %g1, %g3, %g1 /* IEU0 */
- ldda [%o1 + 0x40] %asi, %f16 /* LSU Group */
- sub %g6, 0x80, %g6 /* IEU0 */
- ldda [%o1 + 0x80] %asi, %f32 /* LSU Group */
- /* Clk1 Group 8-( */
- /* Clk2 Group 8-( */
- /* Clk3 Group 8-( */
- /* Clk4 Group 8-( */
-203: rd %pc, %g5 /* PDU Group 8-( */
- addcc %g5, %lo(300f - 203b), %g5 /* IEU1 Group */
- sll %g2, 9, %g2 /* IEU0 */
- jmpl %g5 + %g2, %g0 /* CTI Group brk forced*/
- addcc %o1, 0xc0, %o1 /* IEU1 Group */
-
- .align 512 /* OK, here comes the fun part... */
-300: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) LOOP_CHUNK1(o1, o0, g6, 301f)
- FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) LOOP_CHUNK2(o1, o0, g6, 302f)
- FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) LOOP_CHUNK3(o1, o0, g6, 303f)
- b,pt %xcc, 300b+4; faligndata %f0, %f2, %f48
-301: FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_JUMP(o0, f48, 400f) membar #Sync
-302: FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_JUMP(o0, f48, 416f) membar #Sync
-303: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_JUMP(o0, f48, 432f) membar #Sync
- VISLOOP_PAD
-310: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) LOOP_CHUNK1(o1, o0, g6, 311f)
- FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) LOOP_CHUNK2(o1, o0, g6, 312f)
- FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) LOOP_CHUNK3(o1, o0, g6, 313f)
- b,pt %xcc, 310b+4; faligndata %f2, %f4, %f48
-311: FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_JUMP(o0, f48, 402f) membar #Sync
-312: FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_JUMP(o0, f48, 418f) membar #Sync
-313: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_JUMP(o0, f48, 434f) membar #Sync
- VISLOOP_PAD
-320: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) LOOP_CHUNK1(o1, o0, g6, 321f)
- FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) LOOP_CHUNK2(o1, o0, g6, 322f)
- FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) LOOP_CHUNK3(o1, o0, g6, 323f)
- b,pt %xcc, 320b+4; faligndata %f4, %f6, %f48
-321: FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_JUMP(o0, f48, 404f) membar #Sync
-322: FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_JUMP(o0, f48, 420f) membar #Sync
-323: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_JUMP(o0, f48, 436f) membar #Sync
- VISLOOP_PAD
-330: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) LOOP_CHUNK1(o1, o0, g6, 331f)
- FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) LOOP_CHUNK2(o1, o0, g6, 332f)
- FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) LOOP_CHUNK3(o1, o0, g6, 333f)
- b,pt %xcc, 330b+4; faligndata %f6, %f8, %f48
-331: FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_JUMP(o0, f48, 406f) membar #Sync
-332: FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_JUMP(o0, f48, 422f) membar #Sync
-333: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_JUMP(o0, f48, 438f) membar #Sync
- VISLOOP_PAD
-340: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) LOOP_CHUNK1(o1, o0, g6, 341f)
- FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) LOOP_CHUNK2(o1, o0, g6, 342f)
- FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) LOOP_CHUNK3(o1, o0, g6, 343f)
- b,pt %xcc, 340b+4; faligndata %f8, %f10, %f48
-341: FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_JUMP(o0, f48, 408f) membar #Sync
-342: FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_JUMP(o0, f48, 424f) membar #Sync
-343: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_JUMP(o0, f48, 440f) membar #Sync
- VISLOOP_PAD
-350: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) LOOP_CHUNK1(o1, o0, g6, 351f)
- FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) LOOP_CHUNK2(o1, o0, g6, 352f)
- FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) LOOP_CHUNK3(o1, o0, g6, 353f)
- b,pt %xcc, 350b+4; faligndata %f10, %f12, %f48
-351: FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_JUMP(o0, f48, 410f) membar #Sync
-352: FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_JUMP(o0, f48, 426f) membar #Sync
-353: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_JUMP(o0, f48, 442f) membar #Sync
- VISLOOP_PAD
-360: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) LOOP_CHUNK1(o1, o0, g6, 361f)
- FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) LOOP_CHUNK2(o1, o0, g6, 362f)
- FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) LOOP_CHUNK3(o1, o0, g6, 363f)
- b,pt %xcc, 360b+4; faligndata %f12, %f14, %f48
-361: FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_JUMP(o0, f48, 412f) membar #Sync
-362: FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_JUMP(o0, f48, 428f) membar #Sync
-363: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_JUMP(o0, f48, 444f) membar #Sync
- VISLOOP_PAD
-370: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) LOOP_CHUNK1(o1, o0, g6, 371f)
- FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) LOOP_CHUNK2(o1, o0, g6, 372f)
- FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) LOOP_CHUNK3(o1, o0, g6, 373f)
- b,pt %xcc, 370b+4; faligndata %f14, %f16, %f48
-371: FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_JUMP(o0, f48, 414f) membar #Sync
-372: FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_JUMP(o0, f48, 430f) membar #Sync
-373: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_JUMP(o0, f48, 446f) membar #Sync
- VISLOOP_PAD
-400: FINISH_VISCHUNK(o0, f0, f2, g3)
-402: FINISH_VISCHUNK(o0, f2, f4, g3)
-404: FINISH_VISCHUNK(o0, f4, f6, g3)
-406: FINISH_VISCHUNK(o0, f6, f8, g3)
-408: FINISH_VISCHUNK(o0, f8, f10, g3)
-410: FINISH_VISCHUNK(o0, f10, f12, g3)
-412: FINISH_VISCHUNK(o0, f12, f14, g3)
-414: UNEVEN_VISCHUNK(o0, f14, f0, g3)
-416: FINISH_VISCHUNK(o0, f16, f18, g3)
-418: FINISH_VISCHUNK(o0, f18, f20, g3)
-420: FINISH_VISCHUNK(o0, f20, f22, g3)
-422: FINISH_VISCHUNK(o0, f22, f24, g3)
-424: FINISH_VISCHUNK(o0, f24, f26, g3)
-426: FINISH_VISCHUNK(o0, f26, f28, g3)
-428: FINISH_VISCHUNK(o0, f28, f30, g3)
-430: UNEVEN_VISCHUNK(o0, f30, f0, g3)
-432: FINISH_VISCHUNK(o0, f32, f34, g3)
-434: FINISH_VISCHUNK(o0, f34, f36, g3)
-436: FINISH_VISCHUNK(o0, f36, f38, g3)
-438: FINISH_VISCHUNK(o0, f38, f40, g3)
-440: FINISH_VISCHUNK(o0, f40, f42, g3)
-442: FINISH_VISCHUNK(o0, f42, f44, g3)
-444: FINISH_VISCHUNK(o0, f44, f46, g3)
-446: UNEVEN_VISCHUNK(o0, f46, f0, g3)
-204: ldd [%o1], %f2 /* Load Group */
- add %o1, 8, %o1 /* IEU0 */
- subcc %g3, 8, %g3 /* IEU1 */
- faligndata %f0, %f2, %f8 /* GRU Group */
- std %f8, [%o0] /* Store */
- bl,pn %xcc, 205f /* CTI */
- add %o0, 8, %o0 /* IEU0 Group */
- ldd [%o1], %f0 /* Load Group */
- add %o1, 8, %o1 /* IEU0 */
- subcc %g3, 8, %g3 /* IEU1 */
- faligndata %f2, %f0, %f8 /* GRU Group */
- std %f8, [%o0] /* Store */
- bge,pt %xcc, 204b /* CTI */
- add %o0, 8, %o0 /* IEU0 Group */
-205: brz,pt %o2, 207f /* CTI Group */
- mov %g1, %o1 /* IEU0 */
-206: ldub [%o1], %g5 /* LOAD */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 206b /* CTI */
- stb %g5, [%o0 - 1] /* Store Group */
-207: membar #StoreLoad | #StoreStore /* LSU Group */
- wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-
-208: andcc %o2, 1, %g0 /* IEU1 Group */
- be,pt %icc, 2f+4 /* CTI */
-1: ldub [%o1], %g5 /* LOAD Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 Group */
- be,pn %xcc, 209f /* CTI */
- stb %g5, [%o0 - 1] /* Store */
-2: ldub [%o1], %g5 /* LOAD Group */
- add %o0, 2, %o0 /* IEU0 */
- ldub [%o1 + 1], %o5 /* LOAD Group */
- add %o1, 2, %o1 /* IEU0 */
- subcc %o2, 2, %o2 /* IEU1 Group */
- stb %g5, [%o0 - 2] /* Store */
- bne,pt %xcc, 2b /* CTI */
- stb %o5, [%o0 - 1] /* Store */
-209: retl
- mov %g4, %o0
-
-#ifdef USE_BPR
-
- /* void *__align_cpy_4(void *dest, void *src, size_t n)
- * SPARC v9 SYSV ABI
- * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 3))
- */
-
- .align 32
-ENTRY(__align_cpy_4)
- mov %o0, %g4 /* IEU0 Group */
- cmp %o2, 15 /* IEU1 */
- bleu,pn %xcc, 208b /* CTI */
- cmp %o2, (64 * 6) /* IEU1 Group */
- bgeu,pn %xcc, 200b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- ba,pt %xcc, 216f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
-END(__align_cpy_4)
-
- /* void *__align_cpy_8(void *dest, void *src, size_t n)
- * SPARC v9 SYSV ABI
- * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 7))
- */
-
- .align 32
-ENTRY(__align_cpy_8)
- mov %o0, %g4 /* IEU0 Group */
- cmp %o2, 15 /* IEU1 */
- bleu,pn %xcc, 208b /* CTI */
- cmp %o2, (64 * 6) /* IEU1 Group */
- bgeu,pn %xcc, 201b /* CTI */
- andcc %o0, 0x38, %g5 /* IEU1 Group */
- andcc %o2, -128, %g6 /* IEU1 Group */
- bne,a,pt %xcc, 82f + 4 /* CTI */
- ldx [%o1], %g1 /* Load */
- ba,pt %xcc, 41f /* CTI Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
-END(__align_cpy_8)
-
- /* void *__align_cpy_16(void *dest, void *src, size_t n)
- * SPARC v9 SYSV ABI
- * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 15))
- */
-
- .align 32
-ENTRY(__align_cpy_16)
- mov %o0, %g4 /* IEU0 Group */
- cmp %o2, (64 * 6) /* IEU1 */
- bgeu,pn %xcc, 201b /* CTI */
- andcc %o0, 0x38, %g5 /* IEU1 Group */
- andcc %o2, -128, %g6 /* IEU1 Group */
- bne,a,pt %xcc, 82f + 4 /* CTI */
- ldx [%o1], %g1 /* Load */
- ba,pt %xcc, 41f /* CTI Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
-END(__align_cpy_16)
-
-#endif
-
- .align 32
-ENTRY(memcpy)
-210:
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 Group */
-#endif
- brz,pn %o2, 209b /* CTI Group */
- mov %o0, %g4 /* IEU0 */
-218: cmp %o2, 15 /* IEU1 Group */
- bleu,pn %xcc, 208b /* CTI */
- cmp %o2, (64 * 6) /* IEU1 Group */
- bgeu,pn %xcc, 200b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- sub %o0, %o1, %g5 /* IEU0 */
- andcc %g5, 3, %o5 /* IEU1 Group */
- bne,pn %xcc, 212f /* CTI */
- andcc %o1, 3, %g0 /* IEU1 Group */
- be,a,pt %xcc, 216f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
- andcc %o1, 1, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- andcc %o1, 2, %g0 /* IEU1 Group */
- ldub [%o1], %g2 /* Load Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- sub %o2, 1, %o2 /* IEU0 Group */
- bne,pn %xcc, 5f /* CTI Group */
- stb %g2, [%o0 - 1] /* Store */
-4: lduh [%o1], %g2 /* Load Group */
- add %o1, 2, %o1 /* IEU0 */
- add %o0, 2, %o0 /* IEU1 */
- sub %o2, 2, %o2 /* IEU0 */
- sth %g2, [%o0 - 2] /* Store Group + bubble */
-5: andcc %o1, 4, %g0 /* IEU1 */
-216: be,a,pn %xcc, 2f /* CTI */
- andcc %o2, -128, %g6 /* IEU1 Group */
- lduw [%o1], %g5 /* Load Group */
- add %o1, 4, %o1 /* IEU0 */
- add %o0, 4, %o0 /* IEU1 */
- sub %o2, 4, %o2 /* IEU0 Group */
- stw %g5, [%o0 - 4] /* Store */
- andcc %o2, -128, %g6 /* IEU1 Group */
-2: be,pn %xcc, 215f /* CTI */
- andcc %o0, 4, %g0 /* IEU1 Group */
- be,pn %xcc, 82f + 4 /* CTI Group */
-5: MOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- MOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- MOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- MOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
-35: subcc %g6, 128, %g6 /* IEU1 Group */
- add %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 5b /* CTI */
- add %o0, 128, %o0 /* IEU0 Group */
-215: andcc %o2, 0x70, %g6 /* IEU1 Group */
-41: be,pn %xcc, 80f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-79: rd %pc, %o5 /* PDU Group */
- sll %g6, 1, %g5 /* IEU0 Group */
- add %o1, %g6, %o1 /* IEU1 */
- sub %o5, %g5, %o5 /* IEU0 Group */
- jmpl %o5 + %lo(80f - 79b), %g0 /* CTI Group brk forced*/
- add %o0, %g6, %o0 /* IEU0 Group */
-36: MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
-80: be,pt %xcc, 81f /* CTI */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1], %g2 /* Load Group */
- add %o0, 8, %o0 /* IEU0 */
- stw %g2, [%o0 - 0x4] /* Store Group */
- add %o1, 8, %o1 /* IEU1 */
- srlx %g2, 32, %g2 /* IEU0 Group */
- stw %g2, [%o0 - 0x8] /* Store */
-81: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1], %g2 /* Load Group */
- add %o1, 4, %o1 /* IEU0 */
- stw %g2, [%o0] /* Store Group */
- add %o0, 4, %o0 /* IEU0 */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1], %g2 /* Load Group */
- add %o1, 2, %o1 /* IEU0 */
- sth %g2, [%o0] /* Store Group */
- add %o0, 2, %o0 /* IEU0 */
-1: be,pt %xcc, 211f /* CTI */
- nop /* IEU1 */
- ldub [%o1], %g2 /* Load Group */
- stb %g2, [%o0] /* Store Group + bubble */
-211: retl
- mov %g4, %o0
-
-82: MOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- MOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
-37: subcc %g6, 128, %g6 /* IEU1 Group */
- add %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 82b /* CTI */
- add %o0, 128, %o0 /* IEU0 Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
- be,pn %xcc, 84f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-83: rd %pc, %o5 /* PDU Group */
- add %o1, %g6, %o1 /* IEU0 Group */
- sub %o5, %g6, %o5 /* IEU1 */
- jmpl %o5 + %lo(84f - 83b), %g0 /* CTI Group brk forced*/
- add %o0, %g6, %o0 /* IEU0 Group */
-38: MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
-84: be,pt %xcc, 85f /* CTI Group */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1], %g2 /* Load Group */
- add %o0, 8, %o0 /* IEU0 */
- add %o1, 8, %o1 /* IEU0 Group */
- stx %g2, [%o0 - 0x8] /* Store */
-85: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1], %g2 /* Load Group */
- add %o0, 4, %o0 /* IEU0 */
- add %o1, 4, %o1 /* IEU0 Group */
- stw %g2, [%o0 - 0x4] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1], %g2 /* Load Group */
- add %o0, 2, %o0 /* IEU0 */
- add %o1, 2, %o1 /* IEU0 Group */
- sth %g2, [%o0 - 0x2] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- nop /* IEU0 Group */
- ldub [%o1], %g2 /* Load Group */
- stb %g2, [%o0] /* Store Group + bubble */
-1: retl
- mov %g4, %o0
-
-212: brz,pt %g2, 2f /* CTI Group */
- mov 8, %g1 /* IEU0 */
- sub %g1, %g2, %g2 /* IEU0 Group */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1], %g5 /* Load Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- bne,pt %xcc, 1b /* CTI */
- stb %g5, [%o0 - 1] /* Store */
-2: andn %o2, 7, %g5 /* IEU0 Group */
- and %o2, 7, %o2 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
-1: ldd [%g1 + 0x8], %f6 /* Load Group */
- add %g1, 0x8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 213f /* CTI */
- add %o0, 8, %o0 /* IEU1 */
- ldd [%g1 + 0x8], %f4 /* Load Group */
- add %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 */
- bne,pn %xcc, 1b /* CTI Group */
- add %o0, 8, %o0 /* IEU0 */
-213: brz,pn %o2, 214f /* CTI Group */
- nop /* IEU0 */
- ldub [%o1], %g5 /* LOAD */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 206b /* CTI */
- stb %g5, [%o0 - 1] /* Store Group */
-214: wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-END(memcpy)
-libc_hidden_def(memcpy)
-
- .align 32
-228: andcc %o2, 1, %g0 /* IEU1 Group */
- be,pt %icc, 2f+4 /* CTI */
-1: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 Group */
- be,pn %xcc, 229f /* CTI */
- stb %o5, [%o0] /* Store */
-2: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o0, 2, %o0 /* IEU0 */
- ldub [%o1 - 2], %g5 /* LOAD Group */
- sub %o1, 2, %o1 /* IEU0 */
- subcc %o2, 2, %o2 /* IEU1 Group */
- stb %o5, [%o0 + 1] /* Store */
- bne,pt %xcc, 2b /* CTI */
- stb %g5, [%o0] /* Store */
-229: retl
- mov %g4, %o0
-219: retl
- nop
-
- .align 32
-ENTRY(memmove)
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 Group */
-#endif
- brz,pn %o2, 219b /* CTI Group */
- sub %o0, %o1, %o4 /* IEU0 */
- cmp %o4, %o2 /* IEU1 Group */
- bgeu,pt %XCC, 218b /* CTI */
- mov %o0, %g4 /* IEU0 */
- add %o0, %o2, %o0 /* IEU0 Group */
-220: add %o1, %o2, %o1 /* IEU1 */
- cmp %o2, 15 /* IEU1 Group */
- bleu,pn %xcc, 228b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- sub %o0, %o1, %g5 /* IEU0 */
- andcc %g5, 3, %o5 /* IEU1 Group */
- bne,pn %xcc, 232f /* CTI */
- andcc %o1, 3, %g0 /* IEU1 Group */
- be,a,pt %xcc, 236f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
- andcc %o1, 1, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- andcc %o1, 2, %g0 /* IEU1 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- sub %o2, 1, %o2 /* IEU0 Group */
- be,pn %xcc, 5f /* CTI Group */
- stb %g2, [%o0] /* Store */
-4: lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sub %o0, 2, %o0 /* IEU1 */
- sub %o2, 2, %o2 /* IEU0 */
- sth %g2, [%o0] /* Store Group + bubble */
-5: andcc %o1, 4, %g0 /* IEU1 */
-236: be,a,pn %xcc, 2f /* CTI */
- andcc %o2, -128, %g6 /* IEU1 Group */
- lduw [%o1 - 4], %g5 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- sub %o0, 4, %o0 /* IEU1 */
- sub %o2, 4, %o2 /* IEU0 Group */
- stw %g5, [%o0] /* Store */
- andcc %o2, -128, %g6 /* IEU1 Group */
-2: be,pn %xcc, 235f /* CTI */
- andcc %o0, 4, %g0 /* IEU1 Group */
- be,pn %xcc, 282f + 4 /* CTI Group */
-5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 5b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
-235: andcc %o2, 0x70, %g6 /* IEU1 Group */
-41: be,pn %xcc, 280f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-279: rd %pc, %o5 /* PDU Group */
- sll %g6, 1, %g5 /* IEU0 Group */
- sub %o1, %g6, %o1 /* IEU1 */
- sub %o5, %g5, %o5 /* IEU0 Group */
- jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
-280: be,pt %xcc, 281f /* CTI */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- stw %g2, [%o0 + 4] /* Store Group */
- sub %o1, 8, %o1 /* IEU1 */
- srlx %g2, 32, %g2 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-281: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- stw %g2, [%o0 - 4] /* Store Group */
- sub %o0, 4, %o0 /* IEU0 */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sth %g2, [%o0 - 2] /* Store Group */
- sub %o0, 2, %o0 /* IEU0 */
-1: be,pt %xcc, 211f /* CTI */
- nop /* IEU1 */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-211: retl
- mov %g4, %o0
-
-282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 282b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
- be,pn %xcc, 284f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-283: rd %pc, %o5 /* PDU Group */
- sub %o1, %g6, %o1 /* IEU0 Group */
- sub %o5, %g6, %o5 /* IEU1 */
- jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
-284: be,pt %xcc, 285f /* CTI Group */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- sub %o1, 8, %o1 /* IEU0 Group */
- stx %g2, [%o0] /* Store */
-285: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o0, 4, %o0 /* IEU0 */
- sub %o1, 4, %o1 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o0, 2, %o0 /* IEU0 */
- sub %o1, 2, %o1 /* IEU0 Group */
- sth %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- nop /* IEU0 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-1: retl
- mov %g4, %o0
-
-232: brz,pt %g2, 2f /* CTI Group */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1 - 1], %g5 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- bne,pt %xcc, 1b /* CTI */
- stb %g5, [%o0] /* Store */
-2: andn %o2, 7, %g5 /* IEU0 Group */
- and %o2, 7, %o2 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
-1: ldd [%g1 - 8], %f6 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 233f /* CTI */
- sub %o0, 8, %o0 /* IEU1 */
- ldd [%g1 - 8], %f4 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 */
- bne,pn %xcc, 1b /* CTI Group */
- sub %o0, 8, %o0 /* IEU0 */
-233: brz,pn %o2, 234f /* CTI Group */
- nop /* IEU0 */
-237: ldub [%o1 - 1], %g5 /* LOAD */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 237b /* CTI */
- stb %g5, [%o0] /* Store Group */
-234: wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-END(memmove)
-libc_hidden_def(memmove)
-
-#ifdef USE_BPR
-weak_alias(memcpy,__align_cpy_1)
-weak_alias(memcpy,__align_cpy_2)
-#endif
diff --git a/libc/string/sparc/sparc64/memset.S b/libc/string/sparc/sparc64/memset.S
deleted file mode 100644
index f76a637..0000000
--- a/libc/string/sparc/sparc64/memset.S
+++ /dev/null
@@ -1,316 +0,0 @@
-/* Set a block of memory to some byte value.
- For UltraSPARC.
- Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller (davem(a)caip.rutgers.edu) and
- Jakub Jelinek (jj(a)ultra.linux.cz)
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <features.h>
-#include <asm/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
-#endif
-#define FPRS_FEF 4
-
-#define SET_BLOCKS(base, offset, source) \
- stx source, [base - offset - 0x18]; \
- stx source, [base - offset - 0x10]; \
- stx source, [base - offset - 0x08]; \
- stx source, [base - offset - 0x00];
-
- /* Well, memset is a lot easier to get right than bcopy... */
- .text
- .align 32
-ENTRY(memset)
- andcc %o1, 0xff, %o1
- mov %o0, %o5
- be,a,pt %icc, 50f
-#ifndef USE_BPR
- srl %o2, 0, %o1
-#else
- mov %o2, %o1
-#endif
- cmp %o2, 7
-#ifndef USE_BPR
- srl %o2, 0, %o2
-#endif
- bleu,pn %XCC, 17f
- andcc %o0, 3, %g5
- be,pt %xcc, 4f
- and %o1, 0xff, %o1
- cmp %g5, 3
- be,pn %xcc, 2f
- stb %o1, [%o0 + 0x00]
- cmp %g5, 2
- be,pt %xcc, 2f
- stb %o1, [%o0 + 0x01]
- stb %o1, [%o0 + 0x02]
-2: sub %g5, 4, %g5
- sub %o0, %g5, %o0
- add %o2, %g5, %o2
-4: sllx %o1, 8, %g1
- andcc %o0, 4, %g0
- or %o1, %g1, %o1
- sllx %o1, 16, %g1
- or %o1, %g1, %o1
- be,pt %xcc, 2f
- sllx %o1, 32, %g1
- stw %o1, [%o0]
- sub %o2, 4, %o2
- add %o0, 4, %o0
-2: cmp %o2, 128
- or %o1, %g1, %o1
- blu,pn %xcc, 9f
- andcc %o0, 0x38, %g5
- be,pn %icc, 6f
- mov 64, %o4
- andcc %o0, 8, %g0
- be,pn %icc, 1f
- sub %o4, %g5, %o4
- stx %o1, [%o0]
- add %o0, 8, %o0
-1: andcc %o4, 16, %g0
- be,pn %icc, 1f
- sub %o2, %o4, %o2
- stx %o1, [%o0]
- stx %o1, [%o0 + 8]
- add %o0, 16, %o0
-1: andcc %o4, 32, %g0
- be,pn %icc, 7f
- andncc %o2, 0x3f, %o3
- stw %o1, [%o0]
- stw %o1, [%o0 + 4]
- stw %o1, [%o0 + 8]
- stw %o1, [%o0 + 12]
- stw %o1, [%o0 + 16]
- stw %o1, [%o0 + 20]
- stw %o1, [%o0 + 24]
- stw %o1, [%o0 + 28]
- add %o0, 32, %o0
-7: be,pn %xcc, 9f
- nop
- ldd [%o0 - 8], %f0
-18: wr %g0, ASI_BLK_P, %asi
- membar #StoreStore | #LoadStore
- andcc %o3, 0xc0, %g5
- and %o2, 0x3f, %o2
- fmovd %f0, %f2
- fmovd %f0, %f4
- andn %o3, 0xff, %o3
- fmovd %f0, %f6
- cmp %g5, 64
- fmovd %f0, %f8
- fmovd %f0, %f10
- fmovd %f0, %f12
- brz,pn %g5, 10f
- fmovd %f0, %f14
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x00] %asi
- cmp %g5, 128
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
-2: brz,pn %o3, 12f
- add %o0, %g5, %o0
-10: stda %f0, [%o0 + 0x00] %asi
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
- stda %f0, [%o0 + 0xc0] %asi
-11: subcc %o3, 256, %o3
- bne,pt %xcc, 10b
- add %o0, 256, %o0
-12: wr %g0, FPRS_FEF, %fprs
- membar #StoreLoad | #StoreStore
-9: andcc %o2, 0x78, %g5
- be,pn %xcc, 13f
- andcc %o2, 7, %o2
-14: rd %pc, %o4
- srl %g5, 1, %o3
- sub %o4, %o3, %o4
- jmpl %o4 + (13f - 14b), %g0
- add %o0, %g5, %o0
-12: SET_BLOCKS (%o0, 0x68, %o1)
- SET_BLOCKS (%o0, 0x48, %o1)
- SET_BLOCKS (%o0, 0x28, %o1)
- SET_BLOCKS (%o0, 0x08, %o1)
-13: be,pn %xcc, 8f
- andcc %o2, 4, %g0
- be,pn %xcc, 1f
- andcc %o2, 2, %g0
- stw %o1, [%o0]
- add %o0, 4, %o0
-1: be,pn %xcc, 1f
- andcc %o2, 1, %g0
- sth %o1, [%o0]
- add %o0, 2, %o0
-1: bne,a,pn %xcc, 8f
- stb %o1, [%o0]
-8: retl
- mov %o5, %o0
-17: brz,pn %o2, 0f
-8: add %o0, 1, %o0
- subcc %o2, 1, %o2
- bne,pt %xcc, 8b
- stb %o1, [%o0 - 1]
-0: retl
- mov %o5, %o0
-
-6: stx %o1, [%o0]
- andncc %o2, 0x3f, %o3
- be,pn %xcc, 9b
- nop
- ba,pt %xcc, 18b
- ldd [%o0], %f0
-END(memset)
-libc_hidden_def(memset)
-
-#define ZERO_BLOCKS(base, offset, source) \
- stx source, [base - offset - 0x38]; \
- stx source, [base - offset - 0x30]; \
- stx source, [base - offset - 0x28]; \
- stx source, [base - offset - 0x20]; \
- stx source, [base - offset - 0x18]; \
- stx source, [base - offset - 0x10]; \
- stx source, [base - offset - 0x08]; \
- stx source, [base - offset - 0x00];
-
- .text
- .align 32
-#ifdef __UCLIBC_SUSV3_LEGACY__
-ENTRY(bzero)
-#ifndef USE_BPR
- srl %o1, 0, %o1
-#endif
- mov %o0, %o5
-#endif
-50: cmp %o1, 7
- bleu,pn %xcc, 17f
- andcc %o0, 3, %o2
- be,a,pt %xcc, 4f
- andcc %o0, 4, %g0
- cmp %o2, 3
- be,pn %xcc, 2f
- stb %g0, [%o0 + 0x00]
- cmp %o2, 2
- be,pt %xcc, 2f
- stb %g0, [%o0 + 0x01]
- stb %g0, [%o0 + 0x02]
-2: sub %o2, 4, %o2
- sub %o0, %o2, %o0
- add %o1, %o2, %o1
- andcc %o0, 4, %g0
-4: be,pt %xcc, 2f
- cmp %o1, 128
- stw %g0, [%o0]
- sub %o1, 4, %o1
- add %o0, 4, %o0
-2: blu,pn %xcc, 9f
- andcc %o0, 0x38, %o2
- be,pn %icc, 6f
- mov 64, %o4
- andcc %o0, 8, %g0
- be,pn %icc, 1f
- sub %o4, %o2, %o4
- stx %g0, [%o0]
- add %o0, 8, %o0
-1: andcc %o4, 16, %g0
- be,pn %icc, 1f
- sub %o1, %o4, %o1
- stx %g0, [%o0]
- stx %g0, [%o0 + 8]
- add %o0, 16, %o0
-1: andcc %o4, 32, %g0
- be,pn %icc, 7f
- andncc %o1, 0x3f, %o3
- stx %g0, [%o0]
- stx %g0, [%o0 + 8]
- stx %g0, [%o0 + 16]
- stx %g0, [%o0 + 24]
- add %o0, 32, %o0
-6: andncc %o1, 0x3f, %o3
-7: be,pn %xcc, 9f
- wr %g0, ASI_BLK_P, %asi
- membar #StoreLoad | #StoreStore | #LoadStore
- fzero %f0
- andcc %o3, 0xc0, %o2
- and %o1, 0x3f, %o1
- fzero %f2
- andn %o3, 0xff, %o3
- faddd %f0, %f2, %f4
- fmuld %f0, %f2, %f6
- cmp %o2, 64
- faddd %f0, %f2, %f8
- fmuld %f0, %f2, %f10
- faddd %f0, %f2, %f12
- brz,pn %o2, 10f
- fmuld %f0, %f2, %f14
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x00] %asi
- cmp %o2, 128
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
-2: brz,pn %o3, 12f
- add %o0, %o2, %o0
-10: stda %f0, [%o0 + 0x00] %asi
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
- stda %f0, [%o0 + 0xc0] %asi
-11: subcc %o3, 256, %o3
- bne,pt %xcc, 10b
- add %o0, 256, %o0
-12: wr %g0, FPRS_FEF, %fprs
- membar #StoreLoad | #StoreStore
-9: andcc %o1, 0xf8, %o2
- be,pn %xcc, 13f
- andcc %o1, 7, %o1
-14: rd %pc, %o4
- srl %o2, 1, %o3
- sub %o4, %o3, %o4
- jmpl %o4 + (13f - 14b), %g0
- add %o0, %o2, %o0
-12: ZERO_BLOCKS (%o0, 0xc8, %g0)
- ZERO_BLOCKS (%o0, 0x88, %g0)
- ZERO_BLOCKS (%o0, 0x48, %g0)
- ZERO_BLOCKS (%o0, 0x08, %g0)
-13: be,pn %xcc, 8f
- andcc %o1, 4, %g0
- be,pn %xcc, 1f
- andcc %o1, 2, %g0
- stw %g0, [%o0]
- add %o0, 4, %o0
-1: be,pn %xcc, 1f
- andcc %o1, 1, %g0
- sth %g0, [%o0]
- add %o0, 2, %o0
-1: bne,a,pn %xcc, 8f
- stb %g0, [%o0]
-8: retl
- mov %o5, %o0
-17: be,pn %xcc, 13b
- orcc %o1, 0, %g0
- be,pn %xcc, 0f
-8: add %o0, 1, %o0
- subcc %o1, 1, %o1
- bne,pt %xcc, 8b
- stb %g0, [%o0 - 1]
-0: retl
- mov %o5, %o0
-#ifdef __UCLIBC_SUSV3_LEGACY__
-END(bzero)
-#endif
diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
deleted file mode 100644
index 8bbdc84..0000000
--- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S
+++ /dev/null
@@ -1,611 +0,0 @@
-/* Copy SIZE bytes from SRC to DEST.
- For UltraSPARC-III.
- Copyright (C) 2001, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller (davem(a)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 <features.h>
-
-#define ASI_BLK_P 0xf0
-#define FPRS_FEF 0x04
-#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
-#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
-
-#ifndef XCC
-#define USE_BPR
-#define XCC xcc
-#endif
-
- .register %g2,#scratch
- .register %g3,#scratch
- .register %g6,#scratch
-
- .text
- .align 32
-
-#ifdef __UCLIBC_SUSV3_LEGACY__
-ENTRY(bcopy)
- sub %o1, %o0, %o4
- mov %o0, %g4
- cmp %o4, %o2
- mov %o1, %o0
- bgeu,pt %XCC, 100f
- mov %g4, %o1
-#ifndef USE_BPR
- srl %o2, 0, %o2
-#endif
- brnz,pn %o2, 220f
- add %o0, %o2, %o0
- retl
- nop
-END(bcopy)
-#endif
-
- /* Special/non-trivial issues of this code:
- *
- * 1) %o5 is preserved from VISEntryHalf to VISExitHalf
- * 2) Only low 32 FPU registers are used so that only the
- * lower half of the FPU register set is dirtied by this
- * code. This is especially important in the kernel.
- * 3) This code never prefetches cachelines past the end
- * of the source buffer.
- *
- * The cheetah's flexible spine, oversized liver, enlarged heart,
- * slender muscular body, and claws make it the swiftest hunter
- * in Africa and the fastest animal on land. Can reach speeds
- * of up to 2.4GB per second.
- */
- .align 32
-ENTRY(memcpy)
-
-100: /* %o0=dst, %o1=src, %o2=len */
- mov %o0, %g5
- cmp %o2, 0
- be,pn %XCC, out
-218: or %o0, %o1, %o3
- cmp %o2, 16
- bleu,a,pn %XCC, small_copy
- or %o3, %o2, %o3
-
- cmp %o2, 256
- blu,pt %XCC, medium_copy
- andcc %o3, 0x7, %g0
-
- ba,pt %xcc, enter
- andcc %o0, 0x3f, %g2
-
- /* Here len >= 256 and condition codes reflect execution
- * of "andcc %o0, 0x7, %g2", done by caller.
- */
- .align 64
-enter:
- /* Is 'dst' already aligned on an 64-byte boundary? */
- be,pt %XCC, 2f
-
- /* Compute abs((dst & 0x3f) - 0x40) into %g2. This is the number
- * of bytes to copy to make 'dst' 64-byte aligned. We pre-
- * subtract this from 'len'.
- */
- sub %g2, 0x40, %g2
- sub %g0, %g2, %g2
- sub %o2, %g2, %o2
-
- /* Copy %g2 bytes from src to dst, one byte at a time. */
-1: ldub [%o1 + 0x00], %o3
- add %o1, 0x1, %o1
- add %o0, 0x1, %o0
- subcc %g2, 0x1, %g2
-
- bg,pt %XCC, 1b
- stb %o3, [%o0 + -1]
-
-2: VISEntryHalf
- and %o1, 0x7, %g1
- ba,pt %xcc, begin
- alignaddr %o1, %g0, %o1
-
- .align 64
-begin:
- prefetch [%o1 + 0x000], #one_read
- prefetch [%o1 + 0x040], #one_read
- andn %o2, (0x40 - 1), %o4
- prefetch [%o1 + 0x080], #one_read
- prefetch [%o1 + 0x0c0], #one_read
- ldd [%o1 + 0x000], %f0
- prefetch [%o1 + 0x100], #one_read
- ldd [%o1 + 0x008], %f2
- prefetch [%o1 + 0x140], #one_read
- ldd [%o1 + 0x010], %f4
- prefetch [%o1 + 0x180], #one_read
- faligndata %f0, %f2, %f16
- ldd [%o1 + 0x018], %f6
- faligndata %f2, %f4, %f18
- ldd [%o1 + 0x020], %f8
- faligndata %f4, %f6, %f20
- ldd [%o1 + 0x028], %f10
- faligndata %f6, %f8, %f22
-
- ldd [%o1 + 0x030], %f12
- faligndata %f8, %f10, %f24
- ldd [%o1 + 0x038], %f14
- faligndata %f10, %f12, %f26
- ldd [%o1 + 0x040], %f0
-
- sub %o4, 0x80, %o4
- add %o1, 0x40, %o1
- ba,pt %xcc, loop
- srl %o4, 6, %o3
-
- .align 64
-loop:
- ldd [%o1 + 0x008], %f2
- faligndata %f12, %f14, %f28
- ldd [%o1 + 0x010], %f4
- faligndata %f14, %f0, %f30
- stda %f16, [%o0] ASI_BLK_P
- ldd [%o1 + 0x018], %f6
- faligndata %f0, %f2, %f16
-
- ldd [%o1 + 0x020], %f8
- faligndata %f2, %f4, %f18
- ldd [%o1 + 0x028], %f10
- faligndata %f4, %f6, %f20
- ldd [%o1 + 0x030], %f12
- faligndata %f6, %f8, %f22
- ldd [%o1 + 0x038], %f14
- faligndata %f8, %f10, %f24
-
- ldd [%o1 + 0x040], %f0
- prefetch [%o1 + 0x180], #one_read
- faligndata %f10, %f12, %f26
- subcc %o3, 0x01, %o3
- add %o1, 0x40, %o1
- bg,pt %XCC, loop
- add %o0, 0x40, %o0
-
- /* Finally we copy the last full 64-byte block. */
-loopfini:
- ldd [%o1 + 0x008], %f2
- faligndata %f12, %f14, %f28
- ldd [%o1 + 0x010], %f4
- faligndata %f14, %f0, %f30
- stda %f16, [%o0] ASI_BLK_P
- ldd [%o1 + 0x018], %f6
- faligndata %f0, %f2, %f16
- ldd [%o1 + 0x020], %f8
- faligndata %f2, %f4, %f18
- ldd [%o1 + 0x028], %f10
- faligndata %f4, %f6, %f20
- ldd [%o1 + 0x030], %f12
- faligndata %f6, %f8, %f22
- ldd [%o1 + 0x038], %f14
- faligndata %f8, %f10, %f24
- cmp %g1, 0
- be,pt %XCC, 1f
- add %o0, 0x40, %o0
- ldd [%o1 + 0x040], %f0
-1: faligndata %f10, %f12, %f26
- faligndata %f12, %f14, %f28
- faligndata %f14, %f0, %f30
- stda %f16, [%o0] ASI_BLK_P
- add %o0, 0x40, %o0
- add %o1, 0x40, %o1
- membar #Sync
-
- /* Now we copy the (len modulo 64) bytes at the end.
- * Note how we borrow the %f0 loaded above.
- *
- * Also notice how this code is careful not to perform a
- * load past the end of the src buffer.
- */
-loopend:
- and %o2, 0x3f, %o2
- andcc %o2, 0x38, %g2
- be,pn %XCC, endcruft
- subcc %g2, 0x8, %g2
- be,pn %XCC, endcruft
- cmp %g1, 0
-
- be,a,pt %XCC, 1f
- ldd [%o1 + 0x00], %f0
-
-1: ldd [%o1 + 0x08], %f2
- add %o1, 0x8, %o1
- sub %o2, 0x8, %o2
- subcc %g2, 0x8, %g2
- faligndata %f0, %f2, %f8
- std %f8, [%o0 + 0x00]
- be,pn %XCC, endcruft
- add %o0, 0x8, %o0
- ldd [%o1 + 0x08], %f0
- add %o1, 0x8, %o1
- sub %o2, 0x8, %o2
- subcc %g2, 0x8, %g2
- faligndata %f2, %f0, %f8
- std %f8, [%o0 + 0x00]
- bne,pn %XCC, 1b
- add %o0, 0x8, %o0
-
- /* If anything is left, we copy it one byte at a time.
- * Note that %g1 is (src & 0x3) saved above before the
- * alignaddr was performed.
- */
-endcruft:
- cmp %o2, 0
- add %o1, %g1, %o1
- VISExitHalf
- be,pn %XCC, out
- sub %o0, %o1, %o3
-
- andcc %g1, 0x7, %g0
- bne,pn %icc, small_copy_unaligned
- andcc %o2, 0x8, %g0
- be,pt %icc, 1f
- nop
- ldx [%o1], %o5
- stx %o5, [%o1 + %o3]
- add %o1, 0x8, %o1
-
-1: andcc %o2, 0x4, %g0
- be,pt %icc, 1f
- nop
- lduw [%o1], %o5
- stw %o5, [%o1 + %o3]
- add %o1, 0x4, %o1
-
-1: andcc %o2, 0x2, %g0
- be,pt %icc, 1f
- nop
- lduh [%o1], %o5
- sth %o5, [%o1 + %o3]
- add %o1, 0x2, %o1
-
-1: andcc %o2, 0x1, %g0
- be,pt %icc, out
- nop
- ldub [%o1], %o5
- ba,pt %xcc, out
- stb %o5, [%o1 + %o3]
-
-medium_copy: /* 16 < len <= 64 */
- bne,pn %XCC, small_copy_unaligned
- sub %o0, %o1, %o3
-
-medium_copy_aligned:
- andn %o2, 0x7, %o4
- and %o2, 0x7, %o2
-1: subcc %o4, 0x8, %o4
- ldx [%o1], %o5
- stx %o5, [%o1 + %o3]
- bgu,pt %XCC, 1b
- add %o1, 0x8, %o1
- andcc %o2, 0x4, %g0
- be,pt %XCC, 1f
- nop
- sub %o2, 0x4, %o2
- lduw [%o1], %o5
- stw %o5, [%o1 + %o3]
- add %o1, 0x4, %o1
-1: cmp %o2, 0
- be,pt %XCC, out
- nop
- ba,pt %xcc, small_copy_unaligned
- nop
-
-small_copy: /* 0 < len <= 16 */
- andcc %o3, 0x3, %g0
- bne,pn %XCC, small_copy_unaligned
- sub %o0, %o1, %o3
-
-small_copy_aligned:
- subcc %o2, 4, %o2
- lduw [%o1], %g1
- stw %g1, [%o1 + %o3]
- bgu,pt %XCC, small_copy_aligned
- add %o1, 4, %o1
-
-out: retl
- mov %g5, %o0
-
- .align 32
-small_copy_unaligned:
- subcc %o2, 1, %o2
- ldub [%o1], %g1
- stb %g1, [%o1 + %o3]
- bgu,pt %XCC, small_copy_unaligned
- add %o1, 1, %o1
- retl
- mov %g5, %o0
-
-END(memcpy)
-libc_hidden_def(memcpy)
-
-#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stw %t0, [%dst - offset - 0x1c]; \
- srlx %t0, 32, %t0; \
- stw %t0, [%dst - offset - 0x20]; \
- stw %t1, [%dst - offset - 0x14]; \
- srlx %t1, 32, %t1; \
- stw %t1, [%dst - offset - 0x18]; \
- stw %t2, [%dst - offset - 0x0c]; \
- srlx %t2, 32, %t2; \
- stw %t2, [%dst - offset - 0x10]; \
- stw %t3, [%dst - offset - 0x04]; \
- srlx %t3, 32, %t3; \
- stw %t3, [%dst - offset - 0x08];
-
-#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stx %t0, [%dst - offset - 0x20]; \
- stx %t1, [%dst - offset - 0x18]; \
- stx %t2, [%dst - offset - 0x10]; \
- stx %t3, [%dst - offset - 0x08]; \
- ldx [%src - offset - 0x40], %t0; \
- ldx [%src - offset - 0x38], %t1; \
- ldx [%src - offset - 0x30], %t2; \
- ldx [%src - offset - 0x28], %t3; \
- stx %t0, [%dst - offset - 0x40]; \
- stx %t1, [%dst - offset - 0x38]; \
- stx %t2, [%dst - offset - 0x30]; \
- stx %t3, [%dst - offset - 0x28];
-
-#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stw %t0, [%dst + offset + 0x04]; \
- srlx %t0, 32, %t2; \
- stw %t2, [%dst + offset + 0x00]; \
- stw %t1, [%dst + offset + 0x0c]; \
- srlx %t1, 32, %t3; \
- stw %t3, [%dst + offset + 0x08];
-
-#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stx %t0, [%dst + offset + 0x00]; \
- stx %t1, [%dst + offset + 0x08];
-
- .align 32
-228: andcc %o2, 1, %g0 /* IEU1 Group */
- be,pt %icc, 2f+4 /* CTI */
-1: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 Group */
- be,pn %xcc, 229f /* CTI */
- stb %o5, [%o0] /* Store */
-2: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o0, 2, %o0 /* IEU0 */
- ldub [%o1 - 2], %g5 /* LOAD Group */
- sub %o1, 2, %o1 /* IEU0 */
- subcc %o2, 2, %o2 /* IEU1 Group */
- stb %o5, [%o0 + 1] /* Store */
- bne,pt %xcc, 2b /* CTI */
- stb %g5, [%o0] /* Store */
-229: retl
- mov %g4, %o0
-
- .align 32
-ENTRY(memmove)
- mov %o0, %g5
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 Group */
-#endif
- brz,pn %o2, out /* CTI Group */
- sub %o0, %o1, %o4 /* IEU0 */
- cmp %o4, %o2 /* IEU1 Group */
- bgeu,pt %XCC, 218b /* CTI */
- mov %o0, %g4 /* IEU0 */
- add %o0, %o2, %o0 /* IEU0 Group */
-220: add %o1, %o2, %o1 /* IEU1 */
- cmp %o2, 15 /* IEU1 Group */
- bleu,pn %xcc, 228b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- sub %o0, %o1, %g5 /* IEU0 */
- andcc %g5, 3, %o5 /* IEU1 Group */
- bne,pn %xcc, 232f /* CTI */
- andcc %o1, 3, %g0 /* IEU1 Group */
- be,a,pt %xcc, 236f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
- andcc %o1, 1, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- andcc %o1, 2, %g0 /* IEU1 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- sub %o2, 1, %o2 /* IEU0 Group */
- be,pn %xcc, 5f /* CTI Group */
- stb %g2, [%o0] /* Store */
-4: lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sub %o0, 2, %o0 /* IEU1 */
- sub %o2, 2, %o2 /* IEU0 */
- sth %g2, [%o0] /* Store Group + bubble */
-5: andcc %o1, 4, %g0 /* IEU1 */
-236: be,a,pn %xcc, 2f /* CTI */
- andcc %o2, -128, %g6 /* IEU1 Group */
- lduw [%o1 - 4], %g5 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- sub %o0, 4, %o0 /* IEU1 */
- sub %o2, 4, %o2 /* IEU0 Group */
- stw %g5, [%o0] /* Store */
- andcc %o2, -128, %g6 /* IEU1 Group */
-2: be,pn %xcc, 235f /* CTI */
- andcc %o0, 4, %g0 /* IEU1 Group */
- be,pn %xcc, 282f + 4 /* CTI Group */
-5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 5b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
-235: andcc %o2, 0x70, %g6 /* IEU1 Group */
-41: be,pn %xcc, 280f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-279: rd %pc, %o5 /* PDU Group */
- sll %g6, 1, %g5 /* IEU0 Group */
- sub %o1, %g6, %o1 /* IEU1 */
- sub %o5, %g5, %o5 /* IEU0 Group */
- jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
-280: be,pt %xcc, 281f /* CTI */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- stw %g2, [%o0 + 4] /* Store Group */
- sub %o1, 8, %o1 /* IEU1 */
- srlx %g2, 32, %g2 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-281: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- stw %g2, [%o0 - 4] /* Store Group */
- sub %o0, 4, %o0 /* IEU0 */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sth %g2, [%o0 - 2] /* Store Group */
- sub %o0, 2, %o0 /* IEU0 */
-1: be,pt %xcc, 211f /* CTI */
- nop /* IEU1 */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-211: retl
- mov %g4, %o0
-
-282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 282b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
- be,pn %xcc, 284f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-283: rd %pc, %o5 /* PDU Group */
- sub %o1, %g6, %o1 /* IEU0 Group */
- sub %o5, %g6, %o5 /* IEU1 */
- jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
-284: be,pt %xcc, 285f /* CTI Group */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- sub %o1, 8, %o1 /* IEU0 Group */
- stx %g2, [%o0] /* Store */
-285: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o0, 4, %o0 /* IEU0 */
- sub %o1, 4, %o1 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o0, 2, %o0 /* IEU0 */
- sub %o1, 2, %o1 /* IEU0 Group */
- sth %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- nop /* IEU0 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-1: retl
- mov %g4, %o0
-
-232: brz,pt %g2, 2f /* CTI Group */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1 - 1], %g5 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- bne,pt %xcc, 1b /* CTI */
- stb %g5, [%o0] /* Store */
-2: andn %o2, 7, %g5 /* IEU0 Group */
- and %o2, 7, %o2 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
-1: ldd [%g1 - 8], %f6 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 233f /* CTI */
- sub %o0, 8, %o0 /* IEU1 */
- ldd [%g1 - 8], %f4 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 */
- bne,pn %xcc, 1b /* CTI Group */
- sub %o0, 8, %o0 /* IEU0 */
-233: brz,pn %o2, 234f /* CTI Group */
- nop /* IEU0 */
-237: ldub [%o1 - 1], %g5 /* LOAD */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 237b /* CTI */
- stb %g5, [%o0] /* Store Group */
-234: wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-END(memmove)
-libc_hidden_def(memmove)
-
-#ifdef USE_BPR
-weak_alias(memcpy,__align_cpy_1)
-weak_alias(memcpy,__align_cpy_2)
-weak_alias(memcpy,__align_cpy_4)
-weak_alias(memcpy,__align_cpy_8)
-weak_alias(memcpy,__align_cpy_16)
-#endif
diff --git a/libc/string/sparc/sparc64/stpcpy.S b/libc/string/sparc/sparc64/stpcpy.S
deleted file mode 100644
index 9af0d56..0000000
--- a/libc/string/sparc/sparc64/stpcpy.S
+++ /dev/null
@@ -1,270 +0,0 @@
-/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(stpcpy)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- sllx %g1, 32, %g2 /* IEU0 Group */
-
- bne,pn %icc, 12f /* CTI */
- andcc %o1, 7, %g3 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
- bne,pn %icc, 14f /* CTI */
-
- sllx %g1, 7, %g2 /* IEU0 Group */
-1: ldx [%o1], %o3 /* Load */
- add %o1, 8, %o1 /* IEU1 */
-2: mov %o3, %g3 /* IEU0 Group */
-
- sub %o3, %g1, %o2 /* IEU1 */
-3: ldxa [%o1] ASI_PNF, %o3 /* Load */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %g3, %o2 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU0 Group */
- andcc %o2, %g2, %g0 /* IEU1 */
-
- add %o1, 8, %o1 /* IEU0 Group */
- be,a,pt %xcc, 2b /* CTI */
- stx %g3, [%o0 - 8] /* Store */
- srlx %g3, 56, %g5 /* IEU0 Group */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %g3, 48, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 10f /* CTI */
- srlx %g3, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-
- srlx %g3, 32, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
- srlx %g3, 24, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %g3, 16, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 6f /* CTI */
- srlx %g3, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- sub %o3, %g1, %o2 /* IEU0 */
- stx %g3, [%o0 - 8] /* Store Group */
- andcc %g3, 0xff, %g0 /* IEU1 */
- bne,pt %icc, 3b /* CTI */
-
- mov %o3, %g3 /* IEU0 Group */
-4: retl /* CTI+IEU1 Group */
- sub %o0, 1, %o0 /* IEU0 */
-
- .align 16
-6: ba,pt %xcc, 23f /* CTI Group */
- sub %o0, 3, %g6 /* IEU0 */
-5: sub %o0, 2, %g6 /* IEU0 Group */
- stb %g5, [%o0 - 2] /* Store */
-
- srlx %g3, 16, %g4 /* IEU0 Group */
-23: sth %g4, [%o0 - 4] /* Store */
- srlx %g3, 32, %g4 /* IEU0 Group */
- stw %g4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-8: ba,pt %xcc, 24f /* CTI Group */
- sub %o0, 5, %g6 /* IEU0 */
-
-7: sub %o0, 4, %g6 /* IEU0 Group */
- stb %g5, [%o0 - 4] /* Store */
- srlx %g3, 32, %g4 /* IEU0 Group */
-24: stw %g4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-10: ba,pt %xcc, 25f /* CTI Group */
- sub %o0, 7, %g6 /* IEU0 */
-
-9: sub %o0, 6, %g6 /* IEU0 Group */
- stb %g5, [%o0 - 6] /* Store */
- srlx %g3, 48, %g4 /* IEU0 */
-25: sth %g4, [%o0 - 8] /* Store Group */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-11: stb %g5, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
-
- sub %o0, 8, %o0 /* IEU0 */
-
- .align 16
-12: or %g1, %g2, %g1 /* IEU0 Group */
- ldub [%o1], %o3 /* Load */
- sllx %g1, 7, %g2 /* IEU0 Group */
- stb %o3, [%o0] /* Store Group */
-
-13: add %o0, 1, %o0 /* IEU0 */
- add %o1, 1, %o1 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 13b /* CTI */
- stb %o3, [%o0] /* Store */
-
- andcc %o1, 7, %g3 /* IEU1 Group */
- be,a,pt %icc, 1b /* CTI */
- ldx [%o1], %o3 /* Load */
-14: orcc %g0, 64, %g4 /* IEU1 Group */
-
- sllx %g3, 3, %g5 /* IEU0 */
- sub %o1, %g3, %o1 /* IEU0 Group */
- sub %g4, %g5, %g4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080808080808080 *
- * %g3 = source alignment *
- * %g5 = number of bits to shift left *
- * %g4 = number of bits to shift right */
- ldxa [%o1] ASI_PNF, %o5 /* Load Group */
-
- addcc %o1, 8, %o1 /* IEU1 */
-15: sllx %o5, %g5, %o3 /* IEU0 Group */
- ldxa [%o1] ASI_PNF, %o5 /* Load */
- srlx %o5, %g4, %o4 /* IEU0 Group */
-
- add %o0, 8, %o0 /* IEU1 */
- or %o3, %o4, %o3 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- sub %o3, %g1, %o4 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o4, %o3, %o4 /* IEU0 Group */
-#endif
- andcc %o4, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- srlx %o3, 56, %o4 /* IEU0 Group */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
- srlx %o3, 48, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 21f /* CTI */
- srlx %o3, 40, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 20f /* CTI */
-
- srlx %o3, 32, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- srlx %o3, 24, %o4 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 18f /* CTI */
- srlx %o3, 16, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 17f /* CTI */
- srlx %o3, 8, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,pn %icc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- sub %o0, 1, %o0 /* IEU0 */
-
- .align 16
-17: ba,pt %xcc, 26f /* CTI Group */
- subcc %o0, 3, %g6 /* IEU1 */
-18: ba,pt %xcc, 27f /* CTI Group */
- subcc %o0, 4, %g6 /* IEU1 */
-
-19: ba,pt %xcc, 28f /* CTI Group */
- subcc %o0, 5, %g6 /* IEU1 */
-16: subcc %o0, 2, %g6 /* IEU1 Group */
- srlx %o3, 8, %o4 /* IEU0 */
-
- stb %o4, [%o0 - 2] /* Store */
-26: srlx %o3, 16, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 3] /* Store */
-27: srlx %o3, 24, %o4 /* IEU0 Group */
-
- stb %o4, [%o0 - 4] /* Store */
-28: srlx %o3, 32, %o4 /* IEU0 Group */
- stw %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-21: ba,pt %xcc, 29f /* CTI Group */
- subcc %o0, 7, %g6 /* IEU1 */
-22: ba,pt %xcc, 30f /* CTI Group */
- subcc %o0, 8, %g6 /* IEU1 */
-
-20: subcc %o0, 6, %g6 /* IEU1 Group */
- srlx %o3, 40, %o4 /* IEU0 */
- stb %o4, [%o0 - 6] /* Store */
-29: srlx %o3, 48, %o4 /* IEU0 Group */
-
- stb %o4, [%o0 - 7] /* Store */
-30: srlx %o3, 56, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-END(stpcpy)
-libc_hidden_def(stpcpy)
diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S
deleted file mode 100644
index 56725cc..0000000
--- a/libc/string/sparc/sparc64/strcat.S
+++ /dev/null
@@ -1,338 +0,0 @@
-/* strcat (dest, src) -- Append SRC on the end of DEST.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jj(a)ultra.linux.cz> and
- Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strcat)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- mov %o0, %g6 /* IEU1 */
-
- sllx %g1, 32, %g2 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
- bne,pn %icc, 32f /* CTI */
-
- sllx %g1, 7, %g2 /* IEU0 Group */
- brz,pn %o3, 30f /* CTI+IEU1 */
- ldx [%o0], %o3 /* Load */
-48: add %o0, 8, %o0 /* IEU0 Group */
-
-49: sub %o3, %g1, %o2 /* IEU0 Group */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g5 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %g5, %g2, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
-#endif
- be,pt %xcc, 49b /* CTI */
-
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g3 /* IEU1 Group */
- srlx %o2, 32, %o2 /* IEU0 */
-50: andcc %o2, %g2, %g0 /* IEU1 Group */
-
- be,pn %xcc, 51f /* CTI */
- srlx %g3, 56, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 29f /* CTI */
-
- srlx %g3, 48, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 28f /* CTI */
- srlx %g3, 40, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 27f /* CTI */
- srlx %g3, 32, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 26f /* CTI */
-51: srlx %g3, 24, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 25f /* CTI */
-
- srlx %g3, 16, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
- srlx %g3, 8, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 23f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 52f /* CTI */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 49b /* CTI */
-
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g3 /* IEU1 Group */
- ba,pt %xcc, 50b /* CTI */
- srlx %o2, 32, %o2 /* IEU0 */
-
- .align 16
-52: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -9, %o0 /* IEU0 */
-23: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -10, %o0 /* IEU0 */
-
-24: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -11, %o0 /* IEU0 */
-25: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -12, %o0 /* IEU0 */
-
-26: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -13, %o0 /* IEU0 */
-27: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -14, %o0 /* IEU0 */
-
-28: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -15, %o0 /* IEU0 */
-29: add %o0, -16, %o0 /* IEU0 Group */
-30: andcc %o1, 7, %g3 /* IEU1 */
-
-31: bne,pn %icc, 14f /* CTI */
- orcc %g0, 64, %g4 /* IEU1 Group */
-1: ldx [%o1], %o3 /* Load */
- add %o1, 8, %o1 /* IEU1 */
-
-2: mov %o3, %g3 /* IEU0 Group */
-3: sub %o3, %g1, %o2 /* IEU1 */
- ldxa [%o1] ASI_PNF, %o3 /* Load */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %g3, %o2 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU0 Group */
-
- andcc %o2, %g2, %g0 /* IEU1 */
- add %o1, 8, %o1 /* IEU0 Group */
- be,a,pt %xcc, 2b /* CTI */
- stx %g3, [%o0 - 8] /* Store */
-
- srlx %g3, 56, %g5 /* IEU0 Group */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %g3, 48, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 10f /* CTI */
- srlx %g3, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 9f /* CTI */
- srlx %g3, 32, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
-
- srlx %g3, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %g3, 16, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- srlx %g3, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 5f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- stx %g3, [%o0 - 8] /* Store Group */
- andcc %g3, 0xff, %g0 /* IEU1 */
-
- bne,pt %icc, 3b /* CTI */
- mov %o3, %g3 /* IEU0 Group */
-4: retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-5: stb %g5, [%o0 - 2] /* Store Group */
- srlx %g3, 16, %g4 /* IEU0 */
-6: sth %g4, [%o0 - 4] /* Store Group */
- srlx %g3, 32, %g4 /* IEU0 */
-
- stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-7: stb %g5, [%o0 - 4] /* Store Group */
-
- srlx %g3, 32, %g4 /* IEU0 */
-8: stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
-9: stb %g5, [%o0 - 6] /* Store Group */
- srlx %g3, 48, %g4 /* IEU0 */
-10: sth %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-11: stb %g5, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-32: andcc %o0, 7, %g0 /* IEU1 Group */
- be,a,pn %icc, 48b /* CTI */
- ldx [%o0], %o3 /* Load */
- add %o0, 1, %o0 /* IEU0 Group */
-
- brnz,a,pt %o3, 32b /* CTI+IEU1 */
- lduba [%o0] ASI_PNF, %o3 /* Load */
- add %o0, -1, %o0 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 Group */
-
- be,a,pn %icc, 31b /* CTI */
- andcc %o1, 7, %g3 /* IEU1 Group */
-12: ldub [%o1], %o3 /* Load */
- stb %o3, [%o0] /* Store Group */
-
-13: add %o0, 1, %o0 /* IEU0 */
- add %o1, 1, %o1 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 13b /* CTI */
- stb %o3, [%o0] /* Store */
-
- andcc %o1, 7, %g3 /* IEU1 Group */
- be,a,pt %icc, 1b /* CTI */
- ldx [%o1], %o3 /* Load */
- orcc %g0, 64, %g4 /* IEU1 Group */
-
-14: sllx %g3, 3, %g5 /* IEU0 */
- sub %o1, %g3, %o1 /* IEU0 Group */
- sub %g4, %g5, %g4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080808080808080 *
- * %g3 = source alignment *
- * %g5 = number of bits to shift left *
- * %g4 = number of bits to shift right */
- ldxa [%o1] ASI_PNF, %o5 /* Load Group */
-
- addcc %o1, 8, %o1 /* IEU1 */
-15: sllx %o5, %g5, %o3 /* IEU0 Group */
- ldxa [%o1] ASI_PNF, %o5 /* Load */
- srlx %o5, %g4, %o4 /* IEU0 Group */
-
- add %o0, 8, %o0 /* IEU1 */
- or %o3, %o4, %o3 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- sub %o3, %g1, %o4 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o4, %o3, %o4 /* IEU0 Group */
-#endif
- andcc %o4, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- srlx %o3, 56, %o4 /* IEU0 Group */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
- srlx %o3, 48, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 21f /* CTI */
- srlx %o3, 40, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 20f /* CTI */
-
- srlx %o3, 32, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- srlx %o3, 24, %o4 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 18f /* CTI */
- srlx %o3, 16, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 17f /* CTI */
- srlx %o3, 8, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,pn %icc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-16: srlx %o3, 8, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 2] /* Store */
-17: srlx %o3, 16, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 3] /* Store */
-
-18: srlx %o3, 24, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 4] /* Store */
-19: srlx %o3, 32, %o4 /* IEU0 Group */
- stw %o4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
- nop
- nop
-
-20: srlx %o3, 40, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 6] /* Store */
-21: srlx %o3, 48, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 7] /* Store */
-
-22: srlx %o3, 56, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-END(strcat)
-libc_hidden_def(strcat)
diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S
deleted file mode 100644
index 25810fd..0000000
--- a/libc/string/sparc/sparc64/strchr.S
+++ /dev/null
@@ -1,485 +0,0 @@
-/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <features.h>
-#include <asm/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strchr)
- andcc %o1, 0xff, %o1 /* IEU1 Group */
- be,pn %icc, 17f /* CTI */
- sllx %o1, 8, %g3 /* IEU0 Group */
- sethi %hi(0x01010101), %g1 /* IEU1 */
-
- or %g3, %o1, %g3 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- sllx %g3, 16, %g5 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
-
- sllx %g1, 32, %g2 /* IEU0 Group */
- brz,pn %o3, 5f /* CTI+IEU1 */
- orcc %g3, %g5, %g3 /* IEU1 Group */
- sllx %g3, 32, %g5 /* IEU0 */
-
- cmp %o3, %o1 /* IEU1 Group */
- be,pn %xcc, 14f /* CTI */
- or %g1, %g2, %g1 /* IEU0 */
- andcc %o0, 7, %g0 /* IEU1 Group */
-
- bne,a,pn %icc, 15f /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- ldx [%o0], %o3 /* Load Group */
-1: sllx %g1, 7, %g2 /* IEU0 */
-
- or %g3, %g5, %g3 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
- xor %o3, %g3, %o4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080088080808080 *
- * %g3 = c c c c c c c c *
- * %o3 = value *
- * %o4 = value XOR c */
-2: sub %o3, %g1, %o2 /* IEU0 Group */
-
- sub %o4, %g1, %o5 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g6 /* IEU0 Group */
- andn %o5, %o4, %o5 /* IEU1 */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- or %o5, %g6, %o5 /* IEU0 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- or %o5, %o2, %o5 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU1 */
-
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- srlx %o5, 32, %g5 /* IEU0 Group */
-
- add %o2, %g1, %o2 /* IEU1 */
-3: andcc %g5, %g2, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- srlx %o2, 56, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 6f /* CTI */
- srlx %o2, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %o2, 40, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 8f /* CTI */
- srlx %o2, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-4: srlx %o2, 24, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 10f /* CTI */
- srlx %o2, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %o2, 8, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 12f /* CTI */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 13f /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- ldxa [%o0] ASI_PNF, %o3 /* Load Group */
-
- sub %o4, %g1, %o5 /* IEU0 */
- or %o5, %o2, %o5 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
- andcc %o5, %g2, %g0 /* IEU1 */
-
- be,a,pt %xcc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 Group */
- srlx %o5, 32, %g5 /* IEU0 Group */
- ba,pt %xcc, 3b /* CTI */
-
- add %o2, %g1, %o2 /* IEU1 */
-
- .align 16
-5: retl /* CTI+IEU1 Group */
- clr %o0 /* IEU0 */
-6: retl /* CTI+IEU1 Group */
- add %o0, -16, %o0 /* IEU0 */
-
-7: retl /* CTI+IEU1 Group */
- add %o0, -15, %o0 /* IEU0 */
-8: retl /* CTI+IEU1 Group */
- add %o0, -14, %o0 /* IEU0 */
-
-9: retl /* CTI+IEU1 Group */
- add %o0, -13, %o0 /* IEU0 */
-10: retl /* CTI+IEU1 Group */
- add %o0, -12, %o0 /* IEU0 */
-
-11: retl /* CTI+IEU1 Group */
- add %o0, -11, %o0 /* IEU0 */
-12: retl /* CTI+IEU1 Group */
- add %o0, -10, %o0 /* IEU0 */
-
-13: retl /* CTI+IEU1 Group */
- add %o0, -9, %o0 /* IEU0 */
-14: retl /* CTI+IEU1 Group */
- nop /* IEU0 */
-
- .align 16
-15: ldub [%o0], %o3 /* Load Group */
-16: andcc %o0, 7, %g0 /* IEU1 */
- be,a,pn %icc, 1b /* CTI */
- ldx [%o0], %o3 /* Load Group */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5b /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- cmp %o3, %o1 /* IEU1 Group */
-
- bne,a,pn %icc, 16b /* CTI */
- ldub [%o0], %o3 /* Load */
- retl /* CTI+IEU1 Group */
- add %o0, -1, %o0 /* IEU0 */
-
- /* strchr (str, 0) */
- .align 32
- nop
- .align 16
-17: sethi %hi(0x01010101), %g1 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- sllx %g1, 32, %g2 /* IEU0 Group */
-
- andcc %o0, 7, %g0 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
- bne,pn %icc, 32f /* CTI */
- sllx %g1, 7, %g2 /* IEU0 Group */
-
- brz,pn %o3, 30f /* CTI+IEU1 */
- ldx [%o0], %o3 /* Load */
-18: add %o0, 8, %o0 /* IEU0 Group */
-19: sub %o3, %g1, %o2 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g6 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %g6, %g2, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
-#endif
- be,pt %xcc, 19b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
-
- addcc %o2, %g1, %g3 /* IEU1 Group */
- srlx %o2, 32, %o2 /* IEU0 */
-20: andcc %o2, %g2, %g0 /* IEU1 Group */
- be,pn %xcc, 21f /* CTI */
-
- srlx %g3, 56, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 29f /* CTI */
- srlx %g3, 48, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 28f /* CTI */
- srlx %g3, 40, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 27f /* CTI */
- srlx %g3, 32, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 26f /* CTI */
-
-21: srlx %g3, 24, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 25f /* CTI */
- srlx %g3, 16, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
- srlx %g3, 8, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 23f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
-
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 19b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
-
- addcc %o2, %g1, %g3 /* IEU1 Group */
- ba,pt %xcc, 20b /* CTI */
- srlx %o2, 32, %o2 /* IEU0 */
-
- .align 16
-22: retl /* CTI+IEU1 Group */
- add %o0, -9, %o0 /* IEU0 */
-23: retl /* CTI+IEU1 Group */
- add %o0, -10, %o0 /* IEU0 */
-
-24: retl /* CTI+IEU1 Group */
- add %o0, -11, %o0 /* IEU0 */
-25: retl /* CTI+IEU1 Group */
- add %o0, -12, %o0 /* IEU0 */
-
-26: retl /* CTI+IEU1 Group */
- add %o0, -13, %o0 /* IEU0 */
-27: retl /* CTI+IEU1 Group */
- add %o0, -14, %o0 /* IEU0 */
-
-28: retl /* CTI+IEU1 Group */
- add %o0, -15, %o0 /* IEU0 */
-29: retl /* CTI+IEU1 Group */
- add %o0, -16, %o0 /* IEU0 */
-
-30: retl /* CTI+IEU1 Group */
- nop /* IEU0 */
-
- .align 16
-32: andcc %o0, 7, %g0 /* IEU1 Group */
- be,a,pn %icc, 18b /* CTI */
- ldx [%o0], %o3 /* Load */
- add %o0, 1, %o0 /* IEU0 Group */
-
- brnz,a,pt %o3, 32b /* CTI+IEU1 */
- lduba [%o0] ASI_PNF, %o3 /* Load */
- retl /* CTI+IEU1 Group */
- add %o0, -1, %o0 /* IEU0 */
-END(strchr)
-libc_hidden_def(strchr)
-#ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strchr,index)
-#endif
-
- .align 32
-ENTRY(strrchr)
- andcc %o1, 0xff, %o1 /* IEU1 Group */
- be,pn %icc, 17b /* CTI */
- clr %g4 /* IEU0 */
- andcc %o0, 7, %g0 /* IEU1 Group */
-
- bne,pn %icc, 13f /* CTI */
- sllx %o1, 8, %g3 /* IEU0 */
- ldx [%o0], %o3 /* Load Group */
-1: sethi %hi(0x01010101), %g1 /* IEU0 */
-
- or %g3, %o1, %g3 /* IEU1 */
- sllx %g3, 16, %g5 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
- sllx %g1, 32, %g2 /* IEU0 Group */
-
- or %g3, %g5, %g3 /* IEU1 */
- sllx %g3, 32, %g5 /* IEU0 Group */
- or %g1, %g2, %g1 /* IEU1 */
- sllx %g1, 7, %g2 /* IEU0 Group */
-
- or %g3, %g5, %g3 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
- xor %o3, %g3, %o4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080088080808080 *
- * %g3 = c c c c c c c c *
- * %o3 = value *
- * %o4 = value XOR c */
-2: sub %o3, %g1, %o2 /* IEU0 Group */
-
-3: sub %o4, %g1, %o5 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g6 /* IEU0 Group */
- andn %o5, %o4, %o5 /* IEU1 */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
-
- or %o5, %g6, %o5 /* IEU0 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
-
- or %o5, %o2, %o5 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU1 */
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 2b /* CTI */
-
- xor %o3, %g3, %o4 /* IEU0 */
- srlx %o5, 32, %g5 /* IEU0 Group */
- add %o2, %g1, %o2 /* IEU1 */
- andcc %g5, %g2, %g0 /* IEU1 Group */
-
- be,pn %xcc, 7f /* CTI */
- srlx %o2, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
-
- srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 48, %g5 /* IEU0 */
- be,a,pn %icc, 4f /* CTI */
-
- add %o0, -16, %g4 /* IEU0 Group */
-4: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 48, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 40, %g5 /* IEU0 */
- be,a,pn %icc, 5f /* CTI */
- add %o0, -15, %g4 /* IEU0 Group */
-
-5: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- srlx %o2, 32, %g5 /* IEU0 */
- be,a,pn %icc, 6f /* CTI */
- add %o0, -14, %g4 /* IEU0 Group */
-6: andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 12f /* CTI */
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,a,pn %icc, 7f /* CTI */
-
- add %o0, -13, %g4 /* IEU0 */
-7: srlx %o2, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
-
- srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 16, %g5 /* IEU0 */
- be,a,pn %icc, 8f /* CTI */
-
- add %o0, -12, %g4 /* IEU0 Group */
-8: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 16, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 8, %g5 /* IEU0 */
- be,a,pn %icc, 9f /* CTI */
- add %o0, -11, %g4 /* IEU0 Group */
-
-9: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,a,pn %icc, 10f /* CTI */
- add %o0, -10, %g4 /* IEU0 */
-10: andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
-
- sub %o3, %g1, %o2 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,a,pn %icc, 11f /* CTI */
- add %o0, -9, %g4 /* IEU0 */
-
-11: ba,pt %xcc, 3b /* CTI Group */
- xor %o3, %g3, %o4 /* IEU0 Group */
-12: retl /* CTI+IEU1 Group */
- mov %g4, %o0 /* IEU0 */
-
- .align 16
-13: ldub [%o0], %o3 /* Load Group */
- add %o0, 1, %o0 /* IEU0 */
-14: andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12b /* CTI */
-
- cmp %o3, %o1 /* IEU1 Group */
- ldub [%o0], %o3 /* Load */
- be,a,pn %icc, 15f /* CTI */
- add %o0, -1, %g4 /* IEU0 Group */
-
-15: andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 14b /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- ba,pt %xcc, 1b /* CTI Group */
-
- ldx [%o0], %o3 /* Load */
-END(strrchr)
-libc_hidden_def(strrchr)
-#ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strrchr,rindex)
-#endif
diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S
deleted file mode 100644
index 7b85007..0000000
--- a/libc/string/sparc/sparc64/strcmp.S
+++ /dev/null
@@ -1,278 +0,0 @@
-/* Compare two strings for differences.
- For SPARC v9.
- Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strcmp)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- bne,pn %icc, 7f /* CTI */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
-
- andcc %o1, 7, %g3 /* IEU1 */
- bne,pn %icc, 9f /* CTI */
- sllx %g1, 32, %g2 /* IEU0 Group */
- ldx [%o0], %o2 /* Load */
-
- or %g1, %g2, %g1 /* IEU0 Group */
-1: ldx [%o1], %o3 /* Load */
- sub %o1, %o0, %o1 /* IEU1 */
- sllx %g1, 7, %g2 /* IEU0 Group */
-
-2: add %o0, 8, %o0 /* IEU1 */
- sub %o2, %g1, %g3 /* IEU0 Group */
- subcc %o2, %o3, %g0 /* IEU1 */
- bne,pn %xcc, 13f /* CTI */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %g3, %o2, %g4 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o2 /* Load */
- andcc %g4, %g2, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o2 /* Load Group */
- andcc %g3, %g2, %g0 /* IEU1 */
-#endif
- be,a,pt %xcc, 2b /* CTI */
- ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load Group */
-
- addcc %g3, %g1, %o4 /* IEU1 */
- srlx %g3, 32, %g3 /* IEU0 */
- andcc %g3, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 3f /* CTI */
-
- srlx %o4, 56, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 48, %o5 /* IEU0 */
-
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 40, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4f /* CTI */
- srlx %o4, 32, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
-
-3: srlx %o4, 24, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 16, %o5 /* IEU0 */
-
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 8, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4f /* CTI */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- bne,a,pn %icc, 2b /* CTI */
- ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load */
-
-4: retl /* CTI+IEU1 Group */
- clr %o0 /* IEU0 */
-
- .align 32
-13: mov 0xff, %g6 /* IEU0 Group */
-#ifdef EIGHTBIT_NOT_RARE
- andcc %g4, %g2, %g0 /* IEU1 */
-#else
- andcc %g3, %g2, %g0 /* IEU1 */
-#endif
- be,pt %xcc, 25f /* CTI */
- addcc %g3, %g1, %o4 /* IEU1 Group */
-
- srlx %g3, 32, %g3 /* IEU0 */
- andcc %g3, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 23f /* CTI */
- sllx %g6, 56, %o5 /* IEU0 */
-
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %xcc, 24f /* CTI */
- sllx %g6, 48, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
-
- be,pn %xcc, 24f /* CTI */
- sllx %g6, 40, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %xcc, 24f /* CTI */
-
- sllx %g6, 32, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %xcc, 24f /* CTI */
-23: sllx %g6, 24, %o5 /* IEU0 */
-
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
- sllx %g6, 16, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
-
- be,pn %icc, 24f /* CTI */
- sllx %g6, 8, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
-
- mov %g6, %o5 /* IEU0 */
-25: cmp %o4, %o3 /* IEU1 Group */
-5: mov -1, %o0 /* IEU0 */
- retl /* CTI+IEU1 Group */
-
- movgu %xcc, 1, %o0 /* Single Group */
-
- .align 16
-24: sub %o5, 1, %g6 /* IEU0 Group */
- clr %o0 /* IEU1 */
- or %o5, %g6, %o5 /* IEU0 Group */
- andn %o4, %o5, %o4 /* IEU0 Group */
-
- andn %o3, %o5, %o3 /* IEU1 */
- cmp %o4, %o3 /* IEU1 Group */
- movgu %xcc, 1, %o0 /* Single Group */
- retl /* CTI+IEU1 Group */
-
- movlu %xcc, -1, %o0 /* Single Group */
-6: retl /* CTI+IEU1 Group */
- mov %o4, %o0 /* IEU0 */
-
- .align 16
-7: ldub [%o0], %o2 /* Load */
- add %o0, 1, %o0 /* IEU1 */
- ldub [%o1], %o3 /* Load Group */
- sllx %g1, 32, %g2 /* IEU0 */
-
-8: add %o1, 1, %o1 /* IEU1 */
- subcc %o2, %o3, %o4 /* IEU1 Group */
- bne,pn %xcc, 6b /* CTI */
- lduba [%o0] ASI_PNF, %o2 /* Load */
-
- brz,pn %o3, 4b /* CTI+IEU1 Group */
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pn %icc, 8b /* CTI */
-
- add %o0, 1, %o0 /* IEU0 */
- or %g1, %g2, %g1 /* IEU0 Group */
- andcc %o1, 7, %g3 /* IEU1 */
- be,a,pn %icc, 1b /* CTI */
-
- ldxa [%o0] ASI_PNF, %o2 /* Load Group */
-9: sllx %g3, 3, %g5 /* IEU0 */
- mov 64, %o5 /* IEU1 */
- sub %o1, %g3, %o1 /* IEU0 Group */
-
- sub %o5, %g5, %o5 /* IEU1 */
- ldxa [%o1] ASI_PNF, %g6 /* Load Group */
- or %g1, %g2, %g1 /* IEU0 */
- sub %o1, %o0, %o1 /* IEU1 */
-
- sllx %g1, 7, %g2 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- /* %g1 = 0101010101010101
- * %g2 = 8080808080800880
- * %g5 = number of bits to shift left
- * %o5 = number of bits to shift right */
-10: sllx %g6, %g5, %o3 /* IEU0 Group */
- ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
-
-11: srlx %g6, %o5, %o4 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o2 /* Load */
- or %o3, %o4, %o3 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
-
- subcc %o2, %o3, %g0 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- sub %o2, %g1, %g3 /* IEU0 Group */
- bne,pn %xcc, 13b /* CTI */
- andn %g3, %o2, %g4 /* IEU0 Group */
-
- andcc %g4, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 10b /* CTI */
- srlx %g4, 32, %g4 /* IEU0 */
- andcc %g4, %g2, %g0 /* IEU1 Group */
-#else
- bne,pn %xcc, 13b /* CTI */
- sub %o2, %g1, %g3 /* IEU0 Group */
- andcc %g3, %g2, %g0 /* IEU1 Group */
-
- be,pt %xcc, 10b /* CTI */
- srlx %g3, 32, %g3 /* IEU0 */
- andcc %g3, %g2, %g0 /* IEU1 Group */
-#endif
- be,pt %xcc, 12f /* CTI */
-
- srlx %o2, 56, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 48, %g3 /* IEU0 */
-
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 40, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4b /* CTI */
- srlx %o2, 32, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
-12: srlx %o2, 24, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 16, %g3 /* IEU0 */
-
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 8, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4b /* CTI */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- sllx %g6, %g5, %o3 /* IEU0 */
-
- ba,pt %xcc, 11b /* CTI Group */
- ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
-END(strcmp)
-libc_hidden_def(strcmp)
diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S
deleted file mode 100644
index 28799e4..0000000
--- a/libc/string/sparc/sparc64/strcpy.S
+++ /dev/null
@@ -1,244 +0,0 @@
-/* Copy SRC to DEST returning DEST.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strcpy)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- mov %o0, %g6 /* IEU1 */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
-
- sllx %g1, 32, %g2 /* IEU0 Group */
- bne,pn %icc, 12f /* CTI */
- andcc %o1, 7, %g3 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
-
- bne,pn %icc, 14f /* CTI */
- sllx %g1, 7, %g2 /* IEU0 Group */
-1: ldx [%o1], %o3 /* Load */
- add %o1, 8, %o1 /* IEU1 */
-
-2: mov %o3, %g3 /* IEU0 Group */
-3: sub %o3, %g1, %o2 /* IEU1 */
- ldxa [%o1] ASI_PNF, %o3 /* Load */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %g3, %o2 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU0 Group */
-
- andcc %o2, %g2, %g0 /* IEU1 */
- add %o1, 8, %o1 /* IEU0 Group */
- be,a,pt %xcc, 2b /* CTI */
- stx %g3, [%o0 - 8] /* Store */
-
- srlx %g3, 56, %g5 /* IEU0 Group */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %g3, 48, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 10f /* CTI */
- srlx %g3, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 9f /* CTI */
- srlx %g3, 32, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
-
- srlx %g3, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %g3, 16, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- srlx %g3, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 5f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- stx %g3, [%o0 - 8] /* Store Group */
- andcc %g3, 0xff, %g0 /* IEU1 */
-
- bne,pt %icc, 3b /* CTI */
- mov %o3, %g3 /* IEU0 Group */
-4: retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-5: stb %g5, [%o0 - 2] /* Store Group */
- srlx %g3, 16, %g4 /* IEU0 */
-6: sth %g4, [%o0 - 4] /* Store Group */
- srlx %g3, 32, %g4 /* IEU0 */
-
- stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-7: stb %g5, [%o0 - 4] /* Store Group */
-
- srlx %g3, 32, %g4 /* IEU0 */
-8: stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
-9: stb %g5, [%o0 - 6] /* Store Group */
- srlx %g3, 48, %g4 /* IEU0 */
-10: sth %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-11: stb %g5, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
-12: or %g1, %g2, %g1 /* IEU0 Group */
- ldub [%o1], %o3 /* Load */
- sllx %g1, 7, %g2 /* IEU0 Group */
- stb %o3, [%o0] /* Store Group */
-
-13: add %o0, 1, %o0 /* IEU0 */
- add %o1, 1, %o1 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 13b /* CTI */
- stb %o3, [%o0] /* Store */
-
- andcc %o1, 7, %g3 /* IEU1 Group */
- be,a,pt %icc, 1b /* CTI */
- ldx [%o1], %o3 /* Load */
-14: orcc %g0, 64, %g4 /* IEU1 Group */
-
- sllx %g3, 3, %g5 /* IEU0 */
- sub %o1, %g3, %o1 /* IEU0 Group */
- sub %g4, %g5, %g4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080808080808080 *
- * %g3 = source alignment *
- * %g5 = number of bits to shift left *
- * %g4 = number of bits to shift right */
- ldxa [%o1] ASI_PNF, %o5 /* Load Group */
-
- addcc %o1, 8, %o1 /* IEU1 */
-15: sllx %o5, %g5, %o3 /* IEU0 Group */
- ldxa [%o1] ASI_PNF, %o5 /* Load */
- srlx %o5, %g4, %o4 /* IEU0 Group */
-
- add %o0, 8, %o0 /* IEU1 */
- or %o3, %o4, %o3 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- sub %o3, %g1, %o4 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o4, %o3, %o4 /* IEU0 Group */
-#endif
- andcc %o4, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- srlx %o3, 56, %o4 /* IEU0 Group */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
- srlx %o3, 48, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 21f /* CTI */
- srlx %o3, 40, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 20f /* CTI */
-
- srlx %o3, 32, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- srlx %o3, 24, %o4 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 18f /* CTI */
- srlx %o3, 16, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 17f /* CTI */
- srlx %o3, 8, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,pn %icc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-16: srlx %o3, 8, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 2] /* Store */
-17: srlx %o3, 16, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 3] /* Store */
-
-18: srlx %o3, 24, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 4] /* Store */
-19: srlx %o3, 32, %o4 /* IEU0 Group */
- stw %o4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
- nop
- nop
-
-20: srlx %o3, 40, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 6] /* Store */
-21: srlx %o3, 48, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 7] /* Store */
-
-22: srlx %o3, 56, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-END(strcpy)
-
-libc_hidden_def(strcpy)
diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S
deleted file mode 100644
index f58c1c2..0000000
--- a/libc/string/sparc/sparc64/strlen.S
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Determine the length of a string. For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strlen)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- mov %o0, %o1 /* IEU1 */
-
- sllx %g1, 32, %g4 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- or %g1, %g4, %g1 /* IEU0 Group */
- brz,pn %o3, 13f /* CTI+IEU1 */
-
- sllx %g1, 7, %g4 /* IEU0 Group */
- bne,a,pn %icc, 15f /* CTI */
- add %o0, 1, %o0 /* IEU1 */
- /* %g1 = 0x0101010101010101 *
- * %g4 = 0x8080808080808080 *
- * %o0 = string pointer *
- * %o1 = start of string */
-1: ldx [%o0], %o3 /* Load Group */
-
- add %o0, 8, %o0 /* IEU1 */
-2: sub %o3, %g1, %o2 /* IEU0 Group */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %o5 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o5, %g4, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g4, %g0 /* IEU1 Group */
-#endif
-
- be,pt %xcc, 2b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g5 /* IEU1 Group */
-#ifdef EIGHTBIT_NOT_RARE
- srlx %o5, 32, %o5 /* IEU0 */
-
-3: andcc %o5, %g4, %g0 /* IEU1 Group */
-#else
- srlx %o2, 32, %o2 /* IEU0 */
-
-3: andcc %o2, %g4, %g0 /* IEU1 Group */
-#endif
- be,pn %xcc, 4f /* CTI */
- srlx %g5, 56, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 12f /* CTI */
- srlx %g5, 48, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
-
- srlx %g5, 40, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 10f /* CTI */
- srlx %g5, 32, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-4: srlx %g5, 24, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 8f /* CTI */
- srlx %g5, 16, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
-
- srlx %g5, 8, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g4, %g0 /* IEU1 Group */
-
- be,pt %xcc, 2b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g5 /* IEU1 Group */
- ba,pt %xcc, 3b /* CTI */
-
- srlx %o2, 32, %o2 /* IEU0 */
-5: add %o0, -9, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-
-6: add %o0, -10, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-7: add %o0, -11, %o0 /* IEU0 Group */
-
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-8: add %o0, -12, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
-
- sub %o0, %o1, %o0 /* IEU0 */
-9: add %o0, -13, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-
-10: add %o0, -14, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-11: add %o0, -15, %o0 /* IEU0 Group */
-
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-12: add %o0, -16, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
-
- sub %o0, %o1, %o0 /* IEU0 */
-13: retl /* CTI+IEU1 Group */
- mov 0, %o0 /* IEU0 */
- nop
-
-15: ldub [%o0], %o3 /* Load Group */
-16: andcc %o0, 7, %g0 /* IEU1 */
- be,pn %icc, 1b /* CTI */
- nop /* IEU0 Group */
-
- add %o0, 1, %o0 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,a,pt %icc, 16b /* CTI */
- lduba [%o0] ASI_PNF, %o3 /* Load */
-
- add %o0, -1, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-END(strlen)
-libc_hidden_def(strlen)
diff --git a/libc/sysdeps/linux/m68k/bits/huge_vall.h b/libc/sysdeps/linux/m68k/bits/huge_vall.h
index c44b64d..674b46d 100644
--- a/libc/sysdeps/linux/m68k/bits/huge_vall.h
+++ b/libc/sysdeps/linux/m68k/bits/huge_vall.h
@@ -26,7 +26,7 @@
# define HUGE_VALL (__builtin_huge_vall ())
#elif __GNUC_PREREQ(2,96)
# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#elif defined__GNUC__
+#elif defined __GNUC__
# define HUGE_VALL \
(__extension__ \
diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h
index 5ec4da5..26f6212 100644
--- a/libc/sysdeps/linux/sparc/bits/setjmp.h
+++ b/libc/sysdeps/linux/sparc/bits/setjmp.h
@@ -25,37 +25,6 @@
#include <bits/wordsize.h>
-#if 0 /*__WORDSIZE == 64*/
-
-typedef struct __sparc64_jmp_buf
- {
- struct __sparc64_jmp_buf *uc_link;
- unsigned long uc_flags;
- unsigned long uc_sigmask;
- struct __sparc64_jmp_buf_mcontext
- {
- unsigned long mc_gregs[19];
- unsigned long mc_fp;
- unsigned long mc_i7;
- struct __sparc64_jmp_buf_fpu
- {
- union
- {
- unsigned int sregs[32];
- unsigned long dregs[32];
- long double qregs[16];
- } mcfpu_fpregs;
- unsigned long mcfpu_fprs;
- unsigned long mcfpu_gsr;
- void *mcfpu_fq;
- unsigned char mcfpu_qcnt;
- unsigned char mcfpu_qentsz;
- unsigned char mcfpu_enab;
- } mc_fpregs;
- } uc_mcontext;
- } __jmp_buf[1];
-#else
typedef int __jmp_buf[3];
-#endif
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/sparc/bits/sigcontext.h b/libc/sysdeps/linux/sparc/bits/sigcontext.h
index 9435485..251032f 100644
--- a/libc/sysdeps/linux/sparc/bits/sigcontext.h
+++ b/libc/sysdeps/linux/sparc/bits/sigcontext.h
@@ -21,8 +21,6 @@
#include <bits/wordsize.h>
-#if __WORDSIZE == 32
-
/* It is quite hard to choose what to put here, because
Linux/sparc32 had at least 3 totally incompatible
signal stack layouts.
@@ -42,36 +40,3 @@ struct sigcontext
int si_mask;
};
-#else /* sparc64 */
-
-typedef struct
- {
- unsigned int si_float_regs [64];
- unsigned long si_fsr;
- unsigned long si_gsr;
- unsigned long si_fprs;
- } __siginfo_fpu_t;
-
-struct sigcontext
- {
- char sigc_info[128];
- struct
- {
- unsigned long u_regs[16]; /* globals and ins */
- unsigned long tstate;
- unsigned long tpc;
- unsigned long tnpc;
- unsigned int y;
- unsigned int fprs;
- } sigc_regs;
- __siginfo_fpu_t * sigc_fpu_save;
- struct
- {
- void * ss_sp;
- int ss_flags;
- unsigned long ss_size;
- } sigc_stack;
- unsigned long sigc_mask;
-};
-
-#endif /* sparc64 */
diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S
index 25b5ee5..77e9147 100644
--- a/libc/sysdeps/linux/sparc/crt1.S
+++ b/libc/sysdeps/linux/sparc/crt1.S
@@ -39,16 +39,9 @@
#include <features.h>
#include <bits/wordsize.h>
-/* macro out the 32 / 64 bit differences */
-#if __WORDSIZE == 32
# define STACK_BIAS 0
# define ELE_SIZE 4
# define LD ld
-#else
-# define STACK_BIAS 2047 /* see glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h */
-# define ELE_SIZE 8
-# define LD ldx
-#endif
.text
.align 4
@@ -116,11 +109,7 @@ _start:
nop
/* Die very horribly if exit returns. */
-#if __WORDSIZE == 32
unimp
-#else
- illtrap 0
-#endif
.size _start,.-_start
diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S
index 8e4bc22..1715911 100644
--- a/libc/sysdeps/linux/sparc/fork.S
+++ b/libc/sysdeps/linux/sparc/fork.S
@@ -35,7 +35,7 @@ fork:
bcc,a 9000f
nop
save %sp,-96,%sp
- call HIDDEN_JUMPTARGET(__errno_location)
+ call __errno_location
nop
st %i0,[%o0]
jmpl %i7+8,%g0
diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
index 40303f0..90efb77 100644
--- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
@@ -6,26 +6,19 @@
#include <setjmp.h>
#include <jmpbuf-offsets.h>
-#if __WORDSIZE == 64
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
-
-#else
-
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((int) (address) < (jmpbuf)[JB_SP])
-#endif
-
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#if defined(__arch64__)
-#include "sparc64/jmpbuf-unwind.h"
-#else
-#include "sparc32/jmpbuf-unwind.h"
-#endif
+#include <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
#endif
diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S
index b085faf..fa77f4d 100644
--- a/libc/sysdeps/linux/sparc/pipe.S
+++ b/libc/sysdeps/linux/sparc/pipe.S
@@ -49,7 +49,7 @@ pipe:
restore %g0,%g0,%o0
.Lerror:
- call HIDDEN_JUMPTARGET(__errno_location)
+ call __errno_location
or %g0,EINVAL,%i0
st %i0,[%o0]
ret
diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c
index 123be53..97f98da 100644
--- a/libc/sysdeps/linux/sparc/qp_ops.c
+++ b/libc/sysdeps/linux/sparc/qp_ops.c
@@ -1,5 +1,3 @@
-/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */
-
#include <stdio.h>
#include <stdlib.h>
@@ -9,11 +7,7 @@ static void fakedef(void)
exit(-1);
}
-#ifdef __sparc_v9__
-# define fakedef(sym) strong_alias(fakedef, _Qp_##sym)
-#else
# define fakedef(sym) strong_alias(fakedef, _Q_##sym)
-#endif
fakedef(fne)
fakedef(feq)
@@ -31,7 +25,6 @@ fakedef(qtos)
fakedef(stoq)
fakedef(itoq)
fakedef(add)
-#ifndef __sparc_v9__
fakedef(qtou)
fakedef(utoq)
fakedef(cmp)
@@ -44,4 +37,3 @@ fakedef(qtoll)
fakedef(qtoull)
fakedef(sqrt)
fakedef(ulltoq)
-#endif
diff --git a/libc/sysdeps/linux/sparc/sparcv9/clone.S b/libc/sysdeps/linux/sparc/sparcv9/clone.S
deleted file mode 100644
index 2ee62a0..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/clone.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth(a)tamu.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/>. */
-
-/* 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/errno.h>
-#include <asm/unistd.h>
-#include <tcb-offsets.h>
-#include <sysdep.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); */
-
- .register %g2,#scratch
- .register %g3,#scratch
-
- .text
-
-ENTRY (__clone)
- save %sp, -192, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
- /* sanity check arguments */
- brz,pn %i0, 99f /* fn non-NULL? */
- mov %i0, %g2
- brz,pn %i1, 99f /* child_stack non-NULL? */
- mov %i2, %o0 /* clone flags */
-
- /* The child_stack is the top of the stack, allocate one
- whole stack frame from that as this is what the kernel
- expects. Also, subtract STACK_BIAS. */
- sub %i1, 192 + 0x7ff, %o1
- mov %i3, %g3
- mov %i2, %g4
-
- mov %i4,%o2 /* PTID */
- mov %i5,%o3 /* TLS */
- ldx [%fp+0x7ff+176],%o4 /* CTID */
-
- /* Do the system call */
- set __NR_clone, %g1
- ta 0x6d
- bcs,pn %xcc, 98f
- nop
- brnz,pn %o1, __thread_start
- nop
- jmpl %i7 + 8, %g0
- restore %o0, %g0, %o0
-99: mov EINVAL, %o0
-98: call HIDDEN_JUMPTARGET(__errno_location)
- mov %o0, %i0
- st %i0, [%o0]
- jmpl %i7 + 8, %g0
- restore %g0,-1,%o0
-END(__clone)
-
- .type __thread_start,@function
-__thread_start:
-#ifdef RESET_PID
- sethi %hi(CLONE_THREAD), %l0
- andcc %g4, %l0, %g0
- bne,pt %icc, 1f
- andcc %g4, CLONE_VM, %g0
- bne,a,pn %icc, 2f
- mov -1,%o0
- set __NR_getpid,%g1
- ta 0x6d
-2: st %o0,[%g7 + PID]
- st %o0,[%g7 + TID]
-1:
-#endif
- mov %g0, %fp /* terminate backtrace */
- call %g2
- mov %g3,%o0
- call HIDDEN_JUMPTARGET(_exit),0
- nop
-
- .size __thread_start, .-__thread_start
-
-weak_alias (__clone, clone)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/rem.S b/libc/sysdeps/linux/sparc/sparcv9/rem.S
deleted file mode 100644
index 1474e32..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/rem.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and sdivcc only 36,
- * we use sdivcc eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.rem)
-
- sra %o0, 31, %o2
- wr %o2, 0, %y
- sdivcc %o0, %o1, %o2
- xnor %o2, %g0, %o3
- movvs %icc, %o3, %o2
- smul %o2, %o1, %o2
- retl
- sub %o0, %o2, %o0
-
-END(.rem)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
deleted file mode 100644
index 45535bb..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and sdivcc only 36,
- * we use sdivcc eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.div)
-
- sra %o0, 31, %o2
- wr %o2, 0, %y
- sdivcc %o0, %o1, %o0
- xnor %o0, %g0, %o2
- retl
- movvs %icc, %o2, %o0
-
-END(.div)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/libc/sysdeps/linux/sparc/sparcv9/udiv.S
deleted file mode 100644
index 303f29b..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/udiv.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and udiv only 37,
- * we use udiv eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.udiv)
-
- wr %g0, 0, %y
- retl
- udiv %o0, %o1, %o0
-
-END(.udiv)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/umul.S b/libc/sysdeps/linux/sparc/sparcv9/umul.S
deleted file mode 100644
index e65e4b9..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/umul.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Sparc v9 has multiply.
- */
-
- .text
- .align 32
-ENTRY(.umul)
-
- srl %o0, 0, %o0
- srl %o1, 0, %o1
- mulx %o0, %o1, %o0
- retl
- srlx %o0, 32, %o1
-
-END(.umul)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/urem.S b/libc/sysdeps/linux/sparc/sparcv9/urem.S
deleted file mode 100644
index 9354269..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/urem.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and udiv only 37,
- * we use udiv eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.urem)
-
- wr %g0, 0, %y
- udiv %o0, %o1, %o2
- umul %o2, %o1, %o2
- retl
- sub %o0, %o2, %o0
-
-END(.urem)
diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h
index 37d6a61..edbd5a5 100644
--- a/libc/sysdeps/linux/sparc/sys/procfs.h
+++ b/libc/sysdeps/linux/sparc/sys/procfs.h
@@ -32,20 +32,6 @@
__BEGIN_DECLS
-#if __WORDSIZE == 64
-
-#define ELF_NGREG 36
-
-typedef struct
- {
- unsigned long pr_regs[32];
- unsigned long pr_fsr;
- unsigned long pr_gsr;
- unsigned long pr_fprs;
- } elf_fpregset_t;
-
-#else /* sparc32 */
-
#define ELF_NGREG 38
typedef struct
@@ -63,8 +49,6 @@ typedef struct
unsigned int pr_q[64];
} elf_fpregset_t;
-#endif /* sparc32 */
-
typedef unsigned long elf_greg_t;
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
@@ -110,13 +94,8 @@ struct elf_prpsinfo
char pr_zomb; /* Zombie. */
char pr_nice; /* Nice val. */
unsigned long int pr_flag; /* Flags. */
-#if __WORDSIZE == 64
- unsigned int pr_uid;
- unsigned int pr_gid;
-#else
unsigned short int pr_uid;
unsigned short int pr_gid;
-#endif
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
char pr_fname[16]; /* Filename of executable. */
@@ -138,73 +117,6 @@ typedef __pid_t lwpid_t;
typedef struct elf_prstatus prstatus_t;
typedef struct elf_prpsinfo prpsinfo_t;
-#if __WORDSIZE == 64
-
-/* Provide 32-bit variants so that BFD can read 32-bit
- core files. */
-#define ELF_NGREG32 38
-typedef struct
- {
- union
- {
- unsigned int pr_regs[32];
- double pr_dregs[16];
- } pr_fr;
- unsigned int __unused;
- unsigned int pr_fsr;
- unsigned char pr_qcnt;
- unsigned char pr_q_entrysize;
- unsigned char pr_en;
- unsigned int pr_q[64];
- } elf_fpregset_t32;
-
-typedef unsigned int elf_greg_t32;
-typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
-
-struct elf_prstatus32
- {
- struct elf_siginfo pr_info; /* Info associated with signal. */
- short int pr_cursig; /* Current signal. */
- unsigned int pr_sigpend; /* Set of pending signals. */
- unsigned int pr_sighold; /* Set of held signals. */
- __pid_t pr_pid;
- __pid_t pr_ppid;
- __pid_t pr_pgrp;
- __pid_t pr_sid;
- struct
- {
- int tv_sec, tv_usec;
- } pr_utime, /* User time. */
- pr_stime, /* System time. */
- pr_cutime, /* Cumulative user time. */
- pr_cstime; /* Cumulative system time. */
- elf_gregset_t32 pr_reg; /* GP registers. */
- int pr_fpvalid; /* True if math copro being used. */
- };
-
-struct elf_prpsinfo32
- {
- char pr_state; /* Numeric process state. */
- char pr_sname; /* Char for pr_state. */
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- unsigned 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. */
- };
-
-typedef elf_gregset_t32 prgregset32_t;
-typedef elf_fpregset_t32 prfpregset32_t;
-
-typedef struct elf_prstatus32 prstatus32_t;
-typedef struct elf_prpsinfo32 prpsinfo32_t;
-
-#endif /* sparc64 */
-
__END_DECLS
#endif /* sys/procfs.h */
diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S
index 4b701f7..e5a3c30 100644
--- a/libc/sysdeps/linux/sparc/vfork.S
+++ b/libc/sysdeps/linux/sparc/vfork.S
@@ -37,7 +37,7 @@ __vfork:
bcc,a 9000f
nop
save %sp,-96,%sp
- call HIDDEN_JUMPTARGET(__errno_location)
+ call __errno_location
nop
st %i0,[%o0]
jmpl %i7+8,%g0
diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
index ab90810..d502c75 100644
--- a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
+++ b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
@@ -1,8 +1,82 @@
-#include <features.h>
-#include <bits/wordsize.h>
+/* Machine-dependent pthreads configuration and inline functions.
+ sparc version.
+ Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth(a)tamu.edu>.
-#if __WORDSIZE == 32
-# include "sparc32/pt-machine.h"
-#else
-# include "sparc64/pt-machine.h"
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#ifndef PT_EI
+# define PT_EI __extern_always_inline
#endif
+
+extern long int testandset (int *spinlock);
+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ int ret;
+
+ __asm__ __volatile__("ldstub %1,%0"
+ : "=r"(ret), "=m"(*spinlock)
+ : "m"(*spinlock));
+
+ return ret;
+}
+
+
+/* Memory barrier; default is to do nothing */
+#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
+
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+
+/* Registers %g6 and %g7 are reserved by the ABI for "system use".
+ %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
+struct _pthread_descr_struct;
+register struct _pthread_descr_struct *__thread_self __asm__("%g7");
+
+/* Return the thread descriptor for the current thread. */
+#define THREAD_SELF __thread_self
+
+/* Initialize the thread-unique value. */
+#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
+
+/* Access to data in the thread descriptor is easy. */
+#define THREAD_GETMEM(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+
+/* We want the OS to assign stack addresses. */
+#define FLOATING_STACKS 1
+
+/* Maximum size of the stack if the rlimit is unlimited. */
+#define ARCH_STACK_MAX_SIZE 8*1024*1024
+
+#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
deleted file mode 100644
index d502c75..0000000
--- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- sparc version.
- Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r"(ret), "=m"(*spinlock)
- : "m"(*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
-register char *stack_pointer __asm__("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 8*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
deleted file mode 100644
index e3c73d9..0000000
--- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- Sparc v9 version.
- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
-/* Read barrier. */
-#define READ_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
-/* Write barrier. */
-#define WRITE_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__ ("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
- TLS ABI specifies %g7 as the thread pointer. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-
-/* Compare-and-swap for semaphores. */
-
-#define HAS_COMPARE_AND_SWAP
-PT_EI int
-__compare_and_swap (long int *p, long int oldval, long int newval)
-{
- long int readval;
-
- __asm__ __volatile__ ("casx [%4], %2, %0"
- : "=r"(readval), "=m"(*p)
- : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
- MEMORY_BARRIER();
- return readval == oldval;
-}
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 32*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
index 72a9af5..4de152b 100644
--- a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
+++ b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
@@ -1,14 +1,87 @@
-#include <features.h>
-#include <bits/wordsize.h>
+/* POSIX spinlock implementation. SPARC32 version.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#if __WORDSIZE == 32
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
-# if defined(__CONFIG_SPARC_V9B__)
-# include "sparc32/sparcv9b/pspinlock.c"
-# else
-# include "sparc32/pspinlock.c"
-# endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#else
-# include "sparc64/pspinlock.c"
-#endif
+ 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, see <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <pthread.h>
+#include "internals.h"
+
+/* This implementation is similar to the one used in the Linux kernel. */
+int
+__pthread_spin_lock (pthread_spinlock_t *lock)
+{
+ __asm__ __volatile__
+ ("1: ldstub [%0], %%g2\n"
+ " orcc %%g2, 0x0, %%g0\n"
+ " bne,a 2f\n"
+ " ldub [%0], %%g2\n"
+ ".subsection 2\n"
+ "2: orcc %%g2, 0x0, %%g0\n"
+ " bne,a 2b\n"
+ " ldub [%0], %%g2\n"
+ " b,a 1b\n"
+ ".previous"
+ : /* no outputs */
+ : "r" (lock)
+ : "g2", "memory", "cc");
+ return 0;
+}
+weak_alias (__pthread_spin_lock, pthread_spin_lock)
+
+
+int
+__pthread_spin_trylock (pthread_spinlock_t *lock)
+{
+ int result;
+ __asm__ __volatile__
+ ("ldstub [%1], %0"
+ : "=r" (result)
+ : "r" (lock)
+ : "memory");
+ return result == 0 ? 0 : EBUSY;
+}
+weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
+
+
+int
+__pthread_spin_unlock (pthread_spinlock_t *lock)
+{
+ *lock = 0;
+ return 0;
+}
+weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
+
+
+int
+__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
+{
+ /* We can ignore the `pshared' parameter. Since we are busy-waiting
+ all processes which can access the memory location `lock' points
+ to can use the spinlock. */
+ *lock = 0;
+ return 0;
+}
+weak_alias (__pthread_spin_init, pthread_spin_init)
+
+
+int
+__pthread_spin_destroy (pthread_spinlock_t *lock)
+{
+ /* Nothing to do. */
+ return 0;
+}
+weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
index ab90810..d502c75 100644
--- a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
@@ -1,8 +1,82 @@
-#include <features.h>
-#include <bits/wordsize.h>
+/* Machine-dependent pthreads configuration and inline functions.
+ sparc version.
+ Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth(a)tamu.edu>.
-#if __WORDSIZE == 32
-# include "sparc32/pt-machine.h"
-#else
-# include "sparc64/pt-machine.h"
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#ifndef PT_EI
+# define PT_EI __extern_always_inline
#endif
+
+extern long int testandset (int *spinlock);
+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ int ret;
+
+ __asm__ __volatile__("ldstub %1,%0"
+ : "=r"(ret), "=m"(*spinlock)
+ : "m"(*spinlock));
+
+ return ret;
+}
+
+
+/* Memory barrier; default is to do nothing */
+#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
+
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+
+/* Registers %g6 and %g7 are reserved by the ABI for "system use".
+ %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
+struct _pthread_descr_struct;
+register struct _pthread_descr_struct *__thread_self __asm__("%g7");
+
+/* Return the thread descriptor for the current thread. */
+#define THREAD_SELF __thread_self
+
+/* Initialize the thread-unique value. */
+#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
+
+/* Access to data in the thread descriptor is easy. */
+#define THREAD_GETMEM(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+
+/* We want the OS to assign stack addresses. */
+#define FLOATING_STACKS 1
+
+/* Maximum size of the stack if the rlimit is unlimited. */
+#define ARCH_STACK_MAX_SIZE 8*1024*1024
+
+#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
deleted file mode 100644
index 4de152b..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* POSIX spinlock implementation. SPARC32 version.
- 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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <pthread.h>
-#include "internals.h"
-
-/* This implementation is similar to the one used in the Linux kernel. */
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " orcc %%g2, 0x0, %%g0\n"
- " bne,a 2f\n"
- " ldub [%0], %%g2\n"
- ".subsection 2\n"
- "2: orcc %%g2, 0x0, %%g0\n"
- " bne,a 2b\n"
- " ldub [%0], %%g2\n"
- " b,a 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory", "cc");
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int result;
- __asm__ __volatile__
- ("ldstub [%1], %0"
- : "=r" (result)
- : "r" (lock)
- : "memory");
- return result == 0 ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
deleted file mode 100644
index d502c75..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- sparc version.
- Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r"(ret), "=m"(*spinlock)
- : "m"(*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
-register char *stack_pointer __asm__("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 8*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
deleted file mode 100644
index fb49ca3..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* POSIX spinlock implementation. SPARC v9 version.
- 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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <pthread.h>
-#include "internals.h"
-
-
-/* This implementation is similar to the one used in the Linux kernel. */
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " brnz,pn %%g2, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g2\n"
- " brnz,pt %%g2, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory");
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int result;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (result)
- : "r" (lock)
- : "memory");
- return result == 0 ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("membar #StoreStore | #LoadStore\n"
- "stb %%g0, [%0]"
- :
- : "r" (lock)
- : "memory");
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
deleted file mode 100644
index 743cb77..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* POSIX spinlock implementation. SPARC64 version.
- 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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <pthread.h>
-#include "internals.h"
-
-/* This implementation is similar to the one used in the Linux kernel. */
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g5\n"
- " brnz,pn %%g5, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g5\n"
- " brnz,pt %%g5, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g5", "memory");
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int result;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (result)
- : "r" (lock)
- : "memory");
- return result == 0 ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("membar #StoreStore | #LoadStore\n"
- "stb %%g0, [%0]"
- :
- : "r" (lock)
- : "memory");
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
deleted file mode 100644
index e3c73d9..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- Sparc v9 version.
- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
-/* Read barrier. */
-#define READ_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
-/* Write barrier. */
-#define WRITE_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__ ("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
- TLS ABI specifies %g7 as the thread pointer. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-
-/* Compare-and-swap for semaphores. */
-
-#define HAS_COMPARE_AND_SWAP
-PT_EI int
-__compare_and_swap (long int *p, long int oldval, long int newval)
-{
- long int readval;
-
- __asm__ __volatile__ ("casx [%4], %2, %0"
- : "=r"(readval), "=m"(*p)
- : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
- MEMORY_BARRIER();
- return readval == oldval;
-}
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 32*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
deleted file mode 100644
index bd9bb0d..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <tls.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) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- cmp %g1, 0; \
- bne 1f; \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcs __syscall_error_handler; \
- nop; \
- .subsection 2; \
-1: save %sp, -96, %sp; \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcs __syscall_error_handler2; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0; \
- .previous; \
- SYSCALL_ERROR_HANDLER \
- SYSCALL_ERROR_HANDLER2
-
-#define SYSCALL_ERROR_HANDLER2 \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- .global __errno_location; \
- .type __errno_location,@function; \
- CDISABLE; \
- mov %l0, %o0; \
- call __errno_location; \
- nop; \
- st %l1, [%o0]; \
- jmpl %i7 + 8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# else
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- p_header.data.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# endif
-
-#elif !defined __ASSEMBLER__
-
-/* This code should never be used but we define it anyhow. */
-# define SINGLE_THREAD_P (1)
-
-#endif
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
deleted file mode 100644
index d57283a..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../ia64/pt-sigsuspend.c"
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
deleted file mode 100644
index 9972ee4..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <tls.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) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- brnz,pn %g1, 1f; \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcs,pn %xcc, __syscall_error_handler; \
- nop; \
- .subsection 2; \
-1: save %sp, -192, %sp; \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcs,pn %xcc, __syscall_error_handler2; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0; \
- .previous; \
- SYSCALL_ERROR_HANDLER \
- SYSCALL_ERROR_HANDLER2
-
-#define SYSCALL_ERROR_HANDLER2 \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- .global __errno_location; \
- .type __errno_location,@function; \
- CDISABLE; \
- mov %l0, %o0; \
- call __errno_location; \
- nop; \
- st %l1, [%o0]; \
- jmpl %i7 + 8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# else
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- p_header.data.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# endif
-
-#elif !defined __ASSEMBLER__
-
-/* This code should never be used but we define it anyhow. */
-# define SINGLE_THREAD_P (1)
-
-#endif
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
deleted file mode 100644
index 3ff16b1..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep-cancel.h>
-
-#ifdef SHARED
-.LLGETPC0:
- retl
- add %o7, %o0, %o0
-#endif
-ENTRY(__vfork)
-#ifdef SHARED
- mov %o7, %o1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
- call .LLGETPC0
- add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
- sethi %hi(__libc_pthread_functions), %o2
- mov %o1, %o7
- or %o2, %lo(__libc_pthread_functions), %o2
- ldx [%o0 + %o2], %o2
- ldx [%o2], %o0
-#else
- .weak pthread_create
- sethi %hi(pthread_create), %o0
- or %o0, %lo(pthread_create), %o0
-#endif
-#if defined SHARED && !defined BROKEN_SPARC_WDISP22
- cmp %o0, 0
- bne HIDDEN_JUMPTARGET(fork)
-#else
- brnz,pn %o0, 1f
-#endif
- mov __NR_vfork, %g1
- ta 0x6d
- bcs,pn %xcc, __syscall_error_handler
- nop
- sub %o1, 1, %o1
- retl
- and %o0, %o1, %o0
-#if !defined SHARED || defined BROKEN_SPARC_WDISP22
-1: mov %o7, %g1
- call HIDDEN_JUMPTARGET(fork)
- mov %g1, %o7
-#endif
- SYSCALL_ERROR_HANDLER
-PSEUDO_END (__vfork)
-libc_hidden_def (__vfork)
-weak_alias (__vfork, vfork)
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
index fa656b3..bd9bb0d 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
@@ -1,10 +1,100 @@
-#ifndef SPARC_SYSDEP_CANCEL_H
-#define SPARC_SYSDEP_CANCEL_H
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2002.
-#if defined(__arch64__)
-#include <sparc64/sysdep-cancel.h>
-#else
-#include <sparc32/sysdep-cancel.h>
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received 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>
+#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) \
+ ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
+ cmp %g1, 0; \
+ bne 1f; \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcs __syscall_error_handler; \
+ nop; \
+ .subsection 2; \
+1: save %sp, -96, %sp; \
+ CENABLE; \
+ nop; \
+ mov %o0, %l0; \
+ COPY_ARGS_##args \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcs __syscall_error_handler2; \
+ mov %o0, %l1; \
+ CDISABLE; \
+ mov %l0, %o0; \
+ jmpl %i7 + 8, %g0; \
+ restore %g0, %l1, %o0; \
+ .previous; \
+ SYSCALL_ERROR_HANDLER \
+ SYSCALL_ERROR_HANDLER2
+
+#define SYSCALL_ERROR_HANDLER2 \
+SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
+ .global __errno_location; \
+ .type __errno_location,@function; \
+ CDISABLE; \
+ mov %l0, %o0; \
+ call __errno_location; \
+ nop; \
+ st %l1, [%o0]; \
+ jmpl %i7 + 8, %g0; \
+ restore %g0, -1, %o0; \
+ .previous;
+
+# ifdef IS_IN_libpthread
+# define CENABLE call __pthread_enable_asynccancel
+# define CDISABLE call __pthread_disable_asynccancel
+# elif !defined NOT_IN_libc
+# define CENABLE call __libc_enable_asynccancel
+# define CDISABLE call __libc_disable_asynccancel
+# else
+# define CENABLE call __librt_enable_asynccancel
+# define CDISABLE call __librt_disable_asynccancel
+# endif
+
+#define COPY_ARGS_0 /* Nothing */
+#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
+#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
+#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
+#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
+#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
+#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ p_header.data.multiple_threads) == 0, 1)
+# else
+# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
+# endif
+
+#elif !defined __ASSEMBLER__
+
+/* This code should never be used but we define it anyhow. */
+# define SINGLE_THREAD_P (1)
+
#endif
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
similarity index 100%
rename from libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
rename to libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
rename to libpthread/nptl/sysdeps/jmpbuf-unwind.h
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/pthread_spin_lock.c
similarity index 100%
copy from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
copy to libpthread/nptl/sysdeps/pthread_spin_lock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
similarity index 100%
copy from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
copy to libpthread/nptl/sysdeps/pthread_spin_trylock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h b/libpthread/nptl/sysdeps/pthreaddef.h
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
rename to libpthread/nptl/sysdeps/pthreaddef.h
diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch b/libpthread/nptl/sysdeps/sparc/Makefile.arch
index 52ac6db..f9662c6 100644
--- a/libpthread/nptl/sysdeps/sparc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
@@ -4,8 +4,5 @@
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)/sparv9
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
-
-
diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
index 6cbb37b..2f64e7d 100644
--- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
+++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
@@ -1,5 +1,27 @@
-#if defined(__arch64__)
-#include "sparc64/jmpbuf-unwind.h"
-#else
-#include "sparc32/jmpbuf-unwind.h"
-#endif
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
rename to libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
rename to libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
index d4695c4..435fedc 100644
--- a/libpthread/nptl/sysdeps/sparc/pthreaddef.h
+++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
@@ -1,5 +1,39 @@
-#if defined(__arch64__)
-#include "sparc64/pthreaddef.h"
-#else
-#include "sparc32/pthreaddef.h"
-#endif
+/* 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/>. */
+
+/* Default stack size. */
+#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning. */
+#define STACK_ALIGN 16
+
+/* Minimal stack size after allocating thread descriptor and guard size. */
+#define MINIMAL_REST_STACK 2048
+
+/* Alignment requirement for TCB. */
+#define TCB_ALIGNMENT 16
+
+
+/* Location of current stack frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+/* XXX Until we have a better place keep the definitions here. */
+
+/* While there is no such syscall. */
+#define __exit_thread_inline(val) \
+ INLINE_SYSCALL (exit, 1, (val))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
deleted file mode 100644
index 3d314be..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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"
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " brnz,pn %%g2, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g2\n"
- " brnz,pt %%g2, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory");
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
deleted file mode 100644
index 3b20a21..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sparc64/pthread_spin_trylock.c>
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
deleted file mode 100644
index 482cbe3..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sparc64/pthread_spin_unlock.c>
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
deleted file mode 100644
index 0235056..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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"
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g5\n"
- " brnz,pn %%g5, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g5\n"
- " brnz,pt %%g5, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g5", "memory");
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
deleted file mode 100644
index b14621b..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <errno.h>
-#include "pthreadP.h"
-
-int
-pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int res;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (res)
- : "r" (lock)
- : "memory");
- return res == 0 ? 0 : EBUSY;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
deleted file mode 100644
index a00fad3..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* pthread_spin_unlock -- unlock a spin lock. Generic version.
- Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus(a)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 "pthreadP.h"
-#include <atomic.h>
-
-int
-pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__ ("membar #StoreStore | #LoadStore");
- *lock = 0;
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
deleted file mode 100644
index 845f4bf..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 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/>. */
-
-/* Default stack size. */
-#define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024)
-
-/* Required stack pointer alignment at beginning. */
-#define STACK_ALIGN 16
-
-/* Minimal stack size after allocating thread descriptor and guard size. */
-#define MINIMAL_REST_STACK 4096
-
-/* Alignment requirement for TCB. */
-#define TCB_ALIGNMENT 16
-
-
-/* Location of current stack frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__("%sp");
-
-/* XXX Until we have a better place keep the definitions here. */
-
-/* While there is no such syscall. */
-#define __exit_thread_inline(val) \
- INLINE_SYSCALL (exit, 1, (val))
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
index dfc5e82..a6142aa 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
@@ -1,5 +1,2 @@
-#if defined(__arch64__)
-#include "./sparc64/clone.S"
-#else
-#include "./sparc32/clone.S"
-#endif
+#define RESET_PID
+#include <libc/sysdeps/linux/sparc/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
index e8705c5..37231a8 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
@@ -1,5 +1,44 @@
-#if defined(__arch64__)
-#include "sparc64/pt-vfork.S"
-#else
-#include "sparc32/pt-vfork.S"
-#endif
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
+#include <tcb-offsets.h>
+
+ .text
+ .globl __syscall_error
+ENTRY(__vfork)
+ ld [%g7 + PID], %o5
+ sub %g0, %o5, %o4
+ st %o4, [%g7 + PID]
+
+ LOADSYSCALL(vfork)
+ ta 0x10
+ bcc 2f
+ mov %o7, %g1
+ st %o5, [%g7 + PID]
+ call __syscall_error
+ mov %g1, %o7
+2: sub %o1, 1, %o1
+ andcc %o0, %o1, %o0
+ bne,a 1f
+ st %o5, [%g7 + PID]
+1: retl
+ nop
+END(__vfork)
+
+weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
index 73eaa69..169f6e7 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
@@ -1 +1,93 @@
-#include "sparc32/pthread_barrier_wait.c"
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Martin Schwidefsky <schwidefsky(a)de.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 <pthreadP.h>
+
+/* Wait on barrier. */
+int
+pthread_barrier_wait (
+ pthread_barrier_t *barrier)
+{
+ union sparc_pthread_barrier *ibarrier
+ = (union sparc_pthread_barrier *) barrier;
+ int result = 0;
+ int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
+
+ /* Make sure we are alone. */
+ lll_lock (ibarrier->b.lock, private);
+
+ /* One more arrival. */
+ --ibarrier->b.left;
+
+ /* Are these all? */
+ if (ibarrier->b.left == 0)
+ {
+ /* Yes. Increment the event counter to avoid invalid wake-ups and
+ tell the current waiters that it is their turn. */
+ ++ibarrier->b.curr_event;
+
+ /* Wake up everybody. */
+ lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
+
+ /* This is the thread which finished the serialization. */
+ result = PTHREAD_BARRIER_SERIAL_THREAD;
+ }
+ else
+ {
+ /* The number of the event we are waiting for. The barrier's event
+ number must be bumped before we continue. */
+ unsigned int event = ibarrier->b.curr_event;
+
+ /* Before suspending, make the barrier available to others. */
+ lll_unlock (ibarrier->b.lock, private);
+
+ /* Wait for the event counter of the barrier to change. */
+ do
+ lll_futex_wait (&ibarrier->b.curr_event, event, private);
+ while (event == ibarrier->b.curr_event);
+ }
+
+ /* Make sure the init_count is stored locally or in a register. */
+ unsigned int init_count = ibarrier->b.init_count;
+
+ /* If this was the last woken thread, unlock. */
+ if (__atomic_is_v9 || ibarrier->s.pshared == 0)
+ {
+ if (atomic_increment_val (&ibarrier->b.left) == init_count)
+ /* We are done. */
+ lll_unlock (ibarrier->b.lock, private);
+ }
+ else
+ {
+ unsigned int left;
+ /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
+ is only atomic for threads within the same process, not for
+ multiple processes. */
+ __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
+ left = ++ibarrier->b.left;
+ __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
+ if (left == init_count)
+ /* We are done. */
+ lll_unlock (ibarrier->b.lock, private);
+ }
+
+ return result;
+}
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
deleted file mode 100644
index a6142aa..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define RESET_PID
-#include <libc/sysdeps/linux/sparc/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
deleted file mode 100644
index 37231a8..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sub %g0, %o5, %o4
- st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x10
- bcc 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
deleted file mode 100644
index 169f6e7..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky(a)de.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 <pthreadP.h>
-
-/* Wait on barrier. */
-int
-pthread_barrier_wait (
- pthread_barrier_t *barrier)
-{
- union sparc_pthread_barrier *ibarrier
- = (union sparc_pthread_barrier *) barrier;
- int result = 0;
- int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
-
- /* Make sure we are alone. */
- lll_lock (ibarrier->b.lock, private);
-
- /* One more arrival. */
- --ibarrier->b.left;
-
- /* Are these all? */
- if (ibarrier->b.left == 0)
- {
- /* Yes. Increment the event counter to avoid invalid wake-ups and
- tell the current waiters that it is their turn. */
- ++ibarrier->b.curr_event;
-
- /* Wake up everybody. */
- lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
-
- /* This is the thread which finished the serialization. */
- result = PTHREAD_BARRIER_SERIAL_THREAD;
- }
- else
- {
- /* The number of the event we are waiting for. The barrier's event
- number must be bumped before we continue. */
- unsigned int event = ibarrier->b.curr_event;
-
- /* Before suspending, make the barrier available to others. */
- lll_unlock (ibarrier->b.lock, private);
-
- /* Wait for the event counter of the barrier to change. */
- do
- lll_futex_wait (&ibarrier->b.curr_event, event, private);
- while (event == ibarrier->b.curr_event);
- }
-
- /* Make sure the init_count is stored locally or in a register. */
- unsigned int init_count = ibarrier->b.init_count;
-
- /* If this was the last woken thread, unlock. */
- if (__atomic_is_v9 || ibarrier->s.pshared == 0)
- {
- if (atomic_increment_val (&ibarrier->b.left) == init_count)
- /* We are done. */
- lll_unlock (ibarrier->b.lock, private);
- }
- else
- {
- unsigned int left;
- /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
- is only atomic for threads within the same process, not for
- multiple processes. */
- __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
- left = ++ibarrier->b.left;
- __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
- if (left == init_count)
- /* We are done. */
- lll_unlock (ibarrier->b.lock, private);
- }
-
- return result;
-}
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
deleted file mode 100644
index b61ca7b..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <tls.h>
-#include <sysdep.h>
-#ifndef __ASSEMBLER__
-# include <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; \
- .globl __syscall_error; \
-ENTRY(name) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- cmp %g1, 0; \
- bne 1f; \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcc 8f; \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7; \
-8: jmpl %o7 + 8, %g0; \
- nop; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
-1: save %sp, -96, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register(%o7, %i7); \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcc 1f; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- call __syscall_error; \
- mov %l1, %o0; \
- b 2f; \
- mov -1, %l1; \
-1: CDISABLE; \
- mov %l0, %o0; \
-2: jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0;
-
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# elif defined IS_IN_librt
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# 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/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
deleted file mode 100644
index 71f0662..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- cmp %o5, 0
- bne 1f
- sub %g0, %o5, %o4
- sethi %hi(0x80000000), %o4
-1: st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x10
- bcc 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-libc_hidden_def (vfork)
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
deleted file mode 100644
index 64e3bfc..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define RESET_PID
-#include <libc/sysdeps/linux/sparc/sparcv9/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
deleted file mode 100644
index a058d89..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sub %g0, %o5, %o4
- st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x6d
- bcc,pt %xcc, 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a,pt %icc, 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
deleted file mode 100644
index 0e9d263..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <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; \
- .globl __syscall_error; \
-ENTRY(name) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- brnz,pn %g1, 1f; \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcc,pt %xcc, 8f; \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7; \
-8: jmpl %o7 + 8, %g0; \
- nop; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
-1: save %sp, -192, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register(%o7, %i7); \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcc,pt %xcc, 1f; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- call __syscall_error; \
- mov %l1, %o0; \
- ba,pt %xcc, 2f; \
- mov -1, %l1; \
-1: CDISABLE; \
- mov %l0, %o0; \
-2: jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0;
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# elif defined IS_IN_librt
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# 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/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
deleted file mode 100644
index 0a9c337..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_create.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
deleted file mode 100644
index f0d4fd2..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_delete.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
deleted file mode 100644
index 82121a7..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_getoverr.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
deleted file mode 100644
index 313c05f..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_gettime.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
deleted file mode 100644
index 76f549c..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_settime.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
deleted file mode 100644
index bea4f2f..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sethi %hi(0x80000000), %o3
- cmp %o5, 0
- sub %g0, %o5, %o4
- move %icc, %o3, %o4
- st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x6d
- bcc,pt %xcc, 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a,pt %icc, 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-hidden_def (vfork)
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
index 5be9beb..b61ca7b 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
@@ -1,5 +1,111 @@
-#if defined(__arch64__)
-#include "sparc64/sysdep-cancel.h"
-#else
-#include "sparc32/sysdep-cancel.h"
+/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <tls.h>
+#include <sysdep.h>
+#ifndef __ASSEMBLER__
+# include <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; \
+ .globl __syscall_error; \
+ENTRY(name) \
+ ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
+ cmp %g1, 0; \
+ bne 1f; \
+.type __##syscall_name##_nocancel,@function; \
+.globl __##syscall_name##_nocancel; \
+__##syscall_name##_nocancel: \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcc 8f; \
+ mov %o7, %g1; \
+ call __syscall_error; \
+ mov %g1, %o7; \
+8: jmpl %o7 + 8, %g0; \
+ nop; \
+.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
+1: save %sp, -96, %sp; \
+ cfi_def_cfa_register(%fp); \
+ cfi_window_save; \
+ cfi_register(%o7, %i7); \
+ CENABLE; \
+ nop; \
+ mov %o0, %l0; \
+ COPY_ARGS_##args \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcc 1f; \
+ mov %o0, %l1; \
+ CDISABLE; \
+ mov %l0, %o0; \
+ call __syscall_error; \
+ mov %l1, %o0; \
+ b 2f; \
+ mov -1, %l1; \
+1: CDISABLE; \
+ mov %l0, %o0; \
+2: jmpl %i7 + 8, %g0; \
+ restore %g0, %l1, %o0;
+
+
+# ifdef IS_IN_libpthread
+# define CENABLE call __pthread_enable_asynccancel
+# define CDISABLE call __pthread_disable_asynccancel
+# elif !defined NOT_IN_libc
+# define CENABLE call __libc_enable_asynccancel
+# define CDISABLE call __libc_disable_asynccancel
+# elif defined IS_IN_librt
+# define CENABLE call __librt_enable_asynccancel
+# define CDISABLE call __librt_disable_asynccancel
+# else
+# error Unsupported library
+# endif
+
+#define COPY_ARGS_0 /* Nothing */
+#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
+#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
+#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
+#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
+#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
+#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
+# else
+# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
+# 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/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
index 160cd0b..71f0662 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
@@ -1,5 +1,48 @@
-#if defined(__arch64__)
-#include "sparc64/vfork.S"
-#else
-#include "sparc32/vfork.S"
-#endif
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
+#include <tcb-offsets.h>
+
+ .text
+ .globl __syscall_error
+ENTRY(__vfork)
+ ld [%g7 + PID], %o5
+ cmp %o5, 0
+ bne 1f
+ sub %g0, %o5, %o4
+ sethi %hi(0x80000000), %o4
+1: st %o4, [%g7 + PID]
+
+ LOADSYSCALL(vfork)
+ ta 0x10
+ bcc 2f
+ mov %o7, %g1
+ st %o5, [%g7 + PID]
+ call __syscall_error
+ mov %g1, %o7
+2: sub %o1, 1, %o1
+ andcc %o0, %o1, %o0
+ bne,a 1f
+ st %o5, [%g7 + PID]
+1: retl
+ nop
+END(__vfork)
+
+libc_hidden_def (vfork)
+weak_alias (__vfork, vfork)
diff --git a/test/Makefile b/test/Makefile
index b759bf9..787c530 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -45,7 +45,7 @@ endif
test check all: run
-run: compile subdirs_run
+run: subdirs_run
compile: $(top_builddir)$(LOCAL_INSTALL_PATH) subdirs_compile
diff --git a/test/README b/test/README
index 8fb12d9..28225b0 100644
--- a/test/README
+++ b/test/README
@@ -5,12 +5,11 @@ Following make targets are avaialable
make compile
-This will compile and link the tests
+This will compile and link the tests.
make run
-This will check for binaries, if they are not there it
-will call 'compile' target, then it will execute all the tests.
+This will execute all the tests.
make check
make all
diff --git a/test/librt/Makefile.in b/test/librt/Makefile.in
index 15ecbae..f25522c 100644
--- a/test/librt/Makefile.in
+++ b/test/librt/Makefile.in
@@ -2,3 +2,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
LDFLAGS_shmtest := -lrt
+
+ifeq ($(ARCH_USE_MMU),)
+TESTS_DISABLED := shmtest
+endif
diff --git a/test/math/Makefile.in b/test/math/Makefile.in
index d241baa..147d579 100644
--- a/test/math/Makefile.in
+++ b/test/math/Makefile.in
@@ -13,6 +13,9 @@ endif
ifeq ($(DO_C99_MATH),)
TESTS_DISABLED += test-float test-ifloat test-double test-idouble rint signgam ilogb
endif
+ifeq ($(UCLIBC_HAS_FPU),)
+TESTS_DISABLED += test-fpucw
+endif
DODIFF_rint := 1
DODIFF_signgam := 1
diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c
index e711958..4ba4045 100644
--- a/test/nptl/tst-cancel4.c
+++ b/test/nptl/tst-cancel4.c
@@ -83,7 +83,30 @@ static pthread_barrier_t b2;
# define IPC_ADDVAL 0
#endif
-#define WRITE_BUFFER_SIZE 4096
+/* The WRITE_BUFFER_SIZE value needs to be chosen such that if we set
+ the socket send buffer size to '1', a write of this size on that
+ socket will block.
+
+ The Linux kernel imposes a minimum send socket buffer size which
+ has changed over the years. As of Linux 3.10 the value is:
+
+ 2 * (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff)))
+
+ which is attempting to make sure that with standard MTUs,
+ TCP can always queue up at least 2 full sized packets.
+
+ Furthermore, there is logic in the socket send paths that
+ will allow one more packet (of any size) to be queued up as
+ long as some socket buffer space remains. Blocking only
+ occurs when we try to queue up a new packet and the send
+ buffer space has already been fully consumed.
+
+ Therefore we must set this value to the largest possible value of
+ the formula above (and since it depends upon the size of "struct
+ sk_buff", it is dependent upon machine word size etc.) plus some
+ slack space. */
+
+#define WRITE_BUFFER_SIZE 16384
/* Cleanup handling test. */
static int cl_called;
@@ -758,7 +781,6 @@ tf_sigpause (void *arg)
pthread_cleanup_push (cl, NULL);
- /* Just for fun block the cancellation signal. */
sigpause (SIGCANCEL);
pthread_cleanup_pop (0);
@@ -993,6 +1015,8 @@ tf_accept (void *arg)
if (++tries > 10)
{
printf ("%s: too many unsuccessful bind calls\n", __FUNCTION__);
+ /* prevent endless loop, when bind fails forever */
+ exit (1);
}
strcpy (sun.sun_path, "/tmp/tst-cancel4-socket-1-XXXXXX");
diff --git a/test/nptl/tst-sem3.c b/test/nptl/tst-sem3.c
index d14f6f6..7b75e29 100644
--- a/test/nptl/tst-sem3.c
+++ b/test/nptl/tst-sem3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper(a)redhat.com>, 2002.
@@ -28,7 +28,7 @@
int
-main (void)
+do_test (void)
{
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-sem3.XXXXXX";
@@ -43,7 +43,7 @@ main (void)
if (fd == -1)
{
printf ("cannot open temporary file: %m\n");
- exit (1);
+ return 1;
}
/* Make sure it is always removed. */
@@ -56,14 +56,14 @@ main (void)
if (write (fd, data, ps) != (ssize_t) ps)
{
puts ("short write");
- exit (1);
+ return 1;
}
mem = mmap (NULL, ps, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (mem == MAP_FAILED)
{
printf ("mmap failed: %m\n");
- exit (1);
+ return 1;
}
s = (sem_t *) (((uintptr_t) mem + __alignof (sem_t))
@@ -73,25 +73,25 @@ main (void)
if (sem_init (s, 1, 1) == -1)
{
puts ("init failed");
- exit (1);
+ return 1;
}
if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1)
{
puts ("1st wait failed");
- exit (1);
+ return 1;
}
errno = 0;
if (TEMP_FAILURE_RETRY (sem_trywait (s)) != -1)
{
puts ("trywait succeeded");
- exit (1);
+ return 1;
}
else if (errno != EAGAIN)
{
puts ("trywait didn't return EAGAIN");
- exit (1);
+ return 1;
}
*p = 0;
@@ -101,7 +101,7 @@ main (void)
if (pid == -1)
{
puts ("fork failed");
- exit (1);
+ return 1;
}
else if (pid == 0)
{
@@ -109,13 +109,13 @@ main (void)
if ((*p)++ != 0)
{
puts ("child: *p != 0");
- exit (1);
+ return 1;
}
if (sem_post (s) == -1)
{
puts ("child: 1st post failed");
- exit (1);
+ return 1;
}
puts ("child done");
@@ -125,17 +125,20 @@ main (void)
if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1)
{
printf ("parent: 2nd wait failed: %m\n");
- exit (1);
+ return 1;
}
if (*p != 1)
{
puts ("*p != 1");
- exit (1);
+ return 1;
}
puts ("parent done");
}
- exit (0);
+ return 0;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/test/nptl/tst-sem4.c b/test/nptl/tst-sem4.c
index 125759b..72ed97d 100644
--- a/test/nptl/tst-sem4.c
+++ b/test/nptl/tst-sem4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper(a)redhat.com>, 2002.
@@ -32,7 +32,7 @@ remove_sem (int status, void *arg)
int
-main (void)
+do_test (void)
{
sem_t *s;
sem_t *s2;
@@ -144,3 +144,6 @@ main (void)
return 0;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/test/time/Makefile.in b/test/time/Makefile.in
index 05f73a4..02c8d91 100644
--- a/test/time/Makefile.in
+++ b/test/time/Makefile.in
@@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
tst-strftime tst-strptime tst-timezone
ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += tst-ftime_l
+TESTS_DISABLED += tst-ftime_l tst_wcsftime
endif
CFLAGS_tst-strptime2 := -std=c99
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch upstream updated. 6d550ddd129b18cf800eab604f74536754526cd8
by wbx@helium.waldemar-brodkorb.de 04 Sep '14
by wbx@helium.waldemar-brodkorb.de 04 Sep '14
04 Sep '14
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, upstream has been updated
via 6d550ddd129b18cf800eab604f74536754526cd8 (commit)
via b212e3804fb155cb418852dd70abad9a3d2354cc (commit)
via bc23c6440d34d85c8e6bb04656beb233bba47cb8 (commit)
via ff48662bbadd3d49fabe6fdfeb8e8181d4c80b06 (commit)
via 7a3acb243bc09f253a77faee7ee097a781f3eebe (commit)
via 5c0c667fb21c74b4a9ac0554418a553bf1e11c1c (commit)
via 61ae023e5bb93f05b2b30b31f299efc64bcd420e (commit)
via 88041f133f06d81a9bf6c72fc6e41a604eddf4b8 (commit)
via 512fd3804b963a6738ce59d25dd44a7d9143b8b7 (commit)
via 697dbb016e4bc63d20a7c871a9580e7dce32d1b0 (commit)
via 5a89f1c6964cc938c439d992f187bc87cdd4eb07 (commit)
via ad687dda63a43d5ea5ed834475cec5e0a618ebf5 (commit)
via 23abbfa633f7e017a7939aa3966e0d7d24df480d (commit)
via 68d700d66bfe498eeccd03ba44dd2081e34441d0 (commit)
via 10d05ca07c4632e8dfca4877a8fc6a458b8f5810 (commit)
via 789fca90bff0b0bcd658444cea6afd4cdb43dc5d (commit)
via c09e41ef92e48356e62c795384864ee792ac7fe6 (commit)
from c6e8f34a358f846aa15cb9f53251da3d6668abd1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6d550ddd129b18cf800eab604f74536754526cd8
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Mon Sep 1 20:44:20 2014 +0200
sparc: remove sparc64/sparcv9 code
The sparc64/sparcv9 code is incomplete. Furthermore there is
no real embedded hardware for sparc64 available, so better remove
it until someone comes up with a complete port.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit b212e3804fb155cb418852dd70abad9a3d2354cc
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Thu Sep 4 13:21:23 2014 +0200
ldso: Fix compile-error on noMMU
Thanks to Waldemar Brodkorb for noticing!
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit bc23c6440d34d85c8e6bb04656beb233bba47cb8
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Thu Sep 4 13:16:35 2014 +0200
test: wcsftime depends on XLOCALE
Thanks to Waldemar Brodkorb for noticing.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit ff48662bbadd3d49fabe6fdfeb8e8181d4c80b06
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Thu Sep 4 13:12:52 2014 +0200
test: disable librt shmtest on non-MMU systems
This test fails for non-MMU systems, because it uses fork()
Thanks to Waldemar Brodkorb!
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 7a3acb243bc09f253a77faee7ee097a781f3eebe
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Thu Sep 4 12:46:56 2014 +0200
buildsys: tweak check_ld flag probing
ld was (erroneously) complaining that it failed to merge private bfd
data. Silence this mismatch as seen on m68k with obfd binary.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 5c0c667fb21c74b4a9ac0554418a553bf1e11c1c
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Fri Aug 29 21:06:18 2014 +0200
buildsys: refine compile.S
filter out all -std=
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 61ae023e5bb93f05b2b30b31f299efc64bcd420e
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Fri Aug 29 20:53:04 2014 +0200
buildsys: use SED for create-lds
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 88041f133f06d81a9bf6c72fc6e41a604eddf4b8
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:26 2014 +0200
test: disable test for systems without FPU
This test fails for systems without fpu.
For example m68k build for non-mmu/non-fpu systems fail.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 512fd3804b963a6738ce59d25dd44a7d9143b8b7
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:30 2014 +0200
test: sync with glibc, use do_test
This breaks out of a deadlock, which occurs when testing for powerpc. (qemu)
Otherwise the test suite does not finish.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 697dbb016e4bc63d20a7c871a9580e7dce32d1b0
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:29 2014 +0200
test: get out of the endless while loop, when bind failed
When bind() fails in this test, then /tmp get filled up with
temp files and upcoming tests will fail, because they need to create
temp files, too. Better exit from the loop.
Test still needs to be investigated to fix the failing bind().
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 5a89f1c6964cc938c439d992f187bc87cdd4eb07
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:27 2014 +0200
m68k: fix typo
otherwise you get compile warnings, when building for m68k.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit ad687dda63a43d5ea5ed834475cec5e0a618ebf5
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:24 2014 +0200
test: do not depend on compile
When you cross-compile the testsuite and then try to run
on a system without gcc/binutils it would be nice if no compiling
or linking is tried. Refresh test/README (suggested by Khem)
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 23abbfa633f7e017a7939aa3966e0d7d24df480d
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:23 2014 +0200
test: NPTL: sync WRITE_BUFFER_SIZE with glibc test
Test on Linux 3.16.1 in Qemu ARM fails with:
TEST_EXEC nptl/ tst-cancel4
ret == 1 ; expected_ret == 0
make[1]: *** [tst-cancel4.exe] Error 1
The output of failed test is:
minimum write buffer size too large
../Test.mak:89: recipe for target 'tst-cancel4.exe' failed
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 68d700d66bfe498eeccd03ba44dd2081e34441d0
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:22 2014 +0200
sparc: add missing pthread_spin_lock/pthread_spin_trylock
tst-spin1.c compile breaks with:
test/nptl/tst-spin1.c:34: undefined reference to `pthread_spin_lock'
pthread_spin_lock and pthread_spin_trylock is missing while
building sparc. add the meta c files here.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 10d05ca07c4632e8dfca4877a8fc6a458b8f5810
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:21 2014 +0200
sparc: remove unused subdirs variable
For sparc TARGET_SUBARCH is never used. And there is a typo in the
path.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 789fca90bff0b0bcd658444cea6afd4cdb43dc5d
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:20 2014 +0200
Revert "sparc: disable cancellable system, as it fails in strange ways right now"
This reverts commit 1db4f8f8389f6a935ecd83aff7fcce5d1cf2c0f3.
It is unclear in which way this is breaking sparc systems.
With this change added you get following linking error:
libpthread/nptl/libpthread_so.a(pt-system.oS): In function `__libc_system':
libc/stdlib/system.c:64: undefined reference to `__wait4_nocancel'
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit c09e41ef92e48356e62c795384864ee792ac7fe6
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Thu Aug 28 12:31:19 2014 +0200
Revert "sparc: use HIDDEN_JUMPTARGET for errno"
This reverts commit f51fb26dbcceee9e48d10facc830bd4a549f6cc2.
This fixes linking error for sparc build.
While building a sparc system you get following linking error:
libc/sysdeps/linux/sparc/pipe.S:54: undefined reference to `__GI___errno_location'
Removing the HIDDEN_JUMPTARGET fixes the issue, while using gcc 4.8.3/binutils 2.24.
The definition of __errno_location was changed recently here:
http://git.uclibc.org/uClibc/commit/?id=8f550715c2b211036fc273add3cb5219397…
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
Makerules | 4 +-
Rules.mak | 7 +-
extra/Configs/Config.sparc | 6 -
extra/scripts/none.lds | 13 +
ldso/ldso/dl-elf.c | 2 +-
libc/stdlib/system.c | 13 +-
libc/string/sparc/sparc64/memchr.S | 258 ------
libc/string/sparc/sparc64/memcpy.S | 922 --------------------
libc/string/sparc/sparc64/memset.S | 316 -------
libc/string/sparc/sparc64/sparcv9b/memcpy.S | 611 -------------
libc/string/sparc/sparc64/stpcpy.S | 270 ------
libc/string/sparc/sparc64/strcat.S | 338 -------
libc/string/sparc/sparc64/strchr.S | 485 ----------
libc/string/sparc/sparc64/strcmp.S | 278 ------
libc/string/sparc/sparc64/strcpy.S | 244 ------
libc/string/sparc/sparc64/strlen.S | 172 ----
libc/sysdeps/linux/m68k/bits/huge_vall.h | 2 +-
libc/sysdeps/linux/sparc/bits/setjmp.h | 31 -
libc/sysdeps/linux/sparc/bits/sigcontext.h | 35 -
libc/sysdeps/linux/sparc/crt1.S | 11 -
libc/sysdeps/linux/sparc/fork.S | 2 +-
libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 25 +-
libc/sysdeps/linux/sparc/pipe.S | 2 +-
libc/sysdeps/linux/sparc/qp_ops.c | 8 -
libc/sysdeps/linux/sparc/sparcv9/clone.S | 101 ---
libc/sysdeps/linux/sparc/sparcv9/rem.S | 20 -
libc/sysdeps/linux/sparc/sparcv9/sdiv.S | 18 -
libc/sysdeps/linux/sparc/sparcv9/udiv.S | 15 -
libc/sysdeps/linux/sparc/sparcv9/umul.S | 15 -
libc/sysdeps/linux/sparc/sparcv9/urem.S | 17 -
libc/sysdeps/linux/sparc/sys/procfs.h | 88 --
libc/sysdeps/linux/sparc/vfork.S | 2 +-
.../linuxthreads.old/sysdeps/sparc/pt-machine.h | 86 +-
.../sysdeps/sparc/sparc32/pt-machine.h | 82 --
.../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
libpthread/linuxthreads/sysdeps/sparc/pspinlock.c | 95 +-
libpthread/linuxthreads/sysdeps/sparc/pt-machine.h | 86 +-
.../linuxthreads/sysdeps/sparc/sparc32/pspinlock.c | 87 --
.../sysdeps/sparc/sparc32/pt-machine.h | 82 --
.../sysdeps/sparc/sparc32/sparcv9/pspinlock.c | 93 --
.../linuxthreads/sysdeps/sparc/sparc64/pspinlock.c | 92 --
.../sysdeps/sparc/sparc64/pt-machine.h | 104 ---
.../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 100 ---
.../unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c | 1 -
.../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 99 ---
.../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 63 --
.../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 102 ++-
.../unix/sysv/linux/sparc/{sparc32 => }/vfork.S | 0
.../sysdeps/{sparc/sparc32 => }/jmpbuf-unwind.h | 0
.../{sparc/sparc32 => }/pthread_spin_lock.c | 0
.../{sparc/sparc32 => }/pthread_spin_trylock.c | 0
.../nptl/sysdeps/{sparc/sparc32 => }/pthreaddef.h | 0
libpthread/nptl/sysdeps/sparc/Makefile.arch | 3 -
libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h | 32 +-
.../sparc/{sparc32 => }/pthread_spin_lock.c | 0
.../sparc/{sparc32 => }/pthread_spin_trylock.c | 0
libpthread/nptl/sysdeps/sparc/pthreaddef.h | 44 +-
.../sparc/sparc32/sparcv9/pthread_spin_lock.c | 38 -
.../sparc/sparc32/sparcv9/pthread_spin_trylock.c | 1 -
.../sparc/sparc32/sparcv9/pthread_spin_unlock.c | 1 -
.../nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h | 27 -
.../nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c | 38 -
.../sysdeps/sparc/sparc64/pthread_spin_trylock.c | 33 -
.../sysdeps/sparc/sparc64/pthread_spin_unlock.c | 29 -
libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h | 39 -
.../nptl/sysdeps/unix/sysv/linux/sparc/clone.S | 7 +-
.../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S | 49 +-
.../unix/sysv/linux/sparc/pthread_barrier_wait.c | 94 +-
.../unix/sysv/linux/sparc/{sparc32 => }/sem_post.c | 0
.../sysv/linux/sparc/{sparc32 => }/sem_timedwait.c | 0
.../sysv/linux/sparc/{sparc32 => }/sem_trywait.c | 0
.../unix/sysv/linux/sparc/{sparc32 => }/sem_wait.c | 0
.../sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 2 -
.../unix/sysv/linux/sparc/sparc32/pt-vfork.S | 44 -
.../linux/sparc/sparc32/pthread_barrier_wait.c | 93 --
.../unix/sysv/linux/sparc/sparc32/sysdep-cancel.h | 111 ---
.../sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 48 -
.../sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 2 -
.../unix/sysv/linux/sparc/sparc64/pt-vfork.S | 44 -
.../unix/sysv/linux/sparc/sparc64/sysdep-cancel.h | 109 ---
.../unix/sysv/linux/sparc/sparc64/timer_create.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_delete.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_getoverr.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_gettime.c | 1 -
.../unix/sysv/linux/sparc/sparc64/timer_settime.c | 1 -
.../sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 48 -
.../sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h | 114 ++-
.../nptl/sysdeps/unix/sysv/linux/sparc/vfork.S | 53 +-
test/Makefile | 2 +-
test/README | 5 +-
test/librt/Makefile.in | 4 +
test/math/Makefile.in | 3 +
test/nptl/tst-cancel4.c | 28 +-
test/nptl/tst-sem3.c | 33 +-
test/nptl/tst-sem4.c | 7 +-
test/time/Makefile.in | 2 +-
96 files changed, 804 insertions(+), 5995 deletions(-)
create mode 100644 extra/scripts/none.lds
delete mode 100644 libc/string/sparc/sparc64/memchr.S
delete mode 100644 libc/string/sparc/sparc64/memcpy.S
delete mode 100644 libc/string/sparc/sparc64/memset.S
delete mode 100644 libc/string/sparc/sparc64/sparcv9b/memcpy.S
delete mode 100644 libc/string/sparc/sparc64/stpcpy.S
delete mode 100644 libc/string/sparc/sparc64/strcat.S
delete mode 100644 libc/string/sparc/sparc64/strchr.S
delete mode 100644 libc/string/sparc/sparc64/strcmp.S
delete mode 100644 libc/string/sparc/sparc64/strcpy.S
delete mode 100644 libc/string/sparc/sparc64/strlen.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/clone.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/rem.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/sdiv.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/udiv.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/umul.S
delete mode 100644 libc/sysdeps/linux/sparc/sparcv9/urem.S
delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
delete mode 100644 libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
delete mode 100644 libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
delete mode 100644 libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
rename libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/vfork.S (100%)
rename libpthread/nptl/sysdeps/{sparc/sparc32 => }/jmpbuf-unwind.h (100%)
copy libpthread/nptl/sysdeps/{sparc/sparc32 => }/pthread_spin_lock.c (100%)
copy libpthread/nptl/sysdeps/{sparc/sparc32 => }/pthread_spin_trylock.c (100%)
rename libpthread/nptl/sysdeps/{sparc/sparc32 => }/pthreaddef.h (100%)
rename libpthread/nptl/sysdeps/sparc/{sparc32 => }/pthread_spin_lock.c (100%)
rename libpthread/nptl/sysdeps/sparc/{sparc32 => }/pthread_spin_trylock.c (100%)
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
delete mode 100644 libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_post.c (100%)
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_timedwait.c (100%)
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_trywait.c (100%)
rename libpthread/nptl/sysdeps/unix/sysv/linux/sparc/{sparc32 => }/sem_wait.c (100%)
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
diff --git a/Makerules b/Makerules
index 5030205..05d9548 100644
--- a/Makerules
+++ b/Makerules
@@ -240,7 +240,7 @@ cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) \
cmd_compile.i = $(cmd_compile.c:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
cmd_compile.s = $(cmd_compile.c:-c=-S)
cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
-cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
+cmd_compile.S = $(filter-out -std=%, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
@@ -303,7 +303,7 @@ define create-lds
$(Q)$(CC) -nostdlib -nostartfiles -shared -Wl,-z,combreloc \
-Wl,-z,relro -Wl,--hash-style=gnu -Wl,-z,defs \
-Wl,--verbose 2>&1 | LC_ALL=C \
- sed -e '/^=========/,/^=========/!d;/^=========/d' \
+ $(SED) -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = .* + SIZEOF_HEADERS;/& $(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds
endef
diff --git a/Rules.mak b/Rules.mak
index 19cc38a..cb65700 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -201,7 +201,7 @@ check_as=$(shell \
if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
then echo "-Wa,$(1)"; fi)
check_ld=$(shell \
- if $(CC) $(LDFLAG-fuse-ld) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
+ if $(CC) $(LDFLAG-fuse-ld) $(CFLAG_-Wl--no-warn-mismatch) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
then echo "$(1)"; fi)
# Use variable indirection here so that we can have variable
@@ -254,8 +254,11 @@ ARFLAGS:=cr
# Note: The check for -nostdlib has to be before all calls to check_ld
$(eval $(call check-gcc-var,-nostdlib))
-LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
# deliberately not named CFLAG-fuse-ld since unchecked and from user
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
+# failed to merge target specific data of file /dev/null
+# Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well.
+$(eval $(call check-ld-var,--no-warn-mismatch))
# Flags in OPTIMIZATION are used only for non-debug builds
diff --git a/extra/Configs/Config.sparc b/extra/Configs/Config.sparc
index c6180c8..47c8ac2 100644
--- a/extra/Configs/Config.sparc
+++ b/extra/Configs/Config.sparc
@@ -26,10 +26,4 @@ config CONFIG_SPARC_V7
config CONFIG_SPARC_V8
bool "SPARC v8"
-config CONFIG_SPARC_V9
- bool "SPARC v9"
-
-config CONFIG_SPARC_V9B
- bool "SPARC v9b"
-
endchoice
diff --git a/extra/scripts/none.lds b/extra/scripts/none.lds
new file mode 100644
index 0000000..d6bd05a
--- /dev/null
+++ b/extra/scripts/none.lds
@@ -0,0 +1,13 @@
+/* GNU ld script
+ * Used by the build system to probe flags.
+ * Discards all output to avoid error
+ * "failed to merge target specific data of file %B". */
+TARGET(binary)
+INPUT(/dev/null)
+/* We could as well omit the whole SECTIONS block.
+ * This redundancy is just for clarity. */
+SECTIONS
+{
+ /DISCARD/ : { *(*) }
+}
+
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 1b06bc1..54501d1 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -728,7 +728,7 @@ struct elf_resolve *_dl_load_elf_shared_library(unsigned rflags,
void *new_addr;
new_addr = map_writeable (infile, ppnt, piclib, flags, libaddr);
if (!new_addr) {
- _dl_dprintf(_dl_debug_file, "Can't modify %s's text section.",
+ _dl_dprintf(2, "Can't modify %s's text section.",
libname);
_dl_exit(1);
}
diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c
index 151a229..8c5d25d 100644
--- a/libc/stdlib/system.c
+++ b/libc/stdlib/system.c
@@ -18,13 +18,14 @@
#include <sysdep-cancel.h>
#endif
-extern __typeof(system) __libc_system;
-
-/* TODO: the cancellable version breaks on sparc currently,
- * need to figure out why still
- */
-#if !defined __UCLIBC_HAS_THREADS_NATIVE__ || defined __sparc__
+#if !defined __UCLIBC_HAS_THREADS_NATIVE__
+/* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
+#include <sys/syscall.h>
+#ifndef __NR_vfork
+# define vfork fork
+#endif
+extern __typeof(system) __libc_system;
int __libc_system(const char *command)
{
int wait_val, pid;
diff --git a/libc/string/sparc/sparc64/memchr.S b/libc/string/sparc/sparc64/memchr.S
deleted file mode 100644
index 6467f7f..0000000
--- a/libc/string/sparc/sparc64/memchr.S
+++ /dev/null
@@ -1,258 +0,0 @@
-/* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less
- than N.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
- This version is developed using the same algorithm as the fast C
- version which carries the following introduction:
- Based on strlen implementation by Torbjorn Granlund (tege(a)sics.se)
- with help from Dan Sahlin (dan(a)sics.se) and
- commentary by Jim Blandy (jimb(a)ai.mit.edu)
- adaptation to memchr suggested by Dick Karpinski (dick(a)cca.ucsf.edu)
- and implemented by Roland McGrath (roland(a)ai.mit.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/>. */
-
-#include <asm/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(memchr)
- and %o1, 0xff, %o1 /* IEU0 Group */
-#ifdef USE_BPR
- brz,pn %o2, 12f /* CTI+IEU1 */
-#else
- tst %o2 /* IEU1 */
- be,pn %XCC, 12f /* CTI */
-#endif
- sll %o1, 8, %g3 /* IEU0 Group */
- add %o0, %o2, %o2 /* IEU1 */
-
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- or %g3, %o1, %g3 /* IEU1 */
- ldub [%o0], %o3 /* Load */
- sllx %g3, 16, %g5 /* IEU0 Group */
-
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
- sllx %g1, 32, %g2 /* IEU0 Group */
- or %g3, %g5, %g3 /* IEU1 */
- sllx %g3, 32, %g5 /* IEU0 Group */
-
- cmp %o3, %o1 /* IEU1 */
- be,pn %xcc, 13f /* CTI */
- or %g1, %g2, %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
-
- bne,a,pn %icc, 21f /* CTI */
- add %o0, 1, %o0 /* IEU0 Group */
- ldx [%o0], %o3 /* Load Group */
- sllx %g1, 7, %g2 /* IEU0 */
-
- or %g3, %g5, %g3 /* IEU1 */
-1: add %o0, 8, %o0 /* IEU0 Group */
- xor %o3, %g3, %o4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080088080808080 *
- * %g3 = c c c c c c c c *
- * %o3 = value *
- * %o4 = value XOR c */
-2: cmp %o0, %o2 /* IEU1 Group */
-
- bg,pn %XCC, 11f /* CTI */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- sub %o4, %g1, %o5 /* IEU0 Group */
- add %o0, 8, %o0 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o5, %o4, %o5 /* IEU0 Group */
-#endif
-
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- srlx %o4, 56, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 3f /* CTI */
- srlx %o4, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- srlx %o4, 24, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %o4, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 8f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- bne,pt %icc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- retl /* CTI+IEU1 Group */
-
- add %o0, -9, %o0 /* IEU0 */
-
- .align 16
-3: retl /* CTI+IEU1 Group */
- add %o0, -16, %o0 /* IEU0 */
-4: retl /* CTI+IEU1 Group */
- add %o0, -15, %o0 /* IEU0 */
-
-5: retl /* CTI+IEU1 Group */
- add %o0, -14, %o0 /* IEU0 */
-6: retl /* CTI+IEU1 Group */
- add %o0, -13, %o0 /* IEU0 */
-
-7: retl /* CTI+IEU1 Group */
- add %o0, -12, %o0 /* IEU0 */
-8: retl /* CTI+IEU1 Group */
- add %o0, -11, %o0 /* IEU0 */
-
-9: retl /* CTI+IEU1 Group */
- add %o0, -10, %o0 /* IEU0 */
-11: sub %o4, %g1, %o5 /* IEU0 Group */
- sub %o0, 8, %o0 /* IEU1 */
-
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 12f /* CTI */
- sub %o2, %o0, %o2 /* IEU0 */
- tst %o2 /* IEU1 Group */
-
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 13f /* CTI */
-
- cmp %o2, 1 /* IEU0 */
- be,pn %XCC, 12f /* CTI Group */
- srlx %o4, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 14f /* CTI */
- cmp %o2, 2 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 15f /* CTI */
- cmp %o2, 3 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
-
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
- cmp %o2, 4 /* IEU1 Group */
-
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 17f /* CTI */
-
- cmp %o2, 5 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 18f /* CTI */
- cmp %o2, 6 /* IEU1 Group */
- be,pn %XCC, 12f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- nop /* IEU0 */
-12: retl /* CTI+IEU1 Group */
-
- clr %o0 /* IEU0 */
- nop /* Stub */
-13: retl /* CTI+IEU1 Group */
- nop /* IEU0 */
-
-14: retl /* CTI+IEU1 Group */
- add %o0, 1, %o0 /* IEU0 */
-15: retl /* CTI+IEU1 Group */
- add %o0, 2, %o0 /* IEU0 */
-
-16: retl /* CTI+IEU1 Group */
- add %o0, 3, %o0 /* IEU0 */
-17: retl /* CTI+IEU1 Group */
- add %o0, 4, %o0 /* IEU0 */
-
-18: retl /* CTI+IEU1 Group */
- add %o0, 5, %o0 /* IEU0 */
-19: retl /* CTI+IEU1 Group */
- add %o0, 6, %o0 /* IEU0 */
-
-21: cmp %o0, %o2 /* IEU1 */
- be,pn %XCC, 12b /* CTI */
- sllx %g1, 7, %g2 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
-
- or %g3, %g5, %g3 /* IEU1 */
-22: andcc %o0, 7, %g0 /* IEU1 Group */
- be,a,pn %icc, 1b /* CTI */
- ldx [%o0], %o3 /* Load */
-
- cmp %o3, %o1 /* IEU1 Group */
- be,pn %xcc, 23f /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- cmp %o0, %o2 /* IEU1 Group */
-
- bne,a,pt %XCC, 22b /* CTI */
- ldub [%o0], %o3 /* Load */
- retl /* CTI+IEU1 Group */
- clr %o0 /* IEU0 */
-
-23: retl /* CTI+IEU1 Group */
- add %o0, -1, %o0 /* IEU0 */
-END(memchr)
-
-libc_hidden_def(memchr)
-weak_alias(memchr,__ubp_memchr)
diff --git a/libc/string/sparc/sparc64/memcpy.S b/libc/string/sparc/sparc64/memcpy.S
deleted file mode 100644
index df3e2d3..0000000
--- a/libc/string/sparc/sparc64/memcpy.S
+++ /dev/null
@@ -1,922 +0,0 @@
-/* Copy SIZE bytes from SRC to DEST.
- For UltraSPARC.
- Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller (davem(a)caip.rutgers.edu) and
- Jakub Jelinek (jakub(a)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 <features.h>
-#include <asm/asi.h>
-#ifndef XCC
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#define XCC xcc
-#endif
-#define FPRS_FEF 4
-
-#define FREG_FROB(f1, f2, f3, f4, f5, f6, f7, f8, f9) \
- faligndata %f1, %f2, %f48; \
- faligndata %f2, %f3, %f50; \
- faligndata %f3, %f4, %f52; \
- faligndata %f4, %f5, %f54; \
- faligndata %f5, %f6, %f56; \
- faligndata %f6, %f7, %f58; \
- faligndata %f7, %f8, %f60; \
- faligndata %f8, %f9, %f62;
-
-#define MAIN_LOOP_CHUNK(src, dest, fdest, fsrc, len, jmptgt) \
- ldda [%src] %asi, %fdest; \
- add %src, 0x40, %src; \
- add %dest, 0x40, %dest; \
- subcc %len, 0x40, %len; \
- be,pn %xcc, jmptgt; \
- stda %fsrc, [%dest - 0x40] %asi;
-
-#define LOOP_CHUNK1(src, dest, len, branch_dest) \
- MAIN_LOOP_CHUNK(src, dest, f0, f48, len, branch_dest)
-#define LOOP_CHUNK2(src, dest, len, branch_dest) \
- MAIN_LOOP_CHUNK(src, dest, f16, f48, len, branch_dest)
-#define LOOP_CHUNK3(src, dest, len, branch_dest) \
- MAIN_LOOP_CHUNK(src, dest, f32, f48, len, branch_dest)
-
-#define STORE_SYNC(dest, fsrc) \
- stda %fsrc, [%dest] %asi; \
- add %dest, 0x40, %dest;
-
-#define STORE_JUMP(dest, fsrc, target) \
- stda %fsrc, [%dest] %asi; \
- add %dest, 0x40, %dest; \
- ba,pt %xcc, target;
-
-#define VISLOOP_PAD nop; nop; nop; nop; \
- nop; nop; nop; nop; \
- nop; nop; nop; nop; \
- nop; nop; nop;
-
-#define FINISH_VISCHUNK(dest, f0, f1, left) \
- subcc %left, 8, %left; \
- bl,pn %xcc, 205f; \
- faligndata %f0, %f1, %f48; \
- std %f48, [%dest]; \
- add %dest, 8, %dest;
-
-#define UNEVEN_VISCHUNK(dest, f0, f1, left) \
- subcc %left, 8, %left; \
- bl,pn %xcc, 205f; \
- fsrc1 %f0, %f1; \
- ba,a,pt %xcc, 204f;
-
- /* Macros for non-VIS memcpy code. */
-#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- ldx [%src + offset + 0x10], %t2; \
- ldx [%src + offset + 0x18], %t3; \
- stw %t0, [%dst + offset + 0x04]; \
- srlx %t0, 32, %t0; \
- stw %t0, [%dst + offset + 0x00]; \
- stw %t1, [%dst + offset + 0x0c]; \
- srlx %t1, 32, %t1; \
- stw %t1, [%dst + offset + 0x08]; \
- stw %t2, [%dst + offset + 0x14]; \
- srlx %t2, 32, %t2; \
- stw %t2, [%dst + offset + 0x10]; \
- stw %t3, [%dst + offset + 0x1c]; \
- srlx %t3, 32, %t3; \
- stw %t3, [%dst + offset + 0x18];
-
-#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- ldx [%src + offset + 0x10], %t2; \
- ldx [%src + offset + 0x18], %t3; \
- stx %t0, [%dst + offset + 0x00]; \
- stx %t1, [%dst + offset + 0x08]; \
- stx %t2, [%dst + offset + 0x10]; \
- stx %t3, [%dst + offset + 0x18]; \
- ldx [%src + offset + 0x20], %t0; \
- ldx [%src + offset + 0x28], %t1; \
- ldx [%src + offset + 0x30], %t2; \
- ldx [%src + offset + 0x38], %t3; \
- stx %t0, [%dst + offset + 0x20]; \
- stx %t1, [%dst + offset + 0x28]; \
- stx %t2, [%dst + offset + 0x30]; \
- stx %t3, [%dst + offset + 0x38];
-
-#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x10], %t0; \
- ldx [%src - offset - 0x08], %t1; \
- stw %t0, [%dst - offset - 0x0c]; \
- srlx %t0, 32, %t2; \
- stw %t2, [%dst - offset - 0x10]; \
- stw %t1, [%dst - offset - 0x04]; \
- srlx %t1, 32, %t3; \
- stw %t3, [%dst - offset - 0x08];
-
-#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- ldx [%src - offset - 0x10], %t0; \
- ldx [%src - offset - 0x08], %t1; \
- stx %t0, [%dst - offset - 0x10]; \
- stx %t1, [%dst - offset - 0x08];
-
- /* Macros for non-VIS memmove code. */
-#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stw %t0, [%dst - offset - 0x1c]; \
- srlx %t0, 32, %t0; \
- stw %t0, [%dst - offset - 0x20]; \
- stw %t1, [%dst - offset - 0x14]; \
- srlx %t1, 32, %t1; \
- stw %t1, [%dst - offset - 0x18]; \
- stw %t2, [%dst - offset - 0x0c]; \
- srlx %t2, 32, %t2; \
- stw %t2, [%dst - offset - 0x10]; \
- stw %t3, [%dst - offset - 0x04]; \
- srlx %t3, 32, %t3; \
- stw %t3, [%dst - offset - 0x08];
-
-#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stx %t0, [%dst - offset - 0x20]; \
- stx %t1, [%dst - offset - 0x18]; \
- stx %t2, [%dst - offset - 0x10]; \
- stx %t3, [%dst - offset - 0x08]; \
- ldx [%src - offset - 0x40], %t0; \
- ldx [%src - offset - 0x38], %t1; \
- ldx [%src - offset - 0x30], %t2; \
- ldx [%src - offset - 0x28], %t3; \
- stx %t0, [%dst - offset - 0x40]; \
- stx %t1, [%dst - offset - 0x38]; \
- stx %t2, [%dst - offset - 0x30]; \
- stx %t3, [%dst - offset - 0x28];
-
-#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stw %t0, [%dst + offset + 0x04]; \
- srlx %t0, 32, %t2; \
- stw %t2, [%dst + offset + 0x00]; \
- stw %t1, [%dst + offset + 0x0c]; \
- srlx %t1, 32, %t3; \
- stw %t3, [%dst + offset + 0x08];
-
-#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stx %t0, [%dst + offset + 0x00]; \
- stx %t1, [%dst + offset + 0x08];
-
- .text
- .align 32
-
-#ifdef __UCLIBC_SUSV3_LEGACY__
-ENTRY(bcopy)
- sub %o1, %o0, %o4 /* IEU0 Group */
- mov %o0, %g3 /* IEU1 */
- cmp %o4, %o2 /* IEU1 Group */
- mov %o1, %o0 /* IEU0 */
- bgeu,pt %XCC, 210f /* CTI */
- mov %g3, %o1 /* IEU0 Group */
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 */
-#endif
- brnz,pn %o2, 220f /* CTI Group */
- add %o0, %o2, %o0 /* IEU0 */
- retl
- nop
-END(bcopy)
-#endif
-
- .align 32
-200: be,pt %xcc, 201f /* CTI */
- andcc %o0, 0x38, %g5 /* IEU1 Group */
- mov 8, %g1 /* IEU0 */
- sub %g1, %g2, %g2 /* IEU0 Group */
- andcc %o0, 1, %g0 /* IEU1 */
- be,pt %icc, 2f /* CTI */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1], %o5 /* Load Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- be,pn %xcc, 3f /* CTI */
- stb %o5, [%o0 - 1] /* Store */
-2: ldub [%o1], %o5 /* Load Group */
- add %o0, 2, %o0 /* IEU0 */
- ldub [%o1 + 1], %g3 /* Load Group */
- subcc %g2, 2, %g2 /* IEU1 Group */
- stb %o5, [%o0 - 2] /* Store */
- add %o1, 2, %o1 /* IEU0 */
- bne,pt %xcc, 2b /* CTI Group */
- stb %g3, [%o0 - 1] /* Store */
-3: andcc %o0, 0x38, %g5 /* IEU1 Group */
-201: be,pt %icc, 202f /* CTI */
- mov 64, %g1 /* IEU0 */
- fmovd %f0, %f2 /* FPU */
- sub %g1, %g5, %g5 /* IEU0 Group */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
- sub %o2, %g5, %o2 /* IEU0 */
-1: ldd [%g1 + 0x8], %f6 /* Load Group */
- add %g1, 0x8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 202f /* CTI */
- add %o0, 8, %o0 /* IEU1 */
- ldd [%g1 + 0x8], %f4 /* Load Group */
- add %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 */
- bne,pt %xcc, 1b /* CTI Group */
- add %o0, 8, %o0 /* IEU0 */
-202: membar #LoadStore | #StoreStore | #StoreLoad /* LSU Group */
- wr %g0, ASI_BLK_P, %asi /* LSU Group */
- subcc %o2, 0x40, %g6 /* IEU1 Group */
- mov %o1, %g1 /* IEU0 */
- andncc %g6, (0x40 - 1), %g6 /* IEU1 Group */
- srl %g1, 3, %g2 /* IEU0 */
- sub %o2, %g6, %g3 /* IEU0 Group */
- andn %o1, (0x40 - 1), %o1 /* IEU1 */
- and %g2, 7, %g2 /* IEU0 Group */
- andncc %g3, 0x7, %g3 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- sub %g3, 0x10, %g3 /* IEU0 Group */
- sub %o2, %g6, %o2 /* IEU1 */
- alignaddr %g1, %g0, %g0 /* GRU Group */
- add %g1, %g6, %g1 /* IEU0 Group */
- subcc %o2, %g3, %o2 /* IEU1 */
- ldda [%o1 + 0x00] %asi, %f0 /* LSU Group */
- add %g1, %g3, %g1 /* IEU0 */
- ldda [%o1 + 0x40] %asi, %f16 /* LSU Group */
- sub %g6, 0x80, %g6 /* IEU0 */
- ldda [%o1 + 0x80] %asi, %f32 /* LSU Group */
- /* Clk1 Group 8-( */
- /* Clk2 Group 8-( */
- /* Clk3 Group 8-( */
- /* Clk4 Group 8-( */
-203: rd %pc, %g5 /* PDU Group 8-( */
- addcc %g5, %lo(300f - 203b), %g5 /* IEU1 Group */
- sll %g2, 9, %g2 /* IEU0 */
- jmpl %g5 + %g2, %g0 /* CTI Group brk forced*/
- addcc %o1, 0xc0, %o1 /* IEU1 Group */
-
- .align 512 /* OK, here comes the fun part... */
-300: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) LOOP_CHUNK1(o1, o0, g6, 301f)
- FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) LOOP_CHUNK2(o1, o0, g6, 302f)
- FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) LOOP_CHUNK3(o1, o0, g6, 303f)
- b,pt %xcc, 300b+4; faligndata %f0, %f2, %f48
-301: FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_JUMP(o0, f48, 400f) membar #Sync
-302: FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_JUMP(o0, f48, 416f) membar #Sync
-303: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) STORE_JUMP(o0, f48, 432f) membar #Sync
- VISLOOP_PAD
-310: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) LOOP_CHUNK1(o1, o0, g6, 311f)
- FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) LOOP_CHUNK2(o1, o0, g6, 312f)
- FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) LOOP_CHUNK3(o1, o0, g6, 313f)
- b,pt %xcc, 310b+4; faligndata %f2, %f4, %f48
-311: FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_JUMP(o0, f48, 402f) membar #Sync
-312: FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_JUMP(o0, f48, 418f) membar #Sync
-313: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) STORE_JUMP(o0, f48, 434f) membar #Sync
- VISLOOP_PAD
-320: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) LOOP_CHUNK1(o1, o0, g6, 321f)
- FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) LOOP_CHUNK2(o1, o0, g6, 322f)
- FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) LOOP_CHUNK3(o1, o0, g6, 323f)
- b,pt %xcc, 320b+4; faligndata %f4, %f6, %f48
-321: FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_JUMP(o0, f48, 404f) membar #Sync
-322: FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_JUMP(o0, f48, 420f) membar #Sync
-323: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) STORE_JUMP(o0, f48, 436f) membar #Sync
- VISLOOP_PAD
-330: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) LOOP_CHUNK1(o1, o0, g6, 331f)
- FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) LOOP_CHUNK2(o1, o0, g6, 332f)
- FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) LOOP_CHUNK3(o1, o0, g6, 333f)
- b,pt %xcc, 330b+4; faligndata %f6, %f8, %f48
-331: FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_JUMP(o0, f48, 406f) membar #Sync
-332: FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_JUMP(o0, f48, 422f) membar #Sync
-333: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) STORE_JUMP(o0, f48, 438f) membar #Sync
- VISLOOP_PAD
-340: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) LOOP_CHUNK1(o1, o0, g6, 341f)
- FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) LOOP_CHUNK2(o1, o0, g6, 342f)
- FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) LOOP_CHUNK3(o1, o0, g6, 343f)
- b,pt %xcc, 340b+4; faligndata %f8, %f10, %f48
-341: FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_JUMP(o0, f48, 408f) membar #Sync
-342: FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_JUMP(o0, f48, 424f) membar #Sync
-343: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) STORE_JUMP(o0, f48, 440f) membar #Sync
- VISLOOP_PAD
-350: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) LOOP_CHUNK1(o1, o0, g6, 351f)
- FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) LOOP_CHUNK2(o1, o0, g6, 352f)
- FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) LOOP_CHUNK3(o1, o0, g6, 353f)
- b,pt %xcc, 350b+4; faligndata %f10, %f12, %f48
-351: FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_JUMP(o0, f48, 410f) membar #Sync
-352: FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_JUMP(o0, f48, 426f) membar #Sync
-353: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) STORE_JUMP(o0, f48, 442f) membar #Sync
- VISLOOP_PAD
-360: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) LOOP_CHUNK1(o1, o0, g6, 361f)
- FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) LOOP_CHUNK2(o1, o0, g6, 362f)
- FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) LOOP_CHUNK3(o1, o0, g6, 363f)
- b,pt %xcc, 360b+4; faligndata %f12, %f14, %f48
-361: FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_JUMP(o0, f48, 412f) membar #Sync
-362: FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_JUMP(o0, f48, 428f) membar #Sync
-363: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) STORE_JUMP(o0, f48, 444f) membar #Sync
- VISLOOP_PAD
-370: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) LOOP_CHUNK1(o1, o0, g6, 371f)
- FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) LOOP_CHUNK2(o1, o0, g6, 372f)
- FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) LOOP_CHUNK3(o1, o0, g6, 373f)
- b,pt %xcc, 370b+4; faligndata %f14, %f16, %f48
-371: FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_JUMP(o0, f48, 414f) membar #Sync
-372: FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_JUMP(o0, f48, 430f) membar #Sync
-373: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) STORE_SYNC(o0, f48) membar #Sync
- FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) STORE_JUMP(o0, f48, 446f) membar #Sync
- VISLOOP_PAD
-400: FINISH_VISCHUNK(o0, f0, f2, g3)
-402: FINISH_VISCHUNK(o0, f2, f4, g3)
-404: FINISH_VISCHUNK(o0, f4, f6, g3)
-406: FINISH_VISCHUNK(o0, f6, f8, g3)
-408: FINISH_VISCHUNK(o0, f8, f10, g3)
-410: FINISH_VISCHUNK(o0, f10, f12, g3)
-412: FINISH_VISCHUNK(o0, f12, f14, g3)
-414: UNEVEN_VISCHUNK(o0, f14, f0, g3)
-416: FINISH_VISCHUNK(o0, f16, f18, g3)
-418: FINISH_VISCHUNK(o0, f18, f20, g3)
-420: FINISH_VISCHUNK(o0, f20, f22, g3)
-422: FINISH_VISCHUNK(o0, f22, f24, g3)
-424: FINISH_VISCHUNK(o0, f24, f26, g3)
-426: FINISH_VISCHUNK(o0, f26, f28, g3)
-428: FINISH_VISCHUNK(o0, f28, f30, g3)
-430: UNEVEN_VISCHUNK(o0, f30, f0, g3)
-432: FINISH_VISCHUNK(o0, f32, f34, g3)
-434: FINISH_VISCHUNK(o0, f34, f36, g3)
-436: FINISH_VISCHUNK(o0, f36, f38, g3)
-438: FINISH_VISCHUNK(o0, f38, f40, g3)
-440: FINISH_VISCHUNK(o0, f40, f42, g3)
-442: FINISH_VISCHUNK(o0, f42, f44, g3)
-444: FINISH_VISCHUNK(o0, f44, f46, g3)
-446: UNEVEN_VISCHUNK(o0, f46, f0, g3)
-204: ldd [%o1], %f2 /* Load Group */
- add %o1, 8, %o1 /* IEU0 */
- subcc %g3, 8, %g3 /* IEU1 */
- faligndata %f0, %f2, %f8 /* GRU Group */
- std %f8, [%o0] /* Store */
- bl,pn %xcc, 205f /* CTI */
- add %o0, 8, %o0 /* IEU0 Group */
- ldd [%o1], %f0 /* Load Group */
- add %o1, 8, %o1 /* IEU0 */
- subcc %g3, 8, %g3 /* IEU1 */
- faligndata %f2, %f0, %f8 /* GRU Group */
- std %f8, [%o0] /* Store */
- bge,pt %xcc, 204b /* CTI */
- add %o0, 8, %o0 /* IEU0 Group */
-205: brz,pt %o2, 207f /* CTI Group */
- mov %g1, %o1 /* IEU0 */
-206: ldub [%o1], %g5 /* LOAD */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 206b /* CTI */
- stb %g5, [%o0 - 1] /* Store Group */
-207: membar #StoreLoad | #StoreStore /* LSU Group */
- wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-
-208: andcc %o2, 1, %g0 /* IEU1 Group */
- be,pt %icc, 2f+4 /* CTI */
-1: ldub [%o1], %g5 /* LOAD Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 Group */
- be,pn %xcc, 209f /* CTI */
- stb %g5, [%o0 - 1] /* Store */
-2: ldub [%o1], %g5 /* LOAD Group */
- add %o0, 2, %o0 /* IEU0 */
- ldub [%o1 + 1], %o5 /* LOAD Group */
- add %o1, 2, %o1 /* IEU0 */
- subcc %o2, 2, %o2 /* IEU1 Group */
- stb %g5, [%o0 - 2] /* Store */
- bne,pt %xcc, 2b /* CTI */
- stb %o5, [%o0 - 1] /* Store */
-209: retl
- mov %g4, %o0
-
-#ifdef USE_BPR
-
- /* void *__align_cpy_4(void *dest, void *src, size_t n)
- * SPARC v9 SYSV ABI
- * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 3))
- */
-
- .align 32
-ENTRY(__align_cpy_4)
- mov %o0, %g4 /* IEU0 Group */
- cmp %o2, 15 /* IEU1 */
- bleu,pn %xcc, 208b /* CTI */
- cmp %o2, (64 * 6) /* IEU1 Group */
- bgeu,pn %xcc, 200b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- ba,pt %xcc, 216f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
-END(__align_cpy_4)
-
- /* void *__align_cpy_8(void *dest, void *src, size_t n)
- * SPARC v9 SYSV ABI
- * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 7))
- */
-
- .align 32
-ENTRY(__align_cpy_8)
- mov %o0, %g4 /* IEU0 Group */
- cmp %o2, 15 /* IEU1 */
- bleu,pn %xcc, 208b /* CTI */
- cmp %o2, (64 * 6) /* IEU1 Group */
- bgeu,pn %xcc, 201b /* CTI */
- andcc %o0, 0x38, %g5 /* IEU1 Group */
- andcc %o2, -128, %g6 /* IEU1 Group */
- bne,a,pt %xcc, 82f + 4 /* CTI */
- ldx [%o1], %g1 /* Load */
- ba,pt %xcc, 41f /* CTI Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
-END(__align_cpy_8)
-
- /* void *__align_cpy_16(void *dest, void *src, size_t n)
- * SPARC v9 SYSV ABI
- * Like memcpy, but results are undefined if (!n || ((dest | src | n) & 15))
- */
-
- .align 32
-ENTRY(__align_cpy_16)
- mov %o0, %g4 /* IEU0 Group */
- cmp %o2, (64 * 6) /* IEU1 */
- bgeu,pn %xcc, 201b /* CTI */
- andcc %o0, 0x38, %g5 /* IEU1 Group */
- andcc %o2, -128, %g6 /* IEU1 Group */
- bne,a,pt %xcc, 82f + 4 /* CTI */
- ldx [%o1], %g1 /* Load */
- ba,pt %xcc, 41f /* CTI Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
-END(__align_cpy_16)
-
-#endif
-
- .align 32
-ENTRY(memcpy)
-210:
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 Group */
-#endif
- brz,pn %o2, 209b /* CTI Group */
- mov %o0, %g4 /* IEU0 */
-218: cmp %o2, 15 /* IEU1 Group */
- bleu,pn %xcc, 208b /* CTI */
- cmp %o2, (64 * 6) /* IEU1 Group */
- bgeu,pn %xcc, 200b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- sub %o0, %o1, %g5 /* IEU0 */
- andcc %g5, 3, %o5 /* IEU1 Group */
- bne,pn %xcc, 212f /* CTI */
- andcc %o1, 3, %g0 /* IEU1 Group */
- be,a,pt %xcc, 216f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
- andcc %o1, 1, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- andcc %o1, 2, %g0 /* IEU1 Group */
- ldub [%o1], %g2 /* Load Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- sub %o2, 1, %o2 /* IEU0 Group */
- bne,pn %xcc, 5f /* CTI Group */
- stb %g2, [%o0 - 1] /* Store */
-4: lduh [%o1], %g2 /* Load Group */
- add %o1, 2, %o1 /* IEU0 */
- add %o0, 2, %o0 /* IEU1 */
- sub %o2, 2, %o2 /* IEU0 */
- sth %g2, [%o0 - 2] /* Store Group + bubble */
-5: andcc %o1, 4, %g0 /* IEU1 */
-216: be,a,pn %xcc, 2f /* CTI */
- andcc %o2, -128, %g6 /* IEU1 Group */
- lduw [%o1], %g5 /* Load Group */
- add %o1, 4, %o1 /* IEU0 */
- add %o0, 4, %o0 /* IEU1 */
- sub %o2, 4, %o2 /* IEU0 Group */
- stw %g5, [%o0 - 4] /* Store */
- andcc %o2, -128, %g6 /* IEU1 Group */
-2: be,pn %xcc, 215f /* CTI */
- andcc %o0, 4, %g0 /* IEU1 Group */
- be,pn %xcc, 82f + 4 /* CTI Group */
-5: MOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- MOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- MOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- MOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
-35: subcc %g6, 128, %g6 /* IEU1 Group */
- add %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 5b /* CTI */
- add %o0, 128, %o0 /* IEU0 Group */
-215: andcc %o2, 0x70, %g6 /* IEU1 Group */
-41: be,pn %xcc, 80f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-79: rd %pc, %o5 /* PDU Group */
- sll %g6, 1, %g5 /* IEU0 Group */
- add %o1, %g6, %o1 /* IEU1 */
- sub %o5, %g5, %o5 /* IEU0 Group */
- jmpl %o5 + %lo(80f - 79b), %g0 /* CTI Group brk forced*/
- add %o0, %g6, %o0 /* IEU0 Group */
-36: MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
-80: be,pt %xcc, 81f /* CTI */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1], %g2 /* Load Group */
- add %o0, 8, %o0 /* IEU0 */
- stw %g2, [%o0 - 0x4] /* Store Group */
- add %o1, 8, %o1 /* IEU1 */
- srlx %g2, 32, %g2 /* IEU0 Group */
- stw %g2, [%o0 - 0x8] /* Store */
-81: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1], %g2 /* Load Group */
- add %o1, 4, %o1 /* IEU0 */
- stw %g2, [%o0] /* Store Group */
- add %o0, 4, %o0 /* IEU0 */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1], %g2 /* Load Group */
- add %o1, 2, %o1 /* IEU0 */
- sth %g2, [%o0] /* Store Group */
- add %o0, 2, %o0 /* IEU0 */
-1: be,pt %xcc, 211f /* CTI */
- nop /* IEU1 */
- ldub [%o1], %g2 /* Load Group */
- stb %g2, [%o0] /* Store Group + bubble */
-211: retl
- mov %g4, %o0
-
-82: MOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- MOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
-37: subcc %g6, 128, %g6 /* IEU1 Group */
- add %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 82b /* CTI */
- add %o0, 128, %o0 /* IEU0 Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
- be,pn %xcc, 84f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-83: rd %pc, %o5 /* PDU Group */
- add %o1, %g6, %o1 /* IEU0 Group */
- sub %o5, %g6, %o5 /* IEU1 */
- jmpl %o5 + %lo(84f - 83b), %g0 /* CTI Group brk forced*/
- add %o0, %g6, %o0 /* IEU0 Group */
-38: MOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- MOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
-84: be,pt %xcc, 85f /* CTI Group */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1], %g2 /* Load Group */
- add %o0, 8, %o0 /* IEU0 */
- add %o1, 8, %o1 /* IEU0 Group */
- stx %g2, [%o0 - 0x8] /* Store */
-85: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1], %g2 /* Load Group */
- add %o0, 4, %o0 /* IEU0 */
- add %o1, 4, %o1 /* IEU0 Group */
- stw %g2, [%o0 - 0x4] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1], %g2 /* Load Group */
- add %o0, 2, %o0 /* IEU0 */
- add %o1, 2, %o1 /* IEU0 Group */
- sth %g2, [%o0 - 0x2] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- nop /* IEU0 Group */
- ldub [%o1], %g2 /* Load Group */
- stb %g2, [%o0] /* Store Group + bubble */
-1: retl
- mov %g4, %o0
-
-212: brz,pt %g2, 2f /* CTI Group */
- mov 8, %g1 /* IEU0 */
- sub %g1, %g2, %g2 /* IEU0 Group */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1], %g5 /* Load Group */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- bne,pt %xcc, 1b /* CTI */
- stb %g5, [%o0 - 1] /* Store */
-2: andn %o2, 7, %g5 /* IEU0 Group */
- and %o2, 7, %o2 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
-1: ldd [%g1 + 0x8], %f6 /* Load Group */
- add %g1, 0x8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 213f /* CTI */
- add %o0, 8, %o0 /* IEU1 */
- ldd [%g1 + 0x8], %f4 /* Load Group */
- add %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0] /* Store */
- add %o1, 8, %o1 /* IEU0 */
- bne,pn %xcc, 1b /* CTI Group */
- add %o0, 8, %o0 /* IEU0 */
-213: brz,pn %o2, 214f /* CTI Group */
- nop /* IEU0 */
- ldub [%o1], %g5 /* LOAD */
- add %o1, 1, %o1 /* IEU0 */
- add %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 206b /* CTI */
- stb %g5, [%o0 - 1] /* Store Group */
-214: wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-END(memcpy)
-libc_hidden_def(memcpy)
-
- .align 32
-228: andcc %o2, 1, %g0 /* IEU1 Group */
- be,pt %icc, 2f+4 /* CTI */
-1: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 Group */
- be,pn %xcc, 229f /* CTI */
- stb %o5, [%o0] /* Store */
-2: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o0, 2, %o0 /* IEU0 */
- ldub [%o1 - 2], %g5 /* LOAD Group */
- sub %o1, 2, %o1 /* IEU0 */
- subcc %o2, 2, %o2 /* IEU1 Group */
- stb %o5, [%o0 + 1] /* Store */
- bne,pt %xcc, 2b /* CTI */
- stb %g5, [%o0] /* Store */
-229: retl
- mov %g4, %o0
-219: retl
- nop
-
- .align 32
-ENTRY(memmove)
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 Group */
-#endif
- brz,pn %o2, 219b /* CTI Group */
- sub %o0, %o1, %o4 /* IEU0 */
- cmp %o4, %o2 /* IEU1 Group */
- bgeu,pt %XCC, 218b /* CTI */
- mov %o0, %g4 /* IEU0 */
- add %o0, %o2, %o0 /* IEU0 Group */
-220: add %o1, %o2, %o1 /* IEU1 */
- cmp %o2, 15 /* IEU1 Group */
- bleu,pn %xcc, 228b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- sub %o0, %o1, %g5 /* IEU0 */
- andcc %g5, 3, %o5 /* IEU1 Group */
- bne,pn %xcc, 232f /* CTI */
- andcc %o1, 3, %g0 /* IEU1 Group */
- be,a,pt %xcc, 236f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
- andcc %o1, 1, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- andcc %o1, 2, %g0 /* IEU1 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- sub %o2, 1, %o2 /* IEU0 Group */
- be,pn %xcc, 5f /* CTI Group */
- stb %g2, [%o0] /* Store */
-4: lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sub %o0, 2, %o0 /* IEU1 */
- sub %o2, 2, %o2 /* IEU0 */
- sth %g2, [%o0] /* Store Group + bubble */
-5: andcc %o1, 4, %g0 /* IEU1 */
-236: be,a,pn %xcc, 2f /* CTI */
- andcc %o2, -128, %g6 /* IEU1 Group */
- lduw [%o1 - 4], %g5 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- sub %o0, 4, %o0 /* IEU1 */
- sub %o2, 4, %o2 /* IEU0 Group */
- stw %g5, [%o0] /* Store */
- andcc %o2, -128, %g6 /* IEU1 Group */
-2: be,pn %xcc, 235f /* CTI */
- andcc %o0, 4, %g0 /* IEU1 Group */
- be,pn %xcc, 282f + 4 /* CTI Group */
-5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 5b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
-235: andcc %o2, 0x70, %g6 /* IEU1 Group */
-41: be,pn %xcc, 280f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-279: rd %pc, %o5 /* PDU Group */
- sll %g6, 1, %g5 /* IEU0 Group */
- sub %o1, %g6, %o1 /* IEU1 */
- sub %o5, %g5, %o5 /* IEU0 Group */
- jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
-280: be,pt %xcc, 281f /* CTI */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- stw %g2, [%o0 + 4] /* Store Group */
- sub %o1, 8, %o1 /* IEU1 */
- srlx %g2, 32, %g2 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-281: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- stw %g2, [%o0 - 4] /* Store Group */
- sub %o0, 4, %o0 /* IEU0 */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sth %g2, [%o0 - 2] /* Store Group */
- sub %o0, 2, %o0 /* IEU0 */
-1: be,pt %xcc, 211f /* CTI */
- nop /* IEU1 */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-211: retl
- mov %g4, %o0
-
-282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 282b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
- be,pn %xcc, 284f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-283: rd %pc, %o5 /* PDU Group */
- sub %o1, %g6, %o1 /* IEU0 Group */
- sub %o5, %g6, %o5 /* IEU1 */
- jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
-284: be,pt %xcc, 285f /* CTI Group */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- sub %o1, 8, %o1 /* IEU0 Group */
- stx %g2, [%o0] /* Store */
-285: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o0, 4, %o0 /* IEU0 */
- sub %o1, 4, %o1 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o0, 2, %o0 /* IEU0 */
- sub %o1, 2, %o1 /* IEU0 Group */
- sth %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- nop /* IEU0 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-1: retl
- mov %g4, %o0
-
-232: brz,pt %g2, 2f /* CTI Group */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1 - 1], %g5 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- bne,pt %xcc, 1b /* CTI */
- stb %g5, [%o0] /* Store */
-2: andn %o2, 7, %g5 /* IEU0 Group */
- and %o2, 7, %o2 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
-1: ldd [%g1 - 8], %f6 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 233f /* CTI */
- sub %o0, 8, %o0 /* IEU1 */
- ldd [%g1 - 8], %f4 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 */
- bne,pn %xcc, 1b /* CTI Group */
- sub %o0, 8, %o0 /* IEU0 */
-233: brz,pn %o2, 234f /* CTI Group */
- nop /* IEU0 */
-237: ldub [%o1 - 1], %g5 /* LOAD */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 237b /* CTI */
- stb %g5, [%o0] /* Store Group */
-234: wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-END(memmove)
-libc_hidden_def(memmove)
-
-#ifdef USE_BPR
-weak_alias(memcpy,__align_cpy_1)
-weak_alias(memcpy,__align_cpy_2)
-#endif
diff --git a/libc/string/sparc/sparc64/memset.S b/libc/string/sparc/sparc64/memset.S
deleted file mode 100644
index f76a637..0000000
--- a/libc/string/sparc/sparc64/memset.S
+++ /dev/null
@@ -1,316 +0,0 @@
-/* Set a block of memory to some byte value.
- For UltraSPARC.
- Copyright (C) 1996, 97, 98, 99, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller (davem(a)caip.rutgers.edu) and
- Jakub Jelinek (jj(a)ultra.linux.cz)
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <features.h>
-#include <asm/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
-#endif
-#define FPRS_FEF 4
-
-#define SET_BLOCKS(base, offset, source) \
- stx source, [base - offset - 0x18]; \
- stx source, [base - offset - 0x10]; \
- stx source, [base - offset - 0x08]; \
- stx source, [base - offset - 0x00];
-
- /* Well, memset is a lot easier to get right than bcopy... */
- .text
- .align 32
-ENTRY(memset)
- andcc %o1, 0xff, %o1
- mov %o0, %o5
- be,a,pt %icc, 50f
-#ifndef USE_BPR
- srl %o2, 0, %o1
-#else
- mov %o2, %o1
-#endif
- cmp %o2, 7
-#ifndef USE_BPR
- srl %o2, 0, %o2
-#endif
- bleu,pn %XCC, 17f
- andcc %o0, 3, %g5
- be,pt %xcc, 4f
- and %o1, 0xff, %o1
- cmp %g5, 3
- be,pn %xcc, 2f
- stb %o1, [%o0 + 0x00]
- cmp %g5, 2
- be,pt %xcc, 2f
- stb %o1, [%o0 + 0x01]
- stb %o1, [%o0 + 0x02]
-2: sub %g5, 4, %g5
- sub %o0, %g5, %o0
- add %o2, %g5, %o2
-4: sllx %o1, 8, %g1
- andcc %o0, 4, %g0
- or %o1, %g1, %o1
- sllx %o1, 16, %g1
- or %o1, %g1, %o1
- be,pt %xcc, 2f
- sllx %o1, 32, %g1
- stw %o1, [%o0]
- sub %o2, 4, %o2
- add %o0, 4, %o0
-2: cmp %o2, 128
- or %o1, %g1, %o1
- blu,pn %xcc, 9f
- andcc %o0, 0x38, %g5
- be,pn %icc, 6f
- mov 64, %o4
- andcc %o0, 8, %g0
- be,pn %icc, 1f
- sub %o4, %g5, %o4
- stx %o1, [%o0]
- add %o0, 8, %o0
-1: andcc %o4, 16, %g0
- be,pn %icc, 1f
- sub %o2, %o4, %o2
- stx %o1, [%o0]
- stx %o1, [%o0 + 8]
- add %o0, 16, %o0
-1: andcc %o4, 32, %g0
- be,pn %icc, 7f
- andncc %o2, 0x3f, %o3
- stw %o1, [%o0]
- stw %o1, [%o0 + 4]
- stw %o1, [%o0 + 8]
- stw %o1, [%o0 + 12]
- stw %o1, [%o0 + 16]
- stw %o1, [%o0 + 20]
- stw %o1, [%o0 + 24]
- stw %o1, [%o0 + 28]
- add %o0, 32, %o0
-7: be,pn %xcc, 9f
- nop
- ldd [%o0 - 8], %f0
-18: wr %g0, ASI_BLK_P, %asi
- membar #StoreStore | #LoadStore
- andcc %o3, 0xc0, %g5
- and %o2, 0x3f, %o2
- fmovd %f0, %f2
- fmovd %f0, %f4
- andn %o3, 0xff, %o3
- fmovd %f0, %f6
- cmp %g5, 64
- fmovd %f0, %f8
- fmovd %f0, %f10
- fmovd %f0, %f12
- brz,pn %g5, 10f
- fmovd %f0, %f14
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x00] %asi
- cmp %g5, 128
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
-2: brz,pn %o3, 12f
- add %o0, %g5, %o0
-10: stda %f0, [%o0 + 0x00] %asi
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
- stda %f0, [%o0 + 0xc0] %asi
-11: subcc %o3, 256, %o3
- bne,pt %xcc, 10b
- add %o0, 256, %o0
-12: wr %g0, FPRS_FEF, %fprs
- membar #StoreLoad | #StoreStore
-9: andcc %o2, 0x78, %g5
- be,pn %xcc, 13f
- andcc %o2, 7, %o2
-14: rd %pc, %o4
- srl %g5, 1, %o3
- sub %o4, %o3, %o4
- jmpl %o4 + (13f - 14b), %g0
- add %o0, %g5, %o0
-12: SET_BLOCKS (%o0, 0x68, %o1)
- SET_BLOCKS (%o0, 0x48, %o1)
- SET_BLOCKS (%o0, 0x28, %o1)
- SET_BLOCKS (%o0, 0x08, %o1)
-13: be,pn %xcc, 8f
- andcc %o2, 4, %g0
- be,pn %xcc, 1f
- andcc %o2, 2, %g0
- stw %o1, [%o0]
- add %o0, 4, %o0
-1: be,pn %xcc, 1f
- andcc %o2, 1, %g0
- sth %o1, [%o0]
- add %o0, 2, %o0
-1: bne,a,pn %xcc, 8f
- stb %o1, [%o0]
-8: retl
- mov %o5, %o0
-17: brz,pn %o2, 0f
-8: add %o0, 1, %o0
- subcc %o2, 1, %o2
- bne,pt %xcc, 8b
- stb %o1, [%o0 - 1]
-0: retl
- mov %o5, %o0
-
-6: stx %o1, [%o0]
- andncc %o2, 0x3f, %o3
- be,pn %xcc, 9b
- nop
- ba,pt %xcc, 18b
- ldd [%o0], %f0
-END(memset)
-libc_hidden_def(memset)
-
-#define ZERO_BLOCKS(base, offset, source) \
- stx source, [base - offset - 0x38]; \
- stx source, [base - offset - 0x30]; \
- stx source, [base - offset - 0x28]; \
- stx source, [base - offset - 0x20]; \
- stx source, [base - offset - 0x18]; \
- stx source, [base - offset - 0x10]; \
- stx source, [base - offset - 0x08]; \
- stx source, [base - offset - 0x00];
-
- .text
- .align 32
-#ifdef __UCLIBC_SUSV3_LEGACY__
-ENTRY(bzero)
-#ifndef USE_BPR
- srl %o1, 0, %o1
-#endif
- mov %o0, %o5
-#endif
-50: cmp %o1, 7
- bleu,pn %xcc, 17f
- andcc %o0, 3, %o2
- be,a,pt %xcc, 4f
- andcc %o0, 4, %g0
- cmp %o2, 3
- be,pn %xcc, 2f
- stb %g0, [%o0 + 0x00]
- cmp %o2, 2
- be,pt %xcc, 2f
- stb %g0, [%o0 + 0x01]
- stb %g0, [%o0 + 0x02]
-2: sub %o2, 4, %o2
- sub %o0, %o2, %o0
- add %o1, %o2, %o1
- andcc %o0, 4, %g0
-4: be,pt %xcc, 2f
- cmp %o1, 128
- stw %g0, [%o0]
- sub %o1, 4, %o1
- add %o0, 4, %o0
-2: blu,pn %xcc, 9f
- andcc %o0, 0x38, %o2
- be,pn %icc, 6f
- mov 64, %o4
- andcc %o0, 8, %g0
- be,pn %icc, 1f
- sub %o4, %o2, %o4
- stx %g0, [%o0]
- add %o0, 8, %o0
-1: andcc %o4, 16, %g0
- be,pn %icc, 1f
- sub %o1, %o4, %o1
- stx %g0, [%o0]
- stx %g0, [%o0 + 8]
- add %o0, 16, %o0
-1: andcc %o4, 32, %g0
- be,pn %icc, 7f
- andncc %o1, 0x3f, %o3
- stx %g0, [%o0]
- stx %g0, [%o0 + 8]
- stx %g0, [%o0 + 16]
- stx %g0, [%o0 + 24]
- add %o0, 32, %o0
-6: andncc %o1, 0x3f, %o3
-7: be,pn %xcc, 9f
- wr %g0, ASI_BLK_P, %asi
- membar #StoreLoad | #StoreStore | #LoadStore
- fzero %f0
- andcc %o3, 0xc0, %o2
- and %o1, 0x3f, %o1
- fzero %f2
- andn %o3, 0xff, %o3
- faddd %f0, %f2, %f4
- fmuld %f0, %f2, %f6
- cmp %o2, 64
- faddd %f0, %f2, %f8
- fmuld %f0, %f2, %f10
- faddd %f0, %f2, %f12
- brz,pn %o2, 10f
- fmuld %f0, %f2, %f14
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x00] %asi
- cmp %o2, 128
- be,pn %icc, 2f
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
-2: brz,pn %o3, 12f
- add %o0, %o2, %o0
-10: stda %f0, [%o0 + 0x00] %asi
- stda %f0, [%o0 + 0x40] %asi
- stda %f0, [%o0 + 0x80] %asi
- stda %f0, [%o0 + 0xc0] %asi
-11: subcc %o3, 256, %o3
- bne,pt %xcc, 10b
- add %o0, 256, %o0
-12: wr %g0, FPRS_FEF, %fprs
- membar #StoreLoad | #StoreStore
-9: andcc %o1, 0xf8, %o2
- be,pn %xcc, 13f
- andcc %o1, 7, %o1
-14: rd %pc, %o4
- srl %o2, 1, %o3
- sub %o4, %o3, %o4
- jmpl %o4 + (13f - 14b), %g0
- add %o0, %o2, %o0
-12: ZERO_BLOCKS (%o0, 0xc8, %g0)
- ZERO_BLOCKS (%o0, 0x88, %g0)
- ZERO_BLOCKS (%o0, 0x48, %g0)
- ZERO_BLOCKS (%o0, 0x08, %g0)
-13: be,pn %xcc, 8f
- andcc %o1, 4, %g0
- be,pn %xcc, 1f
- andcc %o1, 2, %g0
- stw %g0, [%o0]
- add %o0, 4, %o0
-1: be,pn %xcc, 1f
- andcc %o1, 1, %g0
- sth %g0, [%o0]
- add %o0, 2, %o0
-1: bne,a,pn %xcc, 8f
- stb %g0, [%o0]
-8: retl
- mov %o5, %o0
-17: be,pn %xcc, 13b
- orcc %o1, 0, %g0
- be,pn %xcc, 0f
-8: add %o0, 1, %o0
- subcc %o1, 1, %o1
- bne,pt %xcc, 8b
- stb %g0, [%o0 - 1]
-0: retl
- mov %o5, %o0
-#ifdef __UCLIBC_SUSV3_LEGACY__
-END(bzero)
-#endif
diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
deleted file mode 100644
index 8bbdc84..0000000
--- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S
+++ /dev/null
@@ -1,611 +0,0 @@
-/* Copy SIZE bytes from SRC to DEST.
- For UltraSPARC-III.
- Copyright (C) 2001, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller (davem(a)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 <features.h>
-
-#define ASI_BLK_P 0xf0
-#define FPRS_FEF 0x04
-#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
-#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
-
-#ifndef XCC
-#define USE_BPR
-#define XCC xcc
-#endif
-
- .register %g2,#scratch
- .register %g3,#scratch
- .register %g6,#scratch
-
- .text
- .align 32
-
-#ifdef __UCLIBC_SUSV3_LEGACY__
-ENTRY(bcopy)
- sub %o1, %o0, %o4
- mov %o0, %g4
- cmp %o4, %o2
- mov %o1, %o0
- bgeu,pt %XCC, 100f
- mov %g4, %o1
-#ifndef USE_BPR
- srl %o2, 0, %o2
-#endif
- brnz,pn %o2, 220f
- add %o0, %o2, %o0
- retl
- nop
-END(bcopy)
-#endif
-
- /* Special/non-trivial issues of this code:
- *
- * 1) %o5 is preserved from VISEntryHalf to VISExitHalf
- * 2) Only low 32 FPU registers are used so that only the
- * lower half of the FPU register set is dirtied by this
- * code. This is especially important in the kernel.
- * 3) This code never prefetches cachelines past the end
- * of the source buffer.
- *
- * The cheetah's flexible spine, oversized liver, enlarged heart,
- * slender muscular body, and claws make it the swiftest hunter
- * in Africa and the fastest animal on land. Can reach speeds
- * of up to 2.4GB per second.
- */
- .align 32
-ENTRY(memcpy)
-
-100: /* %o0=dst, %o1=src, %o2=len */
- mov %o0, %g5
- cmp %o2, 0
- be,pn %XCC, out
-218: or %o0, %o1, %o3
- cmp %o2, 16
- bleu,a,pn %XCC, small_copy
- or %o3, %o2, %o3
-
- cmp %o2, 256
- blu,pt %XCC, medium_copy
- andcc %o3, 0x7, %g0
-
- ba,pt %xcc, enter
- andcc %o0, 0x3f, %g2
-
- /* Here len >= 256 and condition codes reflect execution
- * of "andcc %o0, 0x7, %g2", done by caller.
- */
- .align 64
-enter:
- /* Is 'dst' already aligned on an 64-byte boundary? */
- be,pt %XCC, 2f
-
- /* Compute abs((dst & 0x3f) - 0x40) into %g2. This is the number
- * of bytes to copy to make 'dst' 64-byte aligned. We pre-
- * subtract this from 'len'.
- */
- sub %g2, 0x40, %g2
- sub %g0, %g2, %g2
- sub %o2, %g2, %o2
-
- /* Copy %g2 bytes from src to dst, one byte at a time. */
-1: ldub [%o1 + 0x00], %o3
- add %o1, 0x1, %o1
- add %o0, 0x1, %o0
- subcc %g2, 0x1, %g2
-
- bg,pt %XCC, 1b
- stb %o3, [%o0 + -1]
-
-2: VISEntryHalf
- and %o1, 0x7, %g1
- ba,pt %xcc, begin
- alignaddr %o1, %g0, %o1
-
- .align 64
-begin:
- prefetch [%o1 + 0x000], #one_read
- prefetch [%o1 + 0x040], #one_read
- andn %o2, (0x40 - 1), %o4
- prefetch [%o1 + 0x080], #one_read
- prefetch [%o1 + 0x0c0], #one_read
- ldd [%o1 + 0x000], %f0
- prefetch [%o1 + 0x100], #one_read
- ldd [%o1 + 0x008], %f2
- prefetch [%o1 + 0x140], #one_read
- ldd [%o1 + 0x010], %f4
- prefetch [%o1 + 0x180], #one_read
- faligndata %f0, %f2, %f16
- ldd [%o1 + 0x018], %f6
- faligndata %f2, %f4, %f18
- ldd [%o1 + 0x020], %f8
- faligndata %f4, %f6, %f20
- ldd [%o1 + 0x028], %f10
- faligndata %f6, %f8, %f22
-
- ldd [%o1 + 0x030], %f12
- faligndata %f8, %f10, %f24
- ldd [%o1 + 0x038], %f14
- faligndata %f10, %f12, %f26
- ldd [%o1 + 0x040], %f0
-
- sub %o4, 0x80, %o4
- add %o1, 0x40, %o1
- ba,pt %xcc, loop
- srl %o4, 6, %o3
-
- .align 64
-loop:
- ldd [%o1 + 0x008], %f2
- faligndata %f12, %f14, %f28
- ldd [%o1 + 0x010], %f4
- faligndata %f14, %f0, %f30
- stda %f16, [%o0] ASI_BLK_P
- ldd [%o1 + 0x018], %f6
- faligndata %f0, %f2, %f16
-
- ldd [%o1 + 0x020], %f8
- faligndata %f2, %f4, %f18
- ldd [%o1 + 0x028], %f10
- faligndata %f4, %f6, %f20
- ldd [%o1 + 0x030], %f12
- faligndata %f6, %f8, %f22
- ldd [%o1 + 0x038], %f14
- faligndata %f8, %f10, %f24
-
- ldd [%o1 + 0x040], %f0
- prefetch [%o1 + 0x180], #one_read
- faligndata %f10, %f12, %f26
- subcc %o3, 0x01, %o3
- add %o1, 0x40, %o1
- bg,pt %XCC, loop
- add %o0, 0x40, %o0
-
- /* Finally we copy the last full 64-byte block. */
-loopfini:
- ldd [%o1 + 0x008], %f2
- faligndata %f12, %f14, %f28
- ldd [%o1 + 0x010], %f4
- faligndata %f14, %f0, %f30
- stda %f16, [%o0] ASI_BLK_P
- ldd [%o1 + 0x018], %f6
- faligndata %f0, %f2, %f16
- ldd [%o1 + 0x020], %f8
- faligndata %f2, %f4, %f18
- ldd [%o1 + 0x028], %f10
- faligndata %f4, %f6, %f20
- ldd [%o1 + 0x030], %f12
- faligndata %f6, %f8, %f22
- ldd [%o1 + 0x038], %f14
- faligndata %f8, %f10, %f24
- cmp %g1, 0
- be,pt %XCC, 1f
- add %o0, 0x40, %o0
- ldd [%o1 + 0x040], %f0
-1: faligndata %f10, %f12, %f26
- faligndata %f12, %f14, %f28
- faligndata %f14, %f0, %f30
- stda %f16, [%o0] ASI_BLK_P
- add %o0, 0x40, %o0
- add %o1, 0x40, %o1
- membar #Sync
-
- /* Now we copy the (len modulo 64) bytes at the end.
- * Note how we borrow the %f0 loaded above.
- *
- * Also notice how this code is careful not to perform a
- * load past the end of the src buffer.
- */
-loopend:
- and %o2, 0x3f, %o2
- andcc %o2, 0x38, %g2
- be,pn %XCC, endcruft
- subcc %g2, 0x8, %g2
- be,pn %XCC, endcruft
- cmp %g1, 0
-
- be,a,pt %XCC, 1f
- ldd [%o1 + 0x00], %f0
-
-1: ldd [%o1 + 0x08], %f2
- add %o1, 0x8, %o1
- sub %o2, 0x8, %o2
- subcc %g2, 0x8, %g2
- faligndata %f0, %f2, %f8
- std %f8, [%o0 + 0x00]
- be,pn %XCC, endcruft
- add %o0, 0x8, %o0
- ldd [%o1 + 0x08], %f0
- add %o1, 0x8, %o1
- sub %o2, 0x8, %o2
- subcc %g2, 0x8, %g2
- faligndata %f2, %f0, %f8
- std %f8, [%o0 + 0x00]
- bne,pn %XCC, 1b
- add %o0, 0x8, %o0
-
- /* If anything is left, we copy it one byte at a time.
- * Note that %g1 is (src & 0x3) saved above before the
- * alignaddr was performed.
- */
-endcruft:
- cmp %o2, 0
- add %o1, %g1, %o1
- VISExitHalf
- be,pn %XCC, out
- sub %o0, %o1, %o3
-
- andcc %g1, 0x7, %g0
- bne,pn %icc, small_copy_unaligned
- andcc %o2, 0x8, %g0
- be,pt %icc, 1f
- nop
- ldx [%o1], %o5
- stx %o5, [%o1 + %o3]
- add %o1, 0x8, %o1
-
-1: andcc %o2, 0x4, %g0
- be,pt %icc, 1f
- nop
- lduw [%o1], %o5
- stw %o5, [%o1 + %o3]
- add %o1, 0x4, %o1
-
-1: andcc %o2, 0x2, %g0
- be,pt %icc, 1f
- nop
- lduh [%o1], %o5
- sth %o5, [%o1 + %o3]
- add %o1, 0x2, %o1
-
-1: andcc %o2, 0x1, %g0
- be,pt %icc, out
- nop
- ldub [%o1], %o5
- ba,pt %xcc, out
- stb %o5, [%o1 + %o3]
-
-medium_copy: /* 16 < len <= 64 */
- bne,pn %XCC, small_copy_unaligned
- sub %o0, %o1, %o3
-
-medium_copy_aligned:
- andn %o2, 0x7, %o4
- and %o2, 0x7, %o2
-1: subcc %o4, 0x8, %o4
- ldx [%o1], %o5
- stx %o5, [%o1 + %o3]
- bgu,pt %XCC, 1b
- add %o1, 0x8, %o1
- andcc %o2, 0x4, %g0
- be,pt %XCC, 1f
- nop
- sub %o2, 0x4, %o2
- lduw [%o1], %o5
- stw %o5, [%o1 + %o3]
- add %o1, 0x4, %o1
-1: cmp %o2, 0
- be,pt %XCC, out
- nop
- ba,pt %xcc, small_copy_unaligned
- nop
-
-small_copy: /* 0 < len <= 16 */
- andcc %o3, 0x3, %g0
- bne,pn %XCC, small_copy_unaligned
- sub %o0, %o1, %o3
-
-small_copy_aligned:
- subcc %o2, 4, %o2
- lduw [%o1], %g1
- stw %g1, [%o1 + %o3]
- bgu,pt %XCC, small_copy_aligned
- add %o1, 4, %o1
-
-out: retl
- mov %g5, %o0
-
- .align 32
-small_copy_unaligned:
- subcc %o2, 1, %o2
- ldub [%o1], %g1
- stb %g1, [%o1 + %o3]
- bgu,pt %XCC, small_copy_unaligned
- add %o1, 1, %o1
- retl
- mov %g5, %o0
-
-END(memcpy)
-libc_hidden_def(memcpy)
-
-#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stw %t0, [%dst - offset - 0x1c]; \
- srlx %t0, 32, %t0; \
- stw %t0, [%dst - offset - 0x20]; \
- stw %t1, [%dst - offset - 0x14]; \
- srlx %t1, 32, %t1; \
- stw %t1, [%dst - offset - 0x18]; \
- stw %t2, [%dst - offset - 0x0c]; \
- srlx %t2, 32, %t2; \
- stw %t2, [%dst - offset - 0x10]; \
- stw %t3, [%dst - offset - 0x04]; \
- srlx %t3, 32, %t3; \
- stw %t3, [%dst - offset - 0x08];
-
-#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src - offset - 0x20], %t0; \
- ldx [%src - offset - 0x18], %t1; \
- ldx [%src - offset - 0x10], %t2; \
- ldx [%src - offset - 0x08], %t3; \
- stx %t0, [%dst - offset - 0x20]; \
- stx %t1, [%dst - offset - 0x18]; \
- stx %t2, [%dst - offset - 0x10]; \
- stx %t3, [%dst - offset - 0x08]; \
- ldx [%src - offset - 0x40], %t0; \
- ldx [%src - offset - 0x38], %t1; \
- ldx [%src - offset - 0x30], %t2; \
- ldx [%src - offset - 0x28], %t3; \
- stx %t0, [%dst - offset - 0x40]; \
- stx %t1, [%dst - offset - 0x38]; \
- stx %t2, [%dst - offset - 0x30]; \
- stx %t3, [%dst - offset - 0x28];
-
-#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stw %t0, [%dst + offset + 0x04]; \
- srlx %t0, 32, %t2; \
- stw %t2, [%dst + offset + 0x00]; \
- stw %t1, [%dst + offset + 0x0c]; \
- srlx %t1, 32, %t3; \
- stw %t3, [%dst + offset + 0x08];
-
-#define RMOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1) \
- ldx [%src + offset + 0x00], %t0; \
- ldx [%src + offset + 0x08], %t1; \
- stx %t0, [%dst + offset + 0x00]; \
- stx %t1, [%dst + offset + 0x08];
-
- .align 32
-228: andcc %o2, 1, %g0 /* IEU1 Group */
- be,pt %icc, 2f+4 /* CTI */
-1: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 Group */
- be,pn %xcc, 229f /* CTI */
- stb %o5, [%o0] /* Store */
-2: ldub [%o1 - 1], %o5 /* LOAD Group */
- sub %o0, 2, %o0 /* IEU0 */
- ldub [%o1 - 2], %g5 /* LOAD Group */
- sub %o1, 2, %o1 /* IEU0 */
- subcc %o2, 2, %o2 /* IEU1 Group */
- stb %o5, [%o0 + 1] /* Store */
- bne,pt %xcc, 2b /* CTI */
- stb %g5, [%o0] /* Store */
-229: retl
- mov %g4, %o0
-
- .align 32
-ENTRY(memmove)
- mov %o0, %g5
-#ifndef USE_BPR
- srl %o2, 0, %o2 /* IEU1 Group */
-#endif
- brz,pn %o2, out /* CTI Group */
- sub %o0, %o1, %o4 /* IEU0 */
- cmp %o4, %o2 /* IEU1 Group */
- bgeu,pt %XCC, 218b /* CTI */
- mov %o0, %g4 /* IEU0 */
- add %o0, %o2, %o0 /* IEU0 Group */
-220: add %o1, %o2, %o1 /* IEU1 */
- cmp %o2, 15 /* IEU1 Group */
- bleu,pn %xcc, 228b /* CTI */
- andcc %o0, 7, %g2 /* IEU1 Group */
- sub %o0, %o1, %g5 /* IEU0 */
- andcc %g5, 3, %o5 /* IEU1 Group */
- bne,pn %xcc, 232f /* CTI */
- andcc %o1, 3, %g0 /* IEU1 Group */
- be,a,pt %xcc, 236f /* CTI */
- andcc %o1, 4, %g0 /* IEU1 Group */
- andcc %o1, 1, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- andcc %o1, 2, %g0 /* IEU1 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- sub %o2, 1, %o2 /* IEU0 Group */
- be,pn %xcc, 5f /* CTI Group */
- stb %g2, [%o0] /* Store */
-4: lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sub %o0, 2, %o0 /* IEU1 */
- sub %o2, 2, %o2 /* IEU0 */
- sth %g2, [%o0] /* Store Group + bubble */
-5: andcc %o1, 4, %g0 /* IEU1 */
-236: be,a,pn %xcc, 2f /* CTI */
- andcc %o2, -128, %g6 /* IEU1 Group */
- lduw [%o1 - 4], %g5 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- sub %o0, 4, %o0 /* IEU1 */
- sub %o2, 4, %o2 /* IEU0 Group */
- stw %g5, [%o0] /* Store */
- andcc %o2, -128, %g6 /* IEU1 Group */
-2: be,pn %xcc, 235f /* CTI */
- andcc %o0, 4, %g0 /* IEU1 Group */
- be,pn %xcc, 282f + 4 /* CTI Group */
-5: RMOVE_BIGCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x20, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- RMOVE_BIGCHUNK(o1, o0, 0x60, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 5b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
-235: andcc %o2, 0x70, %g6 /* IEU1 Group */
-41: be,pn %xcc, 280f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-279: rd %pc, %o5 /* PDU Group */
- sll %g6, 1, %g5 /* IEU0 Group */
- sub %o1, %g6, %o1 /* IEU1 */
- sub %o5, %g5, %o5 /* IEU0 Group */
- jmpl %o5 + %lo(280f - 279b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x30, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x20, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g5, o5)
- RMOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g5, o5)
-280: be,pt %xcc, 281f /* CTI */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- stw %g2, [%o0 + 4] /* Store Group */
- sub %o1, 8, %o1 /* IEU1 */
- srlx %g2, 32, %g2 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-281: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o1, 4, %o1 /* IEU0 */
- stw %g2, [%o0 - 4] /* Store Group */
- sub %o0, 4, %o0 /* IEU0 */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o1, 2, %o1 /* IEU0 */
- sth %g2, [%o0 - 2] /* Store Group */
- sub %o0, 2, %o0 /* IEU0 */
-1: be,pt %xcc, 211f /* CTI */
- nop /* IEU1 */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-211: retl
- mov %g4, %o0
-
-282: RMOVE_BIGALIGNCHUNK(o1, o0, 0x00, g1, g3, g5, o5)
- RMOVE_BIGALIGNCHUNK(o1, o0, 0x40, g1, g3, g5, o5)
- subcc %g6, 128, %g6 /* IEU1 Group */
- sub %o1, 128, %o1 /* IEU0 */
- bne,pt %xcc, 282b /* CTI */
- sub %o0, 128, %o0 /* IEU0 Group */
- andcc %o2, 0x70, %g6 /* IEU1 */
- be,pn %xcc, 284f /* CTI */
- andcc %o2, 8, %g0 /* IEU1 Group */
- /* Clk1 8-( */
- /* Clk2 8-( */
- /* Clk3 8-( */
- /* Clk4 8-( */
-283: rd %pc, %o5 /* PDU Group */
- sub %o1, %g6, %o1 /* IEU0 Group */
- sub %o5, %g6, %o5 /* IEU1 */
- jmpl %o5 + %lo(284f - 283b), %g0 /* CTI Group brk forced*/
- sub %o0, %g6, %o0 /* IEU0 Group */
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x60, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x50, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x40, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x30, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x20, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x10, g2, g3)
- RMOVE_LASTALIGNCHUNK(o1, o0, 0x00, g2, g3)
-284: be,pt %xcc, 285f /* CTI Group */
- andcc %o2, 4, %g0 /* IEU1 */
- ldx [%o1 - 8], %g2 /* Load Group */
- sub %o0, 8, %o0 /* IEU0 */
- sub %o1, 8, %o1 /* IEU0 Group */
- stx %g2, [%o0] /* Store */
-285: be,pt %xcc, 1f /* CTI */
- andcc %o2, 2, %g0 /* IEU1 Group */
- lduw [%o1 - 4], %g2 /* Load Group */
- sub %o0, 4, %o0 /* IEU0 */
- sub %o1, 4, %o1 /* IEU0 Group */
- stw %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- andcc %o2, 1, %g0 /* IEU1 Group */
- lduh [%o1 - 2], %g2 /* Load Group */
- sub %o0, 2, %o0 /* IEU0 */
- sub %o1, 2, %o1 /* IEU0 Group */
- sth %g2, [%o0] /* Store */
-1: be,pt %xcc, 1f /* CTI */
- nop /* IEU0 Group */
- ldub [%o1 - 1], %g2 /* Load Group */
- stb %g2, [%o0 - 1] /* Store Group + bubble */
-1: retl
- mov %g4, %o0
-
-232: brz,pt %g2, 2f /* CTI Group */
- sub %o2, %g2, %o2 /* IEU0 Group */
-1: ldub [%o1 - 1], %g5 /* Load Group */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %g2, 1, %g2 /* IEU1 Group */
- bne,pt %xcc, 1b /* CTI */
- stb %g5, [%o0] /* Store */
-2: andn %o2, 7, %g5 /* IEU0 Group */
- and %o2, 7, %o2 /* IEU1 */
- fmovd %f0, %f2 /* FPU */
- alignaddr %o1, %g0, %g1 /* GRU Group */
- ldd [%g1], %f4 /* Load Group */
-1: ldd [%g1 - 8], %f6 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 Group */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f6, %f4, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 Group */
- be,pn %xcc, 233f /* CTI */
- sub %o0, 8, %o0 /* IEU1 */
- ldd [%g1 - 8], %f4 /* Load Group */
- sub %g1, 8, %g1 /* IEU0 */
- subcc %g5, 8, %g5 /* IEU1 */
- faligndata %f4, %f6, %f0 /* GRU Group */
- std %f0, [%o0 - 8] /* Store */
- sub %o1, 8, %o1 /* IEU0 */
- bne,pn %xcc, 1b /* CTI Group */
- sub %o0, 8, %o0 /* IEU0 */
-233: brz,pn %o2, 234f /* CTI Group */
- nop /* IEU0 */
-237: ldub [%o1 - 1], %g5 /* LOAD */
- sub %o1, 1, %o1 /* IEU0 */
- sub %o0, 1, %o0 /* IEU1 */
- subcc %o2, 1, %o2 /* IEU1 */
- bne,pt %xcc, 237b /* CTI */
- stb %g5, [%o0] /* Store Group */
-234: wr %g0, FPRS_FEF, %fprs
- retl
- mov %g4, %o0
-END(memmove)
-libc_hidden_def(memmove)
-
-#ifdef USE_BPR
-weak_alias(memcpy,__align_cpy_1)
-weak_alias(memcpy,__align_cpy_2)
-weak_alias(memcpy,__align_cpy_4)
-weak_alias(memcpy,__align_cpy_8)
-weak_alias(memcpy,__align_cpy_16)
-#endif
diff --git a/libc/string/sparc/sparc64/stpcpy.S b/libc/string/sparc/sparc64/stpcpy.S
deleted file mode 100644
index 9af0d56..0000000
--- a/libc/string/sparc/sparc64/stpcpy.S
+++ /dev/null
@@ -1,270 +0,0 @@
-/* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(stpcpy)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- sllx %g1, 32, %g2 /* IEU0 Group */
-
- bne,pn %icc, 12f /* CTI */
- andcc %o1, 7, %g3 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
- bne,pn %icc, 14f /* CTI */
-
- sllx %g1, 7, %g2 /* IEU0 Group */
-1: ldx [%o1], %o3 /* Load */
- add %o1, 8, %o1 /* IEU1 */
-2: mov %o3, %g3 /* IEU0 Group */
-
- sub %o3, %g1, %o2 /* IEU1 */
-3: ldxa [%o1] ASI_PNF, %o3 /* Load */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %g3, %o2 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU0 Group */
- andcc %o2, %g2, %g0 /* IEU1 */
-
- add %o1, 8, %o1 /* IEU0 Group */
- be,a,pt %xcc, 2b /* CTI */
- stx %g3, [%o0 - 8] /* Store */
- srlx %g3, 56, %g5 /* IEU0 Group */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %g3, 48, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 10f /* CTI */
- srlx %g3, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-
- srlx %g3, 32, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
- srlx %g3, 24, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %g3, 16, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 6f /* CTI */
- srlx %g3, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- sub %o3, %g1, %o2 /* IEU0 */
- stx %g3, [%o0 - 8] /* Store Group */
- andcc %g3, 0xff, %g0 /* IEU1 */
- bne,pt %icc, 3b /* CTI */
-
- mov %o3, %g3 /* IEU0 Group */
-4: retl /* CTI+IEU1 Group */
- sub %o0, 1, %o0 /* IEU0 */
-
- .align 16
-6: ba,pt %xcc, 23f /* CTI Group */
- sub %o0, 3, %g6 /* IEU0 */
-5: sub %o0, 2, %g6 /* IEU0 Group */
- stb %g5, [%o0 - 2] /* Store */
-
- srlx %g3, 16, %g4 /* IEU0 Group */
-23: sth %g4, [%o0 - 4] /* Store */
- srlx %g3, 32, %g4 /* IEU0 Group */
- stw %g4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-8: ba,pt %xcc, 24f /* CTI Group */
- sub %o0, 5, %g6 /* IEU0 */
-
-7: sub %o0, 4, %g6 /* IEU0 Group */
- stb %g5, [%o0 - 4] /* Store */
- srlx %g3, 32, %g4 /* IEU0 Group */
-24: stw %g4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-10: ba,pt %xcc, 25f /* CTI Group */
- sub %o0, 7, %g6 /* IEU0 */
-
-9: sub %o0, 6, %g6 /* IEU0 Group */
- stb %g5, [%o0 - 6] /* Store */
- srlx %g3, 48, %g4 /* IEU0 */
-25: sth %g4, [%o0 - 8] /* Store Group */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-11: stb %g5, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
-
- sub %o0, 8, %o0 /* IEU0 */
-
- .align 16
-12: or %g1, %g2, %g1 /* IEU0 Group */
- ldub [%o1], %o3 /* Load */
- sllx %g1, 7, %g2 /* IEU0 Group */
- stb %o3, [%o0] /* Store Group */
-
-13: add %o0, 1, %o0 /* IEU0 */
- add %o1, 1, %o1 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 13b /* CTI */
- stb %o3, [%o0] /* Store */
-
- andcc %o1, 7, %g3 /* IEU1 Group */
- be,a,pt %icc, 1b /* CTI */
- ldx [%o1], %o3 /* Load */
-14: orcc %g0, 64, %g4 /* IEU1 Group */
-
- sllx %g3, 3, %g5 /* IEU0 */
- sub %o1, %g3, %o1 /* IEU0 Group */
- sub %g4, %g5, %g4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080808080808080 *
- * %g3 = source alignment *
- * %g5 = number of bits to shift left *
- * %g4 = number of bits to shift right */
- ldxa [%o1] ASI_PNF, %o5 /* Load Group */
-
- addcc %o1, 8, %o1 /* IEU1 */
-15: sllx %o5, %g5, %o3 /* IEU0 Group */
- ldxa [%o1] ASI_PNF, %o5 /* Load */
- srlx %o5, %g4, %o4 /* IEU0 Group */
-
- add %o0, 8, %o0 /* IEU1 */
- or %o3, %o4, %o3 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- sub %o3, %g1, %o4 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o4, %o3, %o4 /* IEU0 Group */
-#endif
- andcc %o4, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- srlx %o3, 56, %o4 /* IEU0 Group */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
- srlx %o3, 48, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 21f /* CTI */
- srlx %o3, 40, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 20f /* CTI */
-
- srlx %o3, 32, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- srlx %o3, 24, %o4 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 18f /* CTI */
- srlx %o3, 16, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 17f /* CTI */
- srlx %o3, 8, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,pn %icc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- sub %o0, 1, %o0 /* IEU0 */
-
- .align 16
-17: ba,pt %xcc, 26f /* CTI Group */
- subcc %o0, 3, %g6 /* IEU1 */
-18: ba,pt %xcc, 27f /* CTI Group */
- subcc %o0, 4, %g6 /* IEU1 */
-
-19: ba,pt %xcc, 28f /* CTI Group */
- subcc %o0, 5, %g6 /* IEU1 */
-16: subcc %o0, 2, %g6 /* IEU1 Group */
- srlx %o3, 8, %o4 /* IEU0 */
-
- stb %o4, [%o0 - 2] /* Store */
-26: srlx %o3, 16, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 3] /* Store */
-27: srlx %o3, 24, %o4 /* IEU0 Group */
-
- stb %o4, [%o0 - 4] /* Store */
-28: srlx %o3, 32, %o4 /* IEU0 Group */
- stw %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-21: ba,pt %xcc, 29f /* CTI Group */
- subcc %o0, 7, %g6 /* IEU1 */
-22: ba,pt %xcc, 30f /* CTI Group */
- subcc %o0, 8, %g6 /* IEU1 */
-
-20: subcc %o0, 6, %g6 /* IEU1 Group */
- srlx %o3, 40, %o4 /* IEU0 */
- stb %o4, [%o0 - 6] /* Store */
-29: srlx %o3, 48, %o4 /* IEU0 Group */
-
- stb %o4, [%o0 - 7] /* Store */
-30: srlx %o3, 56, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-END(stpcpy)
-libc_hidden_def(stpcpy)
diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S
deleted file mode 100644
index 56725cc..0000000
--- a/libc/string/sparc/sparc64/strcat.S
+++ /dev/null
@@ -1,338 +0,0 @@
-/* strcat (dest, src) -- Append SRC on the end of DEST.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jj(a)ultra.linux.cz> and
- Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strcat)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- mov %o0, %g6 /* IEU1 */
-
- sllx %g1, 32, %g2 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
- bne,pn %icc, 32f /* CTI */
-
- sllx %g1, 7, %g2 /* IEU0 Group */
- brz,pn %o3, 30f /* CTI+IEU1 */
- ldx [%o0], %o3 /* Load */
-48: add %o0, 8, %o0 /* IEU0 Group */
-
-49: sub %o3, %g1, %o2 /* IEU0 Group */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g5 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %g5, %g2, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
-#endif
- be,pt %xcc, 49b /* CTI */
-
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g3 /* IEU1 Group */
- srlx %o2, 32, %o2 /* IEU0 */
-50: andcc %o2, %g2, %g0 /* IEU1 Group */
-
- be,pn %xcc, 51f /* CTI */
- srlx %g3, 56, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 29f /* CTI */
-
- srlx %g3, 48, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 28f /* CTI */
- srlx %g3, 40, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 27f /* CTI */
- srlx %g3, 32, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 26f /* CTI */
-51: srlx %g3, 24, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 25f /* CTI */
-
- srlx %g3, 16, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
- srlx %g3, 8, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 23f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 52f /* CTI */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 49b /* CTI */
-
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g3 /* IEU1 Group */
- ba,pt %xcc, 50b /* CTI */
- srlx %o2, 32, %o2 /* IEU0 */
-
- .align 16
-52: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -9, %o0 /* IEU0 */
-23: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -10, %o0 /* IEU0 */
-
-24: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -11, %o0 /* IEU0 */
-25: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -12, %o0 /* IEU0 */
-
-26: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -13, %o0 /* IEU0 */
-27: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -14, %o0 /* IEU0 */
-
-28: ba,pt %xcc, 12f /* CTI Group */
- add %o0, -15, %o0 /* IEU0 */
-29: add %o0, -16, %o0 /* IEU0 Group */
-30: andcc %o1, 7, %g3 /* IEU1 */
-
-31: bne,pn %icc, 14f /* CTI */
- orcc %g0, 64, %g4 /* IEU1 Group */
-1: ldx [%o1], %o3 /* Load */
- add %o1, 8, %o1 /* IEU1 */
-
-2: mov %o3, %g3 /* IEU0 Group */
-3: sub %o3, %g1, %o2 /* IEU1 */
- ldxa [%o1] ASI_PNF, %o3 /* Load */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %g3, %o2 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU0 Group */
-
- andcc %o2, %g2, %g0 /* IEU1 */
- add %o1, 8, %o1 /* IEU0 Group */
- be,a,pt %xcc, 2b /* CTI */
- stx %g3, [%o0 - 8] /* Store */
-
- srlx %g3, 56, %g5 /* IEU0 Group */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %g3, 48, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 10f /* CTI */
- srlx %g3, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 9f /* CTI */
- srlx %g3, 32, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
-
- srlx %g3, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %g3, 16, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- srlx %g3, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 5f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- stx %g3, [%o0 - 8] /* Store Group */
- andcc %g3, 0xff, %g0 /* IEU1 */
-
- bne,pt %icc, 3b /* CTI */
- mov %o3, %g3 /* IEU0 Group */
-4: retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-5: stb %g5, [%o0 - 2] /* Store Group */
- srlx %g3, 16, %g4 /* IEU0 */
-6: sth %g4, [%o0 - 4] /* Store Group */
- srlx %g3, 32, %g4 /* IEU0 */
-
- stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-7: stb %g5, [%o0 - 4] /* Store Group */
-
- srlx %g3, 32, %g4 /* IEU0 */
-8: stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
-9: stb %g5, [%o0 - 6] /* Store Group */
- srlx %g3, 48, %g4 /* IEU0 */
-10: sth %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-11: stb %g5, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-32: andcc %o0, 7, %g0 /* IEU1 Group */
- be,a,pn %icc, 48b /* CTI */
- ldx [%o0], %o3 /* Load */
- add %o0, 1, %o0 /* IEU0 Group */
-
- brnz,a,pt %o3, 32b /* CTI+IEU1 */
- lduba [%o0] ASI_PNF, %o3 /* Load */
- add %o0, -1, %o0 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 Group */
-
- be,a,pn %icc, 31b /* CTI */
- andcc %o1, 7, %g3 /* IEU1 Group */
-12: ldub [%o1], %o3 /* Load */
- stb %o3, [%o0] /* Store Group */
-
-13: add %o0, 1, %o0 /* IEU0 */
- add %o1, 1, %o1 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 13b /* CTI */
- stb %o3, [%o0] /* Store */
-
- andcc %o1, 7, %g3 /* IEU1 Group */
- be,a,pt %icc, 1b /* CTI */
- ldx [%o1], %o3 /* Load */
- orcc %g0, 64, %g4 /* IEU1 Group */
-
-14: sllx %g3, 3, %g5 /* IEU0 */
- sub %o1, %g3, %o1 /* IEU0 Group */
- sub %g4, %g5, %g4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080808080808080 *
- * %g3 = source alignment *
- * %g5 = number of bits to shift left *
- * %g4 = number of bits to shift right */
- ldxa [%o1] ASI_PNF, %o5 /* Load Group */
-
- addcc %o1, 8, %o1 /* IEU1 */
-15: sllx %o5, %g5, %o3 /* IEU0 Group */
- ldxa [%o1] ASI_PNF, %o5 /* Load */
- srlx %o5, %g4, %o4 /* IEU0 Group */
-
- add %o0, 8, %o0 /* IEU1 */
- or %o3, %o4, %o3 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- sub %o3, %g1, %o4 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o4, %o3, %o4 /* IEU0 Group */
-#endif
- andcc %o4, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- srlx %o3, 56, %o4 /* IEU0 Group */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
- srlx %o3, 48, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 21f /* CTI */
- srlx %o3, 40, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 20f /* CTI */
-
- srlx %o3, 32, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- srlx %o3, 24, %o4 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 18f /* CTI */
- srlx %o3, 16, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 17f /* CTI */
- srlx %o3, 8, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,pn %icc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-16: srlx %o3, 8, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 2] /* Store */
-17: srlx %o3, 16, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 3] /* Store */
-
-18: srlx %o3, 24, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 4] /* Store */
-19: srlx %o3, 32, %o4 /* IEU0 Group */
- stw %o4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
- nop
- nop
-
-20: srlx %o3, 40, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 6] /* Store */
-21: srlx %o3, 48, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 7] /* Store */
-
-22: srlx %o3, 56, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-END(strcat)
-libc_hidden_def(strcat)
diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S
deleted file mode 100644
index 25810fd..0000000
--- a/libc/string/sparc/sparc64/strchr.S
+++ /dev/null
@@ -1,485 +0,0 @@
-/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <features.h>
-#include <asm/asi.h>
-#ifndef XCC
-#define XCC xcc
-#define USE_BPR
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strchr)
- andcc %o1, 0xff, %o1 /* IEU1 Group */
- be,pn %icc, 17f /* CTI */
- sllx %o1, 8, %g3 /* IEU0 Group */
- sethi %hi(0x01010101), %g1 /* IEU1 */
-
- or %g3, %o1, %g3 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- sllx %g3, 16, %g5 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
-
- sllx %g1, 32, %g2 /* IEU0 Group */
- brz,pn %o3, 5f /* CTI+IEU1 */
- orcc %g3, %g5, %g3 /* IEU1 Group */
- sllx %g3, 32, %g5 /* IEU0 */
-
- cmp %o3, %o1 /* IEU1 Group */
- be,pn %xcc, 14f /* CTI */
- or %g1, %g2, %g1 /* IEU0 */
- andcc %o0, 7, %g0 /* IEU1 Group */
-
- bne,a,pn %icc, 15f /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- ldx [%o0], %o3 /* Load Group */
-1: sllx %g1, 7, %g2 /* IEU0 */
-
- or %g3, %g5, %g3 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
- xor %o3, %g3, %o4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080088080808080 *
- * %g3 = c c c c c c c c *
- * %o3 = value *
- * %o4 = value XOR c */
-2: sub %o3, %g1, %o2 /* IEU0 Group */
-
- sub %o4, %g1, %o5 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g6 /* IEU0 Group */
- andn %o5, %o4, %o5 /* IEU1 */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- or %o5, %g6, %o5 /* IEU0 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- or %o5, %o2, %o5 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU1 */
-
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- srlx %o5, 32, %g5 /* IEU0 Group */
-
- add %o2, %g1, %o2 /* IEU1 */
-3: andcc %g5, %g2, %g0 /* IEU1 Group */
- be,pn %xcc, 4f /* CTI */
- srlx %o2, 56, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 6f /* CTI */
- srlx %o2, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 48, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %o2, 40, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 8f /* CTI */
- srlx %o2, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-4: srlx %o2, 24, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 10f /* CTI */
- srlx %o2, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
-
- srlx %o4, 16, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %o2, 8, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 12f /* CTI */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 13f /* CTI */
- xor %o3, %g3, %o4 /* IEU0 */
- ldxa [%o0] ASI_PNF, %o3 /* Load Group */
-
- sub %o4, %g1, %o5 /* IEU0 */
- or %o5, %o2, %o5 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
- andcc %o5, %g2, %g0 /* IEU1 */
-
- be,a,pt %xcc, 2b /* CTI */
- xor %o3, %g3, %o4 /* IEU0 Group */
- srlx %o5, 32, %g5 /* IEU0 Group */
- ba,pt %xcc, 3b /* CTI */
-
- add %o2, %g1, %o2 /* IEU1 */
-
- .align 16
-5: retl /* CTI+IEU1 Group */
- clr %o0 /* IEU0 */
-6: retl /* CTI+IEU1 Group */
- add %o0, -16, %o0 /* IEU0 */
-
-7: retl /* CTI+IEU1 Group */
- add %o0, -15, %o0 /* IEU0 */
-8: retl /* CTI+IEU1 Group */
- add %o0, -14, %o0 /* IEU0 */
-
-9: retl /* CTI+IEU1 Group */
- add %o0, -13, %o0 /* IEU0 */
-10: retl /* CTI+IEU1 Group */
- add %o0, -12, %o0 /* IEU0 */
-
-11: retl /* CTI+IEU1 Group */
- add %o0, -11, %o0 /* IEU0 */
-12: retl /* CTI+IEU1 Group */
- add %o0, -10, %o0 /* IEU0 */
-
-13: retl /* CTI+IEU1 Group */
- add %o0, -9, %o0 /* IEU0 */
-14: retl /* CTI+IEU1 Group */
- nop /* IEU0 */
-
- .align 16
-15: ldub [%o0], %o3 /* Load Group */
-16: andcc %o0, 7, %g0 /* IEU1 */
- be,a,pn %icc, 1b /* CTI */
- ldx [%o0], %o3 /* Load Group */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5b /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- cmp %o3, %o1 /* IEU1 Group */
-
- bne,a,pn %icc, 16b /* CTI */
- ldub [%o0], %o3 /* Load */
- retl /* CTI+IEU1 Group */
- add %o0, -1, %o0 /* IEU0 */
-
- /* strchr (str, 0) */
- .align 32
- nop
- .align 16
-17: sethi %hi(0x01010101), %g1 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- sllx %g1, 32, %g2 /* IEU0 Group */
-
- andcc %o0, 7, %g0 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
- bne,pn %icc, 32f /* CTI */
- sllx %g1, 7, %g2 /* IEU0 Group */
-
- brz,pn %o3, 30f /* CTI+IEU1 */
- ldx [%o0], %o3 /* Load */
-18: add %o0, 8, %o0 /* IEU0 Group */
-19: sub %o3, %g1, %o2 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g6 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %g6, %g2, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
-#endif
- be,pt %xcc, 19b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
-
- addcc %o2, %g1, %g3 /* IEU1 Group */
- srlx %o2, 32, %o2 /* IEU0 */
-20: andcc %o2, %g2, %g0 /* IEU1 Group */
- be,pn %xcc, 21f /* CTI */
-
- srlx %g3, 56, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 29f /* CTI */
- srlx %g3, 48, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 28f /* CTI */
- srlx %g3, 40, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 27f /* CTI */
- srlx %g3, 32, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 26f /* CTI */
-
-21: srlx %g3, 24, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 25f /* CTI */
- srlx %g3, 16, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
- srlx %g3, 8, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 23f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
-
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 19b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
-
- addcc %o2, %g1, %g3 /* IEU1 Group */
- ba,pt %xcc, 20b /* CTI */
- srlx %o2, 32, %o2 /* IEU0 */
-
- .align 16
-22: retl /* CTI+IEU1 Group */
- add %o0, -9, %o0 /* IEU0 */
-23: retl /* CTI+IEU1 Group */
- add %o0, -10, %o0 /* IEU0 */
-
-24: retl /* CTI+IEU1 Group */
- add %o0, -11, %o0 /* IEU0 */
-25: retl /* CTI+IEU1 Group */
- add %o0, -12, %o0 /* IEU0 */
-
-26: retl /* CTI+IEU1 Group */
- add %o0, -13, %o0 /* IEU0 */
-27: retl /* CTI+IEU1 Group */
- add %o0, -14, %o0 /* IEU0 */
-
-28: retl /* CTI+IEU1 Group */
- add %o0, -15, %o0 /* IEU0 */
-29: retl /* CTI+IEU1 Group */
- add %o0, -16, %o0 /* IEU0 */
-
-30: retl /* CTI+IEU1 Group */
- nop /* IEU0 */
-
- .align 16
-32: andcc %o0, 7, %g0 /* IEU1 Group */
- be,a,pn %icc, 18b /* CTI */
- ldx [%o0], %o3 /* Load */
- add %o0, 1, %o0 /* IEU0 Group */
-
- brnz,a,pt %o3, 32b /* CTI+IEU1 */
- lduba [%o0] ASI_PNF, %o3 /* Load */
- retl /* CTI+IEU1 Group */
- add %o0, -1, %o0 /* IEU0 */
-END(strchr)
-libc_hidden_def(strchr)
-#ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strchr,index)
-#endif
-
- .align 32
-ENTRY(strrchr)
- andcc %o1, 0xff, %o1 /* IEU1 Group */
- be,pn %icc, 17b /* CTI */
- clr %g4 /* IEU0 */
- andcc %o0, 7, %g0 /* IEU1 Group */
-
- bne,pn %icc, 13f /* CTI */
- sllx %o1, 8, %g3 /* IEU0 */
- ldx [%o0], %o3 /* Load Group */
-1: sethi %hi(0x01010101), %g1 /* IEU0 */
-
- or %g3, %o1, %g3 /* IEU1 */
- sllx %g3, 16, %g5 /* IEU0 Group */
- or %g1, %lo(0x01010101), %g1 /* IEU1 */
- sllx %g1, 32, %g2 /* IEU0 Group */
-
- or %g3, %g5, %g3 /* IEU1 */
- sllx %g3, 32, %g5 /* IEU0 Group */
- or %g1, %g2, %g1 /* IEU1 */
- sllx %g1, 7, %g2 /* IEU0 Group */
-
- or %g3, %g5, %g3 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
- xor %o3, %g3, %o4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080088080808080 *
- * %g3 = c c c c c c c c *
- * %o3 = value *
- * %o4 = value XOR c */
-2: sub %o3, %g1, %o2 /* IEU0 Group */
-
-3: sub %o4, %g1, %o5 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %g6 /* IEU0 Group */
- andn %o5, %o4, %o5 /* IEU1 */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
-
- or %o5, %g6, %o5 /* IEU0 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
-
- or %o5, %o2, %o5 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU1 */
- andcc %o5, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 2b /* CTI */
-
- xor %o3, %g3, %o4 /* IEU0 */
- srlx %o5, 32, %g5 /* IEU0 Group */
- add %o2, %g1, %o2 /* IEU1 */
- andcc %g5, %g2, %g0 /* IEU1 Group */
-
- be,pn %xcc, 7f /* CTI */
- srlx %o2, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
-
- srlx %o4, 56, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 48, %g5 /* IEU0 */
- be,a,pn %icc, 4f /* CTI */
-
- add %o0, -16, %g4 /* IEU0 Group */
-4: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 48, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 40, %g5 /* IEU0 */
- be,a,pn %icc, 5f /* CTI */
- add %o0, -15, %g4 /* IEU0 Group */
-
-5: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- srlx %o2, 32, %g5 /* IEU0 */
- be,a,pn %icc, 6f /* CTI */
- add %o0, -14, %g4 /* IEU0 Group */
-6: andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 12f /* CTI */
- srlx %o4, 32, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,a,pn %icc, 7f /* CTI */
-
- add %o0, -13, %g4 /* IEU0 */
-7: srlx %o2, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
-
- srlx %o4, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 16, %g5 /* IEU0 */
- be,a,pn %icc, 8f /* CTI */
-
- add %o0, -12, %g4 /* IEU0 Group */
-8: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 16, %g5 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- srlx %o2, 8, %g5 /* IEU0 */
- be,a,pn %icc, 9f /* CTI */
- add %o0, -11, %g4 /* IEU0 Group */
-
-9: andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
- srlx %o4, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,a,pn %icc, 10f /* CTI */
- add %o0, -10, %g4 /* IEU0 */
-10: andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12f /* CTI */
-
- sub %o3, %g1, %o2 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,a,pn %icc, 11f /* CTI */
- add %o0, -9, %g4 /* IEU0 */
-
-11: ba,pt %xcc, 3b /* CTI Group */
- xor %o3, %g3, %o4 /* IEU0 Group */
-12: retl /* CTI+IEU1 Group */
- mov %g4, %o0 /* IEU0 */
-
- .align 16
-13: ldub [%o0], %o3 /* Load Group */
- add %o0, 1, %o0 /* IEU0 */
-14: andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 12b /* CTI */
-
- cmp %o3, %o1 /* IEU1 Group */
- ldub [%o0], %o3 /* Load */
- be,a,pn %icc, 15f /* CTI */
- add %o0, -1, %g4 /* IEU0 Group */
-
-15: andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 14b /* CTI */
- add %o0, 1, %o0 /* IEU0 */
- ba,pt %xcc, 1b /* CTI Group */
-
- ldx [%o0], %o3 /* Load */
-END(strrchr)
-libc_hidden_def(strrchr)
-#ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strrchr,rindex)
-#endif
diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S
deleted file mode 100644
index 7b85007..0000000
--- a/libc/string/sparc/sparc64/strcmp.S
+++ /dev/null
@@ -1,278 +0,0 @@
-/* Compare two strings for differences.
- For SPARC v9.
- Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strcmp)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- bne,pn %icc, 7f /* CTI */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
-
- andcc %o1, 7, %g3 /* IEU1 */
- bne,pn %icc, 9f /* CTI */
- sllx %g1, 32, %g2 /* IEU0 Group */
- ldx [%o0], %o2 /* Load */
-
- or %g1, %g2, %g1 /* IEU0 Group */
-1: ldx [%o1], %o3 /* Load */
- sub %o1, %o0, %o1 /* IEU1 */
- sllx %g1, 7, %g2 /* IEU0 Group */
-
-2: add %o0, 8, %o0 /* IEU1 */
- sub %o2, %g1, %g3 /* IEU0 Group */
- subcc %o2, %o3, %g0 /* IEU1 */
- bne,pn %xcc, 13f /* CTI */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %g3, %o2, %g4 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o2 /* Load */
- andcc %g4, %g2, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o2 /* Load Group */
- andcc %g3, %g2, %g0 /* IEU1 */
-#endif
- be,a,pt %xcc, 2b /* CTI */
- ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load Group */
-
- addcc %g3, %g1, %o4 /* IEU1 */
- srlx %g3, 32, %g3 /* IEU0 */
- andcc %g3, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 3f /* CTI */
-
- srlx %o4, 56, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 48, %o5 /* IEU0 */
-
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 40, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4f /* CTI */
- srlx %o4, 32, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
-
-3: srlx %o4, 24, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 16, %o5 /* IEU0 */
-
- andcc %o5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4f /* CTI */
- srlx %o4, 8, %o5 /* IEU0 */
- andcc %o5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4f /* CTI */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- bne,a,pn %icc, 2b /* CTI */
- ldxa [%o1 + %o0] ASI_PNF, %o3 /* Load */
-
-4: retl /* CTI+IEU1 Group */
- clr %o0 /* IEU0 */
-
- .align 32
-13: mov 0xff, %g6 /* IEU0 Group */
-#ifdef EIGHTBIT_NOT_RARE
- andcc %g4, %g2, %g0 /* IEU1 */
-#else
- andcc %g3, %g2, %g0 /* IEU1 */
-#endif
- be,pt %xcc, 25f /* CTI */
- addcc %g3, %g1, %o4 /* IEU1 Group */
-
- srlx %g3, 32, %g3 /* IEU0 */
- andcc %g3, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 23f /* CTI */
- sllx %g6, 56, %o5 /* IEU0 */
-
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %xcc, 24f /* CTI */
- sllx %g6, 48, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
-
- be,pn %xcc, 24f /* CTI */
- sllx %g6, 40, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %xcc, 24f /* CTI */
-
- sllx %g6, 32, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %xcc, 24f /* CTI */
-23: sllx %g6, 24, %o5 /* IEU0 */
-
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
- sllx %g6, 16, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
-
- be,pn %icc, 24f /* CTI */
- sllx %g6, 8, %o5 /* IEU0 */
- andcc %o4, %o5, %g0 /* IEU1 Group */
- be,pn %icc, 24f /* CTI */
-
- mov %g6, %o5 /* IEU0 */
-25: cmp %o4, %o3 /* IEU1 Group */
-5: mov -1, %o0 /* IEU0 */
- retl /* CTI+IEU1 Group */
-
- movgu %xcc, 1, %o0 /* Single Group */
-
- .align 16
-24: sub %o5, 1, %g6 /* IEU0 Group */
- clr %o0 /* IEU1 */
- or %o5, %g6, %o5 /* IEU0 Group */
- andn %o4, %o5, %o4 /* IEU0 Group */
-
- andn %o3, %o5, %o3 /* IEU1 */
- cmp %o4, %o3 /* IEU1 Group */
- movgu %xcc, 1, %o0 /* Single Group */
- retl /* CTI+IEU1 Group */
-
- movlu %xcc, -1, %o0 /* Single Group */
-6: retl /* CTI+IEU1 Group */
- mov %o4, %o0 /* IEU0 */
-
- .align 16
-7: ldub [%o0], %o2 /* Load */
- add %o0, 1, %o0 /* IEU1 */
- ldub [%o1], %o3 /* Load Group */
- sllx %g1, 32, %g2 /* IEU0 */
-
-8: add %o1, 1, %o1 /* IEU1 */
- subcc %o2, %o3, %o4 /* IEU1 Group */
- bne,pn %xcc, 6b /* CTI */
- lduba [%o0] ASI_PNF, %o2 /* Load */
-
- brz,pn %o3, 4b /* CTI+IEU1 Group */
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pn %icc, 8b /* CTI */
-
- add %o0, 1, %o0 /* IEU0 */
- or %g1, %g2, %g1 /* IEU0 Group */
- andcc %o1, 7, %g3 /* IEU1 */
- be,a,pn %icc, 1b /* CTI */
-
- ldxa [%o0] ASI_PNF, %o2 /* Load Group */
-9: sllx %g3, 3, %g5 /* IEU0 */
- mov 64, %o5 /* IEU1 */
- sub %o1, %g3, %o1 /* IEU0 Group */
-
- sub %o5, %g5, %o5 /* IEU1 */
- ldxa [%o1] ASI_PNF, %g6 /* Load Group */
- or %g1, %g2, %g1 /* IEU0 */
- sub %o1, %o0, %o1 /* IEU1 */
-
- sllx %g1, 7, %g2 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- /* %g1 = 0101010101010101
- * %g2 = 8080808080800880
- * %g5 = number of bits to shift left
- * %o5 = number of bits to shift right */
-10: sllx %g6, %g5, %o3 /* IEU0 Group */
- ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
-
-11: srlx %g6, %o5, %o4 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o2 /* Load */
- or %o3, %o4, %o3 /* IEU1 */
- add %o0, 8, %o0 /* IEU0 Group */
-
- subcc %o2, %o3, %g0 /* IEU1 */
-#ifdef EIGHTBIT_NOT_RARE
- sub %o2, %g1, %g3 /* IEU0 Group */
- bne,pn %xcc, 13b /* CTI */
- andn %g3, %o2, %g4 /* IEU0 Group */
-
- andcc %g4, %g2, %g0 /* IEU1 Group */
- be,pt %xcc, 10b /* CTI */
- srlx %g4, 32, %g4 /* IEU0 */
- andcc %g4, %g2, %g0 /* IEU1 Group */
-#else
- bne,pn %xcc, 13b /* CTI */
- sub %o2, %g1, %g3 /* IEU0 Group */
- andcc %g3, %g2, %g0 /* IEU1 Group */
-
- be,pt %xcc, 10b /* CTI */
- srlx %g3, 32, %g3 /* IEU0 */
- andcc %g3, %g2, %g0 /* IEU1 Group */
-#endif
- be,pt %xcc, 12f /* CTI */
-
- srlx %o2, 56, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 48, %g3 /* IEU0 */
-
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 40, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4b /* CTI */
- srlx %o2, 32, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
-12: srlx %o2, 24, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 16, %g3 /* IEU0 */
-
- andcc %g3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- srlx %o2, 8, %g3 /* IEU0 */
- andcc %g3, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 4b /* CTI */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
- sllx %g6, %g5, %o3 /* IEU0 */
-
- ba,pt %xcc, 11b /* CTI Group */
- ldxa [%o1 + %o0] ASI_PNF, %g6 /* Load */
-END(strcmp)
-libc_hidden_def(strcmp)
diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S
deleted file mode 100644
index 28799e4..0000000
--- a/libc/string/sparc/sparc64/strcpy.S
+++ /dev/null
@@ -1,244 +0,0 @@
-/* Copy SRC to DEST returning DEST.
- For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-#ifndef XCC
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
-#endif
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strcpy)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- mov %o0, %g6 /* IEU1 */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
-
- sllx %g1, 32, %g2 /* IEU0 Group */
- bne,pn %icc, 12f /* CTI */
- andcc %o1, 7, %g3 /* IEU1 */
- or %g1, %g2, %g1 /* IEU0 Group */
-
- bne,pn %icc, 14f /* CTI */
- sllx %g1, 7, %g2 /* IEU0 Group */
-1: ldx [%o1], %o3 /* Load */
- add %o1, 8, %o1 /* IEU1 */
-
-2: mov %o3, %g3 /* IEU0 Group */
-3: sub %o3, %g1, %o2 /* IEU1 */
- ldxa [%o1] ASI_PNF, %o3 /* Load */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %g3, %o2 /* IEU0 Group */
-#endif
- add %o0, 8, %o0 /* IEU0 Group */
-
- andcc %o2, %g2, %g0 /* IEU1 */
- add %o1, 8, %o1 /* IEU0 Group */
- be,a,pt %xcc, 2b /* CTI */
- stx %g3, [%o0 - 8] /* Store */
-
- srlx %g3, 56, %g5 /* IEU0 Group */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
- srlx %g3, 48, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 10f /* CTI */
- srlx %g3, 40, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 9f /* CTI */
- srlx %g3, 32, %g4 /* IEU0 */
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 8f /* CTI */
-
- srlx %g3, 24, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
- srlx %g3, 16, %g4 /* IEU0 */
-
- andcc %g4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- srlx %g3, 8, %g5 /* IEU0 */
- andcc %g5, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 5f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
- stx %g3, [%o0 - 8] /* Store Group */
- andcc %g3, 0xff, %g0 /* IEU1 */
-
- bne,pt %icc, 3b /* CTI */
- mov %o3, %g3 /* IEU0 Group */
-4: retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-5: stb %g5, [%o0 - 2] /* Store Group */
- srlx %g3, 16, %g4 /* IEU0 */
-6: sth %g4, [%o0 - 4] /* Store Group */
- srlx %g3, 32, %g4 /* IEU0 */
-
- stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-7: stb %g5, [%o0 - 4] /* Store Group */
-
- srlx %g3, 32, %g4 /* IEU0 */
-8: stw %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
-9: stb %g5, [%o0 - 6] /* Store Group */
- srlx %g3, 48, %g4 /* IEU0 */
-10: sth %g4, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-11: stb %g5, [%o0 - 8] /* Store Group */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-
-12: or %g1, %g2, %g1 /* IEU0 Group */
- ldub [%o1], %o3 /* Load */
- sllx %g1, 7, %g2 /* IEU0 Group */
- stb %o3, [%o0] /* Store Group */
-
-13: add %o0, 1, %o0 /* IEU0 */
- add %o1, 1, %o1 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 4b /* CTI */
-
- lduba [%o1] ASI_PNF, %o3 /* Load */
- andcc %o0, 7, %g0 /* IEU1 Group */
- bne,a,pt %icc, 13b /* CTI */
- stb %o3, [%o0] /* Store */
-
- andcc %o1, 7, %g3 /* IEU1 Group */
- be,a,pt %icc, 1b /* CTI */
- ldx [%o1], %o3 /* Load */
-14: orcc %g0, 64, %g4 /* IEU1 Group */
-
- sllx %g3, 3, %g5 /* IEU0 */
- sub %o1, %g3, %o1 /* IEU0 Group */
- sub %g4, %g5, %g4 /* IEU1 */
- /* %g1 = 0101010101010101 *
- * %g2 = 8080808080808080 *
- * %g3 = source alignment *
- * %g5 = number of bits to shift left *
- * %g4 = number of bits to shift right */
- ldxa [%o1] ASI_PNF, %o5 /* Load Group */
-
- addcc %o1, 8, %o1 /* IEU1 */
-15: sllx %o5, %g5, %o3 /* IEU0 Group */
- ldxa [%o1] ASI_PNF, %o5 /* Load */
- srlx %o5, %g4, %o4 /* IEU0 Group */
-
- add %o0, 8, %o0 /* IEU1 */
- or %o3, %o4, %o3 /* IEU0 Group */
- add %o1, 8, %o1 /* IEU1 */
- sub %o3, %g1, %o4 /* IEU0 Group */
-
-#ifdef EIGHTBIT_NOT_RARE
- andn %o4, %o3, %o4 /* IEU0 Group */
-#endif
- andcc %o4, %g2, %g0 /* IEU1 Group */
- be,a,pt %xcc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- srlx %o3, 56, %o4 /* IEU0 Group */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 22f /* CTI */
- srlx %o3, 48, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 21f /* CTI */
- srlx %o3, 40, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 20f /* CTI */
-
- srlx %o3, 32, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 19f /* CTI */
- srlx %o3, 24, %o4 /* IEU0 */
-
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 18f /* CTI */
- srlx %o3, 16, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 17f /* CTI */
- srlx %o3, 8, %o4 /* IEU0 */
- andcc %o4, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 16f /* CTI */
-
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,pn %icc, 15b /* CTI */
- stx %o3, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
-
- mov %g6, %o0 /* IEU0 */
-
- .align 16
-16: srlx %o3, 8, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 2] /* Store */
-17: srlx %o3, 16, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 3] /* Store */
-
-18: srlx %o3, 24, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 4] /* Store */
-19: srlx %o3, 32, %o4 /* IEU0 Group */
- stw %o4, [%o0 - 8] /* Store */
-
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
- nop
- nop
-
-20: srlx %o3, 40, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 6] /* Store */
-21: srlx %o3, 48, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 7] /* Store */
-
-22: srlx %o3, 56, %o4 /* IEU0 Group */
- stb %o4, [%o0 - 8] /* Store */
- retl /* CTI+IEU1 Group */
- mov %g6, %o0 /* IEU0 */
-END(strcpy)
-
-libc_hidden_def(strcpy)
diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S
deleted file mode 100644
index f58c1c2..0000000
--- a/libc/string/sparc/sparc64/strlen.S
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Determine the length of a string. For SPARC v9.
- Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jan Vondrak <jvon4518(a)ss1000.ms.mff.cuni.cz> and
- Jakub Jelinek <jj(a)ultra.linux.cz>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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/asi.h>
-
- /* Normally, this uses
- ((xword - 0x0101010101010101) & 0x8080808080808080) test
- to find out if any byte in xword could be zero. This is fast, but
- also gives false alarm for any byte in range 0x81-0xff. It does
- not matter for correctness, as if this test tells us there could
- be some zero byte, we check it byte by byte, but if bytes with
- high bits set are common in the strings, then this will give poor
- performance. You can #define EIGHTBIT_NOT_RARE and the algorithm
- will use one tick slower, but more precise test
- ((xword - 0x0101010101010101) & (~xword) & 0x8080808080808080),
- which does not give any false alarms (but if some bits are set,
- one cannot assume from it which bytes are zero and which are not).
- It is yet to be measured, what is the correct default for glibc
- in these days for an average user.
- */
-
- .text
- .align 32
-ENTRY(strlen)
- sethi %hi(0x01010101), %g1 /* IEU0 Group */
- ldub [%o0], %o3 /* Load */
- or %g1, %lo(0x01010101), %g1 /* IEU0 Group */
- mov %o0, %o1 /* IEU1 */
-
- sllx %g1, 32, %g4 /* IEU0 Group */
- andcc %o0, 7, %g0 /* IEU1 */
- or %g1, %g4, %g1 /* IEU0 Group */
- brz,pn %o3, 13f /* CTI+IEU1 */
-
- sllx %g1, 7, %g4 /* IEU0 Group */
- bne,a,pn %icc, 15f /* CTI */
- add %o0, 1, %o0 /* IEU1 */
- /* %g1 = 0x0101010101010101 *
- * %g4 = 0x8080808080808080 *
- * %o0 = string pointer *
- * %o1 = start of string */
-1: ldx [%o0], %o3 /* Load Group */
-
- add %o0, 8, %o0 /* IEU1 */
-2: sub %o3, %g1, %o2 /* IEU0 Group */
-#ifdef EIGHTBIT_NOT_RARE
- andn %o2, %o3, %o5 /* IEU0 Group */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o5, %g4, %g0 /* IEU1 Group */
-#else
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g4, %g0 /* IEU1 Group */
-#endif
-
- be,pt %xcc, 2b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g5 /* IEU1 Group */
-#ifdef EIGHTBIT_NOT_RARE
- srlx %o5, 32, %o5 /* IEU0 */
-
-3: andcc %o5, %g4, %g0 /* IEU1 Group */
-#else
- srlx %o2, 32, %o2 /* IEU0 */
-
-3: andcc %o2, %g4, %g0 /* IEU1 Group */
-#endif
- be,pn %xcc, 4f /* CTI */
- srlx %g5, 56, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 12f /* CTI */
- srlx %g5, 48, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 11f /* CTI */
-
- srlx %g5, 40, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 10f /* CTI */
- srlx %g5, 32, %o2 /* IEU0 */
-
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 9f /* CTI */
-4: srlx %g5, 24, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
-
- be,pn %icc, 8f /* CTI */
- srlx %g5, 16, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 7f /* CTI */
-
- srlx %g5, 8, %o2 /* IEU0 */
- andcc %o2, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 6f /* CTI */
- sub %o3, %g1, %o2 /* IEU0 */
-
- andcc %g5, 0xff, %g0 /* IEU1 Group */
- be,pn %icc, 5f /* CTI */
- ldxa [%o0] ASI_PNF, %o3 /* Load */
- andcc %o2, %g4, %g0 /* IEU1 Group */
-
- be,pt %xcc, 2b /* CTI */
- add %o0, 8, %o0 /* IEU0 */
- addcc %o2, %g1, %g5 /* IEU1 Group */
- ba,pt %xcc, 3b /* CTI */
-
- srlx %o2, 32, %o2 /* IEU0 */
-5: add %o0, -9, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-
-6: add %o0, -10, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-7: add %o0, -11, %o0 /* IEU0 Group */
-
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-8: add %o0, -12, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
-
- sub %o0, %o1, %o0 /* IEU0 */
-9: add %o0, -13, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-
-10: add %o0, -14, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-11: add %o0, -15, %o0 /* IEU0 Group */
-
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-12: add %o0, -16, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
-
- sub %o0, %o1, %o0 /* IEU0 */
-13: retl /* CTI+IEU1 Group */
- mov 0, %o0 /* IEU0 */
- nop
-
-15: ldub [%o0], %o3 /* Load Group */
-16: andcc %o0, 7, %g0 /* IEU1 */
- be,pn %icc, 1b /* CTI */
- nop /* IEU0 Group */
-
- add %o0, 1, %o0 /* IEU1 */
- andcc %o3, 0xff, %g0 /* IEU1 Group */
- bne,a,pt %icc, 16b /* CTI */
- lduba [%o0] ASI_PNF, %o3 /* Load */
-
- add %o0, -1, %o0 /* IEU0 Group */
- retl /* CTI+IEU1 Group */
- sub %o0, %o1, %o0 /* IEU0 */
-END(strlen)
-libc_hidden_def(strlen)
diff --git a/libc/sysdeps/linux/m68k/bits/huge_vall.h b/libc/sysdeps/linux/m68k/bits/huge_vall.h
index c44b64d..674b46d 100644
--- a/libc/sysdeps/linux/m68k/bits/huge_vall.h
+++ b/libc/sysdeps/linux/m68k/bits/huge_vall.h
@@ -26,7 +26,7 @@
# define HUGE_VALL (__builtin_huge_vall ())
#elif __GNUC_PREREQ(2,96)
# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#elif defined__GNUC__
+#elif defined __GNUC__
# define HUGE_VALL \
(__extension__ \
diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h
index 5ec4da5..26f6212 100644
--- a/libc/sysdeps/linux/sparc/bits/setjmp.h
+++ b/libc/sysdeps/linux/sparc/bits/setjmp.h
@@ -25,37 +25,6 @@
#include <bits/wordsize.h>
-#if 0 /*__WORDSIZE == 64*/
-
-typedef struct __sparc64_jmp_buf
- {
- struct __sparc64_jmp_buf *uc_link;
- unsigned long uc_flags;
- unsigned long uc_sigmask;
- struct __sparc64_jmp_buf_mcontext
- {
- unsigned long mc_gregs[19];
- unsigned long mc_fp;
- unsigned long mc_i7;
- struct __sparc64_jmp_buf_fpu
- {
- union
- {
- unsigned int sregs[32];
- unsigned long dregs[32];
- long double qregs[16];
- } mcfpu_fpregs;
- unsigned long mcfpu_fprs;
- unsigned long mcfpu_gsr;
- void *mcfpu_fq;
- unsigned char mcfpu_qcnt;
- unsigned char mcfpu_qentsz;
- unsigned char mcfpu_enab;
- } mc_fpregs;
- } uc_mcontext;
- } __jmp_buf[1];
-#else
typedef int __jmp_buf[3];
-#endif
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/sparc/bits/sigcontext.h b/libc/sysdeps/linux/sparc/bits/sigcontext.h
index 9435485..251032f 100644
--- a/libc/sysdeps/linux/sparc/bits/sigcontext.h
+++ b/libc/sysdeps/linux/sparc/bits/sigcontext.h
@@ -21,8 +21,6 @@
#include <bits/wordsize.h>
-#if __WORDSIZE == 32
-
/* It is quite hard to choose what to put here, because
Linux/sparc32 had at least 3 totally incompatible
signal stack layouts.
@@ -42,36 +40,3 @@ struct sigcontext
int si_mask;
};
-#else /* sparc64 */
-
-typedef struct
- {
- unsigned int si_float_regs [64];
- unsigned long si_fsr;
- unsigned long si_gsr;
- unsigned long si_fprs;
- } __siginfo_fpu_t;
-
-struct sigcontext
- {
- char sigc_info[128];
- struct
- {
- unsigned long u_regs[16]; /* globals and ins */
- unsigned long tstate;
- unsigned long tpc;
- unsigned long tnpc;
- unsigned int y;
- unsigned int fprs;
- } sigc_regs;
- __siginfo_fpu_t * sigc_fpu_save;
- struct
- {
- void * ss_sp;
- int ss_flags;
- unsigned long ss_size;
- } sigc_stack;
- unsigned long sigc_mask;
-};
-
-#endif /* sparc64 */
diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S
index 25b5ee5..77e9147 100644
--- a/libc/sysdeps/linux/sparc/crt1.S
+++ b/libc/sysdeps/linux/sparc/crt1.S
@@ -39,16 +39,9 @@
#include <features.h>
#include <bits/wordsize.h>
-/* macro out the 32 / 64 bit differences */
-#if __WORDSIZE == 32
# define STACK_BIAS 0
# define ELE_SIZE 4
# define LD ld
-#else
-# define STACK_BIAS 2047 /* see glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h */
-# define ELE_SIZE 8
-# define LD ldx
-#endif
.text
.align 4
@@ -116,11 +109,7 @@ _start:
nop
/* Die very horribly if exit returns. */
-#if __WORDSIZE == 32
unimp
-#else
- illtrap 0
-#endif
.size _start,.-_start
diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S
index 8e4bc22..1715911 100644
--- a/libc/sysdeps/linux/sparc/fork.S
+++ b/libc/sysdeps/linux/sparc/fork.S
@@ -35,7 +35,7 @@ fork:
bcc,a 9000f
nop
save %sp,-96,%sp
- call HIDDEN_JUMPTARGET(__errno_location)
+ call __errno_location
nop
st %i0,[%o0]
jmpl %i7+8,%g0
diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
index 40303f0..90efb77 100644
--- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
@@ -6,26 +6,19 @@
#include <setjmp.h>
#include <jmpbuf-offsets.h>
-#if __WORDSIZE == 64
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
-
-#else
-
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((int) (address) < (jmpbuf)[JB_SP])
-#endif
-
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#if defined(__arch64__)
-#include "sparc64/jmpbuf-unwind.h"
-#else
-#include "sparc32/jmpbuf-unwind.h"
-#endif
+#include <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
#endif
diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S
index b085faf..fa77f4d 100644
--- a/libc/sysdeps/linux/sparc/pipe.S
+++ b/libc/sysdeps/linux/sparc/pipe.S
@@ -49,7 +49,7 @@ pipe:
restore %g0,%g0,%o0
.Lerror:
- call HIDDEN_JUMPTARGET(__errno_location)
+ call __errno_location
or %g0,EINVAL,%i0
st %i0,[%o0]
ret
diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c
index 123be53..97f98da 100644
--- a/libc/sysdeps/linux/sparc/qp_ops.c
+++ b/libc/sysdeps/linux/sparc/qp_ops.c
@@ -1,5 +1,3 @@
-/* XXX add ops from glibc sysdeps/sparc/sparc64/soft-fp */
-
#include <stdio.h>
#include <stdlib.h>
@@ -9,11 +7,7 @@ static void fakedef(void)
exit(-1);
}
-#ifdef __sparc_v9__
-# define fakedef(sym) strong_alias(fakedef, _Qp_##sym)
-#else
# define fakedef(sym) strong_alias(fakedef, _Q_##sym)
-#endif
fakedef(fne)
fakedef(feq)
@@ -31,7 +25,6 @@ fakedef(qtos)
fakedef(stoq)
fakedef(itoq)
fakedef(add)
-#ifndef __sparc_v9__
fakedef(qtou)
fakedef(utoq)
fakedef(cmp)
@@ -44,4 +37,3 @@ fakedef(qtoll)
fakedef(qtoull)
fakedef(sqrt)
fakedef(ulltoq)
-#endif
diff --git a/libc/sysdeps/linux/sparc/sparcv9/clone.S b/libc/sysdeps/linux/sparc/sparcv9/clone.S
deleted file mode 100644
index 2ee62a0..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/clone.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth(a)tamu.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/>. */
-
-/* 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/errno.h>
-#include <asm/unistd.h>
-#include <tcb-offsets.h>
-#include <sysdep.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); */
-
- .register %g2,#scratch
- .register %g3,#scratch
-
- .text
-
-ENTRY (__clone)
- save %sp, -192, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
- /* sanity check arguments */
- brz,pn %i0, 99f /* fn non-NULL? */
- mov %i0, %g2
- brz,pn %i1, 99f /* child_stack non-NULL? */
- mov %i2, %o0 /* clone flags */
-
- /* The child_stack is the top of the stack, allocate one
- whole stack frame from that as this is what the kernel
- expects. Also, subtract STACK_BIAS. */
- sub %i1, 192 + 0x7ff, %o1
- mov %i3, %g3
- mov %i2, %g4
-
- mov %i4,%o2 /* PTID */
- mov %i5,%o3 /* TLS */
- ldx [%fp+0x7ff+176],%o4 /* CTID */
-
- /* Do the system call */
- set __NR_clone, %g1
- ta 0x6d
- bcs,pn %xcc, 98f
- nop
- brnz,pn %o1, __thread_start
- nop
- jmpl %i7 + 8, %g0
- restore %o0, %g0, %o0
-99: mov EINVAL, %o0
-98: call HIDDEN_JUMPTARGET(__errno_location)
- mov %o0, %i0
- st %i0, [%o0]
- jmpl %i7 + 8, %g0
- restore %g0,-1,%o0
-END(__clone)
-
- .type __thread_start,@function
-__thread_start:
-#ifdef RESET_PID
- sethi %hi(CLONE_THREAD), %l0
- andcc %g4, %l0, %g0
- bne,pt %icc, 1f
- andcc %g4, CLONE_VM, %g0
- bne,a,pn %icc, 2f
- mov -1,%o0
- set __NR_getpid,%g1
- ta 0x6d
-2: st %o0,[%g7 + PID]
- st %o0,[%g7 + TID]
-1:
-#endif
- mov %g0, %fp /* terminate backtrace */
- call %g2
- mov %g3,%o0
- call HIDDEN_JUMPTARGET(_exit),0
- nop
-
- .size __thread_start, .-__thread_start
-
-weak_alias (__clone, clone)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/rem.S b/libc/sysdeps/linux/sparc/sparcv9/rem.S
deleted file mode 100644
index 1474e32..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/rem.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and sdivcc only 36,
- * we use sdivcc eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.rem)
-
- sra %o0, 31, %o2
- wr %o2, 0, %y
- sdivcc %o0, %o1, %o2
- xnor %o2, %g0, %o3
- movvs %icc, %o3, %o2
- smul %o2, %o1, %o2
- retl
- sub %o0, %o2, %o0
-
-END(.rem)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S b/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
deleted file mode 100644
index 45535bb..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/sdiv.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and sdivcc only 36,
- * we use sdivcc eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.div)
-
- sra %o0, 31, %o2
- wr %o2, 0, %y
- sdivcc %o0, %o1, %o0
- xnor %o0, %g0, %o2
- retl
- movvs %icc, %o2, %o0
-
-END(.div)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/udiv.S b/libc/sysdeps/linux/sparc/sparcv9/udiv.S
deleted file mode 100644
index 303f29b..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/udiv.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and udiv only 37,
- * we use udiv eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.udiv)
-
- wr %g0, 0, %y
- retl
- udiv %o0, %o1, %o0
-
-END(.udiv)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/umul.S b/libc/sysdeps/linux/sparc/sparcv9/umul.S
deleted file mode 100644
index e65e4b9..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/umul.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Sparc v9 has multiply.
- */
-
- .text
- .align 32
-ENTRY(.umul)
-
- srl %o0, 0, %o0
- srl %o1, 0, %o1
- mulx %o0, %o1, %o0
- retl
- srlx %o0, 32, %o1
-
-END(.umul)
diff --git a/libc/sysdeps/linux/sparc/sparcv9/urem.S b/libc/sysdeps/linux/sparc/sparcv9/urem.S
deleted file mode 100644
index 9354269..0000000
--- a/libc/sysdeps/linux/sparc/sparcv9/urem.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Sparc v9 has divide.
- * As divx takes 68 cycles and udiv only 37,
- * we use udiv eventhough it is deprecated.
- */
-
- .text
- .align 32
-ENTRY(.urem)
-
- wr %g0, 0, %y
- udiv %o0, %o1, %o2
- umul %o2, %o1, %o2
- retl
- sub %o0, %o2, %o0
-
-END(.urem)
diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h
index 37d6a61..edbd5a5 100644
--- a/libc/sysdeps/linux/sparc/sys/procfs.h
+++ b/libc/sysdeps/linux/sparc/sys/procfs.h
@@ -32,20 +32,6 @@
__BEGIN_DECLS
-#if __WORDSIZE == 64
-
-#define ELF_NGREG 36
-
-typedef struct
- {
- unsigned long pr_regs[32];
- unsigned long pr_fsr;
- unsigned long pr_gsr;
- unsigned long pr_fprs;
- } elf_fpregset_t;
-
-#else /* sparc32 */
-
#define ELF_NGREG 38
typedef struct
@@ -63,8 +49,6 @@ typedef struct
unsigned int pr_q[64];
} elf_fpregset_t;
-#endif /* sparc32 */
-
typedef unsigned long elf_greg_t;
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
@@ -110,13 +94,8 @@ struct elf_prpsinfo
char pr_zomb; /* Zombie. */
char pr_nice; /* Nice val. */
unsigned long int pr_flag; /* Flags. */
-#if __WORDSIZE == 64
- unsigned int pr_uid;
- unsigned int pr_gid;
-#else
unsigned short int pr_uid;
unsigned short int pr_gid;
-#endif
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
char pr_fname[16]; /* Filename of executable. */
@@ -138,73 +117,6 @@ typedef __pid_t lwpid_t;
typedef struct elf_prstatus prstatus_t;
typedef struct elf_prpsinfo prpsinfo_t;
-#if __WORDSIZE == 64
-
-/* Provide 32-bit variants so that BFD can read 32-bit
- core files. */
-#define ELF_NGREG32 38
-typedef struct
- {
- union
- {
- unsigned int pr_regs[32];
- double pr_dregs[16];
- } pr_fr;
- unsigned int __unused;
- unsigned int pr_fsr;
- unsigned char pr_qcnt;
- unsigned char pr_q_entrysize;
- unsigned char pr_en;
- unsigned int pr_q[64];
- } elf_fpregset_t32;
-
-typedef unsigned int elf_greg_t32;
-typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
-
-struct elf_prstatus32
- {
- struct elf_siginfo pr_info; /* Info associated with signal. */
- short int pr_cursig; /* Current signal. */
- unsigned int pr_sigpend; /* Set of pending signals. */
- unsigned int pr_sighold; /* Set of held signals. */
- __pid_t pr_pid;
- __pid_t pr_ppid;
- __pid_t pr_pgrp;
- __pid_t pr_sid;
- struct
- {
- int tv_sec, tv_usec;
- } pr_utime, /* User time. */
- pr_stime, /* System time. */
- pr_cutime, /* Cumulative user time. */
- pr_cstime; /* Cumulative system time. */
- elf_gregset_t32 pr_reg; /* GP registers. */
- int pr_fpvalid; /* True if math copro being used. */
- };
-
-struct elf_prpsinfo32
- {
- char pr_state; /* Numeric process state. */
- char pr_sname; /* Char for pr_state. */
- char pr_zomb; /* Zombie. */
- char pr_nice; /* Nice val. */
- unsigned 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. */
- };
-
-typedef elf_gregset_t32 prgregset32_t;
-typedef elf_fpregset_t32 prfpregset32_t;
-
-typedef struct elf_prstatus32 prstatus32_t;
-typedef struct elf_prpsinfo32 prpsinfo32_t;
-
-#endif /* sparc64 */
-
__END_DECLS
#endif /* sys/procfs.h */
diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S
index 4b701f7..e5a3c30 100644
--- a/libc/sysdeps/linux/sparc/vfork.S
+++ b/libc/sysdeps/linux/sparc/vfork.S
@@ -37,7 +37,7 @@ __vfork:
bcc,a 9000f
nop
save %sp,-96,%sp
- call HIDDEN_JUMPTARGET(__errno_location)
+ call __errno_location
nop
st %i0,[%o0]
jmpl %i7+8,%g0
diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
index ab90810..d502c75 100644
--- a/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
+++ b/libpthread/linuxthreads.old/sysdeps/sparc/pt-machine.h
@@ -1,8 +1,82 @@
-#include <features.h>
-#include <bits/wordsize.h>
+/* Machine-dependent pthreads configuration and inline functions.
+ sparc version.
+ Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth(a)tamu.edu>.
-#if __WORDSIZE == 32
-# include "sparc32/pt-machine.h"
-#else
-# include "sparc64/pt-machine.h"
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#ifndef PT_EI
+# define PT_EI __extern_always_inline
#endif
+
+extern long int testandset (int *spinlock);
+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ int ret;
+
+ __asm__ __volatile__("ldstub %1,%0"
+ : "=r"(ret), "=m"(*spinlock)
+ : "m"(*spinlock));
+
+ return ret;
+}
+
+
+/* Memory barrier; default is to do nothing */
+#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
+
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+
+/* Registers %g6 and %g7 are reserved by the ABI for "system use".
+ %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
+struct _pthread_descr_struct;
+register struct _pthread_descr_struct *__thread_self __asm__("%g7");
+
+/* Return the thread descriptor for the current thread. */
+#define THREAD_SELF __thread_self
+
+/* Initialize the thread-unique value. */
+#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
+
+/* Access to data in the thread descriptor is easy. */
+#define THREAD_GETMEM(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+
+/* We want the OS to assign stack addresses. */
+#define FLOATING_STACKS 1
+
+/* Maximum size of the stack if the rlimit is unlimited. */
+#define ARCH_STACK_MAX_SIZE 8*1024*1024
+
+#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
deleted file mode 100644
index d502c75..0000000
--- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc32/pt-machine.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- sparc version.
- Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r"(ret), "=m"(*spinlock)
- : "m"(*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
-register char *stack_pointer __asm__("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 8*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
deleted file mode 100644
index e3c73d9..0000000
--- a/libpthread/linuxthreads.old/sysdeps/sparc/sparc64/pt-machine.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- Sparc v9 version.
- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
-/* Read barrier. */
-#define READ_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
-/* Write barrier. */
-#define WRITE_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__ ("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
- TLS ABI specifies %g7 as the thread pointer. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-
-/* Compare-and-swap for semaphores. */
-
-#define HAS_COMPARE_AND_SWAP
-PT_EI int
-__compare_and_swap (long int *p, long int oldval, long int newval)
-{
- long int readval;
-
- __asm__ __volatile__ ("casx [%4], %2, %0"
- : "=r"(readval), "=m"(*p)
- : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
- MEMORY_BARRIER();
- return readval == oldval;
-}
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 32*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
index 72a9af5..4de152b 100644
--- a/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
+++ b/libpthread/linuxthreads/sysdeps/sparc/pspinlock.c
@@ -1,14 +1,87 @@
-#include <features.h>
-#include <bits/wordsize.h>
+/* POSIX spinlock implementation. SPARC32 version.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#if __WORDSIZE == 32
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
-# if defined(__CONFIG_SPARC_V9B__)
-# include "sparc32/sparcv9b/pspinlock.c"
-# else
-# include "sparc32/pspinlock.c"
-# endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#else
-# include "sparc64/pspinlock.c"
-#endif
+ 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, see <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <pthread.h>
+#include "internals.h"
+
+/* This implementation is similar to the one used in the Linux kernel. */
+int
+__pthread_spin_lock (pthread_spinlock_t *lock)
+{
+ __asm__ __volatile__
+ ("1: ldstub [%0], %%g2\n"
+ " orcc %%g2, 0x0, %%g0\n"
+ " bne,a 2f\n"
+ " ldub [%0], %%g2\n"
+ ".subsection 2\n"
+ "2: orcc %%g2, 0x0, %%g0\n"
+ " bne,a 2b\n"
+ " ldub [%0], %%g2\n"
+ " b,a 1b\n"
+ ".previous"
+ : /* no outputs */
+ : "r" (lock)
+ : "g2", "memory", "cc");
+ return 0;
+}
+weak_alias (__pthread_spin_lock, pthread_spin_lock)
+
+
+int
+__pthread_spin_trylock (pthread_spinlock_t *lock)
+{
+ int result;
+ __asm__ __volatile__
+ ("ldstub [%1], %0"
+ : "=r" (result)
+ : "r" (lock)
+ : "memory");
+ return result == 0 ? 0 : EBUSY;
+}
+weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
+
+
+int
+__pthread_spin_unlock (pthread_spinlock_t *lock)
+{
+ *lock = 0;
+ return 0;
+}
+weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
+
+
+int
+__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
+{
+ /* We can ignore the `pshared' parameter. Since we are busy-waiting
+ all processes which can access the memory location `lock' points
+ to can use the spinlock. */
+ *lock = 0;
+ return 0;
+}
+weak_alias (__pthread_spin_init, pthread_spin_init)
+
+
+int
+__pthread_spin_destroy (pthread_spinlock_t *lock)
+{
+ /* Nothing to do. */
+ return 0;
+}
+weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
index ab90810..d502c75 100644
--- a/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/sparc/pt-machine.h
@@ -1,8 +1,82 @@
-#include <features.h>
-#include <bits/wordsize.h>
+/* Machine-dependent pthreads configuration and inline functions.
+ sparc version.
+ Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth(a)tamu.edu>.
-#if __WORDSIZE == 32
-# include "sparc32/pt-machine.h"
-#else
-# include "sparc64/pt-machine.h"
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#ifndef PT_EI
+# define PT_EI __extern_always_inline
#endif
+
+extern long int testandset (int *spinlock);
+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ int ret;
+
+ __asm__ __volatile__("ldstub %1,%0"
+ : "=r"(ret), "=m"(*spinlock)
+ : "m"(*spinlock));
+
+ return ret;
+}
+
+
+/* Memory barrier; default is to do nothing */
+#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
+
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+
+/* Registers %g6 and %g7 are reserved by the ABI for "system use".
+ %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
+struct _pthread_descr_struct;
+register struct _pthread_descr_struct *__thread_self __asm__("%g7");
+
+/* Return the thread descriptor for the current thread. */
+#define THREAD_SELF __thread_self
+
+/* Initialize the thread-unique value. */
+#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
+
+/* Access to data in the thread descriptor is easy. */
+#define THREAD_GETMEM(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_GETMEM_NC(descr, member) \
+ ((void) sizeof (descr), THREAD_SELF->member)
+#define THREAD_SETMEM(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+#define THREAD_SETMEM_NC(descr, member, value) \
+ ((void) sizeof (descr), THREAD_SELF->member = (value))
+
+/* We want the OS to assign stack addresses. */
+#define FLOATING_STACKS 1
+
+/* Maximum size of the stack if the rlimit is unlimited. */
+#define ARCH_STACK_MAX_SIZE 8*1024*1024
+
+#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
deleted file mode 100644
index 4de152b..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* POSIX spinlock implementation. SPARC32 version.
- 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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <pthread.h>
-#include "internals.h"
-
-/* This implementation is similar to the one used in the Linux kernel. */
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " orcc %%g2, 0x0, %%g0\n"
- " bne,a 2f\n"
- " ldub [%0], %%g2\n"
- ".subsection 2\n"
- "2: orcc %%g2, 0x0, %%g0\n"
- " bne,a 2b\n"
- " ldub [%0], %%g2\n"
- " b,a 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory", "cc");
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int result;
- __asm__ __volatile__
- ("ldstub [%1], %0"
- : "=r" (result)
- : "r" (lock)
- : "memory");
- return result == 0 ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
deleted file mode 100644
index d502c75..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pt-machine.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- sparc version.
- Copyright (C) 1996-1998, 2000-2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r"(ret), "=m"(*spinlock)
- : "m"(*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
-register char *stack_pointer __asm__("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use".
- %g7 is specified in the TLS ABI as thread pointer -- we do the same. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 8*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
deleted file mode 100644
index fb49ca3..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* POSIX spinlock implementation. SPARC v9 version.
- 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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <pthread.h>
-#include "internals.h"
-
-
-/* This implementation is similar to the one used in the Linux kernel. */
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " brnz,pn %%g2, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g2\n"
- " brnz,pt %%g2, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory");
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int result;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (result)
- : "r" (lock)
- : "memory");
- return result == 0 ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("membar #StoreStore | #LoadStore\n"
- "stb %%g0, [%0]"
- :
- : "r" (lock)
- : "memory");
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
deleted file mode 100644
index 743cb77..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* POSIX spinlock implementation. SPARC64 version.
- 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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <pthread.h>
-#include "internals.h"
-
-/* This implementation is similar to the one used in the Linux kernel. */
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g5\n"
- " brnz,pn %%g5, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g5\n"
- " brnz,pt %%g5, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g5", "memory");
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int result;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (result)
- : "r" (lock)
- : "memory");
- return result == 0 ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("membar #StoreStore | #LoadStore\n"
- "stb %%g0, [%0]"
- :
- : "r" (lock)
- : "memory");
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- *lock = 0;
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
deleted file mode 100644
index e3c73d9..0000000
--- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pt-machine.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- Sparc v9 version.
- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth(a)tamu.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; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#ifndef PT_EI
-# define PT_EI __extern_always_inline
-#endif
-
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-/* Spinlock implementation; required. */
-PT_EI long int
-testandset (int *spinlock)
-{
- int ret;
-
- __asm__ __volatile__("ldstub %1,%0"
- : "=r" (ret), "=m" (*spinlock) : "m" (*spinlock));
-
- return ret;
-}
-
-
-/* Memory barrier; default is to do nothing */
-#define MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore | #StoreLoad | #StoreStore" : : : "memory")
-/* Read barrier. */
-#define READ_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #LoadLoad | #LoadStore" : : : "memory")
-/* Write barrier. */
-#define WRITE_MEMORY_BARRIER() \
- __asm__ __volatile__("membar #StoreLoad | #StoreStore" : : : "memory")
-
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__ ("%sp");
-
-
-/* Registers %g6 and %g7 are reserved by the ABI for "system use". The
- TLS ABI specifies %g7 as the thread pointer. */
-struct _pthread_descr_struct;
-register struct _pthread_descr_struct *__thread_self __asm__ ("%g7");
-
-/* Return the thread descriptor for the current thread. */
-#define THREAD_SELF __thread_self
-
-/* Initialize the thread-unique value. */
-#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
-
-
-/* Compare-and-swap for semaphores. */
-
-#define HAS_COMPARE_AND_SWAP
-PT_EI int
-__compare_and_swap (long int *p, long int oldval, long int newval)
-{
- long int readval;
-
- __asm__ __volatile__ ("casx [%4], %2, %0"
- : "=r"(readval), "=m"(*p)
- : "r"(oldval), "m"(*p), "r"(p), "0"(newval));
- MEMORY_BARRIER();
- return readval == oldval;
-}
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-
-/* Maximum size of the stack if the rlimit is unlimited. */
-#define ARCH_STACK_MAX_SIZE 32*1024*1024
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
deleted file mode 100644
index bd9bb0d..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <tls.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) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- cmp %g1, 0; \
- bne 1f; \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcs __syscall_error_handler; \
- nop; \
- .subsection 2; \
-1: save %sp, -96, %sp; \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcs __syscall_error_handler2; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0; \
- .previous; \
- SYSCALL_ERROR_HANDLER \
- SYSCALL_ERROR_HANDLER2
-
-#define SYSCALL_ERROR_HANDLER2 \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- .global __errno_location; \
- .type __errno_location,@function; \
- CDISABLE; \
- mov %l0, %o0; \
- call __errno_location; \
- nop; \
- st %l1, [%o0]; \
- jmpl %i7 + 8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# else
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- p_header.data.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# endif
-
-#elif !defined __ASSEMBLER__
-
-/* This code should never be used but we define it anyhow. */
-# define SINGLE_THREAD_P (1)
-
-#endif
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
deleted file mode 100644
index d57283a..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../ia64/pt-sigsuspend.c"
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
deleted file mode 100644
index 9972ee4..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <tls.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) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
- brnz,pn %g1, 1f; \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcs,pn %xcc, __syscall_error_handler; \
- nop; \
- .subsection 2; \
-1: save %sp, -192, %sp; \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcs,pn %xcc, __syscall_error_handler2; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0; \
- .previous; \
- SYSCALL_ERROR_HANDLER \
- SYSCALL_ERROR_HANDLER2
-
-#define SYSCALL_ERROR_HANDLER2 \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
- .global __errno_location; \
- .type __errno_location,@function; \
- CDISABLE; \
- mov %l0, %o0; \
- call __errno_location; \
- nop; \
- st %l1, [%o0]; \
- jmpl %i7 + 8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# else
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- p_header.data.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# endif
-
-#elif !defined __ASSEMBLER__
-
-/* This code should never be used but we define it anyhow. */
-# define SINGLE_THREAD_P (1)
-
-#endif
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
deleted file mode 100644
index 3ff16b1..0000000
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep-cancel.h>
-
-#ifdef SHARED
-.LLGETPC0:
- retl
- add %o7, %o0, %o0
-#endif
-ENTRY(__vfork)
-#ifdef SHARED
- mov %o7, %o1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o0
- call .LLGETPC0
- add %o0, %lo(_GLOBAL_OFFSET_TABLE_+4), %o0
- sethi %hi(__libc_pthread_functions), %o2
- mov %o1, %o7
- or %o2, %lo(__libc_pthread_functions), %o2
- ldx [%o0 + %o2], %o2
- ldx [%o2], %o0
-#else
- .weak pthread_create
- sethi %hi(pthread_create), %o0
- or %o0, %lo(pthread_create), %o0
-#endif
-#if defined SHARED && !defined BROKEN_SPARC_WDISP22
- cmp %o0, 0
- bne HIDDEN_JUMPTARGET(fork)
-#else
- brnz,pn %o0, 1f
-#endif
- mov __NR_vfork, %g1
- ta 0x6d
- bcs,pn %xcc, __syscall_error_handler
- nop
- sub %o1, 1, %o1
- retl
- and %o0, %o1, %o0
-#if !defined SHARED || defined BROKEN_SPARC_WDISP22
-1: mov %o7, %g1
- call HIDDEN_JUMPTARGET(fork)
- mov %g1, %o7
-#endif
- SYSCALL_ERROR_HANDLER
-PSEUDO_END (__vfork)
-libc_hidden_def (__vfork)
-weak_alias (__vfork, vfork)
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
index fa656b3..bd9bb0d 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
@@ -1,10 +1,100 @@
-#ifndef SPARC_SYSDEP_CANCEL_H
-#define SPARC_SYSDEP_CANCEL_H
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2002.
-#if defined(__arch64__)
-#include <sparc64/sysdep-cancel.h>
-#else
-#include <sparc32/sysdep-cancel.h>
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received 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>
+#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) \
+ ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1; \
+ cmp %g1, 0; \
+ bne 1f; \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcs __syscall_error_handler; \
+ nop; \
+ .subsection 2; \
+1: save %sp, -96, %sp; \
+ CENABLE; \
+ nop; \
+ mov %o0, %l0; \
+ COPY_ARGS_##args \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcs __syscall_error_handler2; \
+ mov %o0, %l1; \
+ CDISABLE; \
+ mov %l0, %o0; \
+ jmpl %i7 + 8, %g0; \
+ restore %g0, %l1, %o0; \
+ .previous; \
+ SYSCALL_ERROR_HANDLER \
+ SYSCALL_ERROR_HANDLER2
+
+#define SYSCALL_ERROR_HANDLER2 \
+SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2) \
+ .global __errno_location; \
+ .type __errno_location,@function; \
+ CDISABLE; \
+ mov %l0, %o0; \
+ call __errno_location; \
+ nop; \
+ st %l1, [%o0]; \
+ jmpl %i7 + 8, %g0; \
+ restore %g0, -1, %o0; \
+ .previous;
+
+# ifdef IS_IN_libpthread
+# define CENABLE call __pthread_enable_asynccancel
+# define CDISABLE call __pthread_disable_asynccancel
+# elif !defined NOT_IN_libc
+# define CENABLE call __libc_enable_asynccancel
+# define CDISABLE call __libc_disable_asynccancel
+# else
+# define CENABLE call __librt_enable_asynccancel
+# define CDISABLE call __librt_disable_asynccancel
+# endif
+
+#define COPY_ARGS_0 /* Nothing */
+#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
+#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
+#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
+#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
+#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
+#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ p_header.data.multiple_threads) == 0, 1)
+# else
+# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
+# endif
+
+#elif !defined __ASSEMBLER__
+
+/* This code should never be used but we define it anyhow. */
+# define SINGLE_THREAD_P (1)
+
#endif
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
similarity index 100%
rename from libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
rename to libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/vfork.S
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/jmpbuf-unwind.h
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
rename to libpthread/nptl/sysdeps/jmpbuf-unwind.h
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/pthread_spin_lock.c
similarity index 100%
copy from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
copy to libpthread/nptl/sysdeps/pthread_spin_lock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/pthread_spin_trylock.c
similarity index 100%
copy from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
copy to libpthread/nptl/sysdeps/pthread_spin_trylock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h b/libpthread/nptl/sysdeps/pthreaddef.h
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/pthreaddef.h
rename to libpthread/nptl/sysdeps/pthreaddef.h
diff --git a/libpthread/nptl/sysdeps/sparc/Makefile.arch b/libpthread/nptl/sysdeps/sparc/Makefile.arch
index 52ac6db..f9662c6 100644
--- a/libpthread/nptl/sysdeps/sparc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/sparc/Makefile.arch
@@ -4,8 +4,5 @@
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)/sparv9
CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
-
-
diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
index 6cbb37b..2f64e7d 100644
--- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
+++ b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
@@ -1,5 +1,27 @@
-#if defined(__arch64__)
-#include "sparc64/jmpbuf-unwind.h"
-#else
-#include "sparc32/jmpbuf-unwind.h"
-#endif
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.c
rename to libpthread/nptl/sysdeps/sparc/pthread_spin_lock.c
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
similarity index 100%
rename from libpthread/nptl/sysdeps/sparc/sparc32/pthread_spin_trylock.c
rename to libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
diff --git a/libpthread/nptl/sysdeps/sparc/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
index d4695c4..435fedc 100644
--- a/libpthread/nptl/sysdeps/sparc/pthreaddef.h
+++ b/libpthread/nptl/sysdeps/sparc/pthreaddef.h
@@ -1,5 +1,39 @@
-#if defined(__arch64__)
-#include "sparc64/pthreaddef.h"
-#else
-#include "sparc32/pthreaddef.h"
-#endif
+/* 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/>. */
+
+/* Default stack size. */
+#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning. */
+#define STACK_ALIGN 16
+
+/* Minimal stack size after allocating thread descriptor and guard size. */
+#define MINIMAL_REST_STACK 2048
+
+/* Alignment requirement for TCB. */
+#define TCB_ALIGNMENT 16
+
+
+/* Location of current stack frame. */
+#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
+register char *stack_pointer __asm__("%sp");
+
+/* XXX Until we have a better place keep the definitions here. */
+
+/* While there is no such syscall. */
+#define __exit_thread_inline(val) \
+ INLINE_SYSCALL (exit, 1, (val))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
deleted file mode 100644
index 3d314be..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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"
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " brnz,pn %%g2, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g2\n"
- " brnz,pt %%g2, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g2", "memory");
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
deleted file mode 100644
index 3b20a21..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sparc64/pthread_spin_trylock.c>
diff --git a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
deleted file mode 100644
index 482cbe3..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sparc64/pthread_spin_unlock.c>
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
deleted file mode 100644
index 0235056..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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"
-
-int
-pthread_spin_lock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__
- ("1: ldstub [%0], %%g5\n"
- " brnz,pn %%g5, 2f\n"
- " membar #StoreLoad | #StoreStore\n"
- ".subsection 2\n"
- "2: ldub [%0], %%g5\n"
- " brnz,pt %%g5, 2b\n"
- " membar #LoadLoad\n"
- " b,a,pt %%xcc, 1b\n"
- ".previous"
- : /* no outputs */
- : "r" (lock)
- : "g5", "memory");
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
deleted file mode 100644
index b14621b..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_trylock.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <errno.h>
-#include "pthreadP.h"
-
-int
-pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- int res;
- __asm__ __volatile__
- ("ldstub [%1], %0\n"
- "membar #StoreLoad | #StoreStore"
- : "=r" (res)
- : "r" (lock)
- : "memory");
- return res == 0 ? 0 : EBUSY;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c b/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
deleted file mode 100644
index a00fad3..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthread_spin_unlock.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* pthread_spin_unlock -- unlock a spin lock. Generic version.
- Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus(a)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 "pthreadP.h"
-#include <atomic.h>
-
-int
-pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- __asm__ __volatile__ ("membar #StoreStore | #LoadStore");
- *lock = 0;
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h b/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
deleted file mode 100644
index 845f4bf..0000000
--- a/libpthread/nptl/sysdeps/sparc/sparc64/pthreaddef.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 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/>. */
-
-/* Default stack size. */
-#define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024)
-
-/* Required stack pointer alignment at beginning. */
-#define STACK_ALIGN 16
-
-/* Minimal stack size after allocating thread descriptor and guard size. */
-#define MINIMAL_REST_STACK 4096
-
-/* Alignment requirement for TCB. */
-#define TCB_ALIGNMENT 16
-
-
-/* Location of current stack frame. */
-#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
-register char *stack_pointer __asm__("%sp");
-
-/* XXX Until we have a better place keep the definitions here. */
-
-/* While there is no such syscall. */
-#define __exit_thread_inline(val) \
- INLINE_SYSCALL (exit, 1, (val))
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
index dfc5e82..a6142aa 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/clone.S
@@ -1,5 +1,2 @@
-#if defined(__arch64__)
-#include "./sparc64/clone.S"
-#else
-#include "./sparc32/clone.S"
-#endif
+#define RESET_PID
+#include <libc/sysdeps/linux/sparc/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
index e8705c5..37231a8 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
@@ -1,5 +1,44 @@
-#if defined(__arch64__)
-#include "sparc64/pt-vfork.S"
-#else
-#include "sparc32/pt-vfork.S"
-#endif
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
+#include <tcb-offsets.h>
+
+ .text
+ .globl __syscall_error
+ENTRY(__vfork)
+ ld [%g7 + PID], %o5
+ sub %g0, %o5, %o4
+ st %o4, [%g7 + PID]
+
+ LOADSYSCALL(vfork)
+ ta 0x10
+ bcc 2f
+ mov %o7, %g1
+ st %o5, [%g7 + PID]
+ call __syscall_error
+ mov %g1, %o7
+2: sub %o1, 1, %o1
+ andcc %o0, %o1, %o0
+ bne,a 1f
+ st %o5, [%g7 + PID]
+1: retl
+ nop
+END(__vfork)
+
+weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
index 73eaa69..169f6e7 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
@@ -1 +1,93 @@
-#include "sparc32/pthread_barrier_wait.c"
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Martin Schwidefsky <schwidefsky(a)de.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 <pthreadP.h>
+
+/* Wait on barrier. */
+int
+pthread_barrier_wait (
+ pthread_barrier_t *barrier)
+{
+ union sparc_pthread_barrier *ibarrier
+ = (union sparc_pthread_barrier *) barrier;
+ int result = 0;
+ int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
+
+ /* Make sure we are alone. */
+ lll_lock (ibarrier->b.lock, private);
+
+ /* One more arrival. */
+ --ibarrier->b.left;
+
+ /* Are these all? */
+ if (ibarrier->b.left == 0)
+ {
+ /* Yes. Increment the event counter to avoid invalid wake-ups and
+ tell the current waiters that it is their turn. */
+ ++ibarrier->b.curr_event;
+
+ /* Wake up everybody. */
+ lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
+
+ /* This is the thread which finished the serialization. */
+ result = PTHREAD_BARRIER_SERIAL_THREAD;
+ }
+ else
+ {
+ /* The number of the event we are waiting for. The barrier's event
+ number must be bumped before we continue. */
+ unsigned int event = ibarrier->b.curr_event;
+
+ /* Before suspending, make the barrier available to others. */
+ lll_unlock (ibarrier->b.lock, private);
+
+ /* Wait for the event counter of the barrier to change. */
+ do
+ lll_futex_wait (&ibarrier->b.curr_event, event, private);
+ while (event == ibarrier->b.curr_event);
+ }
+
+ /* Make sure the init_count is stored locally or in a register. */
+ unsigned int init_count = ibarrier->b.init_count;
+
+ /* If this was the last woken thread, unlock. */
+ if (__atomic_is_v9 || ibarrier->s.pshared == 0)
+ {
+ if (atomic_increment_val (&ibarrier->b.left) == init_count)
+ /* We are done. */
+ lll_unlock (ibarrier->b.lock, private);
+ }
+ else
+ {
+ unsigned int left;
+ /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
+ is only atomic for threads within the same process, not for
+ multiple processes. */
+ __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
+ left = ++ibarrier->b.left;
+ __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
+ if (left == init_count)
+ /* We are done. */
+ lll_unlock (ibarrier->b.lock, private);
+ }
+
+ return result;
+}
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_trywait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
similarity index 100%
rename from libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
rename to libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
deleted file mode 100644
index a6142aa..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define RESET_PID
-#include <libc/sysdeps/linux/sparc/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
deleted file mode 100644
index 37231a8..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sub %g0, %o5, %o4
- st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x10
- bcc 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
deleted file mode 100644
index 169f6e7..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Martin Schwidefsky <schwidefsky(a)de.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 <pthreadP.h>
-
-/* Wait on barrier. */
-int
-pthread_barrier_wait (
- pthread_barrier_t *barrier)
-{
- union sparc_pthread_barrier *ibarrier
- = (union sparc_pthread_barrier *) barrier;
- int result = 0;
- int private = ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE;
-
- /* Make sure we are alone. */
- lll_lock (ibarrier->b.lock, private);
-
- /* One more arrival. */
- --ibarrier->b.left;
-
- /* Are these all? */
- if (ibarrier->b.left == 0)
- {
- /* Yes. Increment the event counter to avoid invalid wake-ups and
- tell the current waiters that it is their turn. */
- ++ibarrier->b.curr_event;
-
- /* Wake up everybody. */
- lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, private);
-
- /* This is the thread which finished the serialization. */
- result = PTHREAD_BARRIER_SERIAL_THREAD;
- }
- else
- {
- /* The number of the event we are waiting for. The barrier's event
- number must be bumped before we continue. */
- unsigned int event = ibarrier->b.curr_event;
-
- /* Before suspending, make the barrier available to others. */
- lll_unlock (ibarrier->b.lock, private);
-
- /* Wait for the event counter of the barrier to change. */
- do
- lll_futex_wait (&ibarrier->b.curr_event, event, private);
- while (event == ibarrier->b.curr_event);
- }
-
- /* Make sure the init_count is stored locally or in a register. */
- unsigned int init_count = ibarrier->b.init_count;
-
- /* If this was the last woken thread, unlock. */
- if (__atomic_is_v9 || ibarrier->s.pshared == 0)
- {
- if (atomic_increment_val (&ibarrier->b.left) == init_count)
- /* We are done. */
- lll_unlock (ibarrier->b.lock, private);
- }
- else
- {
- unsigned int left;
- /* Slightly more complicated. On pre-v9 CPUs, atomic_increment_val
- is only atomic for threads within the same process, not for
- multiple processes. */
- __sparc32_atomic_do_lock24 (&ibarrier->s.left_lock);
- left = ++ibarrier->b.left;
- __sparc32_atomic_do_unlock24 (&ibarrier->s.left_lock);
- if (left == init_count)
- /* We are done. */
- lll_unlock (ibarrier->b.lock, private);
- }
-
- return result;
-}
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
deleted file mode 100644
index b61ca7b..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <tls.h>
-#include <sysdep.h>
-#ifndef __ASSEMBLER__
-# include <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; \
- .globl __syscall_error; \
-ENTRY(name) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- cmp %g1, 0; \
- bne 1f; \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcc 8f; \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7; \
-8: jmpl %o7 + 8, %g0; \
- nop; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
-1: save %sp, -96, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register(%o7, %i7); \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x10; \
- bcc 1f; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- call __syscall_error; \
- mov %l1, %o0; \
- b 2f; \
- mov -1, %l1; \
-1: CDISABLE; \
- mov %l0, %o0; \
-2: jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0;
-
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# elif defined IS_IN_librt
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# 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/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
deleted file mode 100644
index 71f0662..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- cmp %o5, 0
- bne 1f
- sub %g0, %o5, %o4
- sethi %hi(0x80000000), %o4
-1: st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x10
- bcc 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-libc_hidden_def (vfork)
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
deleted file mode 100644
index 64e3bfc..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define RESET_PID
-#include <libc/sysdeps/linux/sparc/sparcv9/clone.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
deleted file mode 100644
index a058d89..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sub %g0, %o5, %o4
- st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x6d
- bcc,pt %xcc, 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a,pt %icc, 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
deleted file mode 100644
index 0e9d263..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <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; \
- .globl __syscall_error; \
-ENTRY(name) \
- ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
- brnz,pn %g1, 1f; \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcc,pt %xcc, 8f; \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7; \
-8: jmpl %o7 + 8, %g0; \
- nop; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
-1: save %sp, -192, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register(%o7, %i7); \
- CENABLE; \
- nop; \
- mov %o0, %l0; \
- COPY_ARGS_##args \
- mov SYS_ify(syscall_name), %g1; \
- ta 0x6d; \
- bcc,pt %xcc, 1f; \
- mov %o0, %l1; \
- CDISABLE; \
- mov %l0, %o0; \
- call __syscall_error; \
- mov %l1, %o0; \
- ba,pt %xcc, 2f; \
- mov -1, %l1; \
-1: CDISABLE; \
- mov %l0, %o0; \
-2: jmpl %i7 + 8, %g0; \
- restore %g0, %l1, %o0;
-
-# ifdef IS_IN_libpthread
-# define CENABLE call __pthread_enable_asynccancel
-# define CDISABLE call __pthread_disable_asynccancel
-# elif !defined NOT_IN_libc
-# define CENABLE call __libc_enable_asynccancel
-# define CDISABLE call __libc_disable_asynccancel
-# elif defined IS_IN_librt
-# define CENABLE call __librt_enable_asynccancel
-# define CDISABLE call __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define COPY_ARGS_0 /* Nothing */
-#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
-#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
-#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
-#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
-#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
-#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
-# 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/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
deleted file mode 100644
index 0a9c337..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_create.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
deleted file mode 100644
index f0d4fd2..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_delete.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
deleted file mode 100644
index 82121a7..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_getoverr.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
deleted file mode 100644
index 313c05f..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_gettime.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
deleted file mode 100644
index 76f549c..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../x86_64/timer_settime.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
deleted file mode 100644
index bea4f2f..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
-#include <tcb-offsets.h>
-
- .text
- .globl __syscall_error
-ENTRY(__vfork)
- ld [%g7 + PID], %o5
- sethi %hi(0x80000000), %o3
- cmp %o5, 0
- sub %g0, %o5, %o4
- move %icc, %o3, %o4
- st %o4, [%g7 + PID]
-
- LOADSYSCALL(vfork)
- ta 0x6d
- bcc,pt %xcc, 2f
- mov %o7, %g1
- st %o5, [%g7 + PID]
- call __syscall_error
- mov %g1, %o7
-2: sub %o1, 1, %o1
- andcc %o0, %o1, %o0
- bne,a,pt %icc, 1f
- st %o5, [%g7 + PID]
-1: retl
- nop
-END(__vfork)
-
-hidden_def (vfork)
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
index 5be9beb..b61ca7b 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
@@ -1,5 +1,111 @@
-#if defined(__arch64__)
-#include "sparc64/sysdep-cancel.h"
-#else
-#include "sparc32/sysdep-cancel.h"
+/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <tls.h>
+#include <sysdep.h>
+#ifndef __ASSEMBLER__
+# include <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; \
+ .globl __syscall_error; \
+ENTRY(name) \
+ ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
+ cmp %g1, 0; \
+ bne 1f; \
+.type __##syscall_name##_nocancel,@function; \
+.globl __##syscall_name##_nocancel; \
+__##syscall_name##_nocancel: \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcc 8f; \
+ mov %o7, %g1; \
+ call __syscall_error; \
+ mov %g1, %o7; \
+8: jmpl %o7 + 8, %g0; \
+ nop; \
+.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
+1: save %sp, -96, %sp; \
+ cfi_def_cfa_register(%fp); \
+ cfi_window_save; \
+ cfi_register(%o7, %i7); \
+ CENABLE; \
+ nop; \
+ mov %o0, %l0; \
+ COPY_ARGS_##args \
+ mov SYS_ify(syscall_name), %g1; \
+ ta 0x10; \
+ bcc 1f; \
+ mov %o0, %l1; \
+ CDISABLE; \
+ mov %l0, %o0; \
+ call __syscall_error; \
+ mov %l1, %o0; \
+ b 2f; \
+ mov -1, %l1; \
+1: CDISABLE; \
+ mov %l0, %o0; \
+2: jmpl %i7 + 8, %g0; \
+ restore %g0, %l1, %o0;
+
+
+# ifdef IS_IN_libpthread
+# define CENABLE call __pthread_enable_asynccancel
+# define CDISABLE call __pthread_disable_asynccancel
+# elif !defined NOT_IN_libc
+# define CENABLE call __libc_enable_asynccancel
+# define CDISABLE call __libc_disable_asynccancel
+# elif defined IS_IN_librt
+# define CENABLE call __librt_enable_asynccancel
+# define CDISABLE call __librt_disable_asynccancel
+# else
+# error Unsupported library
+# endif
+
+#define COPY_ARGS_0 /* Nothing */
+#define COPY_ARGS_1 COPY_ARGS_0 mov %i0, %o0;
+#define COPY_ARGS_2 COPY_ARGS_1 mov %i1, %o1;
+#define COPY_ARGS_3 COPY_ARGS_2 mov %i2, %o2;
+#define COPY_ARGS_4 COPY_ARGS_3 mov %i3, %o3;
+#define COPY_ARGS_5 COPY_ARGS_4 mov %i4, %o4;
+#define COPY_ARGS_6 COPY_ARGS_5 mov %i5, %o5;
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
+# else
+# define SINGLE_THREAD_P ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1
+# 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/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
index 160cd0b..71f0662 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/vfork.S
@@ -1,5 +1,48 @@
-#if defined(__arch64__)
-#include "sparc64/vfork.S"
-#else
-#include "sparc32/vfork.S"
-#endif
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub(a)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 <sysdep.h>
+#include <tcb-offsets.h>
+
+ .text
+ .globl __syscall_error
+ENTRY(__vfork)
+ ld [%g7 + PID], %o5
+ cmp %o5, 0
+ bne 1f
+ sub %g0, %o5, %o4
+ sethi %hi(0x80000000), %o4
+1: st %o4, [%g7 + PID]
+
+ LOADSYSCALL(vfork)
+ ta 0x10
+ bcc 2f
+ mov %o7, %g1
+ st %o5, [%g7 + PID]
+ call __syscall_error
+ mov %g1, %o7
+2: sub %o1, 1, %o1
+ andcc %o0, %o1, %o0
+ bne,a 1f
+ st %o5, [%g7 + PID]
+1: retl
+ nop
+END(__vfork)
+
+libc_hidden_def (vfork)
+weak_alias (__vfork, vfork)
diff --git a/test/Makefile b/test/Makefile
index b759bf9..787c530 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -45,7 +45,7 @@ endif
test check all: run
-run: compile subdirs_run
+run: subdirs_run
compile: $(top_builddir)$(LOCAL_INSTALL_PATH) subdirs_compile
diff --git a/test/README b/test/README
index 8fb12d9..28225b0 100644
--- a/test/README
+++ b/test/README
@@ -5,12 +5,11 @@ Following make targets are avaialable
make compile
-This will compile and link the tests
+This will compile and link the tests.
make run
-This will check for binaries, if they are not there it
-will call 'compile' target, then it will execute all the tests.
+This will execute all the tests.
make check
make all
diff --git a/test/librt/Makefile.in b/test/librt/Makefile.in
index 15ecbae..f25522c 100644
--- a/test/librt/Makefile.in
+++ b/test/librt/Makefile.in
@@ -2,3 +2,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
LDFLAGS_shmtest := -lrt
+
+ifeq ($(ARCH_USE_MMU),)
+TESTS_DISABLED := shmtest
+endif
diff --git a/test/math/Makefile.in b/test/math/Makefile.in
index d241baa..147d579 100644
--- a/test/math/Makefile.in
+++ b/test/math/Makefile.in
@@ -13,6 +13,9 @@ endif
ifeq ($(DO_C99_MATH),)
TESTS_DISABLED += test-float test-ifloat test-double test-idouble rint signgam ilogb
endif
+ifeq ($(UCLIBC_HAS_FPU),)
+TESTS_DISABLED += test-fpucw
+endif
DODIFF_rint := 1
DODIFF_signgam := 1
diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c
index e711958..4ba4045 100644
--- a/test/nptl/tst-cancel4.c
+++ b/test/nptl/tst-cancel4.c
@@ -83,7 +83,30 @@ static pthread_barrier_t b2;
# define IPC_ADDVAL 0
#endif
-#define WRITE_BUFFER_SIZE 4096
+/* The WRITE_BUFFER_SIZE value needs to be chosen such that if we set
+ the socket send buffer size to '1', a write of this size on that
+ socket will block.
+
+ The Linux kernel imposes a minimum send socket buffer size which
+ has changed over the years. As of Linux 3.10 the value is:
+
+ 2 * (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff)))
+
+ which is attempting to make sure that with standard MTUs,
+ TCP can always queue up at least 2 full sized packets.
+
+ Furthermore, there is logic in the socket send paths that
+ will allow one more packet (of any size) to be queued up as
+ long as some socket buffer space remains. Blocking only
+ occurs when we try to queue up a new packet and the send
+ buffer space has already been fully consumed.
+
+ Therefore we must set this value to the largest possible value of
+ the formula above (and since it depends upon the size of "struct
+ sk_buff", it is dependent upon machine word size etc.) plus some
+ slack space. */
+
+#define WRITE_BUFFER_SIZE 16384
/* Cleanup handling test. */
static int cl_called;
@@ -758,7 +781,6 @@ tf_sigpause (void *arg)
pthread_cleanup_push (cl, NULL);
- /* Just for fun block the cancellation signal. */
sigpause (SIGCANCEL);
pthread_cleanup_pop (0);
@@ -993,6 +1015,8 @@ tf_accept (void *arg)
if (++tries > 10)
{
printf ("%s: too many unsuccessful bind calls\n", __FUNCTION__);
+ /* prevent endless loop, when bind fails forever */
+ exit (1);
}
strcpy (sun.sun_path, "/tmp/tst-cancel4-socket-1-XXXXXX");
diff --git a/test/nptl/tst-sem3.c b/test/nptl/tst-sem3.c
index d14f6f6..7b75e29 100644
--- a/test/nptl/tst-sem3.c
+++ b/test/nptl/tst-sem3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper(a)redhat.com>, 2002.
@@ -28,7 +28,7 @@
int
-main (void)
+do_test (void)
{
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-sem3.XXXXXX";
@@ -43,7 +43,7 @@ main (void)
if (fd == -1)
{
printf ("cannot open temporary file: %m\n");
- exit (1);
+ return 1;
}
/* Make sure it is always removed. */
@@ -56,14 +56,14 @@ main (void)
if (write (fd, data, ps) != (ssize_t) ps)
{
puts ("short write");
- exit (1);
+ return 1;
}
mem = mmap (NULL, ps, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (mem == MAP_FAILED)
{
printf ("mmap failed: %m\n");
- exit (1);
+ return 1;
}
s = (sem_t *) (((uintptr_t) mem + __alignof (sem_t))
@@ -73,25 +73,25 @@ main (void)
if (sem_init (s, 1, 1) == -1)
{
puts ("init failed");
- exit (1);
+ return 1;
}
if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1)
{
puts ("1st wait failed");
- exit (1);
+ return 1;
}
errno = 0;
if (TEMP_FAILURE_RETRY (sem_trywait (s)) != -1)
{
puts ("trywait succeeded");
- exit (1);
+ return 1;
}
else if (errno != EAGAIN)
{
puts ("trywait didn't return EAGAIN");
- exit (1);
+ return 1;
}
*p = 0;
@@ -101,7 +101,7 @@ main (void)
if (pid == -1)
{
puts ("fork failed");
- exit (1);
+ return 1;
}
else if (pid == 0)
{
@@ -109,13 +109,13 @@ main (void)
if ((*p)++ != 0)
{
puts ("child: *p != 0");
- exit (1);
+ return 1;
}
if (sem_post (s) == -1)
{
puts ("child: 1st post failed");
- exit (1);
+ return 1;
}
puts ("child done");
@@ -125,17 +125,20 @@ main (void)
if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1)
{
printf ("parent: 2nd wait failed: %m\n");
- exit (1);
+ return 1;
}
if (*p != 1)
{
puts ("*p != 1");
- exit (1);
+ return 1;
}
puts ("parent done");
}
- exit (0);
+ return 0;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/test/nptl/tst-sem4.c b/test/nptl/tst-sem4.c
index 125759b..72ed97d 100644
--- a/test/nptl/tst-sem4.c
+++ b/test/nptl/tst-sem4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper(a)redhat.com>, 2002.
@@ -32,7 +32,7 @@ remove_sem (int status, void *arg)
int
-main (void)
+do_test (void)
{
sem_t *s;
sem_t *s2;
@@ -144,3 +144,6 @@ main (void)
return 0;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/test/time/Makefile.in b/test/time/Makefile.in
index 05f73a4..02c8d91 100644
--- a/test/time/Makefile.in
+++ b/test/time/Makefile.in
@@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
tst-strftime tst-strptime tst-timezone
ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += tst-ftime_l
+TESTS_DISABLED += tst-ftime_l tst_wcsftime
endif
CFLAGS_tst-strptime2 := -std=c99
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0