aboutsummaryrefslogtreecommitdiff
path: root/meta-aarch64/recipes-kernel/linux-libc-headers/linux-libc-headers/0007-ARM64-ILP32-Use-the-same-size-and-layout-of-the-sign.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-aarch64/recipes-kernel/linux-libc-headers/linux-libc-headers/0007-ARM64-ILP32-Use-the-same-size-and-layout-of-the-sign.patch')
-rw-r--r--meta-aarch64/recipes-kernel/linux-libc-headers/linux-libc-headers/0007-ARM64-ILP32-Use-the-same-size-and-layout-of-the-sign.patch115
1 files changed, 115 insertions, 0 deletions
diff --git a/meta-aarch64/recipes-kernel/linux-libc-headers/linux-libc-headers/0007-ARM64-ILP32-Use-the-same-size-and-layout-of-the-sign.patch b/meta-aarch64/recipes-kernel/linux-libc-headers/linux-libc-headers/0007-ARM64-ILP32-Use-the-same-size-and-layout-of-the-sign.patch
new file mode 100644
index 00000000..02e5b2d2
--- /dev/null
+++ b/meta-aarch64/recipes-kernel/linux-libc-headers/linux-libc-headers/0007-ARM64-ILP32-Use-the-same-size-and-layout-of-the-sign.patch
@@ -0,0 +1,115 @@
+From d3813d97d5face12f9762a394e845fff7774c0dc Mon Sep 17 00:00:00 2001
+From: Andrew Pinski <apinski@cavium.com>
+Date: Wed, 3 Sep 2014 14:19:01 -0700
+Subject: [PATCH 07/25] ARM64:ILP32: Use the same size and layout of the signal
+ structures for ILP32 as for LP64
+
+Defines the macros which allow the signal structures to be the same between ILP32 and LP64.
+
+Signed-off-by: Andrew Pinski <apinski@cavium.com>
+---
+ arch/arm64/include/uapi/asm/siginfo.h | 33 +++++++++++++++++++++++++++++++++
+ arch/arm64/include/uapi/asm/signal.h | 34 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 67 insertions(+)
+
+diff --git a/arch/arm64/include/uapi/asm/siginfo.h b/arch/arm64/include/uapi/asm/siginfo.h
+index 5a74a08..c80c612 100644
+--- a/arch/arm64/include/uapi/asm/siginfo.h
++++ b/arch/arm64/include/uapi/asm/siginfo.h
+@@ -1,5 +1,6 @@
+ /*
+ * Copyright (C) 2012 ARM Ltd.
++ * Copyright (C) 2014 Cavium Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+@@ -18,6 +19,38 @@
+
+ #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+
++#ifdef __ILP32__
++
++/*
++ * For ILP32, the siginfo structures should share the same layout and
++ * alignement requirements as LP64 ABI.
++ * To do this, use an extra pad field and add aligned attribute
++ * to the structure.
++ */
++
++# ifdef __AARCH64EB__
++# define __SIGINFO_INNER(type, field) \
++ int __pad#field; \
++ type field
++# else
++# define __SIGINFO_INNER(type, field) \
++ type field; \
++ int __pad#field
++# endif
++
++# undef __SIGINFO_VOIDPTR
++# define __SIGINFO_VOIDPTR(field) \
++ __SIGINFO_INNER(void __user*, field)
++# undef __SIGINFO_BAND
++
++# define __SIGINFO_BAND(field) \
++ __SIGINFO_INNER(long, field)
++
++/* Make the alignment of siginfo always 8 byte aligned. */
++#define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
++
++#endif
++
+ #include <asm-generic/siginfo.h>
+
+ #endif
+diff --git a/arch/arm64/include/uapi/asm/signal.h b/arch/arm64/include/uapi/asm/signal.h
+index 8d1e723..d33a5f7 100644
+--- a/arch/arm64/include/uapi/asm/signal.h
++++ b/arch/arm64/include/uapi/asm/signal.h
+@@ -16,9 +16,43 @@
+ #ifndef __ASM_SIGNAL_H
+ #define __ASM_SIGNAL_H
+
++#include <asm/posix-types.h>
++
+ /* Required for AArch32 compatibility. */
+ #define SA_RESTORER 0x04000000
+
++/*
++ * Since sigset is a bitmask, we need the same size fields for ILP32
++ * and LP64. With big-endian, 32bit bitmask does not match up to
++ * 64bit bitmask (unlike with little-endian).
++ */
++#ifdef __ILP32__
++
++#define __SIGSET_INNER_TYPE __kernel_ulong_t
++#define _NSIG_BPW 64
++
++# ifdef __AARCH64EB__
++# define __SIGNAL_INNER(type, field) \
++ int __pad_##field; \
++ type field;
++# else
++# define __SIGNAL_INNER(type, field) \
++ type field; \
++ int __pad_##field;
++# endif
++
++# define __SIGACTION_HANDLER(field) \
++ __SIGNAL_INNER(__sighandler_t, field)
++
++
++#define __SIGACTION_FLAGS(field) \
++ __kernel_ulong_t field
++
++#define __SIGACTION_RESTORER(field) \
++ __SIGNAL_INNER(__sigrestore_t, field)
++
++#endif
++
+ #include <asm-generic/signal.h>
+
+ #endif
+--
+1.9.3
+