about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc
diff options
context:
space:
mode:
authorRogerio Alves <rcardoso@linux.ibm.com>2018-11-05 10:18:38 -0600
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2019-01-11 15:17:25 -0200
commit0bc9bdf159f43c50ec31e9a1670e2e04b5d4060d (patch)
tree1e23a140d4f6bf8cd96e01a9c60c9706a2e74d78 /sysdeps/unix/sysv/linux/powerpc
parent5494af04adabe72cbd0055fe9ed466af529eaafd (diff)
downloadglibc-0bc9bdf159f43c50ec31e9a1670e2e04b5d4060d.tar.gz
glibc-0bc9bdf159f43c50ec31e9a1670e2e04b5d4060d.tar.xz
glibc-0bc9bdf159f43c50ec31e9a1670e2e04b5d4060d.zip
powerpc: Fix VSCR position in ucontext (bug 24088)
This patch fix VSCR position on ucontext. VSCR was read in the wrong
position on ucontext structure because it was ignoring the machine
endianess.

	[BZ #24088]
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (vscr_t): Added
	ifdef to fix read of VSCR.
	* sysdeps/powerpc/powerpc64/Makefile [$subdir == stdlib]: Add
	tst-ucontext-ppc64-vscr.c to test list.
	* sysdeps/powerpc/powerpc64/tst-ucontext-ppc64-vscr.c: New test file.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
index ccd4992806..95142401a3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
@@ -98,8 +98,13 @@ typedef double fpregset_t[__NFPREG];
    a whole quadword speedup save/restore.  */
 typedef struct _libc_vscr
 {
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 	unsigned int __pad[3];
 	unsigned int __ctx(vscr_word);
+#else
+	unsigned int __ctx(vscr_word);
+	unsigned int __pad[3];
+#endif
 } vscr_t;
 
 /* Container for Altivec/VMX registers and status.