mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Separate siginfo_t for MIPS
@ 2015-12-10 10:47 Dmitry Ivanov
  2015-12-10 12:36 ` Szabolcs Nagy
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Ivanov @ 2015-12-10 10:47 UTC (permalink / raw)
  To: musl

MIPS has non-default siginfo_t structure. Also, some si_code values are
different. This patch is required for POSIX timers to work.

---
 arch/aarch64/bits/siginfo.h    |  0
 arch/arm/bits/siginfo.h        |  0
 arch/i386/bits/siginfo.h       |  0
 arch/microblaze/bits/siginfo.h |  0
 arch/mips/bits/siginfo.h       | 52 ++++++++++++++++++++++++++++++++++++++++++
 arch/or1k/bits/siginfo.h       |  0
 arch/powerpc/bits/siginfo.h    |  0
 arch/sh/bits/siginfo.h         |  0
 arch/x32/bits/siginfo.h        |  0
 arch/x86_64/bits/siginfo.h     |  0
 include/signal.h               |  7 ++++++
 11 files changed, 59 insertions(+)
 create mode 100644 arch/aarch64/bits/siginfo.h
 create mode 100644 arch/arm/bits/siginfo.h
 create mode 100644 arch/i386/bits/siginfo.h
 create mode 100644 arch/microblaze/bits/siginfo.h
 create mode 100644 arch/mips/bits/siginfo.h
 create mode 100644 arch/or1k/bits/siginfo.h
 create mode 100644 arch/powerpc/bits/siginfo.h
 create mode 100644 arch/sh/bits/siginfo.h
 create mode 100644 arch/x32/bits/siginfo.h
 create mode 100644 arch/x86_64/bits/siginfo.h

diff --git a/arch/aarch64/bits/siginfo.h b/arch/aarch64/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/arm/bits/siginfo.h b/arch/arm/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/i386/bits/siginfo.h b/arch/i386/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/microblaze/bits/siginfo.h b/arch/microblaze/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/mips/bits/siginfo.h b/arch/mips/bits/siginfo.h
new file mode 100644
index 0000000..42dbdf5
--- /dev/null
+++ b/arch/mips/bits/siginfo.h
@@ -0,0 +1,52 @@
+#define HAVE_ARCH_SIGINFO_T
+
+#undef SI_ASYNCIO
+#undef SI_TIMER
+#undef SI_MESGQ
+#define SI_ASYNCIO  -2 /* sent by AIO completion */
+#define SI_TIMER    -3 /* sent by timer expiration */
+#define SI_MESGQ    -4 /* sent by real time mesq state change */
+
+/* We can't use generic siginfo_t, because our si_code and si_errno are swapped */
+typedef struct {
+	int si_signo, si_code, si_errno;
+	union {
+		char __pad[128 - 2*sizeof(int) - sizeof(long)];
+		struct {
+			union {
+				struct {
+					pid_t si_pid;
+					uid_t si_uid;
+				} __piduid;
+				struct {
+					int si_timerid;
+					int si_overrun;
+				} __timer;
+			} __first;
+			union {
+				union sigval si_value;
+				struct {
+					int si_status;
+					clock_t si_utime, si_stime;
+				} __sigchld;
+			} __second;
+		} __si_common;
+		struct {
+			void *si_addr;
+			short si_addr_lsb;
+			struct {
+				void *si_lower;
+				void *si_upper;
+			} __addr_bnd;
+		} __sigfault;
+		struct {
+			long si_band;
+			int si_fd;
+		} __sigpoll;
+		struct {
+			void *si_call_addr;
+			int si_syscall;
+			unsigned si_arch;
+		} __sigsys;
+	} __si_fields;
+} siginfo_t;
diff --git a/arch/or1k/bits/siginfo.h b/arch/or1k/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/powerpc/bits/siginfo.h b/arch/powerpc/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/sh/bits/siginfo.h b/arch/sh/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/x32/bits/siginfo.h b/arch/x32/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/arch/x86_64/bits/siginfo.h b/arch/x86_64/bits/siginfo.h
new file mode 100644
index 0000000..e69de29
diff --git a/include/signal.h b/include/signal.h
index 559362f..087657b 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -85,6 +85,11 @@ union sigval {
 	void *sival_ptr;
 };
 
+#undef HAVE_ARCH_SIGINFO_T
+
+#include <bits/siginfo.h>
+
+#ifndef HAVE_ARCH_SIGINFO_T
 typedef struct {
 	int si_signo, si_errno, si_code;
 	union {
@@ -127,6 +132,8 @@ typedef struct {
 		} __sigsys;
 	} __si_fields;
 } siginfo_t;
+#endif
+
 #define si_pid     __si_fields.__si_common.__first.__piduid.si_pid
 #define si_uid     __si_fields.__si_common.__first.__piduid.si_uid
 #define si_status  __si_fields.__si_common.__second.__sigchld.si_status
-- 
2.1.4



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-27  3:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 10:47 [PATCH] Separate siginfo_t for MIPS Dmitry Ivanov
2015-12-10 12:36 ` Szabolcs Nagy
2015-12-10 13:49   ` [PATCH v2] Different " Dmitry Ivanov
2015-12-16  4:34   ` [PATCH] Separate " Rich Felker
2016-01-26 22:24     ` Szabolcs Nagy
2016-01-26 22:57       ` Rich Felker
2016-01-26 23:32         ` Szabolcs Nagy
2016-01-27  1:03           ` Szabolcs Nagy
2016-01-27  3:33             ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).