diff mbox series

[v2,15/23] linux: Use generic __syscall_error for microblaze

Message ID 20201113165837.121629-16-adhemerval.zanella@linaro.org
State New
Headers show
Series Simplify internal Linux syscall | expand

Commit Message

Adhemerval Zanella Nov. 13, 2020, 4:58 p.m. UTC
Although the auto-generated syscall sets errno directly for dynamic
case, using a function call generates more compact code:

--- sizes-microblaze-linux-gnu.inline
+++ sizes-microblaze-linux-gnu.outline
    text           data     bss     dec     hex filename
-1835305          52738    9216 1897259  1cf32b libc.so
- 188644           7236     176  196056   2fdd8 elf/ld.so
- 121772           5872    8356  136000   21340 nptl/libpthread.so
-  30836           1724     160   32720    7fd0 rt/librt.so
+1831025          52714    9216 1892955  1ce25b libc.so
+ 188904           7240     176  196320   2fee0 elf/ld.so
+ 121540           5864    8356  135760   21250 nptl/libpthread.so
+  30640           1720     160   32520    7f08 rt/librt.so

Checked with a cross make check for microblaze-linux-gnu.
---
 sysdeps/unix/sysv/linux/microblaze/Makefile   |  6 ---
 .../sysv/linux/microblaze/syscall_error.h     | 25 ++++++++++++
 sysdeps/unix/sysv/linux/microblaze/sysdep.S   | 39 -------------------
 3 files changed, 25 insertions(+), 45 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/microblaze/syscall_error.h
 delete mode 100644 sysdeps/unix/sysv/linux/microblaze/sysdep.S
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/microblaze/Makefile b/sysdeps/unix/sysv/linux/microblaze/Makefile
index d178bc6f34..614553204f 100644
--- a/sysdeps/unix/sysv/linux/microblaze/Makefile
+++ b/sysdeps/unix/sysv/linux/microblaze/Makefile
@@ -1,9 +1,3 @@ 
 ifeq ($(subdir),resource)
 sysdep_routines += backtrace_linux
 endif
-
-ifeq ($(subdir),nptl)
-# pull in __syscall_error routine
-libpthread-routines += sysdep
-libpthread-shared-only-routines += sysdep
-endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/syscall_error.h b/sysdeps/unix/sysv/linux/microblaze/syscall_error.h
new file mode 100644
index 0000000000..3632dfddd7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/syscall_error.h
@@ -0,0 +1,25 @@ 
+/* Linux wrappers for setting errno.  Microblaze version.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SYSCALL_ERROR_H
+#define _SYSCALL_ERROR_H
+
+#define SYSCALL_ERROR_FUNC        1
+#define SYSCALL_ERROR_FUNC_ATTR
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.S b/sysdeps/unix/sysv/linux/microblaze/sysdep.S
deleted file mode 100644
index c3157880d8..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/sysdep.S
+++ /dev/null
@@ -1,39 +0,0 @@ 
-/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
-
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-
-/* The following code is only used in the shared library when we
-   compile the reentrant version.  Otherwise each system call defines
-   each own version.  */
-
-#ifndef	PIC
-
-/* The syscall stubs jump here when they detect an error.  */
-
-# undef CALL_MCOUNT
-# define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %d0.  */
-
-	.text
-ENTRY (__syscall_error)
-	rsubk	r3,r3,r0
-	rtsd	r15,8
-	addik	r3,r0,-1	/* delay slot.  */
-END (__syscall_error)
-#endif /* PIC.  */