summaryrefslogtreecommitdiff
path: root/arch/arm64/include/uapi/asm/siginfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/include/uapi/asm/siginfo.h')
-rw-r--r--arch/arm64/include/uapi/asm/siginfo.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm64/include/uapi/asm/siginfo.h b/arch/arm64/include/uapi/asm/siginfo.h
index 5a74a0853db0..c80c612885ae 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