Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2014 13:56:14 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r265182 - in user/dchagin/lemul/sys: amd64/linux amd64/linux32 compat/linux i386/linux
Message-ID:  <201405011356.s41DuEvL070087@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Thu May  1 13:56:13 2014
New Revision: 265182
URL: http://svnweb.freebsd.org/changeset/base/265182

Log:
  To avoid code duplication move MI signals definitions to the MI
  header file.

Modified:
  user/dchagin/lemul/sys/amd64/linux/linux.h
  user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c
  user/dchagin/lemul/sys/amd64/linux32/linux.h
  user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c
  user/dchagin/lemul/sys/compat/linux/linux_signal.c
  user/dchagin/lemul/sys/compat/linux/linux_signal.h
  user/dchagin/lemul/sys/i386/linux/linux.h
  user/dchagin/lemul/sys/i386/linux/linux_sysvec.c

Modified: user/dchagin/lemul/sys/amd64/linux/linux.h
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux/linux.h	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/amd64/linux/linux.h	Thu May  1 13:56:13 2014	(r265182)
@@ -172,62 +172,11 @@ struct l_newstat {
 /*
  * Signalling
  */
-#define	LINUX_SIGHUP		1
-#define	LINUX_SIGINT		2
-#define	LINUX_SIGQUIT		3
-#define	LINUX_SIGILL		4
-#define	LINUX_SIGTRAP		5
-#define	LINUX_SIGABRT		6
-#define	LINUX_SIGIOT		LINUX_SIGABRT
-#define	LINUX_SIGBUS		7
-#define	LINUX_SIGFPE		8
-#define	LINUX_SIGKILL		9
-#define	LINUX_SIGUSR1		10
-#define	LINUX_SIGSEGV		11
-#define	LINUX_SIGUSR2		12
-#define	LINUX_SIGPIPE		13
-#define	LINUX_SIGALRM		14
-#define	LINUX_SIGTERM		15
-#define	LINUX_SIGSTKFLT		16
-#define	LINUX_SIGCHLD		17
-#define	LINUX_SIGCONT		18
-#define	LINUX_SIGSTOP		19
-#define	LINUX_SIGTSTP		20
-#define	LINUX_SIGTTIN		21
-#define	LINUX_SIGTTOU		22
-#define	LINUX_SIGURG		23
-#define	LINUX_SIGXCPU		24
-#define	LINUX_SIGXFSZ		25
-#define	LINUX_SIGVTALRM		26
-#define	LINUX_SIGPROF		27
-#define	LINUX_SIGWINCH		28
-#define	LINUX_SIGIO		29
-#define	LINUX_SIGPOLL		LINUX_SIGIO
-#define	LINUX_SIGPWR		30
-#define	LINUX_SIGSYS		31
-#define	LINUX_SIGRTMIN		32
-
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG		64
 #define	LINUX_NBPW		64
 #define	LINUX_NSIG_WORDS	(LINUX_NSIG / LINUX_NBPW)
 
-/* sigaction flags */
-#define	LINUX_SA_NOCLDSTOP	0x00000001
-#define	LINUX_SA_NOCLDWAIT	0x00000002
-#define	LINUX_SA_SIGINFO	0x00000004
-#define	LINUX_SA_RESTORER	0x04000000
-#define	LINUX_SA_ONSTACK	0x08000000
-#define	LINUX_SA_RESTART	0x10000000
-#define	LINUX_SA_INTERRUPT	0x20000000
-#define	LINUX_SA_NOMASK		0x40000000
-#define	LINUX_SA_ONESHOT	0x80000000
-
-/* sigprocmask actions */
-#define	LINUX_SIG_BLOCK		0
-#define	LINUX_SIG_UNBLOCK	1
-#define	LINUX_SIG_SETMASK	2
-
 /* primitives to manipulate sigset_t */
 
 #define	LINUX_SIGEMPTYSET(set)					\

Modified: user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c	Thu May  1 13:56:13 2014	(r265182)
@@ -148,28 +148,6 @@ static int bsd_to_linux_errno[ELAST + 1]
 	 -72, -67, -71
 };
 
-int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
-	LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
-	LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
-	LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
-	LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
-	LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
-	LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
-	LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
-	0, LINUX_SIGUSR1, LINUX_SIGUSR2
-};
-
-int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
-	SIGHUP, SIGINT, SIGQUIT, SIGILL,
-	SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
-	SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
-	SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
-	SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
-	SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
-	SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
-	SIGIO, SIGURG, SIGSYS
-};
-
 #define LINUX_T_UNKNOWN  255
 static int _bsd_to_linux_trapcode[] = {
 	LINUX_T_UNKNOWN,	/* 0 */

Modified: user/dchagin/lemul/sys/amd64/linux32/linux.h
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux.h	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/amd64/linux32/linux.h	Thu May  1 13:56:13 2014	(r265182)
@@ -260,62 +260,11 @@ struct l_statfs64 { 
 /*
  * Signalling
  */
-#define	LINUX_SIGHUP		1
-#define	LINUX_SIGINT		2
-#define	LINUX_SIGQUIT		3
-#define	LINUX_SIGILL		4
-#define	LINUX_SIGTRAP		5
-#define	LINUX_SIGABRT		6
-#define	LINUX_SIGIOT		LINUX_SIGABRT
-#define	LINUX_SIGBUS		7
-#define	LINUX_SIGFPE		8
-#define	LINUX_SIGKILL		9
-#define	LINUX_SIGUSR1		10
-#define	LINUX_SIGSEGV		11
-#define	LINUX_SIGUSR2		12
-#define	LINUX_SIGPIPE		13
-#define	LINUX_SIGALRM		14
-#define	LINUX_SIGTERM		15
-#define	LINUX_SIGSTKFLT		16
-#define	LINUX_SIGCHLD		17
-#define	LINUX_SIGCONT		18
-#define	LINUX_SIGSTOP		19
-#define	LINUX_SIGTSTP		20
-#define	LINUX_SIGTTIN		21
-#define	LINUX_SIGTTOU		22
-#define	LINUX_SIGURG		23
-#define	LINUX_SIGXCPU		24
-#define	LINUX_SIGXFSZ		25
-#define	LINUX_SIGVTALRM		26
-#define	LINUX_SIGPROF		27
-#define	LINUX_SIGWINCH		28
-#define	LINUX_SIGIO		29
-#define	LINUX_SIGPOLL		LINUX_SIGIO
-#define	LINUX_SIGPWR		30
-#define	LINUX_SIGSYS		31
-#define	LINUX_SIGRTMIN		32
-
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2
 #define	LINUX_NBPW		32
 #define	LINUX_NSIG		(LINUX_NBPW * LINUX_NSIG_WORDS)
 
-/* sigaction flags */
-#define	LINUX_SA_NOCLDSTOP	0x00000001
-#define	LINUX_SA_NOCLDWAIT	0x00000002
-#define	LINUX_SA_SIGINFO	0x00000004
-#define	LINUX_SA_RESTORER	0x04000000
-#define	LINUX_SA_ONSTACK	0x08000000
-#define	LINUX_SA_RESTART	0x10000000
-#define	LINUX_SA_INTERRUPT	0x20000000
-#define	LINUX_SA_NOMASK		0x40000000
-#define	LINUX_SA_ONESHOT	0x80000000
-
-/* sigprocmask actions */
-#define	LINUX_SIG_BLOCK		0
-#define	LINUX_SIG_UNBLOCK	1
-#define	LINUX_SIG_SETMASK	2
-
 /* sigset_t macros */
 #define	LINUX_SIGEMPTYSET(set)		(set).__bits[0] = (set).__bits[1] = 0
 #define	LINUX_SIGISMEMBER(set, sig)	SIGISMEMBER(set, sig)

Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c	Thu May  1 13:56:13 2014	(r265182)
@@ -156,28 +156,6 @@ static int bsd_to_linux_errno[ELAST + 1]
 	 -72, -67, -71
 };
 
-int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
-	LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
-	LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
-	LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
-	LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
-	LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
-	LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
-	LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
-	0, LINUX_SIGUSR1, LINUX_SIGUSR2
-};
-
-int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
-	SIGHUP, SIGINT, SIGQUIT, SIGILL,
-	SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
-	SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
-	SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
-	SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
-	SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
-	SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
-	SIGIO, SIGURG, SIGSYS
-};
-
 #define LINUX_T_UNKNOWN  255
 static int _bsd_to_linux_trapcode[] = {
 	LINUX_T_UNKNOWN,	/* 0 */

Modified: user/dchagin/lemul/sys/compat/linux/linux_signal.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_signal.c	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/compat/linux/linux_signal.c	Thu May  1 13:56:13 2014	(r265182)
@@ -58,6 +58,29 @@ __FBSDID("$FreeBSD$");
 static int	linux_do_tkill(struct thread *td, struct thread *tdt,
 		    ksiginfo_t *ksi);
 
+
+int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
+	LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
+	LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
+	LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
+	LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
+	LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
+	LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
+	LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
+	0, LINUX_SIGUSR1, LINUX_SIGUSR2
+};
+
+int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
+	SIGHUP, SIGINT, SIGQUIT, SIGILL,
+	SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
+	SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
+	SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
+	SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
+	SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
+	SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
+	SIGIO, SIGURG, SIGSYS
+};
+
 #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 void
 linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss)

Modified: user/dchagin/lemul/sys/compat/linux/linux_signal.h
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_signal.h	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/compat/linux/linux_signal.h	Thu May  1 13:56:13 2014	(r265182)
@@ -31,6 +31,60 @@
 #ifndef _LINUX_SIGNAL_H_
 #define _LINUX_SIGNAL_H_
 
+/*
+ * Signalling
+ */
+#define	LINUX_SIGHUP		1
+#define	LINUX_SIGINT		2
+#define	LINUX_SIGQUIT		3
+#define	LINUX_SIGILL		4
+#define	LINUX_SIGTRAP		5
+#define	LINUX_SIGABRT		6
+#define	LINUX_SIGIOT		LINUX_SIGABRT
+#define	LINUX_SIGBUS		7
+#define	LINUX_SIGFPE		8
+#define	LINUX_SIGKILL		9
+#define	LINUX_SIGUSR1		10
+#define	LINUX_SIGSEGV		11
+#define	LINUX_SIGUSR2		12
+#define	LINUX_SIGPIPE		13
+#define	LINUX_SIGALRM		14
+#define	LINUX_SIGTERM		15
+#define	LINUX_SIGSTKFLT		16
+#define	LINUX_SIGCHLD		17
+#define	LINUX_SIGCONT		18
+#define	LINUX_SIGSTOP		19
+#define	LINUX_SIGTSTP		20
+#define	LINUX_SIGTTIN		21
+#define	LINUX_SIGTTOU		22
+#define	LINUX_SIGURG		23
+#define	LINUX_SIGXCPU		24
+#define	LINUX_SIGXFSZ		25
+#define	LINUX_SIGVTALRM		26
+#define	LINUX_SIGPROF		27
+#define	LINUX_SIGWINCH		28
+#define	LINUX_SIGIO		29
+#define	LINUX_SIGPOLL		LINUX_SIGIO
+#define	LINUX_SIGPWR		30
+#define	LINUX_SIGSYS		31
+#define	LINUX_SIGRTMIN		32
+
+/* sigaction flags */
+#define	LINUX_SA_NOCLDSTOP	0x00000001
+#define	LINUX_SA_NOCLDWAIT	0x00000002
+#define	LINUX_SA_SIGINFO	0x00000004
+#define	LINUX_SA_RESTORER	0x04000000
+#define	LINUX_SA_ONSTACK	0x08000000
+#define	LINUX_SA_RESTART	0x10000000
+#define	LINUX_SA_INTERRUPT	0x20000000
+#define	LINUX_SA_NOMASK		0x40000000
+#define	LINUX_SA_ONESHOT	0x80000000
+
+/* sigprocmask actions */
+#define	LINUX_SIG_BLOCK		0
+#define	LINUX_SIG_UNBLOCK	1
+#define	LINUX_SIG_SETMASK	2
+
 #define	LINUX_SI_TKILL		-6;
 
 extern int bsd_to_linux_signal[];

Modified: user/dchagin/lemul/sys/i386/linux/linux.h
==============================================================================
--- user/dchagin/lemul/sys/i386/linux/linux.h	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/i386/linux/linux.h	Thu May  1 13:56:13 2014	(r265182)
@@ -235,62 +235,11 @@ struct l_statfs64 { 
 /*
  * Signalling
  */
-#define	LINUX_SIGHUP		1
-#define	LINUX_SIGINT		2
-#define	LINUX_SIGQUIT		3
-#define	LINUX_SIGILL		4
-#define	LINUX_SIGTRAP		5
-#define	LINUX_SIGABRT		6
-#define	LINUX_SIGIOT		LINUX_SIGABRT
-#define	LINUX_SIGBUS		7
-#define	LINUX_SIGFPE		8
-#define	LINUX_SIGKILL		9
-#define	LINUX_SIGUSR1		10
-#define	LINUX_SIGSEGV		11
-#define	LINUX_SIGUSR2		12
-#define	LINUX_SIGPIPE		13
-#define	LINUX_SIGALRM		14
-#define	LINUX_SIGTERM		15
-#define	LINUX_SIGSTKFLT		16
-#define	LINUX_SIGCHLD		17
-#define	LINUX_SIGCONT		18
-#define	LINUX_SIGSTOP		19
-#define	LINUX_SIGTSTP		20
-#define	LINUX_SIGTTIN		21
-#define	LINUX_SIGTTOU		22
-#define	LINUX_SIGURG		23
-#define	LINUX_SIGXCPU		24
-#define	LINUX_SIGXFSZ		25
-#define	LINUX_SIGVTALRM		26
-#define	LINUX_SIGPROF		27
-#define	LINUX_SIGWINCH		28
-#define	LINUX_SIGIO		29
-#define	LINUX_SIGPOLL		LINUX_SIGIO
-#define	LINUX_SIGPWR		30
-#define	LINUX_SIGSYS		31
-#define	LINUX_SIGRTMIN		32
-
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2
 #define	LINUX_NBPW		32
 #define	LINUX_NSIG		(LINUX_NBPW * LINUX_NSIG_WORDS)
 
-/* sigaction flags */
-#define	LINUX_SA_NOCLDSTOP	0x00000001
-#define	LINUX_SA_NOCLDWAIT	0x00000002
-#define	LINUX_SA_SIGINFO	0x00000004
-#define	LINUX_SA_RESTORER	0x04000000
-#define	LINUX_SA_ONSTACK	0x08000000
-#define	LINUX_SA_RESTART	0x10000000
-#define	LINUX_SA_INTERRUPT	0x20000000
-#define	LINUX_SA_NOMASK		0x40000000
-#define	LINUX_SA_ONESHOT	0x80000000
-
-/* sigprocmask actions */
-#define	LINUX_SIG_BLOCK		0
-#define	LINUX_SIG_UNBLOCK	1
-#define	LINUX_SIG_SETMASK	2
-
 /* sigset_t macros */
 #define	LINUX_SIGEMPTYSET(set)		(set).__bits[0] = (set).__bits[1] = 0
 #define	LINUX_SIGISMEMBER(set, sig)	SIGISMEMBER(set, sig)

Modified: user/dchagin/lemul/sys/i386/linux/linux_sysvec.c
==============================================================================
--- user/dchagin/lemul/sys/i386/linux/linux_sysvec.c	Thu May  1 13:54:51 2014	(r265181)
+++ user/dchagin/lemul/sys/i386/linux/linux_sysvec.c	Thu May  1 13:56:13 2014	(r265182)
@@ -142,28 +142,6 @@ static int bsd_to_linux_errno[ELAST + 1]
 	 -72, -67, -71
 };
 
-int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
-	LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
-	LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
-	LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
-	LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
-	LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
-	LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
-	LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
-	0, LINUX_SIGUSR1, LINUX_SIGUSR2
-};
-
-int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
-	SIGHUP, SIGINT, SIGQUIT, SIGILL,
-	SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
-	SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
-	SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
-	SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
-	SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
-	SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
-	SIGIO, SIGURG, SIGSYS
-};
-
 #define LINUX_T_UNKNOWN  255
 static int _bsd_to_linux_trapcode[] = {
 	LINUX_T_UNKNOWN,	/* 0 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405011356.s41DuEvL070087>