|
From: <sv...@va...> - 2008-12-10 09:29:04
|
Author: tom
Date: 2008-12-10 09:28:56 +0000 (Wed, 10 Dec 2008)
New Revision: 8815
Log:
Add support for eventfd2 (and wire up pipe2 on PPC platforms).
Modified:
trunk/coregrind/m_syswrap/priv_syswrap-linux.h
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
Modified: trunk/coregrind/m_syswrap/priv_syswrap-linux.h
===================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-linux.h 2008-12-09 11:07:55 UTC (rev 8814)
+++ trunk/coregrind/m_syswrap/priv_syswrap-linux.h 2008-12-10 09:28:56 UTC (rev 8815)
@@ -84,6 +84,7 @@
DECL_TEMPLATE(linux, sys_epoll_wait);
DECL_TEMPLATE(linux, sys_epoll_pwait);
DECL_TEMPLATE(linux, sys_eventfd);
+DECL_TEMPLATE(linux, sys_eventfd2);
DECL_TEMPLATE(linux, sys_gettid);
DECL_TEMPLATE(linux, sys_set_tid_address);
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2008-12-09 11:07:55 UTC (rev 8814)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2008-12-10 09:28:56 UTC (rev 8815)
@@ -1363,7 +1363,7 @@
// (__NR_paccept, sys_ni_syscall) // 288
// (__NR_signalfd4, sys_ni_syscall) // 289
- // (__NR_eventfd2, sys_ni_syscall) // 290
+ LINX_(__NR_eventfd2, sys_eventfd2), // 290
// (__NR_epoll_create1, sys_ni_syscall) // 291
// (__NR_dup3, sys_ni_syscall) // 292
LINXY(__NR_pipe2, sys_pipe2) // 293
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2008-12-09 11:07:55 UTC (rev 8814)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2008-12-10 09:28:56 UTC (rev 8815)
@@ -1111,6 +1111,22 @@
}
}
+PRE(sys_eventfd2)
+{
+ PRINT("sys_eventfd2 ( %lu, %d )", ARG1,ARG2);
+ PRE_REG_READ2(long, "sys_eventfd2", unsigned int, count, int, flags);
+}
+POST(sys_eventfd2)
+{
+ if (!ML_(fd_allowed)(RES, "eventfd2", tid, True)) {
+ VG_(close)(RES);
+ SET_STATUS_Failure( VKI_EMFILE );
+ } else {
+ if (VG_(clo_track_fds))
+ ML_(record_fd_open_nameless) (tid, RES);
+ }
+}
+
/* ---------------------------------------------------------------------
tid-related wrappers
------------------------------------------------------------------ */
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2008-12-09 11:07:55 UTC (rev 8814)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2008-12-10 09:28:56 UTC (rev 8815)
@@ -1859,6 +1859,12 @@
// LINXY(__NR_subpage_prot, sys_ni_syscall), // 310
LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 311
LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 312
+ // (__NR_signalfd4, sys_ni_syscall) // 313
+ LINX_(__NR_eventfd2, sys_eventfd2), // 314
+ // (__NR_epoll_create1, sys_ni_syscall) // 315
+ // (__NR_dup3, sys_ni_syscall) // 316
+ LINXY(__NR_pipe2, sys_pipe2) // 317
+ // (__NR_inotify_init1, sys_ni_syscall) // 318
};
const UInt ML_(syscall_table_size) =
Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-12-09 11:07:55 UTC (rev 8814)
+++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-12-10 09:28:56 UTC (rev 8815)
@@ -1499,6 +1499,12 @@
// LINXY(__NR_subpage_prot, sys_ni_syscall), // 310
LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 311
LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 312
+ // (__NR_signalfd4, sys_ni_syscall) // 313
+ LINX_(__NR_eventfd2, sys_eventfd2), // 314
+ // (__NR_epoll_create1, sys_ni_syscall) // 315
+ // (__NR_dup3, sys_ni_syscall) // 316
+ LINXY(__NR_pipe2, sys_pipe2) // 317
+ // (__NR_inotify_init1, sys_ni_syscall) // 318
};
const UInt ML_(syscall_table_size) =
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2008-12-09 11:07:55 UTC (rev 8814)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2008-12-10 09:28:56 UTC (rev 8815)
@@ -2235,7 +2235,7 @@
LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 325
LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 326
// (__NR_signalfd4, sys_ni_syscall) // 327
- // (__NR_eventfd2, sys_ni_syscall) // 328
+ LINX_(__NR_eventfd2, sys_eventfd2), // 328
// (__NR_epoll_create1, sys_ni_syscall) // 329
// (__NR_dup3, sys_ni_syscall) // 330
|