Allow defining a custom __SIGINFO struct. This allows architectures to
apply their own padding and allignment requirements to the struct. This
is similar to the __ARCH_SI_ATTRIBUTES #define that already exists, but
applies to the __SIGINFO struct instead of the siginfo_t struct.

Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
---
 include/uapi/asm-generic/siginfo.h | 32 ++++++++++++++++--------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/include/uapi/asm-generic/siginfo.h 
b/include/uapi/asm-generic/siginfo.h
index cb3d6c267181..09b0a1abac14 100644
--- a/include/uapi/asm-generic/siginfo.h
+++ b/include/uapi/asm-generic/siginfo.h
@@ -108,23 +108,25 @@ union __sifields {
        } _sigsys;
 };
 
-#ifndef __ARCH_HAS_SWAPPED_SIGINFO
-#define __SIGINFO                      \
-struct {                               \
-       int si_signo;                   \
-       int si_errno;                   \
-       int si_code;                    \
-       union __sifields _sifields;     \
+#ifndef __SIGINFO
+# ifndef __ARCH_HAS_SWAPPED_SIGINFO
+# define __SIGINFO                                             \
+struct {                                                       \
+       int si_signo;                                           \
+       int si_errno;                                           \
+       int si_code;                                            \
+       union __sifields _sifields __ARCH_SI_ATTRIBUTES;        \
 }
-#else
-#define __SIGINFO                      \
-struct {                               \
-       int si_signo;                   \
-       int si_code;                    \
-       int si_errno;                   \
-       union __sifields _sifields;     \
+# else
+# define __SIGINFO                                             \
+struct {                                                       \
+       int si_signo;                                           \
+       int si_code;                                            \
+       int si_errno;                                           \
+       union __sifields _sifields __ARCH_SI_ATTRIBUTES;        \
 }
-#endif /* __ARCH_HAS_SWAPPED_SIGINFO */
+# endif /* __ARCH_HAS_SWAPPED_SIGINFO */
+#endif /* __SIGINFO */
 
 typedef struct siginfo {
        union {
-- 
2.22.0

Reply via email to