public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/syscall-refactor] sparc: Remove assembly syscall macros
@ 2020-06-29 21:50 Adhemerval Zanella
0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2020-06-29 21:50 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d3c48b47043a6640e2db128443ac8cd7a9bdb398
commit d3c48b47043a6640e2db128443ac8cd7a9bdb398
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jun 25 10:41:30 2020 -0300
sparc: Remove assembly syscall macros
Diff:
---
sysdeps/sparc/cpu_relax.c | 1 +
sysdeps/sparc/sparc64/multiarch/md5-block.c | 1 +
sysdeps/sparc/sparc64/multiarch/sha256-block.c | 1 +
sysdeps/sparc/sparc64/multiarch/sha512-block.c | 1 +
.../sysv/linux/sparc/sparc32/____longjmp_chk.S | 2 +-
sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h | 103 +-------------------
sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S | 2 +-
.../sysv/linux/sparc/sparc64/____longjmp_chk.S | 2 +-
sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h | 104 +--------------------
sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S | 2 +-
sysdeps/unix/sysv/linux/sparc/sysdep.h | 11 +--
11 files changed, 11 insertions(+), 219 deletions(-)
diff --git a/sysdeps/sparc/cpu_relax.c b/sysdeps/sparc/cpu_relax.c
index 295d112a90..80f718d72d 100644
--- a/sysdeps/sparc/cpu_relax.c
+++ b/sysdeps/sparc/cpu_relax.c
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <sparc-ifunc.h>
+#include <atomic-machine.h>
#ifdef __sparc_v9__
static void
diff --git a/sysdeps/sparc/sparc64/multiarch/md5-block.c b/sysdeps/sparc/sparc64/multiarch/md5-block.c
index 7c1a3a368f..97d322cbe2 100644
--- a/sysdeps/sparc/sparc64/multiarch/md5-block.c
+++ b/sysdeps/sparc/sparc64/multiarch/md5-block.c
@@ -1,4 +1,5 @@
#include <sparc-ifunc.h>
+#include <stdbool.h>
#define __md5_process_block __md5_process_block_generic
extern void __md5_process_block_generic (const void *buffer, size_t len,
diff --git a/sysdeps/sparc/sparc64/multiarch/sha256-block.c b/sysdeps/sparc/sparc64/multiarch/sha256-block.c
index 9d65315a5a..ab079e6edf 100644
--- a/sysdeps/sparc/sparc64/multiarch/sha256-block.c
+++ b/sysdeps/sparc/sparc64/multiarch/sha256-block.c
@@ -1,4 +1,5 @@
#include <sparc-ifunc.h>
+#include <stdbool.h>
#define __sha256_process_block __sha256_process_block_generic
extern void __sha256_process_block_generic (const void *buffer, size_t len,
diff --git a/sysdeps/sparc/sparc64/multiarch/sha512-block.c b/sysdeps/sparc/sparc64/multiarch/sha512-block.c
index 2863e05d09..97dce6164d 100644
--- a/sysdeps/sparc/sparc64/multiarch/sha512-block.c
+++ b/sysdeps/sparc/sparc64/multiarch/sha512-block.c
@@ -1,4 +1,5 @@
#include <sparc-ifunc.h>
+#include <stdbool.h>
#define __sha512_process_block __sha512_process_block_generic
extern void __sha512_process_block_generic (const void *buffer, size_t len,
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S
index 2478055814..1294eeb7fa 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S
@@ -46,7 +46,7 @@ ENTRY (____longjmp_chk)
clr %o0
add %sp, 64, %o1
- LOADSYSCALL(sigaltstack)
+ mov __NR_sigaltstack, %g1
ta 0x10
bcs .Lok
ld [%sp + 64 + 4], %o2
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 2c3754770b..68e90d827b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -20,108 +20,7 @@
#define _LINUX_SPARC32_SYSDEP_H 1
#include <sysdeps/unix/sysv/linux/sparc/sysdep.h>
-
-#if IS_IN (rtld)
-# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */
-#endif
-#include <tls.h>
-
-#undef SYS_ify
-#define SYS_ify(syscall_name) __NR_##syscall_name
-
-#ifdef __ASSEMBLER__
-
-#define LOADSYSCALL(x) mov __NR_##x, %g1
-
-#undef PSEUDO
-#define PSEUDO(name, syscall_name, args) \
- .text; \
-ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10; \
- bcc 1f; \
- nop; \
- SYSCALL_ERROR_HANDLER \
-1:
-
-#undef PSEUDO_NOERRNO
-#define PSEUDO_NOERRNO(name, syscall_name, args)\
- .text; \
-ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10;
-
-#undef PSEUDO_ERRVAL
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
-ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10;
-
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
- END(name)
-
-#ifndef PIC
-# define SYSCALL_ERROR_HANDLER \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7;
-#else
-# if RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG_LEAF(o2,g1) \
- sethi %gdop_hix22(rtld_errno), %g1; \
- xor %g1, %gdop_lox10(rtld_errno), %g1;\
- ld [%o2 + %g1], %g1, %gdop(rtld_errno); \
- st %o0, [%g1]; \
- jmp %o7 + 8; \
- mov -1, %o0;
-# elif defined _LIBC_REENTRANT
-
-# if IS_IN (libc)
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG_LEAF(o2,g1) \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
- add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
- ld [%o2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
- st %o0, [%g7 + %g1]; \
- jmp %o7 + 8; \
- mov -1, %o0;
-# else
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG_LEAF(o2,g1) \
- sethi %gdop_hix22(errno), %g1;\
- xor %g1, %gdop_lox10(errno), %g1;\
- ld [%o2 + %g1], %g1, %gdop(errno);\
- st %o0, [%g1]; \
- jmp %o7 + 8; \
- mov -1, %o0;
-# endif /* _LIBC_REENTRANT */
-#endif /* PIC */
-
-
-#else /* __ASSEMBLER__ */
-
-#define __SYSCALL_STRING \
- "ta 0x10;" \
- "bcc 1f;" \
- " nop;" \
- "sub %%g0, %%o0, %%o0;" \
- "1:"
-
-#define __SYSCALL_CLOBBERS \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
- "cc", "memory"
-
-#endif /* __ASSEMBLER__ */
+#include <tcb-offsets.h>
/* Pointer mangling support. */
#if IS_IN (rtld)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S b/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
index be48386016..5deb40d7ec 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
@@ -22,7 +22,7 @@
.text
.globl __syscall_error
ENTRY(__libc_vfork)
- LOADSYSCALL(vfork)
+ mov __NR_vfork, %g1
ta 0x10
bcc 2f
mov %o7, %g1
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S
index 01f5f1b383..dc2aab290b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S
@@ -46,7 +46,7 @@ ENTRY (____longjmp_chk)
cfi_register(%o7, %i7)
add %fp, 2023, %o1
clr %o0
- LOADSYSCALL(sigaltstack)
+ mov __NR_sigaltstack, %g1
ta 0x6d
bcs,pn %xcc, .Lok2
lduw [%fp + 2031], %l2
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index 2010faf50f..07ffe63d3a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -20,109 +20,7 @@
#define _LINUX_SPARC64_SYSDEP_H 1
#include <sysdeps/unix/sysv/linux/sparc/sysdep.h>
-
-#if IS_IN (rtld)
-# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */
-#endif
-#include <tls.h>
-
-#undef SYS_ify
-#define SYS_ify(syscall_name) __NR_##syscall_name
-
-#ifdef __ASSEMBLER__
-
-#define LOADSYSCALL(x) mov __NR_##x, %g1
-
-#undef PSEUDO
-#define PSEUDO(name, syscall_name, args) \
- .text; \
-ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d; \
- bcc,pt %xcc, 1f; \
- nop; \
- SYSCALL_ERROR_HANDLER \
-1:
-
-#undef PSEUDO_NOERRNO
-#define PSEUDO_NOERRNO(name, syscall_name, args)\
- .text; \
-ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d;
-
-#undef PSEUDO_ERRVAL
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
-ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d;
-
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
- END(name)
-
-#ifndef PIC
-# define SYSCALL_ERROR_HANDLER \
- mov %o7, %g1; \
- call __syscall_error; \
- mov %g1, %o7;
-#else
-# if RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG_LEAF(o2,g1) \
- sethi %gdop_hix22(rtld_errno), %g1; \
- xor %g1, %gdop_lox10(rtld_errno), %g1;\
- ldx [%o2 + %g1], %g1, %gdop(rtld_errno); \
- st %o0, [%g1]; \
- jmp %o7 + 8; \
- mov -1, %o0;
-# elif defined _LIBC_REENTRANT
-
-# if IS_IN (libc)
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG_LEAF(o2,g1) \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
- add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
- ldx [%o2 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO);\
- st %o0, [%g7 + %g1]; \
- jmp %o7 + 8; \
- mov -1, %o0;
-# else
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG_LEAF(o2,g1) \
- sethi %gdop_hix22(errno), %g1;\
- xor %g1, %gdop_lox10(errno), %g1;\
- ldx [%o2 + %g1], %g1, %gdop(errno);\
- st %o0, [%g1]; \
- jmp %o7 + 8; \
- mov -1, %o0;
-# endif /* _LIBC_REENTRANT */
-#endif /* PIC */
-
-#else /* __ASSEMBLER__ */
-
-#define __SYSCALL_STRING \
- "ta 0x6d;" \
- "bcc,pt %%xcc, 1f;" \
- " nop;" \
- "sub %%g0, %%o0, %%o0;" \
- "1:"
-
-#define __SYSCALL_CLOBBERS \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
- "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \
- "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \
- "cc", "memory"
-
-#endif /* __ASSEMBLER__ */
+#include <tcb-offsets.h>
/* This is the offset from the %sp to the backing store above the
register windows. So if you poke stack memory directly you add this. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S b/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
index 56a491f3de..114c7bcb26 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
@@ -22,7 +22,7 @@
.text
.globl __syscall_error
ENTRY(__libc_vfork)
- LOADSYSCALL(vfork)
+ mov __NR_vfork, %g1
ta 0x6d
bcc,pt %xcc, 2f
mov %o7, %g1
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sysdep.h
index 1598331aa8..cdce18c576 100644
--- a/sysdeps/unix/sysv/linux/sparc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sysdep.h
@@ -23,16 +23,7 @@
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/sparc/sysdep.h>
-#ifdef __ASSEMBLER__
-
-#define ret retl; nop
-#define ret_NOERRNO retl; nop
-#define ret_ERRVAL retl; nop
-#define r0 %o0
-#define r1 %o1
-#define MOVE(x,y) mov x, y
-
-#else /* __ASSEMBLER__ */
+#ifndef __ASSEMBLER__
# define VDSO_NAME "LINUX_2.6"
# define VDSO_HASH 61765110
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-29 21:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 21:50 [glibc/azanella/syscall-refactor] sparc: Remove assembly syscall macros Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).