|
From: <sv...@va...> - 2006-04-03 16:38:38
|
Author: tom
Date: 2006-04-03 17:38:33 +0100 (Mon, 03 Apr 2006)
New Revision: 5819
Log:
Enable sigsuspend on x86-linux and ppc32-linux.
Modified:
trunk/coregrind/m_syswrap/priv_syswrap-generic.h
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
Modified: trunk/coregrind/m_syswrap/priv_syswrap-generic.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/priv_syswrap-generic.h 2006-04-03 16:37:30 =
UTC (rev 5818)
+++ trunk/coregrind/m_syswrap/priv_syswrap-generic.h 2006-04-03 16:38:33 =
UTC (rev 5819)
@@ -170,7 +170,6 @@
=20
// For the remainder, not really sure yet
DECL_TEMPLATE(generic, sys_ptrace); // (x86?) (almost-P)
-DECL_TEMPLATE(generic, sys_sigsuspend); // POSIX, but L (prot=
o varies across archs)
DECL_TEMPLATE(generic, sys_setrlimit); // SVr4, 4.3BSD
DECL_TEMPLATE(generic, sys_ioctl); // x86? (various)
DECL_TEMPLATE(generic, sys_old_getrlimit); // SVr4, 4.3BSD L?
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2006-04-03 16:37:30 UTC (=
rev 5818)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2006-04-03 16:38:33 UTC (=
rev 5819)
@@ -5290,24 +5290,6 @@
PRE_REG_READ0(long, "pause");
}
=20
-//zz // XXX: x86-specific
-//zz PRE(sys_sigsuspend, SfMayBlock)
-//zz {
-//zz /* The C library interface to sigsuspend just takes a pointer to
-//zz a signal mask but this system call has three arguments - the =
first
-//zz two don't appear to be used by the kernel and are always pass=
ed as
-//zz zero by glibc and the third is the first word of the signal m=
ask
-//zz so only 32 signals are supported.
-//zz =20
-//zz In fact glibc normally uses rt_sigsuspend if it is available =
as
-//zz that takes a pointer to the signal mask so supports more sign=
als.
-//zz */
-//zz PRINT("sys_sigsuspend ( %d, %d, %d )", ARG1,ARG2,ARG3 );
-//zz PRE_REG_READ3(int, "sigsuspend",
-//zz int, history0, int, history1,
-//zz vki_old_sigset_t, mask);
-//zz }
-
// XXX: x86-specific
PRE(sys_sigaltstack)
{
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2006-04-03 16:37:30 U=
TC (rev 5818)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2006-04-03 16:38:33 U=
TC (rev 5819)
@@ -392,6 +392,7 @@
DECL_TEMPLATE(ppc32_linux, sys_sigreturn);
DECL_TEMPLATE(ppc32_linux, sys_rt_sigreturn);
DECL_TEMPLATE(ppc32_linux, sys_sigaction);
+DECL_TEMPLATE(ppc32_linux, sys_sigsuspend);
=20
PRE(sys_socketcall)
{
@@ -1424,7 +1425,21 @@
POST_MEM_WRITE( ARG3, sizeof(struct vki_old_sigaction));
}
=20
+PRE(sys_sigsuspend)
+{
+ /* The C library interface to sigsuspend just takes a pointer to
+ a signal mask but this system call only takes the first word of
+ the signal mask as an argument so only 32 signals are supported.
+ =20
+ In fact glibc normally uses rt_sigsuspend if it is available as
+ that takes a pointer to the signal mask so supports more signals.
+ */
+ *flags |=3D SfMayBlock;
+ PRINT("sys_sigsuspend ( %d )", ARG1 );
+ PRE_REG_READ1(int, "sigsuspend", vki_old_sigset_t, mask);
+}
=20
+
#undef PRE
#undef POST
=20
@@ -1461,7 +1476,7 @@
GENX_(__NR_execve, sys_execve), // 11
GENX_(__NR_chdir, sys_chdir), // 12
GENXY(__NR_time, sys_time), // 13
-//.. GENX_(__NR_mknod, sys_mknod), // 14
+ GENX_(__NR_mknod, sys_mknod), // 14
//..=20
GENX_(__NR_chmod, sys_chmod), // 15
//.. LINX_(__NR_lchown, sys_lchown16), // 16 ## P
@@ -1531,7 +1546,7 @@
//..=20
//.. LINX_(__NR_setreuid, sys_setreuid16), // 70
//.. LINX_(__NR_setregid, sys_setregid16), // 71
-//.. GENX_(__NR_sigsuspend, sys_sigsuspend), // 72
+ PLAX_(__NR_sigsuspend, sys_sigsuspend), // 72
//.. LINXY(__NR_sigpending, sys_sigpending), // 73
//.. // (__NR_sethostname, sys_sethostname), // 74 */*
//..=20
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2006-04-03 16:37:30 UTC=
(rev 5818)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2006-04-03 16:38:33 UTC=
(rev 5819)
@@ -772,6 +772,7 @@
DECL_TEMPLATE(x86_linux, sys_get_thread_area);
DECL_TEMPLATE(x86_linux, sys_ptrace);
DECL_TEMPLATE(x86_linux, sys_sigaction);
+DECL_TEMPLATE(x86_linux, sys_sigsuspend);
DECL_TEMPLATE(x86_linux, old_select);
DECL_TEMPLATE(x86_linux, sys_vm86old);
DECL_TEMPLATE(x86_linux, sys_vm86);
@@ -1694,6 +1695,24 @@
POST_MEM_WRITE( ARG3, sizeof(struct vki_old_sigaction));
}
=20
+PRE(sys_sigsuspend)
+{
+ /* The C library interface to sigsuspend just takes a pointer to
+ a signal mask but this system call has three arguments - the first
+ two don't appear to be used by the kernel and are always passed as
+ zero by glibc and the third is the first word of the signal mask
+ so only 32 signals are supported.
+ =20
+ In fact glibc normally uses rt_sigsuspend if it is available as
+ that takes a pointer to the signal mask so supports more signals.
+ */
+ *flags |=3D SfMayBlock;
+ PRINT("sys_sigsuspend ( %d, %d, %d )", ARG1,ARG2,ARG3 );
+ PRE_REG_READ3(int, "sigsuspend",
+ int, history0, int, history1,
+ vki_old_sigset_t, mask);
+}
+
PRE(sys_vm86old)
{
PRINT("sys_vm86old ( %p )", ARG1);
@@ -1863,7 +1882,7 @@
//zz=20
LINX_(__NR_setreuid, sys_setreuid16), // 70
LINX_(__NR_setregid, sys_setregid16), // 71
-//zz GENX_(__NR_sigsuspend, sys_sigsuspend), // 72
+ PLAX_(__NR_sigsuspend, sys_sigsuspend), // 72
LINXY(__NR_sigpending, sys_sigpending), // 73
//zz // (__NR_sethostname, sys_sethostname), // 74 */*
//zz=20
|