about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc64/memcpy.S12
-rw-r--r--sysdeps/unix/sysv/linux/sched_setaffinity.c9
2 files changed, 12 insertions, 9 deletions
diff --git a/sysdeps/powerpc/powerpc64/memcpy.S b/sysdeps/powerpc/powerpc64/memcpy.S
index c6d764595e..f3448e0b31 100644
--- a/sysdeps/powerpc/powerpc64/memcpy.S
+++ b/sysdeps/powerpc/powerpc64/memcpy.S
@@ -79,6 +79,8 @@ EALIGN (BP_SYM (memcpy), 5, 0)
     rldicl. 0,12,0,61
     cmpldi cr6,31,7
     ble-  cr6,.L2  /* less than 8 bytes left.  */
+    srdi  11,31,3
+    andi. 10,12,7
     bne-  0,.L6   /* Source is not DW aligned.  */
     srdi. 9,31,3
     mr    10,3
@@ -164,19 +166,17 @@ EALIGN (BP_SYM (memcpy), 5, 0)
     ld 30,-16(1)
     blr
 
+    .align  4
 .L6:
-    srdi 11,31,3
-    mr 4,3
-    mr 5,12
 
   /* Copy doublewords where the destination is aligned but the source is
      not.  Use aligned doubleword loads from the source, shifted to realign
      the data, to allow aligned destination stores.  */
-    andi. 10,5,7
+    subf  5,10,12
     andi. 0,11,1
-    subf  5,10,5
-    ld    6,0(5)
     sldi  10,10,3
+    mr    4,3
+    ld    6,0(5)
     ld    7,8(5)
     subfic  9,10,64
     beq   2f
diff --git a/sysdeps/unix/sysv/linux/sched_setaffinity.c b/sysdeps/unix/sysv/linux/sched_setaffinity.c
index 36f73d4a59..5b1b8ee878 100644
--- a/sysdeps/unix/sysv/linux/sched_setaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_setaffinity.c
@@ -60,9 +60,12 @@ __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
      does not request to set a bit beyond that.  */
   for (size_t cnt = __kernel_cpumask_size; cnt < cpusetsize; ++cnt)
     if (((char *) cpuset)[cnt] != '\0')
-      /* Found a nonzero byte.  This means the user request cannot be
-	 fulfilled.  */
-      return EINVAL;
+      {
+        /* Found a nonzero byte.  This means the user request cannot be
+	   fulfilled.  */
+	__set_errno (EINVAL);
+	return -1;
+      }
 
   return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
 }