Skip to contentSkip to conversation

signal/timer/event fds v10 - eventfd wire up x86_64 arch ...

PATCH In review Davide Libenzi 2 participants 3 messages Apr 2, 2007 – Apr 27, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 12/13 signal/timer/event fds v10 - eventfd wire up x86_64 arch ...

This patch wire the eventfd system call to the x86_64 architecture.

- Davide

arch/x86_64/ia32/ia32entry.S +1 -0
Index: linux-2.6.21-rc5.fds/arch/x86_64/ia32/ia32entry.S
===================================================================
@@ -721,4 +721,5 @@
 	.quad sys_epoll_pwait
 	.quad sys_signalfd		/* 320 */
 	.quad sys_timerfd
+	.quad sys_eventfd
 ia32_syscall_end:		
include/asm-x86_64/unistd.h +3 -1
Index: linux-2.6.21-rc5.fds/include/asm-x86_64/unistd.h
===================================================================
@@ -623,8 +623,10 @@
 __SYSCALL(__NR_signalfd, sys_signalfd)
 #define __NR_timerfd		281
 __SYSCALL(__NR_timerfd, sys_timerfd)
+#define __NR_eventfd		282
+__SYSCALL(__NR_eventfd, sys_eventfd)
 
-#define __NR_syscall_max __NR_timerfd
+#define __NR_syscall_max __NR_eventfd
 
 #ifndef __NO_STUBS
 #define __ARCH_WANT_OLD_READDIR
#1 lore raw
Quoted 27 lines · On Mon, 02 Apr 2007 15:46:31 -0700 Davide Libenzi <[email protected]>…

This patch wire the eventfd system call to the x86_64 architecture.

- Davide

Index: linux-2.6.21-rc5.fds/arch/x86_64/ia32/ia32entry.S
===================================================================

arch/x86_64/ia32/ia32entry.S +1 -0
@@ -721,4 +721,5 @@
 	.quad sys_epoll_pwait
 	.quad sys_signalfd		/* 320 */
 	.quad sys_timerfd
+	.quad sys_eventfd
 ia32_syscall_end:		

Index: linux-2.6.21-rc5.fds/include/asm-x86_64/unistd.h
===================================================================

include/asm-x86_64/unistd.h +0 -0
@@ -623,8 +623,10 @@
 __SYSCALL(__NR_signalfd, sys_signalfd)

include/asm-x86_64/unistd.h line 632

Quoted 10 lines
include/asm-x86_64/unistd.h +3 -1
 #define __NR_timerfd		281
 __SYSCALL(__NR_timerfd, sys_timerfd)
+#define __NR_eventfd		282
+__SYSCALL(__NR_eventfd, sys_eventfd)
 
-#define __NR_syscall_max __NR_timerfd
+#define __NR_syscall_max __NR_eventfd
 
 #ifndef __NO_STUBS
 #define __ARCH_WANT_OLD_READDIR

General point: the first hunk here which wires up the 32-bit entry point should arguably be part of the "wire up i386" patch, not the "wire up x86_64" patch.

This is not a clear-cut thing. The problem with the approach you've taken here is that if we wire up i386 and not x86_64's i386 table (for example) there are ways in which intervening patches can accidentally get i386 and x86_64 emulation's syscall tables out of sync. And, of course, 32-bit applications will run on i386 but won't run on x86_64 or vice-versa.

So I think the best way to avoid all such problems is to always wire up i386 and x86_64 (both 32- and 64-bit) in the same patch.

#2 lore raw
Quoted 4 lines · Andrew Morton

General point: the first hunk here which wires up the 32-bit entry point should arguably be part of the "wire up i386" patch, not the "wire up x86_64" patch.

Quoted 8 lines

This is not a clear-cut thing. The problem with the approach you've taken here is that if we wire up i386 and not x86_64's i386 table (for example) there are ways in which intervening patches can accidentally get i386 and x86_64 emulation's syscall tables out of sync. And, of course, 32-bit applications will run on i386 but won't run on x86_64 or vice-versa.

So I think the best way to avoid all such problems is to always wire up i386 and x86_64 (both 32- and 64-bit) in the same patch.

Makes perfect sense to me. Since you've done it in -mm, I'll use your tree as a reference from now on.

- Davide