summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc64/sysdep.h16
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sysdep.h2
4 files changed, 21 insertions, 13 deletions
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index 1ea4c3b917..589f7c8d18 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -306,7 +306,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
beq \JUMPFALSE
.endm
-#if IS_IN(rtld)
+#if !defined(USE_PPC_SCV) || IS_IN(rtld)
# define DO_CALL(syscall) \
li r0,syscall; \
DO_CALL_SC
@@ -323,7 +323,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
b 1f; \
0: DO_CALL_SC; \
1:
-#endif /* IS_IN(rtld) */
+#endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */
/* DO_CALL_SC and DO_CALL_SCV expect the syscall number to be in r0. */
#define DO_CALL_SC \
@@ -378,7 +378,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
.endif
#endif
-#if IS_IN(rtld)
+#if !defined(USE_PPC_SCV) || IS_IN(rtld)
# define PSEUDO_RET \
RET_SC; \
TAIL_CALL_SYSCALL_ERROR
@@ -395,7 +395,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
b 1f; \
0: RET_SC; \
1: TAIL_CALL_SYSCALL_ERROR
-#endif
+#endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */
#define RET_SCV \
li r9,-4095; \
@@ -417,7 +417,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
ENTRY (name); \
DO_CALL (SYS_ify (syscall_name))
-#if IS_IN(rtld)
+#if !defined(USE_PPC_SCV) || IS_IN(rtld)
# define PSEUDO_RET_NOERRNO \
blr
#else
@@ -425,7 +425,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
# define PSEUDO_RET_NOERRNO \
NVOLREG_RESTORE; \
blr
-#endif /* IS_IN(rtld) */
+#endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */
#define ret_NOERRNO PSEUDO_RET_NOERRNO
@@ -438,7 +438,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
ENTRY (name); \
DO_CALL (SYS_ify (syscall_name))
-#if IS_IN(rtld)
+#if !defined(USE_PPC_SCV) || IS_IN(rtld)
# define PSEUDO_RET_ERRVAL \
blr
#else
@@ -446,7 +446,7 @@ LT_LABELSUFFIX(name,_name_end): ; \
# define PSEUDO_RET_ERRVAL \
NVOLREG_RESTORE; \
blr
-#endif /* IS_IN(rtld) */
+#endif /* !defined(USE_PPC_SCV) || IS_IN(rtld) */
#define ret_ERRVAL PSEUDO_RET_ERRVAL
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index e9bd8cb960..777ead80b0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -38,11 +38,13 @@ ENTRY (__clone)
beq- cr0,L(badargs)
/* Save some regs in the "red zone". */
+#ifdef USE_PPC_SCV
std r28,-32(r1)
+ cfi_offset(r28,-32)
+#endif
std r29,-24(r1)
std r30,-16(r1)
std r31,-8(r1)
- cfi_offset(r28,-32)
cfi_offset(r29,-24)
cfi_offset(r30,-16)
cfi_offset(r31,-8)
@@ -71,6 +73,7 @@ ENTRY (__clone)
/* Do the call. */
li r0,SYS_ify(clone)
+#ifdef USE_PPC_SCV
CHECK_SCV_SUPPORT r28 0f
/* This is equivalent to DO_CALL_SCV, but we cannot use the macro here
because it uses CFI directives and we just called cfi_endproc. */
@@ -87,6 +90,7 @@ ENTRY (__clone)
/* When using scv, error is indicated by negative r3. */
cmpdi cr1,r3,0
b 1f
+#endif /* USE_PPC_SCV */
0: DO_CALL_SC
/* Check for child process. */
@@ -119,22 +123,26 @@ L(parent):
cmpdi cr1,r28,0
/* Parent. Restore registers & return. */
+#ifdef USE_PPC_SCV
cfi_offset(r28,-32)
+ ld r28,-32(r1)
+ cfi_restore(r28)
+#endif
cfi_offset(r29,-24)
cfi_offset(r30,-16)
cfi_offset(r31,-8)
- ld r28,-32(r1)
ld r29,-24(r1)
ld r30,-16(r1)
ld r31,-8(r1)
- cfi_restore(r28)
cfi_restore(r29)
cfi_restore(r30)
cfi_restore(r31)
+#ifdef USE_PPC_SCV
beq cr1,0f
RET_SCV
b 1f
+#endif
0: RET_SC
1: TAIL_CALL_SYSCALL_ERROR
diff --git a/sysdeps/unix/sysv/linux/powerpc/syscall.S b/sysdeps/unix/sysv/linux/powerpc/syscall.S
index d6ec87f006..a29652feaf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/syscall.S
+++ b/sysdeps/unix/sysv/linux/powerpc/syscall.S
@@ -25,7 +25,7 @@ ENTRY (syscall)
mr r6,r7
mr r7,r8
mr r8,r9
-#if !IS_IN(rtld) && (defined(__PPC64__) || defined(__powerpc64__))
+#if defined(USE_PPC_SCV) && !IS_IN(rtld) && (defined(__PPC64__) || defined(__powerpc64__))
CHECK_SCV_SUPPORT r9 0f
DO_CALL_SCV
RET_SCV
diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/sysdep.h
index 2f31f9177b..4b9d43c636 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.h
@@ -125,7 +125,7 @@
/* When inside the dynamic loader, the thread pointer may not have been
initialized yet, so don't check for scv support in that case. */
-# if !IS_IN(rtld)
+# if defined(USE_PPC_SCV) && !IS_IN(rtld)
# undef TRY_SYSCALL_SCV
# define TRY_SYSCALL_SCV(nr) \
CHECK_THREAD_POINTER && THREAD_GET_HWCAP() & PPC_FEATURE2_SCV ? \