linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Introduce __ARCH_WANT_SYS_SYSFS
@ 2008-04-22 12:13 Will Newton
  2008-04-22 13:15 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 52+ messages in thread
From: Will Newton @ 2008-04-22 12:13 UTC (permalink / raw)
  To: Linux Kernel list, linux-arch

[-- Attachment #1: Type: text/plain, Size: 11353 bytes --]

Hi,

This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
architectures that support the sysfs(2) system call. At the moment
that's everybody but blackfin, but future architectures may want to
save the (admittedly small) code size that it adds to the kernel as
well.

(patch attached as well as inline because gmail seems to mangle my whitespace)

---
>From d0746366e8ccb5fbaa6c9945540cecbe0c421222 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Tue, 22 Apr 2008 12:57:03 +0100
Subject: [PATCH] Introduce __ARCH_WANT_SYS_SYSFS.

Signed-off-by: Will Newton <will.newton@imgtec.com>

All arches that want the sysfs(2) system call should define this symbol.
Arches such as blackfin that do not implement the system call don't compile
the code and save some small amount of space.
---
 fs/filesystems.c               |    5 +++++
 include/asm-alpha/unistd.h     |    1 +
 include/asm-arm/unistd.h       |    1 +
 include/asm-avr32/unistd.h     |    1 +
 include/asm-cris/unistd.h      |    1 +
 include/asm-frv/unistd.h       |    1 +
 include/asm-h8300/unistd.h     |    1 +
 include/asm-ia64/unistd.h      |    1 +
 include/asm-m32r/unistd.h      |    1 +
 include/asm-m68k/unistd.h      |    1 +
 include/asm-m68knommu/unistd.h |    1 +
 include/asm-mips/unistd.h      |    1 +
 include/asm-mn10300/unistd.h   |    1 +
 include/asm-parisc/unistd.h    |    1 +
 include/asm-powerpc/unistd.h   |    1 +
 include/asm-s390/unistd.h      |    1 +
 include/asm-sh/unistd_32.h     |    1 +
 include/asm-sh/unistd_64.h     |    1 +
 include/asm-sparc/unistd.h     |    1 +
 include/asm-sparc64/unistd.h   |    1 +
 include/asm-v850/unistd.h      |    1 +
 include/asm-x86/unistd_32.h    |    1 +
 include/asm-x86/unistd_64.h    |    1 +
 include/asm-xtensa/unistd.h    |    1 +
 24 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/fs/filesystems.c b/fs/filesystems.c
index f37f872..cd57e41 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -12,6 +12,7 @@
 #include <linux/kmod.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/unistd.h>
 #include <asm/uaccess.h>

 /*
@@ -118,6 +119,8 @@ int unregister_filesystem(struct file_system_type * fs)

 EXPORT_SYMBOL(unregister_filesystem);

+#ifdef __ARCH_WANT_SYS_SYSFS
+
 static int fs_index(const char __user * __name)
 {
 	struct file_system_type * tmp;
@@ -197,6 +200,8 @@ asmlinkage long sys_sysfs(int option, unsigned
long arg1, unsigned long arg2)
 	return retval;
 }

+#endif
+
 int get_filesystem_list(char * buf)
 {
 	int len = 0;
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 5b5c174..0b6c920 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -447,6 +447,7 @@
 #define __ARCH_WANT_SYS_OLD_GETRLIMIT
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SYSFS

 /* "Conditional" syscalls.  What we want is

diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 88e868b..d70b815 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -420,6 +420,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
 #define __ARCH_WANT_SYS_TIME
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index 89861a2..d77cabc 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -331,6 +331,7 @@
 #define __ARCH_WANT_SYS_GETPGRP
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index 76398ef..02b8833 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -361,6 +361,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index f184eb8..cccbb33 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -361,6 +361,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h
index 99f3c35..047b073 100644
--- a/include/asm-h8300/unistd.h
+++ b/include/asm-h8300/unistd.h
@@ -352,6 +352,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index e603147..d7594e6 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -323,6 +323,7 @@

 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 #ifdef CONFIG_IA32_SUPPORT
 # define __ARCH_WANT_SYS_FADVISE64
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index cf701c9..dda43d4 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -350,6 +350,7 @@
 #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 #define __IGNORE_lchown
 #define __IGNORE_setuid
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index e72ba56..c578622 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -352,6 +352,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 /* whitelist for checksyscalls */
 #define __IGNORE_restart_syscall
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index 4ba98b9..7148ba1 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -353,6 +353,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 4964c82..22e3d13 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -981,6 +981,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 # ifdef CONFIG_32BIT
 #  define __ARCH_WANT_STAT64
 #  define __ARCH_WANT_SYS_TIME
diff --git a/include/asm-mn10300/unistd.h b/include/asm-mn10300/unistd.h
index 3721aa9..a1ccfdf 100644
--- a/include/asm-mn10300/unistd.h
+++ b/include/asm-mn10300/unistd.h
@@ -369,6 +369,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index a7d857f..d480f23 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -974,6 +974,7 @@ type name(type1 arg1, type2 arg2, type3 arg3,
type4 arg4, type5 arg5)	\
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 #endif /* __ASSEMBLY__ */

diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index ce91bb6..763f056 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -371,6 +371,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 #ifdef CONFIG_PPC32
 #define __ARCH_WANT_OLD_STAT
 #endif
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 583da80..afd9e19 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -384,6 +384,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 # ifndef CONFIG_64BIT
 #   define __ARCH_WANT_STAT64
 #   define __ARCH_WANT_SYS_TIME
diff --git a/include/asm-sh/unistd_32.h b/include/asm-sh/unistd_32.h
index 0b07212..d010bd0 100644
--- a/include/asm-sh/unistd_32.h
+++ b/include/asm-sh/unistd_32.h
@@ -363,6 +363,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-sh/unistd_64.h b/include/asm-sh/unistd_64.h
index 9d21eab..d69090b 100644
--- a/include/asm-sh/unistd_64.h
+++ b/include/asm-sh/unistd_64.h
@@ -402,6 +402,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 2338a02..c7e7123 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -365,6 +365,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 77559da..891683c 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -370,6 +370,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h
index 2241ed4..b030a78 100644
--- a/include/asm-v850/unistd.h
+++ b/include/asm-v850/unistd.h
@@ -226,6 +226,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-x86/unistd_32.h b/include/asm-x86/unistd_32.h
index 984123a..35f611e 100644
--- a/include/asm-x86/unistd_32.h
+++ b/include/asm-x86/unistd_32.h
@@ -358,6 +358,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * "Conditional" syscalls
diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h
index 3883ceb..6c46395 100644
--- a/include/asm-x86/unistd_64.h
+++ b/include/asm-x86/unistd_64.h
@@ -664,6 +664,7 @@ __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime)
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_SYS_TIME
 #define __ARCH_WANT_COMPAT_SYS_TIME
+#define __ARCH_WANT_SYS_SYSFS
 #endif	/* __NO_STUBS */

 #ifdef __KERNEL__
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
index c092c8f..0a1bdae 100644
--- a/include/asm-xtensa/unistd.h
+++ b/include/asm-xtensa/unistd.h
@@ -718,6 +718,7 @@ __SYSCALL(306, sys_eventfd, 1)
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_SYSFS

 /*
  * Ignore legacy system calls in the checksyscalls.sh script
-- 
1.5.3.5

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Introduce-__ARCH_WANT_SYS_SYSFS.patch --]
[-- Type: text/x-patch; name=0001-Introduce-__ARCH_WANT_SYS_SYSFS.patch, Size: 11024 bytes --]

From d0746366e8ccb5fbaa6c9945540cecbe0c421222 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Tue, 22 Apr 2008 12:57:03 +0100
Subject: [PATCH] Introduce __ARCH_WANT_SYS_SYSFS.

Signed-off-by: Will Newton <will.newton@imgtec.com>

All arches that want the sysfs(2) system call should define this symbol.
Arches such as blackfin that do not implement the system call don't compile
the code and save some small amount of space.
---
 fs/filesystems.c               |    5 +++++
 include/asm-alpha/unistd.h     |    1 +
 include/asm-arm/unistd.h       |    1 +
 include/asm-avr32/unistd.h     |    1 +
 include/asm-cris/unistd.h      |    1 +
 include/asm-frv/unistd.h       |    1 +
 include/asm-h8300/unistd.h     |    1 +
 include/asm-ia64/unistd.h      |    1 +
 include/asm-m32r/unistd.h      |    1 +
 include/asm-m68k/unistd.h      |    1 +
 include/asm-m68knommu/unistd.h |    1 +
 include/asm-mips/unistd.h      |    1 +
 include/asm-mn10300/unistd.h   |    1 +
 include/asm-parisc/unistd.h    |    1 +
 include/asm-powerpc/unistd.h   |    1 +
 include/asm-s390/unistd.h      |    1 +
 include/asm-sh/unistd_32.h     |    1 +
 include/asm-sh/unistd_64.h     |    1 +
 include/asm-sparc/unistd.h     |    1 +
 include/asm-sparc64/unistd.h   |    1 +
 include/asm-v850/unistd.h      |    1 +
 include/asm-x86/unistd_32.h    |    1 +
 include/asm-x86/unistd_64.h    |    1 +
 include/asm-xtensa/unistd.h    |    1 +
 24 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/fs/filesystems.c b/fs/filesystems.c
index f37f872..cd57e41 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -12,6 +12,7 @@
 #include <linux/kmod.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/unistd.h>
 #include <asm/uaccess.h>
 
 /*
@@ -118,6 +119,8 @@ int unregister_filesystem(struct file_system_type * fs)
 
 EXPORT_SYMBOL(unregister_filesystem);
 
+#ifdef __ARCH_WANT_SYS_SYSFS
+
 static int fs_index(const char __user * __name)
 {
 	struct file_system_type * tmp;
@@ -197,6 +200,8 @@ asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2)
 	return retval;
 }
 
+#endif
+
 int get_filesystem_list(char * buf)
 {
 	int len = 0;
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 5b5c174..0b6c920 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -447,6 +447,7 @@
 #define __ARCH_WANT_SYS_OLD_GETRLIMIT
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SYSFS
 
 /* "Conditional" syscalls.  What we want is
 
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 88e868b..d70b815 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -420,6 +420,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
 #define __ARCH_WANT_SYS_TIME
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index 89861a2..d77cabc 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -331,6 +331,7 @@
 #define __ARCH_WANT_SYS_GETPGRP
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index 76398ef..02b8833 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -361,6 +361,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index f184eb8..cccbb33 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -361,6 +361,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h
index 99f3c35..047b073 100644
--- a/include/asm-h8300/unistd.h
+++ b/include/asm-h8300/unistd.h
@@ -352,6 +352,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index e603147..d7594e6 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -323,6 +323,7 @@
 
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 #ifdef CONFIG_IA32_SUPPORT
 # define __ARCH_WANT_SYS_FADVISE64
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index cf701c9..dda43d4 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -350,6 +350,7 @@
 #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 #define __IGNORE_lchown
 #define __IGNORE_setuid
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index e72ba56..c578622 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -352,6 +352,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 /* whitelist for checksyscalls */
 #define __IGNORE_restart_syscall
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index 4ba98b9..7148ba1 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -353,6 +353,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 4964c82..22e3d13 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -981,6 +981,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 # ifdef CONFIG_32BIT
 #  define __ARCH_WANT_STAT64
 #  define __ARCH_WANT_SYS_TIME
diff --git a/include/asm-mn10300/unistd.h b/include/asm-mn10300/unistd.h
index 3721aa9..a1ccfdf 100644
--- a/include/asm-mn10300/unistd.h
+++ b/include/asm-mn10300/unistd.h
@@ -369,6 +369,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index a7d857f..d480f23 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -974,6 +974,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index ce91bb6..763f056 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -371,6 +371,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 #ifdef CONFIG_PPC32
 #define __ARCH_WANT_OLD_STAT
 #endif
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 583da80..afd9e19 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -384,6 +384,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 # ifndef CONFIG_64BIT
 #   define __ARCH_WANT_STAT64
 #   define __ARCH_WANT_SYS_TIME
diff --git a/include/asm-sh/unistd_32.h b/include/asm-sh/unistd_32.h
index 0b07212..d010bd0 100644
--- a/include/asm-sh/unistd_32.h
+++ b/include/asm-sh/unistd_32.h
@@ -363,6 +363,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-sh/unistd_64.h b/include/asm-sh/unistd_64.h
index 9d21eab..d69090b 100644
--- a/include/asm-sh/unistd_64.h
+++ b/include/asm-sh/unistd_64.h
@@ -402,6 +402,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 2338a02..c7e7123 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -365,6 +365,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 77559da..891683c 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -370,6 +370,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h
index 2241ed4..b030a78 100644
--- a/include/asm-v850/unistd.h
+++ b/include/asm-v850/unistd.h
@@ -226,6 +226,7 @@
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-x86/unistd_32.h b/include/asm-x86/unistd_32.h
index 984123a..35f611e 100644
--- a/include/asm-x86/unistd_32.h
+++ b/include/asm-x86/unistd_32.h
@@ -358,6 +358,7 @@
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
+#define __ARCH_WANT_SYS_SYSFS
 
 /*
  * "Conditional" syscalls
diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h
index 3883ceb..6c46395 100644
--- a/include/asm-x86/unistd_64.h
+++ b/include/asm-x86/unistd_64.h
@@ -664,6 +664,7 @@ __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime)
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_SYS_TIME
 #define __ARCH_WANT_COMPAT_SYS_TIME
+#define __ARCH_WANT_SYS_SYSFS
 #endif	/* __NO_STUBS */
 
 #ifdef __KERNEL__
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
index c092c8f..0a1bdae 100644
--- a/include/asm-xtensa/unistd.h
+++ b/include/asm-xtensa/unistd.h
@@ -718,6 +718,7 @@ __SYSCALL(306, sys_eventfd, 1)
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_SYSFS
 
 /* 
  * Ignore legacy system calls in the checksyscalls.sh script
-- 
1.5.3.5


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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 12:13 [RFC] Introduce __ARCH_WANT_SYS_SYSFS Will Newton
@ 2008-04-22 13:15 ` Arnd Bergmann
  2008-04-23 21:16   ` Michal Simek
  2008-04-22 15:12 ` [RFC] Introduce __ARCH_WANT_SYS_SYSFS Randy Dunlap
  2008-04-22 15:21 ` Kyle McMartin
  2 siblings, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-22 13:15 UTC (permalink / raw)
  To: Will Newton
  Cc: Linux Kernel list, linux-arch, monstr, git, microblaze-uclinux

On Tuesday 22 April 2008, Will Newton wrote:
> This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
> architectures that support the sysfs(2) system call. At the moment
> that's everybody but blackfin, but future architectures may want to
> save the (admittedly small) code size that it adds to the kernel as
> well.

Yes, good thing to have. Since we'll be getting a new architecture
(microblaze) soon, I think we should extend this mechanism (even though
it's ugly) to all syscalls that we don't want to have in new architectures
and make sure that microblaze doesn't have to set any of them.

	Arnd <><

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 12:13 [RFC] Introduce __ARCH_WANT_SYS_SYSFS Will Newton
  2008-04-22 13:15 ` Arnd Bergmann
@ 2008-04-22 15:12 ` Randy Dunlap
  2008-04-22 15:16   ` Will Newton
  2008-04-24 14:51   ` Adrian Bunk
  2008-04-22 15:21 ` Kyle McMartin
  2 siblings, 2 replies; 52+ messages in thread
From: Randy Dunlap @ 2008-04-22 15:12 UTC (permalink / raw)
  To: Will Newton; +Cc: Linux Kernel list, linux-arch

On Tue, 22 Apr 2008 13:13:39 +0100 Will Newton wrote:

> Hi,
> 
> This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
> architectures that support the sysfs(2) system call. At the moment
> that's everybody but blackfin, but future architectures may want to
> save the (admittedly small) code size that it adds to the kernel as
> well.
> 
> (patch attached as well as inline because gmail seems to mangle my whitespace)
> 
> ---
> >From d0746366e8ccb5fbaa6c9945540cecbe0c421222 Mon Sep 17 00:00:00 2001
> From: Will Newton <will.newton@imgtec.com>
> Date: Tue, 22 Apr 2008 12:57:03 +0100
> Subject: [PATCH] Introduce __ARCH_WANT_SYS_SYSFS.
> 
> Signed-off-by: Will Newton <will.newton@imgtec.com>
> 
> All arches that want the sysfs(2) system call should define this symbol.
> Arches such as blackfin that do not implement the system call don't compile
> the code and save some small amount of space.

Is there any reason that this couldn't (and shouldn't) be done
in the Kconfig space and done as documented in
Documentation/kbuild/kconfig-language.txt ?

<quote:>
Adding common features and make the usage configurable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is a common idiom to implement a feature/functionality that are
relevant for some architectures but not all.
The recommended way to do so is to use a config variable named HAVE_*
that is defined in a common Kconfig file and selected by the relevant
architectures.
An example is the generic IOMAP functionality.

We would in lib/Kconfig see:

# Generic IOMAP is used to ...
config HAVE_GENERIC_IOMAP

config GENERIC_IOMAP
	depends on HAVE_GENERIC_IOMAP && FOO

And in lib/Makefile we would see:
obj-$(CONFIG_GENERIC_IOMAP) += iomap.o

For each architecture using the generic IOMAP functionality we would see:

config X86
	select ...
	select HAVE_GENERIC_IOMAP
	select ...



---
~Randy

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:12 ` [RFC] Introduce __ARCH_WANT_SYS_SYSFS Randy Dunlap
@ 2008-04-22 15:16   ` Will Newton
  2008-04-22 15:24     ` Kyle McMartin
  2008-04-24 14:51   ` Adrian Bunk
  1 sibling, 1 reply; 52+ messages in thread
From: Will Newton @ 2008-04-22 15:16 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 4:12 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> On Tue, 22 Apr 2008 13:13:39 +0100 Will Newton wrote:
>
>  > Hi,
>  >
>  > This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
>  > architectures that support the sysfs(2) system call. At the moment
>  > that's everybody but blackfin, but future architectures may want to
>  > save the (admittedly small) code size that it adds to the kernel as
>  > well.
>  >
>  > (patch attached as well as inline because gmail seems to mangle my whitespace)
>  >
>  > ---
>  > >From d0746366e8ccb5fbaa6c9945540cecbe0c421222 Mon Sep 17 00:00:00 2001
>  > From: Will Newton <will.newton@imgtec.com>
>  > Date: Tue, 22 Apr 2008 12:57:03 +0100
>  > Subject: [PATCH] Introduce __ARCH_WANT_SYS_SYSFS.
>  >
>  > Signed-off-by: Will Newton <will.newton@imgtec.com>
>  >
>  > All arches that want the sysfs(2) system call should define this symbol.
>  > Arches such as blackfin that do not implement the system call don't compile
>  > the code and save some small amount of space.
>
>  Is there any reason that this couldn't (and shouldn't) be done
>  in the Kconfig space and done as documented in
>  Documentation/kbuild/kconfig-language.txt ?

It can be done with Kconfig. Whether it should be or not depends on
your point of view, hence RFC. Currently __ARCH_WANT macros is the way
syscalls are enabled and disabled across architectures. If there's
consensus that it should be done via Kconfig that could certainly be
implmented, but that's a different patch.

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 12:13 [RFC] Introduce __ARCH_WANT_SYS_SYSFS Will Newton
  2008-04-22 13:15 ` Arnd Bergmann
  2008-04-22 15:12 ` [RFC] Introduce __ARCH_WANT_SYS_SYSFS Randy Dunlap
@ 2008-04-22 15:21 ` Kyle McMartin
  2008-04-22 15:38   ` Arnd Bergmann
  2 siblings, 1 reply; 52+ messages in thread
From: Kyle McMartin @ 2008-04-22 15:21 UTC (permalink / raw)
  To: Will Newton; +Cc: Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 01:13:39PM +0100, Will Newton wrote:
> Hi,
> 
> This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
> architectures that support the sysfs(2) system call. At the moment
> that's everybody but blackfin, but future architectures may want to
> save the (admittedly small) code size that it adds to the kernel as
> well.
> 

This should (imnsho, at least),
	1 - Add a cond_syscall for sys_sysfs to sys_ni.c
	2 - Use a CONFIG_EMBEDDED dependent option that defaults on,
	    possibly depend on BLACKFIN if you really want to.

Adding this junk to every arch header is, in my opinion, completely
unacceptable just because blackfin wants to be different.

--Kyle

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:16   ` Will Newton
@ 2008-04-22 15:24     ` Kyle McMartin
  2008-04-22 15:34       ` Will Newton
  0 siblings, 1 reply; 52+ messages in thread
From: Kyle McMartin @ 2008-04-22 15:24 UTC (permalink / raw)
  To: Will Newton; +Cc: Randy Dunlap, Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 04:16:17PM +0100, Will Newton wrote:
> It can be done with Kconfig. Whether it should be or not depends on
> your point of view, hence RFC. Currently __ARCH_WANT macros is the way
> syscalls are enabled and disabled across architectures. If there's
> consensus that it should be done via Kconfig that could certainly be
> implmented, but that's a different patch.
>

It's currently done in unistd.h for hysterical raisins. All new
conditional syscalls have been done in Kconfig.

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:24     ` Kyle McMartin
@ 2008-04-22 15:34       ` Will Newton
  2008-04-22 15:38         ` Kyle McMartin
  0 siblings, 1 reply; 52+ messages in thread
From: Will Newton @ 2008-04-22 15:34 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Randy Dunlap, Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 4:24 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
> On Tue, Apr 22, 2008 at 04:16:17PM +0100, Will Newton wrote:
>  > It can be done with Kconfig. Whether it should be or not depends on
>  > your point of view, hence RFC. Currently __ARCH_WANT macros is the way
>  > syscalls are enabled and disabled across architectures. If there's
>  > consensus that it should be done via Kconfig that could certainly be
>  > implmented, but that's a different patch.
>  >
>
>  It's currently done in unistd.h for hysterical raisins. All new
>  conditional syscalls have been done in Kconfig.

Do you have a syscall in mind that does this in the correct way?

BTW, don't blame the blackfin guys for this, I'm thinking about future
architectures that may be added rather than any existing ones. ;-)

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:21 ` Kyle McMartin
@ 2008-04-22 15:38   ` Arnd Bergmann
  2008-04-22 15:42     ` Kyle McMartin
  0 siblings, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-22 15:38 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Will Newton, Linux Kernel list, linux-arch

On Tuesday 22 April 2008, Kyle McMartin wrote:
> 
> This should (imnsho, at least),
>         1 - Add a cond_syscall for sys_sysfs to sys_ni.c
>         2 - Use a CONFIG_EMBEDDED dependent option that defaults on,
>             possibly depend on BLACKFIN if you really want to.
> 
> Adding this junk to every arch header is, in my opinion, completely
> unacceptable just because blackfin wants to be different.

It's not that they want to be different, but rather that I (among others)
requested that they don't implement obsolete syscalls, so they removed it
from their syscall table.

	Arnd <><

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:34       ` Will Newton
@ 2008-04-22 15:38         ` Kyle McMartin
  2008-04-23 14:36           ` Will Newton
  0 siblings, 1 reply; 52+ messages in thread
From: Kyle McMartin @ 2008-04-22 15:38 UTC (permalink / raw)
  To: Will Newton; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 04:34:03PM +0100, Will Newton wrote:
> On Tue, Apr 22, 2008 at 4:24 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
> > On Tue, Apr 22, 2008 at 04:16:17PM +0100, Will Newton wrote:
> >  > It can be done with Kconfig. Whether it should be or not depends on
> >  > your point of view, hence RFC. Currently __ARCH_WANT macros is the way
> >  > syscalls are enabled and disabled across architectures. If there's
> >  > consensus that it should be done via Kconfig that could certainly be
> >  > implmented, but that's a different patch.
> >  >
> >
> >  It's currently done in unistd.h for hysterical raisins. All new
> >  conditional syscalls have been done in Kconfig.
> 
> Do you have a syscall in mind that does this in the correct way?
> 

epoll is the most immediate example at hand, since it touches
fs/compat.c similarly to how you would be touching fs/filesystem.c, and
touches kernel/sys_ni.c and init/Kconfig in much the same way.

> BTW, don't blame the blackfin guys for this, I'm thinking about future
> architectures that may be added rather than any existing ones. ;-)
> 

Meh. :)

cheers, Kyle

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:38   ` Arnd Bergmann
@ 2008-04-22 15:42     ` Kyle McMartin
  0 siblings, 0 replies; 52+ messages in thread
From: Kyle McMartin @ 2008-04-22 15:42 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Kyle McMartin, Will Newton, Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 05:38:19PM +0200, Arnd Bergmann wrote:
> On Tuesday 22 April 2008, Kyle McMartin wrote:
> > 
> > This should (imnsho, at least),
> >         1 - Add a cond_syscall for sys_sysfs to sys_ni.c
> >         2 - Use a CONFIG_EMBEDDED dependent option that defaults on,
> >             possibly depend on BLACKFIN if you really want to.
> > 
> > Adding this junk to every arch header is, in my opinion, completely
> > unacceptable just because blackfin wants to be different.
> 
> It's not that they want to be different, but rather that I (among others)
> requested that they don't implement obsolete syscalls, so they removed it
> from their syscall table.
> 

Ah, I stupidly assumed sys_sysfs was something to do with /sys.

regards, Kyle

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:38         ` Kyle McMartin
@ 2008-04-23 14:36           ` Will Newton
  2008-04-23 14:59             ` Arnd Bergmann
                               ` (2 more replies)
  0 siblings, 3 replies; 52+ messages in thread
From: Will Newton @ 2008-04-23 14:36 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Randy Dunlap, Linux Kernel list, linux-arch

[-- Attachment #1: Type: text/plain, Size: 10988 bytes --]

On Tue, Apr 22, 2008 at 4:38 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
> On Tue, Apr 22, 2008 at 04:34:03PM +0100, Will Newton wrote:
>  > On Tue, Apr 22, 2008 at 4:24 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
>  > > On Tue, Apr 22, 2008 at 04:16:17PM +0100, Will Newton wrote:
>  > >  > It can be done with Kconfig. Whether it should be or not depends on
>  > >  > your point of view, hence RFC. Currently __ARCH_WANT macros is the way
>  > >  > syscalls are enabled and disabled across architectures. If there's
>  > >  > consensus that it should be done via Kconfig that could certainly be
>  > >  > implmented, but that's a different patch.
>  > >  >
>  > >
>  > >  It's currently done in unistd.h for hysterical raisins. All new
>  > >  conditional syscalls have been done in Kconfig.
>  >
>  > Do you have a syscall in mind that does this in the correct way?
>  >
>
>  epoll is the most immediate example at hand, since it touches
>  fs/compat.c similarly to how you would be touching fs/filesystem.c, and
>  touches kernel/sys_ni.c and init/Kconfig in much the same way.

I implemented the approach you suggested - Kconfig symbol and
cond_syscall definition. I think I actually like the previous approach
better:

1. The arch Kconfig files are quite non-uniform compared to unistd.h
so the definitions wind up at different places in the file which is a
bit messy.
2. Changes to Kconfig may cause churn in defconfigs perhaps?
3. There is more churn in arch Kconfig than unistd.h so getting a
cross arch patch applied is likely to be more difficult.
4. The patch is about 4 times as many lines.

What do you think?

>From 094cbe1ca2fa28ae845ef80da6dad02e90cfbe04 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Wed, 23 Apr 2008 15:28:37 +0100
Subject: [PATCH] Introduce ARCH_HAS_SYS_SYSFS Kconfig symbol.

This symbol should be defined by all arches that implement the sysfs(2)
system call. Arches that do not wish to implement this legacy system call
can save a little bit of kernel code size. The only current architecture
to benefit from this is blackfin, but in the future other arches may wish
to do this as well.
---
 arch/alpha/Kconfig     |    4 ++++
 arch/arm/Kconfig       |    4 ++++
 arch/avr32/Kconfig     |    4 ++++
 arch/cris/Kconfig      |    4 ++++
 arch/frv/Kconfig       |    4 ++++
 arch/h8300/Kconfig     |    4 ++++
 arch/ia64/Kconfig      |    4 ++++
 arch/m32r/Kconfig      |    4 ++++
 arch/m68k/Kconfig      |    4 ++++
 arch/m68knommu/Kconfig |    4 ++++
 arch/mips/Kconfig      |    4 ++++
 arch/mn10300/Kconfig   |    4 ++++
 arch/parisc/Kconfig    |    4 ++++
 arch/powerpc/Kconfig   |    4 ++++
 arch/ppc/Kconfig       |    4 ++++
 arch/s390/Kconfig      |    4 ++++
 arch/sh/Kconfig        |    4 ++++
 arch/sparc/Kconfig     |    4 ++++
 arch/sparc64/Kconfig   |    4 ++++
 arch/um/Kconfig        |    4 ++++
 arch/v850/Kconfig      |    4 ++++
 arch/x86/Kconfig       |    4 ++++
 arch/xtensa/Kconfig    |    4 ++++
 fs/filesystems.c       |    4 ++++
 kernel/sys_ni.c        |    1 +
 25 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 729cdbd..9b7b4d2 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -71,6 +71,10 @@ config AUTO_IRQ_AFFINITY
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"


diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4039a13..c806808 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -137,6 +137,10 @@ config ZONE_DMA
 	bool
 	default y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config GENERIC_ISA_DMA
 	bool

diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 28e0caf..2f9f01d 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -66,6 +66,10 @@ config GENERIC_BUG
 	def_bool y
 	depends on BUG

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"

 menu "System Type and features"
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 9389d38..7aec04b 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -32,6 +32,10 @@ config ARCH_HAS_ILOG2_U64
 	bool
 	default n

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config GENERIC_FIND_NEXT_BIT
 	bool
 	default y
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index a5aac1b..f08fb9a 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -58,6 +58,10 @@ config ARCH_HAS_ILOG2_U64
 	bool
 	default y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 1000
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 085dc6e..8184c99 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -69,6 +69,10 @@ config TIME_LOW_RES
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config NO_IOPORT
 	def_bool y

diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 8fa3faf..513d960 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -111,6 +111,10 @@ config AUDIT_ARCH
 	bool
 	default y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 choice
 	prompt "System type"
 	default IA64_GENERIC
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index de153de..79d6f79 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -39,6 +39,10 @@ config NO_DMA
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 65db226..26859b1 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -56,6 +56,10 @@ config NO_DMA
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 07eb4c4..d9240a6 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -68,6 +68,10 @@ config NO_IOPORT
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"

 menu "Processor type and features"
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8724ed3..0716726 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -752,6 +752,10 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
 	bool
 	default n

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 #
 # Select some configuration options automatically based on user selections.
 #
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 6a6409a..3666f5f 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -63,6 +63,10 @@ config GENERIC_HARDIRQS
 config HOTPLUG_CPU
 	def_bool n

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 1000
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index bc7a19d..c6f5139 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -91,6 +91,10 @@ config ARCH_MAY_HAVE_PC_FDC
 	depends on BROKEN
 	default y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"


diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 1189d8d..21803f2 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -194,6 +194,10 @@ config PPC_OF_PLATFORM_PCI
 	depends on PPC64 # not supported on 32 bits yet
 	default n

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"

 source "arch/powerpc/sysdev/Kconfig"
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index abc877f..0156eb2 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -72,6 +72,10 @@ config GENERIC_BUG
 	default y
 	depends on BUG

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"

 menu "Processor"
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 1831833..c04b232 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -55,6 +55,10 @@ config GENERIC_LOCKBREAK
 	default y
 	depends on SMP && PREEMPT

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 mainmenu "Linux Kernel Configuration"

 config S390
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 8d2cd1d..66b74dc 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -93,6 +93,10 @@ config ARCH_SUPPORTS_AOUT
 config IO_TRAPPED
 	bool

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"

 menu "System type"
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c40343c..25c17e3 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -30,6 +30,10 @@ config OF
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 463d1be..9f5d1ed 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -90,6 +90,10 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 choice
 	prompt "Kernel page size"
 	default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index dba8e05..be0cb93 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -68,6 +68,10 @@ config IRQ_RELEASE_METHOD
 	bool
 	default y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index 4379f43..b54d1f4 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -56,6 +56,10 @@ config ARCH_HAS_ILOG2_U64
 config ARCH_SUPPORTS_AOUT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 # Turn off some random 386 crap that can affect device config
 config ISA
 	bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6c70fed..e0b830b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -155,6 +155,10 @@ config GENERIC_PENDING_IRQ
 	depends on GENERIC_HARDIRQS && SMP
 	default y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config X86_SMP
 	bool
 	depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 9fc8551..7834ad7 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -50,6 +50,10 @@ config ARCH_HAS_ILOG2_U64
 config NO_IOPORT
 	def_bool y

+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/fs/filesystems.c b/fs/filesystems.c
index f37f872..f6e1567 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -118,6 +118,8 @@ int unregister_filesystem(struct file_system_type * fs)

 EXPORT_SYMBOL(unregister_filesystem);

+#ifdef CONFIG_ARCH_HAS_SYS_SYSFS
+
 static int fs_index(const char __user * __name)
 {
 	struct file_system_type * tmp;
@@ -197,6 +199,8 @@ asmlinkage long sys_sysfs(int option, unsigned
long arg1, unsigned long arg2)
 	return retval;
 }

+#endif
+
 int get_filesystem_list(char * buf)
 {
 	int len = 0;
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 5b9b467..866ff4b 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -121,6 +121,7 @@ cond_syscall(sys_vm86old);
 cond_syscall(sys_vm86);
 cond_syscall(compat_sys_ipc);
 cond_syscall(compat_sys_sysctl);
+cond_syscall(sys_sysfs);

 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
-- 
1.5.3.5

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Introduce-ARCH_HAS_SYS_SYSFS-Kconfig-symbol.patch --]
[-- Type: text/x-patch; name=0001-Introduce-ARCH_HAS_SYS_SYSFS-Kconfig-symbol.patch, Size: 9402 bytes --]

From 094cbe1ca2fa28ae845ef80da6dad02e90cfbe04 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Wed, 23 Apr 2008 15:28:37 +0100
Subject: [PATCH] Introduce ARCH_HAS_SYS_SYSFS Kconfig symbol.

This symbol should be defined by all arches that implement the sysfs(2)
system call. Arches that do not wish to implement this legacy system call
can save a little bit of kernel code size. The only current architecture
to benefit from this is blackfin, but in the future other arches may wish
to do this as well.
---
 arch/alpha/Kconfig     |    4 ++++
 arch/arm/Kconfig       |    4 ++++
 arch/avr32/Kconfig     |    4 ++++
 arch/cris/Kconfig      |    4 ++++
 arch/frv/Kconfig       |    4 ++++
 arch/h8300/Kconfig     |    4 ++++
 arch/ia64/Kconfig      |    4 ++++
 arch/m32r/Kconfig      |    4 ++++
 arch/m68k/Kconfig      |    4 ++++
 arch/m68knommu/Kconfig |    4 ++++
 arch/mips/Kconfig      |    4 ++++
 arch/mn10300/Kconfig   |    4 ++++
 arch/parisc/Kconfig    |    4 ++++
 arch/powerpc/Kconfig   |    4 ++++
 arch/ppc/Kconfig       |    4 ++++
 arch/s390/Kconfig      |    4 ++++
 arch/sh/Kconfig        |    4 ++++
 arch/sparc/Kconfig     |    4 ++++
 arch/sparc64/Kconfig   |    4 ++++
 arch/um/Kconfig        |    4 ++++
 arch/v850/Kconfig      |    4 ++++
 arch/x86/Kconfig       |    4 ++++
 arch/xtensa/Kconfig    |    4 ++++
 fs/filesystems.c       |    4 ++++
 kernel/sys_ni.c        |    1 +
 25 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 729cdbd..9b7b4d2 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -71,6 +71,10 @@ config AUTO_IRQ_AFFINITY
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4039a13..c806808 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -137,6 +137,10 @@ config ZONE_DMA
 	bool
 	default y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config GENERIC_ISA_DMA
 	bool
 
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 28e0caf..2f9f01d 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -66,6 +66,10 @@ config GENERIC_BUG
 	def_bool y
 	depends on BUG
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 menu "System Type and features"
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 9389d38..7aec04b 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -32,6 +32,10 @@ config ARCH_HAS_ILOG2_U64
 	bool
 	default n
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config GENERIC_FIND_NEXT_BIT
 	bool
 	default y
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index a5aac1b..f08fb9a 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -58,6 +58,10 @@ config ARCH_HAS_ILOG2_U64
 	bool
 	default y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 1000
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 085dc6e..8184c99 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -69,6 +69,10 @@ config TIME_LOW_RES
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config NO_IOPORT
 	def_bool y
 
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 8fa3faf..513d960 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -111,6 +111,10 @@ config AUDIT_ARCH
 	bool
 	default y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 choice
 	prompt "System type"
 	default IA64_GENERIC
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index de153de..79d6f79 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -39,6 +39,10 @@ config NO_DMA
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 65db226..26859b1 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -56,6 +56,10 @@ config NO_DMA
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 07eb4c4..d9240a6 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -68,6 +68,10 @@ config NO_IOPORT
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 menu "Processor type and features"
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8724ed3..0716726 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -752,6 +752,10 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
 	bool
 	default n
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 #
 # Select some configuration options automatically based on user selections.
 #
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 6a6409a..3666f5f 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -63,6 +63,10 @@ config GENERIC_HARDIRQS
 config HOTPLUG_CPU
 	def_bool n
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 1000
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index bc7a19d..c6f5139 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -91,6 +91,10 @@ config ARCH_MAY_HAVE_PC_FDC
 	depends on BROKEN
 	default y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 1189d8d..21803f2 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -194,6 +194,10 @@ config PPC_OF_PLATFORM_PCI
 	depends on PPC64 # not supported on 32 bits yet
 	default n
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 source "arch/powerpc/sysdev/Kconfig"
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index abc877f..0156eb2 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -72,6 +72,10 @@ config GENERIC_BUG
 	default y
 	depends on BUG
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 menu "Processor"
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 1831833..c04b232 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -55,6 +55,10 @@ config GENERIC_LOCKBREAK
 	default y
 	depends on SMP && PREEMPT
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 mainmenu "Linux Kernel Configuration"
 
 config S390
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 8d2cd1d..66b74dc 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -93,6 +93,10 @@ config ARCH_SUPPORTS_AOUT
 config IO_TRAPPED
 	bool
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 source "init/Kconfig"
 
 menu "System type"
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c40343c..25c17e3 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -30,6 +30,10 @@ config OF
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 463d1be..9f5d1ed 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -90,6 +90,10 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 choice
 	prompt "Kernel page size"
 	default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index dba8e05..be0cb93 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -68,6 +68,10 @@ config IRQ_RELEASE_METHOD
 	bool
 	default y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index 4379f43..b54d1f4 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -56,6 +56,10 @@ config ARCH_HAS_ILOG2_U64
 config ARCH_SUPPORTS_AOUT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 # Turn off some random 386 crap that can affect device config
 config ISA
 	bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6c70fed..e0b830b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -155,6 +155,10 @@ config GENERIC_PENDING_IRQ
 	depends on GENERIC_HARDIRQS && SMP
 	default y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config X86_SMP
 	bool
 	depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 9fc8551..7834ad7 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -50,6 +50,10 @@ config ARCH_HAS_ILOG2_U64
 config NO_IOPORT
 	def_bool y
 
+config ARCH_HAS_SYS_SYSFS
+	bool
+	default y
+
 config HZ
 	int
 	default 100
diff --git a/fs/filesystems.c b/fs/filesystems.c
index f37f872..f6e1567 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -118,6 +118,8 @@ int unregister_filesystem(struct file_system_type * fs)
 
 EXPORT_SYMBOL(unregister_filesystem);
 
+#ifdef CONFIG_ARCH_HAS_SYS_SYSFS
+
 static int fs_index(const char __user * __name)
 {
 	struct file_system_type * tmp;
@@ -197,6 +199,8 @@ asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2)
 	return retval;
 }
 
+#endif
+
 int get_filesystem_list(char * buf)
 {
 	int len = 0;
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 5b9b467..866ff4b 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -121,6 +121,7 @@ cond_syscall(sys_vm86old);
 cond_syscall(sys_vm86);
 cond_syscall(compat_sys_ipc);
 cond_syscall(compat_sys_sysctl);
+cond_syscall(sys_sysfs);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
-- 
1.5.3.5


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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 14:36           ` Will Newton
@ 2008-04-23 14:59             ` Arnd Bergmann
  2008-04-23 15:40             ` Kyle McMartin
  2008-04-23 18:44             ` Sam Ravnborg
  2 siblings, 0 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-23 14:59 UTC (permalink / raw)
  To: Will Newton; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Wednesday 23 April 2008, Will Newton wrote:
> I implemented the approach you suggested - Kconfig symbol and
> cond_syscall definition. I think I actually like the previous approach
> better:
> 
> 1. The arch Kconfig files are quite non-uniform compared to unistd.h
> so the definitions wind up at different places in the file which is a
> bit messy.
> 2. Changes to Kconfig may cause churn in defconfigs perhaps?
> 3. There is more churn in arch Kconfig than unistd.h so getting a
> cross arch patch applied is likely to be more difficult.
> 4. The patch is about 4 times as many lines.
> 
> What do you think?

I still feel that the original patch was more helpful and consistent
with how we do it for the existing obsolete syscalls.

Note that there is a much simpler solution if you just use an
"#ifdef __NR_sys_sysfs" around the definition of the syscall, but
that has another disadvantage in that it is harder to spot when
new architectures get it wrong.

	Arnd <><

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 14:36           ` Will Newton
  2008-04-23 14:59             ` Arnd Bergmann
@ 2008-04-23 15:40             ` Kyle McMartin
  2008-04-23 15:50               ` Will Newton
  2008-04-23 18:44             ` Sam Ravnborg
  2 siblings, 1 reply; 52+ messages in thread
From: Kyle McMartin @ 2008-04-23 15:40 UTC (permalink / raw)
  To: Will Newton; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Wed, Apr 23, 2008 at 03:36:23PM +0100, Will Newton wrote:
> +config ARCH_HAS_SYS_SYSFS
> +	bool
> +	default y
> +
>  source "init/Kconfig"
> 

Sorry, I meant something more like

config ARCH_HAS_SYS_SYSFS
	def_bool !BLACKFIN
	help
	  Obsolete sys_sysfs syscall

in init/Kconfig

But, it's your patch, you can do it however you like. :)

regards, Kyle

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 15:40             ` Kyle McMartin
@ 2008-04-23 15:50               ` Will Newton
  2008-04-23 16:05                 ` Mike Frysinger
  0 siblings, 1 reply; 52+ messages in thread
From: Will Newton @ 2008-04-23 15:50 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Randy Dunlap, Linux Kernel list, linux-arch

On Wed, Apr 23, 2008 at 4:40 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
> On Wed, Apr 23, 2008 at 03:36:23PM +0100, Will Newton wrote:
>  > +config ARCH_HAS_SYS_SYSFS
>  > +     bool
>  > +     default y
>  > +
>  >  source "init/Kconfig"
>  >
>
>  Sorry, I meant something more like
>
>
>  config ARCH_HAS_SYS_SYSFS
>         def_bool !BLACKFIN
>         help
>           Obsolete sys_sysfs syscall
>
>  in init/Kconfig
>
>  But, it's your patch, you can do it however you like. :)

That's definitely shorter - but it feels a bit more like #ifdef
CONFIG_BLACKFIN which is explicitly what I don't want to do, because
I'm not actually interested in blackfin. ;-)

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 15:50               ` Will Newton
@ 2008-04-23 16:05                 ` Mike Frysinger
  2008-04-23 17:59                   ` Mike Frysinger
  0 siblings, 1 reply; 52+ messages in thread
From: Mike Frysinger @ 2008-04-23 16:05 UTC (permalink / raw)
  To: Will Newton; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Wed, Apr 23, 2008 at 11:50 AM, Will Newton <will.newton@gmail.com> wrote:
> On Wed, Apr 23, 2008 at 4:40 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
>  > On Wed, Apr 23, 2008 at 03:36:23PM +0100, Will Newton wrote:
>  >  > +config ARCH_HAS_SYS_SYSFS
>  >  > +     bool
>  >  > +     default y
>  >  > +
>  >  >  source "init/Kconfig"
>  >  >
>  >
>  >  Sorry, I meant something more like
>  >
>  >
>  >  config ARCH_HAS_SYS_SYSFS
>  >         def_bool !BLACKFIN
>  >         help
>  >           Obsolete sys_sysfs syscall
>  >
>  >  in init/Kconfig
>  >
>  >  But, it's your patch, you can do it however you like. :)
>
>  That's definitely shorter - but it feels a bit more like #ifdef
>  CONFIG_BLACKFIN which is explicitly what I don't want to do, because
>  I'm not actually interested in blackfin. ;-)

i'd have to agree that updating asm/unistd.h fits better with existing
paradigm.  if we want to talk about converting *all cases* to Kconfig,
we can do it in a separate thread.  splitting the design between two
different files is simply confusing to everyone involved as they spend
their time going "well which way am *i* supposed to do it".
-mike

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 16:05                 ` Mike Frysinger
@ 2008-04-23 17:59                   ` Mike Frysinger
  2008-04-24  9:18                     ` Will Newton
  0 siblings, 1 reply; 52+ messages in thread
From: Mike Frysinger @ 2008-04-23 17:59 UTC (permalink / raw)
  To: Will Newton; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Wed, Apr 23, 2008 at 12:05 PM, Mike Frysinger <vapier.adi@gmail.com> wrote:
> On Wed, Apr 23, 2008 at 11:50 AM, Will Newton <will.newton@gmail.com> wrote:
>  > On Wed, Apr 23, 2008 at 4:40 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
>  >  > On Wed, Apr 23, 2008 at 03:36:23PM +0100, Will Newton wrote:
>  >  >  > +config ARCH_HAS_SYS_SYSFS
>  >  >  > +     bool
>  >  >  > +     default y
>  >  >  > +
>  >  >  >  source "init/Kconfig"
>  >  >  >
>  >  >
>  >  >  Sorry, I meant something more like
>  >  >
>  >  >
>  >  >  config ARCH_HAS_SYS_SYSFS
>  >  >         def_bool !BLACKFIN
>  >  >         help
>  >  >           Obsolete sys_sysfs syscall
>  >  >
>  >  >  in init/Kconfig
>  >  >
>  >  >  But, it's your patch, you can do it however you like. :)
>  >
>  >  That's definitely shorter - but it feels a bit more like #ifdef
>  >  CONFIG_BLACKFIN which is explicitly what I don't want to do, because
>  >  I'm not actually interested in blackfin. ;-)
>
>  i'd have to agree that updating asm/unistd.h fits better with existing
>  paradigm.  if we want to talk about converting *all cases* to Kconfig,
>  we can do it in a separate thread.  splitting the design between two
>  different files is simply confusing to everyone involved as they spend
>  their time going "well which way am *i* supposed to do it".

thinking about this some more ... we actually have three choices here,
not just two.  checksyscalls.sh introduced a new form in asm/unistd.h:
#define __IGNORE_sysfs
perhaps we should be unifying the __ARCH_WANT_XXX and the __IGNORE_XXX
-mike

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 14:36           ` Will Newton
  2008-04-23 14:59             ` Arnd Bergmann
  2008-04-23 15:40             ` Kyle McMartin
@ 2008-04-23 18:44             ` Sam Ravnborg
  2 siblings, 0 replies; 52+ messages in thread
From: Sam Ravnborg @ 2008-04-23 18:44 UTC (permalink / raw)
  To: Will Newton; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Wed, Apr 23, 2008 at 03:36:23PM +0100, Will Newton wrote:
> On Tue, Apr 22, 2008 at 4:38 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
> > On Tue, Apr 22, 2008 at 04:34:03PM +0100, Will Newton wrote:
> >  > On Tue, Apr 22, 2008 at 4:24 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
> >  > > On Tue, Apr 22, 2008 at 04:16:17PM +0100, Will Newton wrote:
> >  > >  > It can be done with Kconfig. Whether it should be or not depends on
> >  > >  > your point of view, hence RFC. Currently __ARCH_WANT macros is the way
> >  > >  > syscalls are enabled and disabled across architectures. If there's
> >  > >  > consensus that it should be done via Kconfig that could certainly be
> >  > >  > implmented, but that's a different patch.
> >  > >  >
> >  > >
> >  > >  It's currently done in unistd.h for hysterical raisins. All new
> >  > >  conditional syscalls have been done in Kconfig.
> >  >
> >  > Do you have a syscall in mind that does this in the correct way?
> >  >
> >
> >  epoll is the most immediate example at hand, since it touches
> >  fs/compat.c similarly to how you would be touching fs/filesystem.c, and
> >  touches kernel/sys_ni.c and init/Kconfig in much the same way.
> 
> I implemented the approach you suggested - Kconfig symbol and
> cond_syscall definition. I think I actually like the previous approach
> better:
> 
> 1. The arch Kconfig files are quite non-uniform compared to unistd.h
> so the definitions wind up at different places in the file which is a
> bit messy.
> 2. Changes to Kconfig may cause churn in defconfigs perhaps?
> 3. There is more churn in arch Kconfig than unistd.h so getting a
> cross arch patch applied is likely to be more difficult.
> 4. The patch is about 4 times as many lines.
> 
> What do you think?

If we go the Kconfig route we should use the
HAVE_ semantic as expressed by the patch below.
It is preferable to defining a config symbol for each
arch.
This also address your point 1) and 4)
2) is not an issue since the symbols are not visible.

	Sam

Note: cut'n'pasted...

diff --git a/arch/Kconfig b/arch/Kconfig
index 694c9af..759bd5b 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -36,3 +36,9 @@ config HAVE_KPROBES

 config HAVE_KRETPROBES
        def_bool n
+
+# syscall symbols.
+# archs shall select the SYMBOL if they
+# implment this syscall
+config HAVE_SYS_SYSFS
+       defbool n
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 87a693c..487310f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -24,6 +24,8 @@ config X86
        select HAVE_KRETPROBES
        select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
        select HAVE_ARCH_KGDB
+       # kconfig selectable syscalls
+       select HAVE_SYS_SYSFS


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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 13:15 ` Arnd Bergmann
@ 2008-04-23 21:16   ` Michal Simek
  2008-04-23 21:38     ` Mike Frysinger
  2008-04-24 11:11     ` microblaze syscall list Arnd Bergmann
  0 siblings, 2 replies; 52+ messages in thread
From: Michal Simek @ 2008-04-23 21:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Will Newton, Linux Kernel list, linux-arch, git, microblaze-uclinux

Hi Arnd and others,

I would like to fix syscalls in Microblaze repo. Can you give me a hint how to
do it?

I look at Blackfin arch and I compared files with microblaze. There are some
differences but not so much.
Can you tell me how to test it which syscall is necessary for platform.
I have never found any documentation about.

In my syscall_table.S (on some arch in entry.S) is one big jump table with
reference to syscalls. In unistd.h is definition.

Is there any convention which syscalls are use for all archs and which are
architecture specific?

Thanks for info,
Michal Simek

>> This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
>> architectures that support the sysfs(2) system call. At the moment
>> that's everybody but blackfin, but future architectures may want to
>> save the (admittedly small) code size that it adds to the kernel as
>> well.
> 
> Yes, good thing to have. Since we'll be getting a new architecture
> (microblaze) soon, I think we should extend this mechanism (even though
> it's ugly) to all syscalls that we don't want to have in new architectures
> and make sure that microblaze doesn't have to set any of them.
> 
> 	Arnd <><
> 

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 21:16   ` Michal Simek
@ 2008-04-23 21:38     ` Mike Frysinger
  2008-04-24 11:11     ` microblaze syscall list Arnd Bergmann
  1 sibling, 0 replies; 52+ messages in thread
From: Mike Frysinger @ 2008-04-23 21:38 UTC (permalink / raw)
  To: monstr
  Cc: Arnd Bergmann, Will Newton, Linux Kernel list, linux-arch, git,
	microblaze-uclinux

On Wed, Apr 23, 2008 at 5:16 PM, Michal Simek <monstr@seznam.cz> wrote:
>  I would like to fix syscalls in Microblaze repo. Can you give me a hint how to
>  do it?
>
>  I look at Blackfin arch and I compared files with microblaze. There are some
>  differences but not so much.
>  Can you tell me how to test it which syscall is necessary for platform.
>  I have never found any documentation about.
>
>  In my syscall_table.S (on some arch in entry.S) is one big jump table with
>  reference to syscalls. In unistd.h is definition.
>
>  Is there any convention which syscalls are use for all archs and which are
>  architecture specific?

i dont believe there is any documentation for syscalls.  you just have
to know which syscalls are outdated and which replace others ;).  i
think someone already pointed out a few to you in an earlier post ?
otherwise, feel free to ask about sets.

i dont recall if microblaze is no-mmu-only, mmu-only, or both ... you
should take care with comparing against Blackfin if microblaze
supports an mmu.  if it is no-mmu-only, then the Blackfin list should
be quite good for you start with as we turn off numa/mmu-only
functions as well as old stuff (like the poll/select/mmap/etc...
friends).
-mike

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-23 17:59                   ` Mike Frysinger
@ 2008-04-24  9:18                     ` Will Newton
  0 siblings, 0 replies; 52+ messages in thread
From: Will Newton @ 2008-04-24  9:18 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Kyle McMartin, Randy Dunlap, Linux Kernel list, linux-arch

On Wed, Apr 23, 2008 at 6:59 PM, Mike Frysinger <vapier.adi@gmail.com> wrote:
>
> On Wed, Apr 23, 2008 at 12:05 PM, Mike Frysinger <vapier.adi@gmail.com> wrote:
>  > On Wed, Apr 23, 2008 at 11:50 AM, Will Newton <will.newton@gmail.com> wrote:
>  >  > On Wed, Apr 23, 2008 at 4:40 PM, Kyle McMartin <kyle@mcmartin.ca> wrote:
>  >  >  > On Wed, Apr 23, 2008 at 03:36:23PM +0100, Will Newton wrote:
>  >  >  >  > +config ARCH_HAS_SYS_SYSFS
>  >  >  >  > +     bool
>  >  >  >  > +     default y
>  >  >  >  > +
>  >  >  >  >  source "init/Kconfig"
>  >  >  >  >
>  >  >  >
>  >  >  >  Sorry, I meant something more like
>  >  >  >
>  >  >  >
>  >  >  >  config ARCH_HAS_SYS_SYSFS
>  >  >  >         def_bool !BLACKFIN
>  >  >  >         help
>  >  >  >           Obsolete sys_sysfs syscall
>  >  >  >
>  >  >  >  in init/Kconfig
>  >  >  >
>  >  >  >  But, it's your patch, you can do it however you like. :)
>  >  >
>  >  >  That's definitely shorter - but it feels a bit more like #ifdef
>  >  >  CONFIG_BLACKFIN which is explicitly what I don't want to do, because
>  >  >  I'm not actually interested in blackfin. ;-)
>  >
>  >  i'd have to agree that updating asm/unistd.h fits better with existing
>  >  paradigm.  if we want to talk about converting *all cases* to Kconfig,
>  >  we can do it in a separate thread.  splitting the design between two
>  >  different files is simply confusing to everyone involved as they spend
>  >  their time going "well which way am *i* supposed to do it".
>
>  thinking about this some more ... we actually have three choices here,
>  not just two.  checksyscalls.sh introduced a new form in asm/unistd.h:
>  #define __IGNORE_sysfs
>  perhaps we should be unifying the __ARCH_WANT_XXX and the __IGNORE_XXX

I'm not sure this would be possible. IGNORE is saying "please don't
warn me about the fact that I don't define define this syscall".
ARCH_WANT is saying "give me the generic implementation of this
syscall". You should never define IGNORE and ARCH_WANT for the same
syscall, but you may want to have neither - you have defined the
syscall but you don't want the generic version.

>  -mike
>

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

* microblaze syscall list
  2008-04-23 21:16   ` Michal Simek
  2008-04-23 21:38     ` Mike Frysinger
@ 2008-04-24 11:11     ` Arnd Bergmann
  2008-04-24 18:42       ` Michal Simek
  2008-04-24 20:51       ` Michal Simek
  1 sibling, 2 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-24 11:11 UTC (permalink / raw)
  To: monstr
  Cc: Will Newton, Linux Kernel list, linux-arch, git, microblaze-uclinux

On Wednesday 23 April 2008, Michal Simek wrote:

> I would like to fix syscalls in Microblaze repo. Can you give me a hint how to
> do it?

I think we need to do it on a case-by-case basis, best here on the
linux-arch mailing list. I'm sure there are some controversial ones,
but most should be pretty clear.
 
> I look at Blackfin arch and I compared files with microblaze. There are some
> differences but not so much.
> Can you tell me how to test it which syscall is necessary for platform.
> I have never found any documentation about.

Hopefully we can get to this kind of documentation by the end of this
discussion. scripts/checksyscalls.sh is some part of the documentation,
and we can refine that.

Maybe we can even have an asm-generic/unistd.h that defines all the
still relevant syscalls, plus a per-architecture range that you can
use for microblaze-specific calls in your own unistd.h.

> In my syscall_table.S (on some arch in entry.S) is one big jump table with
> reference to syscalls. In unistd.h is definition.
> 
> Is there any convention which syscalls are use for all archs and which are
> architecture specific?

Not really. There are very few syscalls that are needed only on certain
architectures. The more common case is that a syscall has been replaced
by a more complex interface, and a new architecture only needs one of the
two, while older architectures still need both.

Let me just comment on your syscall table as it is today:

> ENTRY(sys_call_table)
> 	.long sys_restart_syscall	/* 0 - old "setup()" system call,
> 					 * used for restarting */

The comment is irrelevant and misleading -- microblaze never had sys_setup.

> 	.long sys_exit
> 	.long sys_ni_syscall		/* was fork */

it might be useful to renumber your calls once all the irrelevant ones
have been removed, so you can get rid of all the sys_ni_syscalls here.

> 	.long sys_read
> 	.long sys_write
> 	.long sys_open			/* 5 */

Since we have all the new sys_*at calls like openat, we don't really
need the old versions any more. The kernel implementation of sys_open
basically calls openat. You could do the same in libc instead.
Don't know if that's worth it though, opinions?

> 	.long sys_close
> 	.long sys_waitpid

waitpid and wait4 can be replaced with waitid

> 	.long sys_creat
> 	.long sys_link
> 	.long sys_unlink		/* 10 */
> 	.long sys_execve_wrapper

having an execve_wrapper instead of execve looks like a strange convention,
though I guess you had a good reason for it, could you explain?

This one looks architecture specific, so you may want to rename it
microblaze_execve_wrapper instead of sys_execve_wrapper.

> 	.long sys_chdir
> 	.long sys_time

__ARCH_WANT_SYS_TIME

> 	.long sys_mknod
> 	.long sys_chmod			/* 15 */

the mknod and chmod calls fall in the same category as open, as
you can express them with fmknodat and fchmodat.

> 	.long sys_lchown16

Anything that uses 16 bit uids should really go away in new architectures.
We have a CONFIG_UID16 for that, which you should define to 'n'.


> 	.long sys_ni_syscall		/* old break syscall holder */
> 	.long sys_ni_syscall		/* stat */
> 	.long sys_lseek

You should not have both lseek and llseek. In general, I'd recommend
implementing only the large-file interfaces, so your lseek syscall
should probably point at sys_llseek.

> 	.long sys_getpid		/* 20 */
> 	.long sys_mount
> 	.long sys_oldumount

If a call has 'old' in its name, you don't need it in general. You certainly
shouldn't have oldumount.

> 	.long sys_setuid16
> 	.long sys_getuid16

uid16 --> kill these.

> 	.long sys_stime			/* 25 */

this should not be there, it depends on __ARCH_WANT_SYS_TIME, which you
should not set, and it has been replaced with sys_settimeofday ages ago.

> 	.long sys_ptrace
> 	.long sys_alarm

same for __ARCH_WANT_SYS_ALARM

> 	.long sys_ni_syscall		/* fstat */
> 	.long sys_pause

__ARCH_WANT_SYS_PAUSE

> 	.long sys_utime			/* 30 */

superceded by utimes, __ARCH_WANT_SYS_UTIME

> 	.long sys_ni_syscall		/* old stty syscall holder */
> 	.long sys_ni_syscall		/* old gtty syscall holder */
> 	.long sys_access

faccessat

> 	.long sys_nice

The sys_nice function has a __ARCH_WANT_SYS_NICE ifdef around it,
though I'm not sure what the replacement is. sys_setpriority?

> 	.long sys_ni_syscall		/* 35 - old ftime syscall holder */
> 	.long sys_sync
> 	.long sys_kill

We have sys_kill, sys_tkill and sys_tgkill, but afaics we need all three
of them. It would be nice to have them use consecutive numbers though.

> 	.long sys_rename
> 	.long sys_mkdir
> 	.long sys_rmdir			/* 40 */

renameat, mkdirat, unlinkat

> 	.long sys_dup
> 	.long sys_pipe
> 	.long sys_times
> 	.long sys_ni_syscall		/* old prof syscall holder */
> 	.long sys_brk			/* 45 */
> 	.long sys_setgid16
> 	.long sys_getgid16

uid16 again

> 	.long sys_signal

__ARCH_WANT_SYS_SIGNAL

> 	.long sys_geteuid16
> 	.long sys_getegid16		/* 50 */

uid16

> 	.long sys_acct

this one is an optional feature, but it should remain in the table.

> 	.long sys_umount		/* recycled never used phys() */
> 	.long sys_ni_syscall		/* old lock syscall holder */
> 	.long sys_ioctl
> 	.long sys_fcntl			/* 55 */

fcntl64

> 	.long sys_ni_syscall		/* old mpx syscall holder */
> 	.long sys_setpgid
> 	.long sys_ni_syscall		/* old ulimit syscall holder */
> 	.long sys_ni_syscall		/* olduname */
> 	.long sys_umask			/* 60 */
> 	.long sys_chroot
> 	.long sys_ustat

we have ustat, statfs, fstatfs, statfs64, fstatfs64. Maybe we
can reduce that to just statfs64 and fstatfs64 now?

> 	.long sys_dup2
> 	.long sys_getppid
> 	.long sys_getpgrp		/* 65 */

__ARCH_WANT_SYS_GETPGRP. what's the replacement?

> 	.long sys_setsid
> 	.long sys_sigaction

sigaction is one of the old signal-handling calls that have
been superceded by rt signals. This one should be rt_sigaction.

Interestingly, there is a __ARCH_WANT_SYS_SIGPROCMASK and
__ARCH_WANT_SYS_RT_SIGACTION, but they work the other way round
in that you actually should set them for a new architecture that
doesn't come with its own version.

Maybe we should invert the logic and define __ARCH_HAVE_SYS_RT_SIGACTION
on those architectures that don't use the generic code?

> 	.long sys_sgetmask
> 	.long sys_ssetmask

__ARCH_WANT_SYS_SGETMASK

> 	.long sys_setreuid16		/* 70 */
> 	.long sys_setregid16

uid16

> 	.long sys_sigsuspend_wrapper
> 	.long sys_sigpending

old signals

> 	.long sys_sethostname
> 	.long sys_setrlimit		/* 75 */
> 	.long sys_ni_syscall		/* old_getrlimit */
> 	.long sys_getrusage
> 	.long sys_gettimeofday
> 	.long sys_settimeofday
> 	.long sys_getgroups16		/* 80 */
> 	.long sys_setgroups16

uid16

> 	.long sys_ni_syscall		/* old_select */
> 	.long sys_symlink
> 	.long sys_ni_syscall		/* lstat */
> 	.long sys_readlink		/* 85 */

symlinkat, readlinkat

> 	.long sys_uselib

This should get hidden in __ARCH_WANT_SYS_USELIB, which we don't have
yet.

> 	.long sys_swapon
> 	.long sys_reboot
> 	.long sys_ni_syscall		/* old_readdir */
> 	.long sys_mmap			/* 90 */ /* old_mmap */

mmap2

> 	.long sys_munmap
> 	.long sys_truncate
> 	.long sys_ftruncate

these should be truncate64 and ftruncate64. They are also missing
an __ARCH_WANT_SYS_TRUNCATE.

Question: why is there no sys_truncateat?

> 	.long sys_fchmod
> 	.long sys_fchown16		/* 95 */

uid16

> 	.long sys_getpriority
> 	.long sys_setpriority
> 	.long sys_ni_syscall		/* old profil syscall holder */

> 	.long sys_statfs
> 	.long sys_fstatfs		/* 100 */

see comment about ustat

> 	.long sys_ni_syscall		/* ioperm */

> 	.long sys_socketcall

socketcall must die. please put the separate calls into you sys_call_table.

> 	.long sys_syslog

> 	.long sys_setitimer
> 	.long sys_getitimer		/* 105 */

do we still need these, or can we replace them with posix timers
for new architectures?

> 	.long sys_newstat
> 	.long sys_newlstat
> 	.long sys_newfstat

these are the right ones, but you should probably replace the
definition of struct stat with the definition of the struct
stat64 from glibc. your struct stat64 has issues with broken
padding and should just go away.

> 	.long sys_ni_syscall		/* uname */
> 	.long sys_ni_syscall		/* 110 */ /* iopl */
> 	.long sys_vhangup
> 	.long sys_ni_syscall		/* old "idle" system call */
> 	.long sys_ni_syscall		/* old sys_vm86old */
> 	.long sys_wait4

waitid

> 	.long sys_swapoff		/* 115 */
> 	.long sys_sysinfo

> 	.long sys_ipc

same as sys_socketcall, ipc should be replaced with separate
syscalls for its subfunctions.

> 	.long sys_fsync


> 	.long sys_sigreturn_wrapper

old signals

> 	.long sys_clone_wrapper		/* 120 */
> 	.long sys_setdomainname
> 	.long sys_newuname
> 	.long sys_ni_syscall		/* modify_ldt */
> 	.long sys_adjtimex
> 	.long sys_ni_syscall		/* 125:	sys_mprotect */

> 	.long sys_sigprocmask

old signals

> 	.long sys_ni_syscall		/* old "create_module" */
> 	.long sys_init_module
> 	.long sys_delete_module
> 	.long sys_ni_syscall		/* 130:	old "get_kernel_syms" */
> 	.long sys_quotactl
> 	.long sys_getpgid
> 	.long sys_fchdir

question: should there be an fchdirat?

> 	.long sys_bdflush

entirely obsolete

> 	.long sys_sysfs			/* 135 */

same here

> 	.long sys_personality
> 	.long sys_ni_syscall		/* reserved for afs_syscall */
> 	.long sys_setfsuid16
> 	.long sys_setfsgid16

uid16

> 	.long sys_llseek		/* 140 */

> 	.long sys_getdents

getdents64

> 	.long sys_select

pselect6 or pselect7

> 	.long sys_flock
> 	.long sys_ni_syscall		/* sys_msync */
> 	.long sys_readv			/* 145 */
> 	.long sys_writev
> 	.long sys_getsid
> 	.long sys_fdatasync

> 	.long sys_sysctl

sys_sysctl has been deprecated on other platforms for years,
don't introduce it here.

> 	.long sys_ni_syscall		/* 150:	sys_mlock */
> 	.long sys_ni_syscall		/* sys_munlock */
> 	.long sys_ni_syscall		/* sys_mlockall */
> 	.long sys_ni_syscall		/* sys_munlockall */

ok to have placeholders for these, but only if you can potentially
get an mmu version of the architecture.

Of course, you can always add them at the end of the list if
necessary.

> 	.long sys_sched_setparam
> 	.long sys_sched_getparam	/* 155 */
> 	.long sys_sched_setscheduler
> 	.long sys_sched_getscheduler
> 	.long sys_sched_yield
> 	.long sys_sched_get_priority_max
> 	.long sys_sched_get_priority_min	/* 160 */
> 	.long sys_sched_rr_get_interval
> 	.long sys_nanosleep
> 	.long sys_ni_syscall		/* sys_mremap */

> 	.long sys_setresuid16
> 	.long sys_getresuid16		/* 165 */

uid16

> 	.long sys_ni_syscall		/* sys_vm86 */
> 	.long sys_ni_syscall		/* Old sys_query_module */
> 	.long sys_poll

ppoll

> 	.long sys_nfsservctl

This used to be deprecated, but I think the replacement nfsctl file system
never got popular use from user space, so you may need to keep it.
Does anyone have more information on this?

> 	.long sys_setresgid16		/* 170 */
> 	.long sys_getresgid16

uid16

> 	.long sys_prctl
> 	.long sys_rt_sigreturn_wrapper
> 	.long sys_rt_sigaction
> 	.long sys_rt_sigprocmask	/* 175 */
> 	.long sys_rt_sigpending
> 	.long sys_rt_sigtimedwait
> 	.long sys_rt_sigqueueinfo
> 	.long sys_rt_sigsuspend_wrapper

fine, but please use the generic version of sys_rt_sigsuspend
rather than rolling your own.

I also wonder if there could be a more generalized version of
sys_rt_sigreturn, probably not.

> 	.long sys_pread64		/* 180 */
> 	.long sys_pwrite64

> 	.long sys_chown16

uid16

> 	.long sys_getcwd
> 	.long sys_capget
> 	.long sys_capset		/* 185 */
> 	.long sys_ni_syscall		/* sigaltstack */
> 	.long sys_sendfile

sys_sendfile64

> 	.long sys_ni_syscall		/* reserved for streams1 */
> 	.long sys_ni_syscall		/* reserved for streams2 */
> 	.long sys_vfork_wrapper		/* 190 */

you already have clone, so you don't need vfork

> 	.long sys_getrlimit
> 	.long sys_mmap2			/* mmap2 */

> 	.long sys_truncate64
> 	.long sys_ftruncate64
> 	.long sys_stat64		/* 195 */
> 	.long sys_lstat64
> 	.long sys_fstat64

these are the LFS versions of syscalls, so you want them
instead of the older ones, as mentioned there.

An interesting question for the mailing list: should a new architecture
'typedef unsigned long long off_t', or ignore all syscalls that deal with
off_t and use the loff_t versions instead?

> 	.long sys_lchown
> 	.long sys_getuid
> 	.long sys_getgid		/* 200 */
> 	.long sys_geteuid
> 	.long sys_getegid
> 	.long sys_setreuid
> 	.long sys_setregid
> 	.long sys_getgroups		/* 205 */
> 	.long sys_setgroups
> 	.long sys_fchown
> 	.long sys_setresuid
> 	.long sys_getresuid
> 	.long sys_setresgid		/* 210 */
> 	.long sys_getresgid
> 	.long sys_chown
> 	.long sys_setuid
> 	.long sys_setgid
> 	.long sys_setfsuid		/* 215 */
> 	.long sys_setfsgid

same for these, which replace the uid16 calls.

> 	.long sys_pivot_root
> 	.long sys_ni_syscall		/* sys_mincore */
> 	.long sys_ni_syscall		/* sys_madvise */
> 	.long sys_getdents64		/* 220 */
> 	.long sys_fcntl64
> 	.long sys_ni_syscall		/* reserved for TUX */
> 	.long sys_ni_syscall
> 	.long sys_gettid
> 	.long sys_readahead		/* 225 */
> 	.long sys_setxattr
> 	.long sys_lsetxattr
> 	.long sys_fsetxattr
> 	.long sys_getxattr
> 	.long sys_lgetxattr		/* 230 */
> 	.long sys_fgetxattr
> 	.long sys_listxattr
> 	.long sys_llistxattr
> 	.long sys_flistxattr
> 	.long sys_removexattr		/* 235 */
> 	.long sys_lremovexattr
> 	.long sys_fremovexattr
> 	.long sys_tkill
> 	.long sys_sendfile64
> 	.long sys_futex			/* 240 */
> 	.long sys_sched_setaffinity
> 	.long sys_sched_getaffinity
> 	.long sys_ni_syscall		/* set_thread_area */
> 	.long sys_ni_syscall		/* get_thread_area */
> 	.long sys_io_setup		/* 245 */
> 	.long sys_io_destroy
> 	.long sys_io_getevents
> 	.long sys_io_submit
> 	.long sys_io_cancel
> 	.long sys_fadvise64		/* 250 */

fadvise64_64

> 	.long sys_ni_syscall
> 	.long sys_exit_group
> 	.long sys_lookup_dcookie
> 	.long sys_epoll_create
> 	.long sys_epoll_ctl		/* 255 */
> 	.long sys_epoll_wait

epoll_pwait

> 	.long sys_ni_syscall		/* sys_remap_file_pages */
> 	.long sys_set_tid_address
> 	.long sys_timer_create
> 	.long sys_timer_settime		/* 260 */
> 	.long sys_timer_gettime
> 	.long sys_timer_getoverrun
> 	.long sys_timer_delete
> 	.long sys_clock_settime
> 	.long sys_clock_gettime		/* 265 */
> 	.long sys_clock_getres
> 	.long sys_clock_nanosleep
> 	.long sys_statfs64
> 	.long sys_fstatfs64
> 	.long sys_tgkill		/* 270 */

> 	.long sys_utimes

futimensat

> 	.long sys_fadvise64_64
> 	.long sys_ni_syscall		/* sys_vserver */

> 	.long sys_mbind
> 	.long sys_get_mempolicy
> 	.long sys_set_mempolicy

probably not very useful for nommu.

> 	.long sys_mq_open
> 	.long sys_mq_unlink
> 	.long sys_mq_timedsend
> 	.long sys_mq_timedreceive	/* 280 */
> 	.long sys_mq_notify
> 	.long sys_mq_getsetattr

> 	.long sys_kexec_load

you don't implement kexec, but I guess it doesn't hurt to define
it anyway.

> 	.long sys_waitid
> 	.long sys_ni_syscall		/* 285 */ /* available */
> 	.long sys_add_key
> 	.long sys_request_key
> 	.long sys_keyctl
> 	.long sys_ioprio_set
> 	.long sys_ioprio_get		/* 290 */
> 	.long sys_inotify_init
> 	.long sys_inotify_add_watch
> 	.long sys_inotify_rm_watch
> 	.long sys_ni_syscall		/* sys_migrate_pages */

> 	.long sys_ni_syscall		/* 295 */ /* sys_openat */
> 	.long sys_ni_syscall		/* sys_mkdirat */
> 	.long sys_ni_syscall		/* sys_mknodat */
> 	.long sys_ni_syscall		/* sys_fchownat */
> 	.long sys_ni_syscall		/* sys_futimesat */
> 	.long sys_ni_syscall		/* 300 */ /* sys_fstatat64 */
> 	.long sys_ni_syscall		/* sys_unlinkat */
> 	.long sys_ni_syscall		/* sys_renameat */
> 	.long sys_ni_syscall		/* sys_linkat */
> 	.long sys_ni_syscall		/* sys_symlinkat */
> 	.long sys_ni_syscall		/* 305 */ /* sys_readlinkat */
> 	.long sys_ni_syscall		/* sys_fchmodat */
> 	.long sys_ni_syscall		/* sys_faccessat */
> 	.long sys_ni_syscall		/* pselect6 */
> 	.long sys_ni_syscall		/* ppoll */
> 	.long sys_ni_syscall		/* 310 */ /* sys_unshare */
> 	.long sys_ni_syscall		/* sys_set_robust_list */
> 	.long sys_ni_syscall		/* sys_get_robust_list */
> 	.long sys_ni_syscall		/* sys_splice */
> 	.long sys_ni_syscall		/* sys_sync_file_range */
> 	.long sys_ni_syscall		/* 315 */ /* sys_tee */
> 	.long sys_ni_syscall		/* sys_vmsplice */

I think you should enable all of these, except sys_futimesat,
which has already been obsoleted again.

> 	.long sys_move_pages

but not this one, on nommu.
You can either define all the mmu syscalls and let them get
handled by cond_syscall, or not define them at all, but please
be consistent.

> 	.long sys_getcpu
> 	.long sys_epoll_pwait
> 	.long sys_utimensat		/* 320 */
> 	.long sys_signalfd
> 	.long sys_timerfd_create
> 	.long sys_eventfd
> 	.long sys_fallocate
> 	.long sys_semtimedop		/* 325 */

semtimedop is a bit lonely here, all the other sys_ipc 
functions belong here as well.

> 	.long sys_timerfd_settime
> 	.long sys_timerfd_gettime

	Arnd <><

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

* Re: [RFC] Introduce __ARCH_WANT_SYS_SYSFS
  2008-04-22 15:12 ` [RFC] Introduce __ARCH_WANT_SYS_SYSFS Randy Dunlap
  2008-04-22 15:16   ` Will Newton
@ 2008-04-24 14:51   ` Adrian Bunk
  1 sibling, 0 replies; 52+ messages in thread
From: Adrian Bunk @ 2008-04-24 14:51 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Will Newton, Linux Kernel list, linux-arch

On Tue, Apr 22, 2008 at 08:12:11AM -0700, Randy Dunlap wrote:
> On Tue, 22 Apr 2008 13:13:39 +0100 Will Newton wrote:
> 
> > Hi,
> > 
> > This patch introduces a __ARCH_WANT_SYS_SYSFS #define for
> > architectures that support the sysfs(2) system call. At the moment
> > that's everybody but blackfin, but future architectures may want to
> > save the (admittedly small) code size that it adds to the kernel as
> > well.
> > 
> > (patch attached as well as inline because gmail seems to mangle my whitespace)
> > 
> > ---
> > >From d0746366e8ccb5fbaa6c9945540cecbe0c421222 Mon Sep 17 00:00:00 2001
> > From: Will Newton <will.newton@imgtec.com>
> > Date: Tue, 22 Apr 2008 12:57:03 +0100
> > Subject: [PATCH] Introduce __ARCH_WANT_SYS_SYSFS.
> > 
> > Signed-off-by: Will Newton <will.newton@imgtec.com>
> > 
> > All arches that want the sysfs(2) system call should define this symbol.
> > Arches such as blackfin that do not implement the system call don't compile
> > the code and save some small amount of space.
> 
> Is there any reason that this couldn't (and shouldn't) be done
> in the Kconfig space and done as documented in
> Documentation/kbuild/kconfig-language.txt ?
>...

Moving it to Kconfig makes sense for stuff where the placement is 
arbitrary.

But in this case having everything in one file is better than splitting 
the information between the header and Kconfig.

> ~Randy

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: microblaze syscall list
  2008-04-24 11:11     ` microblaze syscall list Arnd Bergmann
@ 2008-04-24 18:42       ` Michal Simek
  2008-04-24 21:21         ` Arnd Bergmann
  2008-04-25  9:36         ` [microblaze-uclinux] " John Williams
  2008-04-24 20:51       ` Michal Simek
  1 sibling, 2 replies; 52+ messages in thread
From: Michal Simek @ 2008-04-24 18:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Will Newton, Linux Kernel list, linux-arch, git, microblaze-uclinux

Hi Arnd,

>> I would like to fix syscalls in Microblaze repo. Can you give me a hint how to
>> do it?
> 
> I think we need to do it on a case-by-case basis, best here on the
> linux-arch mailing list. I'm sure there are some controversial ones,
> but most should be pretty clear.
>  
>> I look at Blackfin arch and I compared files with microblaze. There are some
>> differences but not so much.
>> Can you tell me how to test it which syscall is necessary for platform.
>> I have never found any documentation about.
> 
> Hopefully we can get to this kind of documentation by the end of this
> discussion. scripts/checksyscalls.sh is some part of the documentation,
> and we can refine that.
:-)

> Maybe we can even have an asm-generic/unistd.h that defines all the
> still relevant syscalls, plus a per-architecture range that you can
> use for microblaze-specific calls in your own unistd.h.

That will be really useful. Good idea.

>> In my syscall_table.S (on some arch in entry.S) is one big jump table with
>> reference to syscalls. In unistd.h is definition.
>>
>> Is there any convention which syscalls are use for all archs and which are
>> architecture specific?
> 
> Not really. There are very few syscalls that are needed only on certain
> architectures. The more common case is that a syscall has been replaced
> by a more complex interface, and a new architecture only needs one of the
> two, while older architectures still need both.
> 
> Let me just comment on your syscall table as it is today:
> 
>> ENTRY(sys_call_table)
>> 	.long sys_restart_syscall	/* 0 - old "setup()" system call,
>> 					 * used for restarting */
> 
> The comment is irrelevant and misleading -- microblaze never had sys_setup.

I removed this comment.

>> 	.long sys_exit
>> 	.long sys_ni_syscall		/* was fork */
> 
> it might be useful to renumber your calls once all the irrelevant ones
> have been removed, so you can get rid of all the sys_ni_syscalls here.

I'll delete all sys_ni_syscall from syscall_table.S and I'll remove it from
unistd.h too. I hope I'll keep the same call numbers.

>> 	.long sys_read
>> 	.long sys_write
>> 	.long sys_open			/* 5 */
> 
> Since we have all the new sys_*at calls like openat, we don't really
> need the old versions any more. The kernel implementation of sys_open
> basically calls openat. You could do the same in libc instead.
> Don't know if that's worth it though, opinions?

I looked at it and there are the different arguments for open and openat
syscalls. Implementation is almost the same. I keep it now.

>> 	.long sys_close
>> 	.long sys_waitpid
> 
> waitpid and wait4 can be replaced with waitid

Can I keep number of syscall(unistd.h) and only add reference to waitid in
syscall_table? or just remove?

>> 	.long sys_creat
>> 	.long sys_link
>> 	.long sys_unlink		/* 10 */
>> 	.long sys_execve_wrapper
> 
> having an execve_wrapper instead of execve looks like a strange convention,
> though I guess you had a good reason for it, could you explain?
>
> This one looks architecture specific, so you may want to rename it
> microblaze_execve_wrapper instead of sys_execve_wrapper.

I looked at it and the same of style is used in arm
(arch/arm/kernel/entry-common.S) and some others arch. This wrapper only set one
parameter to correct pointer to stack.

I'll comment the rest later. I need time to look at it.

Thanks for your big help. I really appreciate this.

Michal

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

* Re: microblaze syscall list
  2008-04-24 11:11     ` microblaze syscall list Arnd Bergmann
  2008-04-24 18:42       ` Michal Simek
@ 2008-04-24 20:51       ` Michal Simek
  2008-04-24 21:37         ` Arnd Bergmann
  1 sibling, 1 reply; 52+ messages in thread
From: Michal Simek @ 2008-04-24 20:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Will Newton, Linux Kernel list, linux-arch, git, microblaze-uclinux

Hi Arnd,
here is current syscall table - I only rewrite your changes. I remove sys_ni_syscall except from #ifdefs. 
I would like to match syscalls to logical block. Can I do it? (I'll fix unistd.h later)
Can you look at it if I remove old syscalls? 
I will continue tomorrow I am tired.

Michal

ENTRY(sys_call_table)
	.long sys_restart_syscall	/* 0 */
	.long sys_reboot
	.long sys_exit
	.long sys_execve_wrapper
	.long sys_chdir


	.long sys_sync
	.long sys_kill
	.long sys_tkill
	.long sys_tgkill		/* 270 */

	.long sys_dup
	.long sys_pipe
	.long sys_times
	.long sys_brk			/* 45 */




	.long sys_acct
	.long sys_mount
	.long sys_umount		/* recycled never used phys() */

	.long sys_umask			/* 60 */
	.long sys_chroot
	.long sys_dup2


	.long sys_setrlimit		/* 75 */
	.long sys_getrusage
	.long sys_gettimeofday
	.long sys_settimeofday

	.long sys_munmap
	.long sys_fchmod
	.long sys_fchown		/* 95 */
	.long sys_getpriority
	.long sys_setpriority
	.long sys_syslog
	.long sys_setitimer
	.long sys_getitimer		/* 105 */
	.long sys_newstat
	.long sys_newlstat
	.long sys_newfstat
	.long sys_vhangup
	.long sys_swapoff		/* 115 */
	.long sys_sysinfo
	.long sys_fsync

	.long sys_clone_wrapper		/* 120 */
	.long sys_setdomainname
	.long sys_newuname
	.long sys_adjtimex
	.long sys_init_module
	.long sys_delete_module
	.long sys_quotactl

	.long sys_fchdir
	.long sys_personality
	.long sys_llseek		/* 140 */
	.long sys_flock
	.long sys_readv			/* 145 */
	.long sys_writev

	.long sys_fdatasync
	.long sys_sched_setparam
	.long sys_sched_getparam	/* 155 */
	.long sys_sched_setscheduler
	.long sys_sched_getscheduler
	.long sys_sched_yield
	.long sys_sched_get_priority_max
	.long sys_sched_get_priority_min	/* 160 */
	.long sys_sched_rr_get_interval
	.long sys_nanosleep

	.long sys_ppoll
	.long sys_nfsservctl		/* nfsctl in new version */

	.long sys_prctl

@ /* RT signals */
	.long sys_rt_sigreturn_wrapper
	.long sys_rt_sigaction
	.long sys_rt_sigprocmask	/* 175 */
	.long sys_rt_sigpending
	.long sys_rt_sigtimedwait
	.long sys_rt_sigqueueinfo
	.long sys_rt_sigsuspend_wrapper


	.long sys_pread64		/* 180 */
	.long sys_pwrite64
	.long sys_chown
	.long sys_getcwd
	.long sys_capget
	.long sys_capset		/* 185 */
	.long sys_vfork		/* 190 */
	.long sys_getrlimit
	.long sys_mmap2			/* mmap2 */
#ifdef __ARCH_WANT_SYS_TRUNCATE
	.long sys_truncate64
	.long sys_ftruncate64
#else
	.long sys_ni_syscall
	.long sys_ni_syscall
#endif 
	.long sys_stat64		/* 195 */
	.long sys_lstat64
	.long sys_fstat64

	.long sys_chown
	.long sys_lchown
	.long sys_fchown

/* process */
	.long sys_getpid		/* 20 */
	.long sys_getppid

	.long sys_getpgid
	.long sys_setresgid		/* 170 */
	.long sys_getresgid

	.long sys_setsid
	.long sys_getsid



/* permissions */
	.long sys_setresuid
	.long sys_getresuid		/* 165 */
	.long sys_getuid
	.long sys_getgid		/* 200 */
	.long sys_geteuid
	.long sys_getegid
	.long sys_setreuid
	.long sys_setpgid
	.long sys_setregid
	.long sys_getgroups		/* 205 */
	.long sys_setgroups
	.long sys_setresuid
	.long sys_getresuid
	.long sys_setresgid		/* 210 */
	.long sys_getresgid
	.long sys_setuid
	.long sys_setgid
	.long sys_setfsuid		/* 215 */
	.long sys_setfsgid
	.long sys_gettid



	.long sys_pivot_root
	.long sys_getdents64		/* 220 */
	.long sys_fcntl64
	.long sys_readahead		/* 225 */
	.long sys_waitid

	.long sys_setxattr
	.long sys_lsetxattr
	.long sys_fsetxattr
	.long sys_getxattr
	.long sys_lgetxattr		/* 230 */
	.long sys_fgetxattr
	.long sys_listxattr
	.long sys_llistxattr
	.long sys_flistxattr
	.long sys_removexattr		/* 235 */
	.long sys_lremovexattr
	.long sys_fremovexattr

	.long sys_sendfile64
	.long sys_futex			/* 240 */
	.long sys_sched_setaffinity
	.long sys_sched_getaffinity
	.long sys_io_setup		/* 245 */
	.long sys_io_destroy
	.long sys_io_getevents
	.long sys_io_submit
	.long sys_io_cancel
	.long sys_exit_group
	.long sys_lookup_dcookie
	.long sys_epoll_create
	.long sys_epoll_ctl		/* 255 */
	.long sys_epoll_pwait
	.long sys_set_tid_address

	.long sys_statfs64
	.long sys_fstatfs64
	.long sys_utimensat
	.long sys_fadvise64_64
	.long sys_mbind
	.long sys_mq_open
	.long sys_mq_unlink
	.long sys_mq_timedsend
	.long sys_mq_timedreceive	/* 280 */
	.long sys_mq_notify
	.long sys_mq_getsetattr
	.long sys_kexec_load

	.long sys_add_key
	.long sys_request_key
	.long sys_keyctl
	.long sys_ioprio_set
	.long sys_ioprio_get		/* 290 */
	.long sys_inotify_init
	.long sys_inotify_add_watch
	.long sys_inotify_rm_watch

/* FILES */
	.long sys_read
	.long sys_write
	.long sys_open /* will sys_openat */	/* 5 */
	.long sys_openat		/* 295 */
	.long sys_ioctl
	.long sys_close
	.long sys_creat
	.long sys_link
	.long sys_unlink		/* 10 */
	.long sys_mkdirat
	.long sys_mknodat
	.long sys_unlinkat
	.long sys_renameat
	.long sys_linkat
	.long sys_symlinkat
	.long sys_readlinkat


	.long sys_fchmodat
	.long sys_faccessat
	.long sys_pselect6
	.long sys_ppoll
	.long sys_unshare
	.long sys_fstatat64
	.long sys_set_robust_list
	.long sys_get_robust_list
	.long sys_splice
	.long sys_sync_file_range
	.long sys_tee
	.long sys_vmsplice
	.long sys_getcpu

	.long sys_eventfd
	.long sys_fallocate
	.long sys_signalfd

/* Time */
	.long sys_utimensat		/* 320 */
	.long sys_timer_create
	.long sys_timer_settime		/* 260 */
	.long sys_timer_gettime
	.long sys_timer_getoverrun
	.long sys_timer_delete
	.long sys_clock_settime
	.long sys_clock_gettime		/* 265 */
	.long sys_clock_getres
	.long sys_clock_nanosleep
	.long sys_timerfd_create
	.long sys_timerfd_settime
	.long sys_timerfd_gettime

/* NET */
	.long sys_accept
	.long sys_bind		/* 315 */
	.long sys_connect
	.long sys_getpeername
	.long sys_getsockname
	.long sys_getsockopt
	.long sys_listen	/* 320 */
	.long sys_recv
	.long sys_recvfrom
	.long sys_recvmsg
	.long sys_send
	.long sys_sendmsg	/* 325 */
	.long sys_sendto
	.long sys_setsockopt
	.long sys_shutdown
	.long sys_socket
	.long sys_socketpair	/* 330 */
	.long sys_sethostname

/* IPC semaphores */
	.long sys_semtimedop		/* 325 */
	.long sys_semctl
	.long sys_semget
	.long sys_semop
/* IPC messages */
	.long sys_msgctl
	.long sys_msgget	/* 335 */
	.long sys_msgrcv
	.long sys_msgsnd
/* IPC shared memory */
	.long sys_shmat
	.long sys_shmctl
	.long sys_shmdt	/* 340 */
	.long sys_shmget


#ifdef __ARCH_WANT_SYS_SIGNAL
	.long sys_signal
#else
	.long sys_ni_syscall
#endif
#ifdef __ARCH_WANT_SYS_TIME
	.long sys_time
	.long sys_stime
#else
	.long sys_ni_syscall
	.long sys_ni_syscall
#endif
	.long sys_ptrace
#ifdef __ARCH_WANT_SYS_ALARM
	.long sys_alarm
#else
	.long sys_ni_syscall
#endif

#ifdef __ARCH_WANT_SYS_PAUSE
	.long sys_pause
#else
	.long sys_ni_syscall
#endif
#ifdef __ARCH_WANT_SYS_UTIME
	.long sys_utime
#else
	.long sys_ni_syscall
#endif
#ifdef __ARCH_WANT_SYS_NICE
	.long sys_nice			/* maybe sys_setpriority? */
#else
	.long sys_ni_syscall
#endif
#ifdef __ARCH_WANT_SYS_GETPGRP
	.long sys_getpgrp		/* 65 */
#else
	.long sys_ni_syscall
#endif
ifdef __ARCH_WANT_SYS_SGETMASK
	.long sys_sgetmask
	.long sys_ssetmask
#else
	.long sys_ni_syscall
	.long sys_ni_syscall
#endif
#ifdef __ARCH_WANT_SYS_USELIB
	.long sys_uselib
#else
	.long sys_ni_syscall
#endif

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

* Re: microblaze syscall list
  2008-04-24 18:42       ` Michal Simek
@ 2008-04-24 21:21         ` Arnd Bergmann
  2008-04-25  9:36         ` [microblaze-uclinux] " John Williams
  1 sibling, 0 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-24 21:21 UTC (permalink / raw)
  To: monstr
  Cc: Will Newton, Linux Kernel list, linux-arch, git, microblaze-uclinux

On Thursday 24 April 2008, Michal Simek wrote:

> >> 	.long sys_exit
> >> 	.long sys_ni_syscall		/* was fork */
> > 
> > it might be useful to renumber your calls once all the irrelevant ones
> > have been removed, so you can get rid of all the sys_ni_syscalls here.
> 
> I'll delete all sys_ni_syscall from syscall_table.S and I'll remove it from
> unistd.h too. I hope I'll keep the same call numbers.

there is not much point in keeping the syscall numbers, as you'll have
to do incompatible changes to your libc in order to do all the changes
I'm asking for.
 
> >> 	.long sys_read
> >> 	.long sys_write
> >> 	.long sys_open			/* 5 */
> > 
> > Since we have all the new sys_*at calls like openat, we don't really
> > need the old versions any more. The kernel implementation of sys_open
> > basically calls openat. You could do the same in libc instead.
> > Don't know if that's worth it though, opinions?
> 
> I looked at it and there are the different arguments for open and openat
> syscalls. Implementation is almost the same. I keep it now.

There is no "for now". If you keep them for submission, you'll have to
keep them forever. You'll have to wrap them in your libc to adapt the
arguments.

> >> 	.long sys_close
> >> 	.long sys_waitpid
> > 
> > waitpid and wait4 can be replaced with waitid
> 
> Can I keep number of syscall(unistd.h) and only add reference to waitid in
> syscall_table? or just remove?

if you keep the syscall number in unistd.h, you may confuse user space
that relies on it when the actual call is not there. It's most important
to keep the two in sync.

It may turn out to be better to leave them in, but then you still need
both the number and the sys_call_table entry.

The wait/waitpid/wait4/waitid case is much less interesting than
the uid16/uid32 and off_t/loff_t cases, where you don't ever want
anyone to call the old functions.

the openat/*at family of calls probably falls into the same category
as waitid: there are user space programs that call either one, and
it doesn't matter much which one (kernel or libc) does the conversion.

> >> 	.long sys_creat
> >> 	.long sys_link
> >> 	.long sys_unlink		/* 10 */
> >> 	.long sys_execve_wrapper
> > 
> > having an execve_wrapper instead of execve looks like a strange convention,
> > though I guess you had a good reason for it, could you explain?
> >
> > This one looks architecture specific, so you may want to rename it
> > microblaze_execve_wrapper instead of sys_execve_wrapper.
> 
> I looked at it and the same of style is used in arm
> (arch/arm/kernel/entry-common.S) and some others arch. This wrapper only set one
> parameter to correct pointer to stack.

right, but other architectures don't seem to need it.

> I'll comment the rest later. I need time to look at it.

I guess you should also wait for other comments on my list.

	Arnd <><

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

* Re: microblaze syscall list
  2008-04-24 20:51       ` Michal Simek
@ 2008-04-24 21:37         ` Arnd Bergmann
  0 siblings, 0 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-24 21:37 UTC (permalink / raw)
  To: Michal Simek
  Cc: Will Newton, Linux Kernel list, linux-arch, git, microblaze-uclinux

On Thursday 24 April 2008, Michal Simek wrote:
> Hi Arnd,
> here is current syscall table - I only rewrite your changes. I remove sys_ni_syscall except from #ifdefs. 
> I would like to match syscalls to logical block. Can I do it? (I'll fix unistd.h later)

yes, that makes a lot of sense to me. If we introduce a new
asm-generic/unistd.h, it's good to have it sorted in some
meaningful way, even if it is going to get messier over time.

> Can you look at it if I remove old syscalls? 
> I will continue tomorrow I am tired.

ok, I'll look at it tomorrow.

> 
> #ifdef __ARCH_WANT_SYS_SIGNAL
> 	.long sys_signal
> #else
> 	.long sys_ni_syscall
> #endif
> #ifdef __ARCH_WANT_SYS_TIME
> 	.long sys_time
> 	.long sys_stime
> #else
> 	.long sys_ni_syscall
> 	.long sys_ni_syscall
> #endif

I guess I wasn't entirely clear with what I mean referring to
__ARCH_WANT_SYS_*. Instead of adding the #ifdef here, I meant
you should just remove the call entirely. With a few exceptions
that I already mentioned, the fact that there is an __ARCH_WANT
check in the syscall definition means that new architectures
should not reference the call, nor #define the __ARCH_WANT macro.

	Arnd <><

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

* Re: [microblaze-uclinux] Re: microblaze syscall list
  2008-04-24 18:42       ` Michal Simek
  2008-04-24 21:21         ` Arnd Bergmann
@ 2008-04-25  9:36         ` John Williams
  2008-04-25 10:06           ` Matthew Wilcox
  1 sibling, 1 reply; 52+ messages in thread
From: John Williams @ 2008-04-25  9:36 UTC (permalink / raw)
  To: microblaze-uclinux
  Cc: Arnd Bergmann, Will Newton, Linux Kernel list, linux-arch, git

Hi Michal, Arnd,

Michal Simek wrote:


>>> 	.long sys_read
>>> 	.long sys_write
>>> 	.long sys_open			/* 5 */
>> Since we have all the new sys_*at calls like openat, we don't really
>> need the old versions any more. The kernel implementation of sys_open
>> basically calls openat. You could do the same in libc instead.
>> Don't know if that's worth it though, opinions?
> 
> I looked at it and there are the different arguments for open and openat
> syscalls. Implementation is almost the same. I keep it now.

Please remember that MicroBlaze has been around as an arch for > 4 
years, just not in the kernel.org tree.  These older style syscall 
interfaces are all part of the uClibc and glibc ports for MicroBlaze.

While I understand that there are shiny new ways of doing all this 
stuff, please don't break our C libraries, toolchains and all else.  A 
MicroBlaze arch in kernel.org that isn't actually supported by a C 
library or toolchain is not much use either!

Can we compromise and say that the new syscall interfaces will be added 
if they are currently missing, but older interfaces retained until the 
libs and toolchains catch up?

John


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

* Re: [microblaze-uclinux] Re: microblaze syscall list
  2008-04-25  9:36         ` [microblaze-uclinux] " John Williams
@ 2008-04-25 10:06           ` Matthew Wilcox
  2008-04-25 11:32             ` Geert Uytterhoeven
  2008-04-27  2:04             ` John Williams
  0 siblings, 2 replies; 52+ messages in thread
From: Matthew Wilcox @ 2008-04-25 10:06 UTC (permalink / raw)
  To: John Williams
  Cc: microblaze-uclinux, Arnd Bergmann, Will Newton,
	Linux Kernel list, linux-arch, git

On Fri, Apr 25, 2008 at 07:36:35PM +1000, John Williams wrote:
> Please remember that MicroBlaze has been around as an arch for > 4 
> years, just not in the kernel.org tree.  These older style syscall 
> interfaces are all part of the uClibc and glibc ports for MicroBlaze.

So is it fair to say that you now understand this was the Wrong Way To
Do Things, and if anyone asks, you'd recommend getting an arch merged
into kernel.org sooner rather than later?

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

* Re: [microblaze-uclinux] Re: microblaze syscall list
  2008-04-25 10:06           ` Matthew Wilcox
@ 2008-04-25 11:32             ` Geert Uytterhoeven
  2008-04-27  2:04             ` John Williams
  1 sibling, 0 replies; 52+ messages in thread
From: Geert Uytterhoeven @ 2008-04-25 11:32 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: John Williams, microblaze-uclinux, Arnd Bergmann, Will Newton,
	Linux Kernel list, linux-arch, git

On Fri, 25 Apr 2008, Matthew Wilcox wrote:
> On Fri, Apr 25, 2008 at 07:36:35PM +1000, John Williams wrote:
> > Please remember that MicroBlaze has been around as an arch for > 4 
> > years, just not in the kernel.org tree.  These older style syscall 
> > interfaces are all part of the uClibc and glibc ports for MicroBlaze.
> 
> So is it fair to say that you now understand this was the Wrong Way To
> Do Things, and if anyone asks, you'd recommend getting an arch merged
> into kernel.org sooner rather than later?

It's also an indicator we should have an asm-generic/unistd.h ASAP (as
Arnd suggested), to make sure future archs don't make the same mistake
over and over again.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [microblaze-uclinux] Re: microblaze syscall list
  2008-04-25 10:06           ` Matthew Wilcox
  2008-04-25 11:32             ` Geert Uytterhoeven
@ 2008-04-27  2:04             ` John Williams
  2008-04-27 15:52               ` Michal Simek
  1 sibling, 1 reply; 52+ messages in thread
From: John Williams @ 2008-04-27  2:04 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: microblaze-uclinux, Arnd Bergmann, Will Newton,
	Linux Kernel list, linux-arch, git

Matthew Wilcox wrote:
> On Fri, Apr 25, 2008 at 07:36:35PM +1000, John Williams wrote:
>> Please remember that MicroBlaze has been around as an arch for > 4 
>> years, just not in the kernel.org tree.  These older style syscall 
>> interfaces are all part of the uClibc and glibc ports for MicroBlaze.
> 
> So is it fair to say that you now understand this was the Wrong Way To
> Do Things, and if anyone asks, you'd recommend getting an arch merged
> into kernel.org sooner rather than later?
> 

Without question!  If some abject humility will smooth the path for 
MicroBlaze, I'm happy to show it.

By way of history, as a no-MMU arch starting on the 2.4 kernel series, 
there was no home for us in kernel.org originally, however we were 
always in the uClinux "mainline" at uclinux.org from the first release I 
did back in 2002.

We jumped in at 2.6.20 basing from some vendor patches that were never 
going to fly in kernel.org.  Since then we have been improving and 
cleaning them up to where they might actually stand a chance.

I am lobbying Xilinx (the effective "silicon vendor") as hard as I can 
to support both the push to and maintenance within kernel.org.  They had 
someone at ELC in Mountain View week before last, which is a good sign I 
think.

Cheers,

John


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

* Re: microblaze syscall list
  2008-04-27  2:04             ` John Williams
@ 2008-04-27 15:52               ` Michal Simek
  2008-04-27 16:50                 ` Alan Cox
                                   ` (2 more replies)
  0 siblings, 3 replies; 52+ messages in thread
From: Michal Simek @ 2008-04-27 15:52 UTC (permalink / raw)
  To: microblaze-uclinux
  Cc: Matthew Wilcox, Arnd Bergmann, Will Newton, Linux Kernel list,
	linux-arch, git, John Williams, Stephen Neuendorffer, John Linn


Hi John, Arnd, Metthew and others,

>>> Please remember that MicroBlaze has been around as an arch for > 4
>>> years, just not in the kernel.org tree.  These older style syscall
>>> interfaces are all part of the uClibc and glibc ports for MicroBlaze.
>>
>> So is it fair to say that you now understand this was the Wrong Way To
>> Do Things, and if anyone asks, you'd recommend getting an arch merged
>> into kernel.org sooner rather than later?
>>
> 
> Without question!  If some abject humility will smooth the path for
> MicroBlaze, I'm happy to show it.
> 
> By way of history, as a no-MMU arch starting on the 2.4 kernel series,
> there was no home for us in kernel.org originally, however we were
> always in the uClinux "mainline" at uclinux.org from the first release I
> did back in 2002.
> 
> We jumped in at 2.6.20 basing from some vendor patches that were never
> going to fly in kernel.org.  Since then we have been improving and
> cleaning them up to where they might actually stand a chance.
> 
> I am lobbying Xilinx (the effective "silicon vendor") as hard as I can
> to support both the push to and maintenance within kernel.org.  They had
> someone at ELC in Mountain View week before last, which is a good sign I
> think.

I see that current situation needs some comments from my site.

What are facts?
* We have old GCC, old syscall table and all programs use old syscalls.
* I looked at all cpu and their syscalls. There is really big mess in every
architecture. They use almost the same syscalls as is in syscall table for
Microblaze.

Arnd commented current syscall table and send me long email about(Thanks again).
On the base on this email I did converted table for future use - for porting old
application to new version. Below is my table with syscalls and there is a short
description. (or http://www.monstr.eu/wiki/doku.php?id=kernel:syscall)

I counted how big impact will be syscall change to programs which are in John W
distribution
all programs
mknod - 174
rmdir - 488
mkdir - 1128
symlink - 404
rename - 1536
access - 1664
chmod -  1122
open - 22583 (crazy)
ipc - 26

Only busybox
open - 667
chmod 44
access 52
rename 32
symlink 8
mkdir 19
rmdir 9
mknod 16

I thing you understand that we can't change all application per night. This is
not possible. But we have to start with change this.

There is two opinions:
* One is take syscall table with old syscalls for backward compatibility.
As John W wrote. Microblaze has history around 4 years and 2.6 kernel almost 2
years.
 * Second is change everything and start with new gcc and syscall.

I feel second version is better for future and the first is better for now.

We definitely need to start with change but this change must not break what is
done. For this purpose I would like to have a table which told me which syscall
is old or new. On the base on this table we can continuously rewrite all
applications.
I think that rewriting syscalls is not only problem for Microblaze cpu.

Can you look at my table and correct it if I am wrong with some syscalls?

I labeled syscalls like ok - this means ok for Microblaze without MMU. mmu is
marked for MMU port. I hope I covered most syscalls which are in current kernel.

Regards,
Michal Simek

ENTRY(sys_call_table)

/* Microblaze don't use any compat syscalls */

/* fs/aio.c */
ok	.long sys_io_setup
ok	.long sys_io_destroy
ok	.long sys_io_submit
ok	.long sys_io_cancel
ok	.long sys_io_getevents

/* fs/xattr.c */
ok	.long sys_setxattr
ok	.long sys_lsetxattr
ok	.long sys_fsetxattr
ok	.long sys_getxattr
ok	.long sys_lgetxattr
ok	.long sys_fgetxattr
ok	.long sys_listxattr
ok	.long sys_llistxattr
ok	.long sys_flistxattr
ok	.long sys_removexattrs
ok	.long sys_lremovexattr
ok	.long sys_fremovexattr

/* fs/buffer.c */
	.long sys_bdflush /* obsolete */

/* fs/compat.c */
	.long compat_sys_utime
	.long compat_sys_utimensat
	.long compat_sys_futimesat
	.long compat_sys_utimes
	.long compat_sys_newstat
	.long compat_sys_newlstat
	.long compat_sys_newfstatat
	.long compat_sys_newfstat
	.long compat_sys_statfs
	.long compat_sys_fstatfs
	.long compat_sys_statfs64
	.long compat_sys_fstatfs64
	.long compat_sys_fcntl64
	.long compat_sys_fcntl
	.long compat_sys_mount
	.long compat_sys_old_readdir
	.long compat_sys_getdents
	.long compat_sys_getdents64
	.long compat_sys_select
	.long compat_sys_pselect7
	.long compat_sys_pselect6
	.long compat_sys_ppoll
	.long compat_sys_nfsservctl
	.long compat_sys_nfsservctl
	.long compat_sys_epoll_pwait
	.long compat_sys_signalfd
	.long compat_sys_timerfd_settime
	.long compat_sys_timerfd_gettime

/* fs/compat_ioctl.c */
	.long compat_sys_ioctl

/* fs/dcache.c */
ok	.long sys_getcwd

/* fs/cookies.c */
ok	.long sys_lookup_dcookie

/* fs/eventfd.c */
ok	.long sys_eventfd

/* fs/eventpoll.c */
ok	.long sys_epoll_create
ok	.long sys_epoll_ctl
	.long sys_epoll_wait /* obsolete -> sys_epoll_pwait */
ok	.long sys_epoll_pwait

/* fs/exec.c */
ok	.long sys_uselib /* #ifdef __ARCH_WANT_SYS_USELIB */

/* fs/fcntl.c */
ok	.long sys_dup
ok	.long sys_dup2
	.long sys_fcntl /* obsolete -> fcntl64 */
ok	.long sys_fcntl64

/* fs/filesystems.c */
	.long sys_sysfs /* obsolete */


/* fs/inotify_user.c */
ok	.long sys_inotify_init
ok	.long sys_inotify_add_watch
ok	.long sys_inotify_rm_watch

/* fs/ioctl.c */
ok	.long sys_ioctl

/* fs/ioprio.c */
ok	.long sys_ioprio_set
ok	.long sys_ioprio_get

/* fs/locks.c */
ok	.long sys_flock

/* fs/namei.c */
ok	.long sys_mknodat
	.long sys_mknod /* obsolete -> mknodat */
ok	.long sys_mkdirat
	.long sys_mkdir /* obsolete -> mkdirat */
	.long sys_rmdir /* obsolete -> unlinkat */
ok	.long sys_unlinkat
ok	.long sys_unlink
ok	.long sys_symlinkat
	.long sys_symlink /* obsolete -> sys_symlinkat */
ok	.long sys_linkat
ok	.long sys_link
ok	.long sys_renameat
	.long sys_rename /* obsolete -> renameat */

/* fs/namespace.c */
ok	.long sys_umount
	.long sys_oldumount /*_ARCH_WANT_SYS_OLDUMOUNT obsolate -> sys_umount */
ok	.long sys_mount
ok	.long sys_pivot_root


/* fs/nfsctl.c */
ok	.long sys_nfsservctl

/* fs/open.c */
	.long sys_statfs /* obsolete -> statfs64 */
ok	.long sys_statfs64
	.long sys_fstatfs /* obsolete -> fstatfs64 */
ok	.long sys_fstatfs64
	.long sys_truncate /* obsolete -> truncate64 */
	.long sys_ftruncate /* obsolete -> ftruncate64 */
ok	.long sys_truncate64 /* __ARCH_WANT_SYS_TRUNCATE */
ok	.long sys_ftruncate64 /* __ARCH_WANT_SYS_TRUNCATE */
ok	.long sys_fallocate
ok	.long sys_faccessat
	.long sys_access /* obsolete -> faccessat */
ok	.long sys_chdir
ok	.long sys_fchdir
ok	.long sys_chroot
ok	.long sys_fchmod
ok	.long sys_fchmodat
	.long sys_chmod /* obsolete -> fchmodat */
ok	.long sys_chown
ok	.long sys_fchownat
ok	.long sys_lchown
ok	.long sys_fchown
	.long sys_open /* obsolete -> openat */
ok	.long sys_openat
ok	.long sys_creat
ok	.long sys_close
ok	.long sys_vhangup

/* fs/quota.c */
ok	.long sys_quotactl

/* fs/readdir.c */
	.long sys_getdents /* obsolete -> sys_getdents64 */
ok	.long sys_getdents64

/* fs/read_write.c */
	.long sys_lseek /* only lseek or llseek */
ok	.long sys_llseek /* _ARCH_WANT_SYS_LLSEEK */
ok	.long sys_read
ok	.long sys_readv
ok	.long sys_write
ok	.long sys_writev
ok	.long sys_pread64
ok	.long sys_pwrite64
	.long sys_sendfile /* obsolete -> sys_sendfile64 */
ok	.long sys_sendfile64


/* fs/select.c */
	.long sys_select /* obsolete -> sys_pselect6 */
ok	.long sys_pselect7
	.long sys_pselect6 /* obsolete -> sys_pselect7 */
	.long sys_poll /* obsolete -> sys_ppoll */
ok	.long sys_ppoll

/* fs/signalfd.c */
ok	.long sys_signalfd



/* fs/splice.c */
ok	.long sys_vmsplice
ok	.long sys_splice
ok	.long sys_tee

/* fs/stat.c */
	.long sys_stat /*_ARCH_WANT_OLD_STAT */
	.long sys_lstat /* _ARCH_WANT_OLD_STAT */
	.long sys_fstat /* _ARCH_WANT_OLD_STAT */
ok	.long sys_newstat
ok	.long sys_newlstat
	.long sys_newfstatat /* _ARCH_WANT_SYS_NEWFSTATAT */
ok	.long sys_newfstat
ok	.long sys_readlinkat
	.long sys_readlink /* obsolete -> sys_readlinkat */
ok	.long sys_stat64 /* _ARCH_WANT_STAT64 */
ok	.long sys_lstat64 /* _ARCH_WANT_STAT64 */
ok	.long sys_fstat64 /* _ARCH_WANT_STAT64 */
ok	.long sys_fstatat64 /* _ARCH_WANT_STAT64 */

/* fs/super.c */
	.long sys_ustat /* obsolete -> statfs64 */

/* fs/sync.c */
ok	.long sys_sync
ok	.long sys_fsync
ok	.long sys_fdatasync
ok	.long sys_sync_file_range
	/* .long sys_sync_file_range2 */


/* fs/timerfd.c */
ok	.long sys_timerfd_create
ok	.long sys_timerfd_settime
ok	.long sys_timerfd_gettime

/* fs/utimes.c */
ok	.long sys_utime	/* _ARCH_WANT_SYS_TIME */
ok	.long sys_utimensat
ok	.long sys_futimesat
	.long sys_utimes /* obsolete -> sys_futimesat */

/* kernel/acct.c */
opt	.long sys_acct

/* kernel/capability.c */
ok	.long sys_capget
ok	.long sys_capset

/* kernel/compat.c */
	.long compat_sys_nanosleep
	.long compat_sys_getitimer
	.long compat_sys_setitimer
	.long compat_sys_times
	.long compat_sys_sigpending
	.long compat_sys_sigprocmask
	.long compat_sys_setrlimit
	.long compat_sys_old_getrlimit
	.long compat_sys_getrlimit
	.long compat_sys_getrusage
	.long compat_sys_waitid
	.long compat_sys_sched_setaffinity
	.long compat_sys_sched_getaffinity
	.long compat_sys_time	/* _ARCH_WANT_COMPAT_SYS_TIME */
	.long compat_sys_stime	/* _ARCH_WANT_COMPAT_SYS_TIME */
ok	.long compat_sys_rt_sigsuspend /* _ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND */
	.long compat_sys_adjtimex
	.long compat_sys_move_pages
	.long compat_sys_migrate_pages

/* kernel/exec_domain.c */
ok	.long sys_personality

/* kernel/exit.c */
ok	.long sys_exit
ok	.long sys_exit_group
ok	.long sys_waitid
	.long sys_wait4	/* obsolete -> waitid */
	.long sys_waitpid /*_ARCH_WANT_SYS_WAITPID */ /* obsolete -> waitid */

/* kernel/fork.c */
ok	.long sys_set_tid_address
ok	.long sys_unshare

/* kernel/futex.c */
ok	.long sys_futex
ok	.long sys_set_robust_list
ok	.long sys_get_robust_list

/* kernel/futex_compat.c */
	.long compat_sys_futex
	.long compat_sys_set_robust_list
	.long compat_sys_get_robust_list

/* kernel/hrtimer.c */
ok	.long sys_nanosleep

/* kernel/itimer.c */
ok	.long sys_getitimer
ok	.long sys_setitimer


/* kernel/kexec.c */
ok	.long sys_kexec_load
	.long compat_sys_kexec_load

/* kernel/module.c */
ok	.long sys_init_module
ok	.long sys_delete_module


/* kernel/posix-timers.c */
ok	.long sys_timer_create
ok	.long sys_timer_gettime
ok	.long sys_timer_getoverrun
ok	.long sys_timer_settime
ok	.long sys_timer_delete
ok	.long sys_clock_settime
ok	.long sys_clock_gettime
ok	.long sys_clock_getres
ok	.long sys_clock_nanosleep

/* kernel/printk.c */
ok	.long sys_syslog

/* kernel/ptrace.c */
ok	.long sys_ptrace
	.long compat_sys_ptrace /* _ARCH_WANT_COMPAT_SYS_PTRACE */

/* kernel/sched.c */
ok	.long sys_nice /* __ARCH_WANT_SYS_NICE */
ok	.long sys_sched_setparam
ok	.long sys_sched_setscheduler
ok	.long sys_sched_getscheduler
ok	.long sys_sched_getparam
ok	.long sys_sched_setaffinity
ok	.long sys_sched_getaffinity
ok	.long sys_sched_yield
ok	.long sys_sched_get_priority_max
ok	.long sys_sched_get_priority_min
ok	.long sys_sched_rr_get_interval

/* kernel/signal.c */
ok	.long sys_restart_syscall
ok	.long sys_kill
ok	.long sys_tkill
ok	.long sys_tgkill
ok	.long sys_rt_sigsuspend /* _ARCH_WANT_SYS_RT_SIGSUSPEND */
ok	.long sys_rt_sigaction /* _ARCH_WANT_SYS_RT_SIGACTION */
ok	.long sys_rt_sigprocmask /* _ARCH_WANT_SYS_SIGPROCMASK */
ok	.long sys_rt_sigpending	/* _ARCH_WANT_SYS_SIGPENDING */
ok	.long sys_rt_sigtimedwait
ok	.long sys_rt_sigqueueinfo
	.long sys_sigprocmask /* obsolete -> sys_rt_sigprocmask */
	.long sys_sigpending /* obsolete -> sys_rt_sigpending */
ok	.long sys_signal	/* __ARCH_WANT_SYS_SIGNAL */
ok	.long sys_pause		/* __ARCH_WANT_SYS_PAUSE */
ok	.long sys_sgetmask /* __ARCH_WANT_SYS_SGETMASK */
ok	.long sys_ssetmask /* __ARCH_WANT_SYS_SGETMASK */


/* kernel/sys.c */
ok	.long sys_setpriority
ok	.long sys_getpriority
ok	.long sys_reboot
ok	.long sys_setregid
ok	.long sys_setgid
ok	.long sys_setreuid
ok	.long sys_setuid
ok	.long sys_setresuid
ok	.long sys_getresuid
ok	.long sys_setresgid
ok	.long sys_getresgid
ok	.long sys_setfsuid
ok	.long sys_setfsgid
ok	.long sys_times
ok	.long sys_setpgid
ok	.long sys_getpgid
ok	.long sys_getpgrp /* __ARCH_WANT_SYS_GETPGRP */
ok	.long sys_getsid
ok	.long sys_setsid
ok	.long sys_getgroups
ok	.long sys_setgroups
ok	.long sys_newuname
ok	.long sys_sethostname
	.long sys_gethostname /* _ARCH_WANT_SYS_GETHOSTNAME */
ok	.long sys_setdomainname
ok	.long sys_getrlimit
	.long sys_old_getrlimit /* _ARCH_WANT_SYS_OLD_GETRLIMIT */
ok	.long sys_setrlimit
ok	.long sys_getrusage
ok	.long sys_umask
ok	.long sys_prctl
ok	.long sys_getcpu



/* kernel/sysctl.c */
	.long sys_sysctl /* deprecated */

/* kernel/sys_ni.c */
	.long sys_ni_syscall /* :-) */


/* kernel/time.c */
ok	.long sys_time /* __ARCH_WANT_SYS_TIME */
ok	.long sys_stime /* __ARCH_WANT_SYS_TIME */
ok	.long sys_gettimeofday
ok	.long sys_settimeofday
ok	.long sys_adjtimex

	.
/* kernel/timer.c */
ok	.long sys_alarm /* __ARCH_WANT_SYS_ALARM */
ok	.long sys_getpid
ok	.long sys_getppid
ok	.long sys_getuid
ok	.long sys_geteuid
ok	.long sys_getgid
ok	.long sys_getegid
ok	.long sys_gettid
ok	.long sys_sysinfo


/* kernel/uid16.c */ /* all replace by full version CONFIG_UID16 */
	.long sys_chown16
	.long sys_lchown16
	.long sys_fchown16
	.long sys_setregid16
	.long sys_setgid16
	.long sys_setreuid16
	.long sys_setuid16
	.long sys_setresuid16
	.long sys_getresuid16
	.long sys_setresgid16
	.long sys_getresgid16
	.long sys_setfsuid16
	.long sys_setfsgid16
	.long sys_getgroups16
	.long sys_setgroups16
	.long sys_getuid16
	.long sys_geteuid16
	.long sys_getgid16
	.long sys_getegid16

/* ipc/compat_mq.c */
	.long compat_sys_mq_open
	.long compat_sys_mq_timedsend
	.long compat_sys_mq_timedreceive
	.long compat_sys_mq_notify
	.long compat_sys_mq_getsetattr

/* ipc/mqueue.c */
ok	.long sys_mq_open
ok	.long sys_mq_unlink
ok	.long sys_mq_timedsend
ok	.long sys_mq_timedreceive
ok	.long sys_mq_notify
ok	.long sys_mq_getsetattr

/* ipc/msg.c */
ok	.long sys_msgget
ok	.long sys_msgctl
ok	.long sys_msgrcv
ok	.long sys_msgsnd

/* ipc/sem.c */
ok	.long sys_semget
ok	.long sys_semctl
ok	.long sys_semtimedop
ok	.long sys_semop

/* ipc/shm.c */
ok	.long sys_shmget
ok	.long sys_shmctl
ok	.long sys_shmat
ok	.long sys_shmdt


/* net/compat.c */
	.long compat_sys_setsockopt
	.long compat_sys_getsockopt
	.long compat_sys_sendmsg
	.long compat_sys_recvmsg
	.long compat_sys_socketcall

/* net/socket.c */
	.long sys_socket
	.long sys_socketpair
	.long sys_bind
	.long sys_listen
	.long sys_accept
	.long sys_connect
	.long sys_getsockname
	.long sys_getpeername
	.long sys_sendto
	.long sys_send
	.long sys_recvfrom
	.long sys_recv
	.long sys_setsockopt
	.long sys_getsockopt
	.long sys_shutdown
	.long sys_sendmsg
	.long sys_recvmsg
	.long sys_socketcall /* _ARCH_WANT_SYS_SOCKETCALL - deprecated */

/* mm/fadvise.c */
ok	.long sys_fadvise64_64
	.long sys_fadvise64 /*_ARCH_WANT_SYS_FADVISE64 obsolete -> sys_fadvise64_64 */

/* mm/filemap.c */
ok	.long sys_readahead


/* mm/fremap.c */
	.long sys_remap_file_pages

/* mm/madvise.c */
	.long sys_madvise

/* mm/mempolicy.c */
mmu	.long sys_mbind
mmu	.long sys_set_mempolicy
mmu	.long sys_migrate_pages
mmu	.long sys_get_mempolicy
	.long compat_sys_get_mempolicy
	.long compat_sys_set_mempolicy
	.long compat_sys_mbind

/* mm/migrate.c */
mmu	.long sys_move_pages

/* mm/mincore.c */
	.long sys_mincore

/* mm/mlock.c */
mmu	.long sys_mlock
mmu	.long sys_munlock
mmu	.long sys_mlockall
mmu	.long sys_munlockall

/* mm/mmap.c */
mmu	.long sys_brk
mmu	.long sys_munmap

/* mm/mremap.c */
	.long sys_mremap

/* mm/msync.c */
	.long sys_msync

/* mm/nommu.c */
ok	.long sys_brk
ok	.long sys_munmap
	.long sys_mremap


/* mm/swapfile.c */
ok	.long sys_swapoff
ok	.long sys_swapon


/* security/keys/compat.c */
	.long compat_sys_keyctl

/* security/keys/keyctl.c */
ok	.long sys_add_key
ok	.long sys_request_key
ok	.long sys_keyctl

/* arch - microblaze specific */
/* arch/microblaze/kernel/signal.c */
	.long sys_sigreturn /* obsolete -> sys_rt_sigreturn */
ok	.long sys_rt_sigreturn_wrapper /*.long sys_rt_sigreturn*/
	.long sys_sigaction /* obsolete -> rt_sigaction */
	.long sys_sigsuspend /* obsolete -> rt_sigsuspend */

/*arch/microblaze/kernel/sys_microblaze.c*/
	.long sys_vfork		/* I don't need it if I have clone vfork_wrapper */
ok	.long sys_clone		/* .long sys_clone_wrapper */
ok	.long sys_execve	/* .long sys_execve_wrapper */
ok	.long sys_pipe
ok	.long sys_mmap2
	.long sys_mmap	/* obsolete -> sys_mmap2 */
	.long sys_ipc /* obsolete -> replace by subcall */




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

* Re: microblaze syscall list
  2008-04-27 15:52               ` Michal Simek
@ 2008-04-27 16:50                 ` Alan Cox
  2008-04-27 20:15                 ` Arnd Bergmann
  2008-05-03 21:57                 ` Arnd Bergmann
  2 siblings, 0 replies; 52+ messages in thread
From: Alan Cox @ 2008-04-27 16:50 UTC (permalink / raw)
  To: monstr
  Cc: microblaze-uclinux, Matthew Wilcox, Arnd Bergmann, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

> There is two opinions:
> * One is take syscall table with old syscalls for backward compatibility.
> As John W wrote. Microblaze has history around 4 years and 2.6 kernel almost 2
> years.

I would keep the old syscall table. Otherwise you end up with two
differing microblaze setups and people will get binaries, libraries and
compilers muddled up for years to come which will be nothing but pain for
eveyone.

Alan

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

* Re: microblaze syscall list
  2008-04-27 15:52               ` Michal Simek
  2008-04-27 16:50                 ` Alan Cox
@ 2008-04-27 20:15                 ` Arnd Bergmann
  2008-04-28  0:15                   ` John Williams
  2008-05-03 21:57                 ` Arnd Bergmann
  2 siblings, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-27 20:15 UTC (permalink / raw)
  To: monstr
  Cc: microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

On Sunday 27 April 2008, Michal Simek wrote:
> Arnd commented current syscall table and send me long email about(Thanks again).
> On the base on this email I did converted table for future use - for porting old
> application to new version. Below is my table with syscalls and there is a short
> description. (or http://www.monstr.eu/wiki/doku.php?id=kernel:syscall)
> 
> I counted how big impact will be syscall change to programs which are in John W
> distribution
> all programs
> mknod - 174
> rmdir - 488
> mkdir - 1128
> symlink - 404
> rename - 1536
> access - 1664
> chmod -  1122
> open - 22583 (crazy)
> ipc - 26
> 
> Only busybox
> open - 667
> chmod 44
> access 52
> rename 32
> symlink 8
> mkdir 19
> rmdir 9
> mknod 16
> 
> I thing you understand that we can't change all application per night. This is
> not possible. But we have to start with change this.

Note that the only thing you should need to change is the libc implementation
(any version of it: glibc, uclibc, klibc, ...), but not any application source
code, as the applications just call the functions that are defined in the libc.
If you have binaries that are statically linked with their libc, you'd have
to recompile or at least relink them. If you redefine data structures or
types that are used in application code, like struct stat or off_t, you
also need to recompile all user code.

Of course, as Alan and others have mentioned, even without changing any
application source code, the amount of work for that is significantly more 
than just changing the kernel.

I think you have three options here:

1. Keep the old syscall interface and just add new syscalls for the stuff
that you are currently missing. Don't change userspace at all, but live
with somewhat bloated kernels and libc forever and maintain a larger
code base in the kernel.

2. Change the syscall interface in the kernel in the way we have discussed,
and adapt the libc code along with it. Break all backwards compatibility
and start out with a new leaner ABI. Old applications can still use
your old out-of-tree kernels, or forks of that.

3. Merge only the ABI as in 2. into the mainline kernel, but use new
syscall numbers for that. Maintain an out-of-tree patch that adds the
old ABI for backwards compatibility so you can run old and new code
on one kernel if you build with that patch, but eventually phase
out the old ABI.

I won't try to force you to go either route, it's your own decision,
but you should understand the tradeoffs. I don't think there is any
value in trying to deprecate just part of the ABI and break some
binaries but not others, this will only cause hard to find bugs. Make
sure that if you decide to break backwards compatibility, you break it
in an obvious way and get the most benefit out of it.

	Arnd <><

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

* Re: microblaze syscall list
  2008-04-27 20:15                 ` Arnd Bergmann
@ 2008-04-28  0:15                   ` John Williams
  2008-04-28 12:31                     ` Arnd Bergmann
  0 siblings, 1 reply; 52+ messages in thread
From: John Williams @ 2008-04-28  0:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: monstr, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn


Arnd Bergmann wrote:
> On Sunday 27 April 2008, Michal Simek wrote:

>> I thing you understand that we can't change all application per night. This is
>> not possible. But we have to start with change this.
> 
> Note that the only thing you should need to change is the libc implementation
> (any version of it: glibc, uclibc, klibc, ...), but not any application source
> code, as the applications just call the functions that are defined in the libc.
> If you have binaries that are statically linked with their libc, you'd have
> to recompile or at least relink them. If you redefine data structures or
> types that are used in application code, like struct stat or off_t, you
> also need to recompile all user code.

Until very recently with the MMU support added to the CPU (and upcoming 
MMU support patches for MicroBlaze), all apps were statically linked 
anyway. So, this is not too much of an issue I don't think.

Because the CPU is so configurable re: instruction set and features, it 
is common to rebuild your entire userland and libs + kernel in one go. 
If you add support for HW integer mul or div, barrel shift etc, you need 
to rebuild not just the kernel but apps and libs as well.  Or rather, 
rebuild apps, and relink against a different multilib'd libc.

So, the issue seems not so much that there's a bunch of legacy binaries 
out there that will break, but rather that there will be a dead-zone 
period in which the kernel is exporting an ABI that is simply not 
available in the C libs and existing toolchains.  We should be doing all 
we can to encourage individual developers and distro maintainers (like 
PetaLogix) to base from the kernel.org tree.

> I think you have three options here:
> 
> 1. Keep the old syscall interface and just add new syscalls for the stuff
> that you are currently missing. Don't change userspace at all, but live
> with somewhat bloated kernels and libc forever and maintain a larger
> code base in the kernel.
> 
> 2. Change the syscall interface in the kernel in the way we have discussed,
> and adapt the libc code along with it. Break all backwards compatibility
> and start out with a new leaner ABI. Old applications can still use
> your old out-of-tree kernels, or forks of that.
> 
> 3. Merge only the ABI as in 2. into the mainline kernel, but use new
> syscall numbers for that. Maintain an out-of-tree patch that adds the
> old ABI for backwards compatibility so you can run old and new code
> on one kernel if you build with that patch, but eventually phase
> out the old ABI.

Maybe I misunderstand, but is there an option 1(a) where we keep the 
old, add the new, and suffer the bloat for a short period until the 
toolchains and C libs catch up and we remove out the old interfaces?

Are the old and new syscalls necessarily overloaded onto the same 
numbers?  We'd obviously like to be as "standard" as reasonably possible 
regarding syscall numbers

> I won't try to force you to go either route, it's your own decision,
> but you should understand the tradeoffs. I don't think there is any
> value in trying to deprecate just part of the ABI and break some
> binaries but not others, this will only cause hard to find bugs. Make
> sure that if you decide to break backwards compatibility, you break it
> in an obvious way and get the most benefit out of it.

No argument there.

John



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

* Re: microblaze syscall list
  2008-04-28  0:15                   ` John Williams
@ 2008-04-28 12:31                     ` Arnd Bergmann
  2008-05-01 19:17                       ` Arnd Bergmann
  0 siblings, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-04-28 12:31 UTC (permalink / raw)
  To: John Williams
  Cc: monstr, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

On Monday 28 April 2008, John Williams wrote:
> 
> Until very recently with the MMU support added to the CPU (and upcoming 
> MMU support patches for MicroBlaze), all apps were statically linked 
> anyway. So, this is not too much of an issue I don't think.
> 
> Because the CPU is so configurable re: instruction set and features, it 
> is common to rebuild your entire userland and libs + kernel in one go. 
> If you add support for HW integer mul or div, barrel shift etc, you need 
> to rebuild not just the kernel but apps and libs as well.  Or rather, 
> rebuild apps, and relink against a different multilib'd libc.

If this is the common case, that is a good argument for breaking the ABI
completely now. You will just require a new libc build with a new kernel.

> So, the issue seems not so much that there's a bunch of legacy binaries 
> out there that will break, but rather that there will be a dead-zone 
> period in which the kernel is exporting an ABI that is simply not 
> available in the C libs and existing toolchains.  We should be doing all 
> we can to encourage individual developers and distro maintainers (like 
> PetaLogix) to base from the kernel.org tree.

As far as I can tell, these distrbutions typically come with both
kernel and libc source code together. It would be logical to just
require updating both here as well.

> Maybe I misunderstand, but is there an option 1(a) where we keep the 
> old, add the new, and suffer the bloat for a short period until the 
> toolchains and C libs catch up and we remove out the old interfaces?
>
> Are the old and new syscalls necessarily overloaded onto the same 
> numbers?  We'd obviously like to be as "standard" as reasonably possible 
> regarding syscall numbers

It's more than just the syscall numbers that should ideally change.
The other changes I would recommend include moving to large file
types (64 bit off_t), 32 bit UIDs, cleaned up sysV-IPC types, and a
few others. All these break the user code in the same way that changing
the instruction set does, which is the reason that we can't change
any of the existing architectures that started out in the old days.

The syscall numbers are entirely arbitrary, that's why I suggested
in my approach 3. that you introduce a new set of syscall numbers for
the new ABI, and keep compatibility with the old calls in their existing
numbers as an out-of-tree patch.

If you assume that the user recompiles the libc and the kernel together,
you can obviously change syscall numbers and data types in any way you
please, but still I'd suggest you don't change them after the kernel
gets merged upstream.

How about this strategy then:
* Change all the data types and syscall numbers in the -for-2.6.27
branch to only include the minimal set, and a modern ABI
* Add the old interfaces as an out-of-tree patch that adds source
level compatibility with the old libc, but does not modify any
of the new interfaces, so that a patched kernel can run all binaries
built for the upstream version.
* phase out the old source interface gradually, as all users update
their libc source code.

This way, early adopters suffer the pain of incompatibility twice, but
get the clean kernel port quickly.

	Arnd <><

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

* Re: microblaze syscall list
  2008-04-28 12:31                     ` Arnd Bergmann
@ 2008-05-01 19:17                       ` Arnd Bergmann
  2008-05-02  5:38                         ` John Williams
  0 siblings, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-01 19:17 UTC (permalink / raw)
  To: John Williams
  Cc: monstr, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

On Monday 28 April 2008, Arnd Bergmann wrote:
> How about this strategy then:
> * Change all the data types and syscall numbers in the -for-2.6.27
> branch to only include the minimal set, and a modern ABI
> * Add the old interfaces as an out-of-tree patch that adds source
> level compatibility with the old libc, but does not modify any
> of the new interfaces, so that a patched kernel can run all binaries
> built for the upstream version.
> * phase out the old source interface gradually, as all users update
> their libc source code.

Any news on this from the microblaze people? Have you made up your mind
on what route you want to go?

	Arnd <><

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

* Re: microblaze syscall list
  2008-05-01 19:17                       ` Arnd Bergmann
@ 2008-05-02  5:38                         ` John Williams
  2008-05-02  8:18                           ` Michal Simek
  0 siblings, 1 reply; 52+ messages in thread
From: John Williams @ 2008-05-02  5:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: John Williams, monstr, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, Stephen Neuendorffer,
	John Linn

Arnd Bergmann wrote:
> On Monday 28 April 2008, Arnd Bergmann wrote:
> 
>>How about this strategy then:
>>* Change all the data types and syscall numbers in the -for-2.6.27
>>branch to only include the minimal set, and a modern ABI
>>* Add the old interfaces as an out-of-tree patch that adds source
>>level compatibility with the old libc, but does not modify any
>>of the new interfaces, so that a patched kernel can run all binaries
>>built for the upstream version.
>>* phase out the old source interface gradually, as all users update
>>their libc source code.
> 
> 
> Any news on this from the microblaze people? Have you made up your mind
> on what route you want to go?

I think we're still digesting it.  I need to sync up with Michal and the 
Xilinx people.  The libc and kernel API changes have to happen in 
tandem, otherwise Michal can't properly test the kernel he's pushing.

I am the defacto MicroBlaze uClibc and toolchain "builder" but somewhat 
reluctantly - am trying to convince Xilnx to hand that over to someone 
who is expert at it.

Michal, John L, any thoughts?

John



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

* Re: microblaze syscall list
  2008-05-02  5:38                         ` John Williams
@ 2008-05-02  8:18                           ` Michal Simek
  2008-05-03  3:49                             ` John Williams
  0 siblings, 1 reply; 52+ messages in thread
From: Michal Simek @ 2008-05-02  8:18 UTC (permalink / raw)
  To: John Williams
  Cc: Arnd Bergmann, Matthew Wilcox, Will Newton, Linux Kernel list,
	linux-arch, git, Stephen Neuendorffer, John Linn

Hi All,

>>> How about this strategy then:
>>> * Change all the data types and syscall numbers in the -for-2.6.27
>>> branch to only include the minimal set, and a modern ABI
>>> * Add the old interfaces as an out-of-tree patch that adds source
>>> level compatibility with the old libc, but does not modify any
>>> of the new interfaces, so that a patched kernel can run all binaries
>>> built for the upstream version.
>>> * phase out the old source interface gradually, as all users update
>>> their libc source code.
>>
>>
>> Any news on this from the microblaze people? Have you made up your mind
>> on what route you want to go?
> 
> I think we're still digesting it.  I need to sync up with Michal and the
> Xilinx people.  The libc and kernel API changes have to happen in
> tandem, otherwise Michal can't properly test the kernel he's pushing.
> 
> I am the defacto MicroBlaze uClibc and toolchain "builder" but somewhat
> reluctantly - am trying to convince Xilnx to hand that over to someone
> who is expert at it.
> 
> Michal, John L, any thoughts?
> 
> John

I am convinced we need to change syscall table. I don't want to maintain old
syscalls. It will be easier to test smaller amount of syscalls. I would like to
talk about with you (John W) via Skype. (Can you send me private email where you
have time?) I talked with Steve about this week. After that I will publish our
proposed way.

Michal





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

* Re: microblaze syscall list
  2008-05-02  8:18                           ` Michal Simek
@ 2008-05-03  3:49                             ` John Williams
  2008-05-03  9:16                               ` Arnd Bergmann
  0 siblings, 1 reply; 52+ messages in thread
From: John Williams @ 2008-05-03  3:49 UTC (permalink / raw)
  To: monstr
  Cc: Arnd Bergmann, Matthew Wilcox, Will Newton, Linux Kernel list,
	linux-arch, git, Stephen Neuendorffer, John Linn

Michal, Arnd et al,

Michal Simek wrote:

>>>> How about this strategy then:
>>>> * Change all the data types and syscall numbers in the -for-2.6.27
>>>> branch to only include the minimal set, and a modern ABI
>>>> * Add the old interfaces as an out-of-tree patch that adds source
>>>> level compatibility with the old libc, but does not modify any
>>>> of the new interfaces, so that a patched kernel can run all binaries
>>>> built for the upstream version.
>>>> * phase out the old source interface gradually, as all users update
>>>> their libc source code.
>>>
>>> Any news on this from the microblaze people? Have you made up your mind
>>> on what route you want to go?
>> I think we're still digesting it.  I need to sync up with Michal and the
>> Xilinx people.  The libc and kernel API changes have to happen in
>> tandem, otherwise Michal can't properly test the kernel he's pushing.
>>
>> I am the defacto MicroBlaze uClibc and toolchain "builder" but somewhat
>> reluctantly - am trying to convince Xilnx to hand that over to someone
>> who is expert at it.
>>
>> Michal, John L, any thoughts?
>>
>> John
> 
> I am convinced we need to change syscall table. I don't want to maintain old
> syscalls. It will be easier to test smaller amount of syscalls. I would like to
> talk about with you (John W) via Skype. (Can you send me private email where you
> have time?) I talked with Steve about this week. After that I will publish our
> proposed way.

As a first pass at assessing the C library impact on a completely 
renovated syscall list, I took Michal's proposed new unistd.h and used 
it to grep over both the uClibc implementation that (almost) every 
existing microblaze user uses (!MMU), plus the glibc (cough cough) 
implementation that is our default with the emerging MMU support.

To test the implementation / reference of a syscall number, I grepped 
the entire source trees for

   __NR_xxx

or

   _system[0-9](.*xxxx    (stripped leading __NR_X)

to try and find any mention at all of a particular syscall in that C 
library implementation.

The results are interesting, and verbose.  In fact, the lists are so 
long I'm almost certain I've missed some other obscure way that uClibc 
or glibc can access a __NR_ macro.  Please let me know if this is the case.

Certainly there are many implemented in neither, such as as splice and 
friends.

Also interesting is e.g. openat() - it is implemented/referenced by 
neither!  So, surely it would be premature to phase out open() in favour 
of openat() when the latter is not in any viable MicroBlaze C library yet.

I guess we need some help to find the other critical ones.

What's also curious is that uClibc not-implemented list is shorter than 
glibc's.  Does this just mean glibc uses fewer of the legacy APIs?  I 
really don't know, but I'm sure someone else does.

If there's a cleaner analysis I can do, please let me know and I'll repeat.

Here goes - uClibc first, then glibc

** Not implemented/referenced in uClibc 0.9.27 12 January 2005
__NR_add_key
__NR_clock_getres
__NR_clock_gettime
__NR_clock_nanosleep
__NR_clock_settime
__NR_creat
__NR_epoll_pwait
__NR_eventfd
__NR__exit
__NR_exit_group
__NR_faccessat
__NR_fadvise64_64
__NR_fallocate
__NR_fchmodat
__NR_fchownat
__NR_fstatat64
__NR_fstatfs64
__NR_futex
__NR_futimesat
__NR_getcpu
__NR_get_robust_list
__NR_gettid
__NR_inotify_add_watch
__NR_inotify_init
__NR_inotify_rm_watch
__NR_io_cancel
__NR_io_destroy
__NR_io_getevents
__NR_ioprio_get
__NR_ioprio_set
__NR_io_setup
__NR_io_submit
__NR_kexec_load
__NR_keyctl
__NR_linkat
__NR_lookup_dcookie
__NR_mkdirat
__NR_mknodat
__NR_newfstat
__NR_newlstat
__NR_newstat
__NR_newuname
__NR_nfsservctl
__NR_openat
__NR_ppoll
__NR_pselect7
__NR_readahead
__NR_readlinkat
__NR_removexattrs
__NR_renameat
__NR_request_key
__NR_restart_syscall
__NR_rt_sigqueueinfo
__NR_sched_getaffinity
__NR_sched_setaffinity
__NR_semtimedop
__NR_set_robust_list
__NR_set_tid_address
__NR_sgetmask
__NR_signal
__NR_signalfd
__NR_splice
__NR_ssetmask
__NR_statfs64
__NR_symlinkat
__NR_sync_file_range
__NR_syscalls
__NR_tee
__NR_tgkill
__NR_timerfd_create
__NR_timerfd_gettime
__NR_timerfd_settime
__NR_tkill
__NR_unlinkat
__NR_unshare
__NR_utimensat
__NR_vmsplice
__NR_waitid



** Not implemented/referenced in glibc
__NR_add_key
__NR_adjtimex
__NR_alarm
__NR_capget
__NR_capset
__NR_chdir
__NR_chown
__NR_chroot
__NR_close
__NR_creat
__NR_delete_module
__NR_dup
__NR_dup2
__NR_epoll_create
__NR_epoll_ctl
__NR_epoll_pwait
__NR_eventfd
__NR_execve
__NR_faccessat
__NR_fallocate
__NR_fchdir
__NR_fchmod
__NR_fchmodat
__NR_fchown
__NR_fchownat
__NR_fdatasync
__NR_fgetxattr
__NR_flistxattr
__NR_flock
__NR_fremovexattr
__NR_fsetxattr
__NR_fstatat64
__NR_fsync
__NR_futimesat
__NR_getcpu
__NR_getegid
__NR_geteuid
__NR_getgroups
__NR_getitimer
__NR_getpgid
__NR_getpgrp
__NR_getppid
__NR_getpriority
__NR_getrlimit
__NR_get_robust_list
__NR_getrusage
__NR_getsid
__NR_gettid
__NR_getxattr
__NR_init_module
__NR_inotify_add_watch
__NR_inotify_init
__NR_inotify_rm_watch
__NR_io_cancel
__NR_io_destroy
__NR_io_getevents
__NR_ioprio_get
__NR_ioprio_set
__NR_io_setup
__NR_io_submit
__NR_kexec_load
__NR_keyctl
__NR_kill
__NR_lgetxattr
__NR_link
__NR_linkat
__NR_listxattr
__NR_llistxattr
__NR_lookup_dcookie
__NR_lremovexattr
__NR_lseek
__NR_lsetxattr
__NR_mkdirat
__NR_mknodat
__NR_mount
__NR_msgctl
__NR_msgget
__NR_msgrcv
__NR_msgsnd
__NR_munmap
__NR_nanosleep
__NR_newfstat
__NR_newlstat
__NR_newstat
__NR_newuname
__NR_nfsservctl
__NR_nice
__NR_openat
__NR_pause
__NR_personality
__NR_pivot_root
__NR_ppoll
__NR_prctl
__NR_pselect7
__NR_ptrace
__NR_quotactl
__NR_read
__NR_readlinkat
__NR_readv
__NR_reboot
__NR_removexattrs
__NR_renameat
__NR_request_key
__NR_restart_syscall
__NR_sched_getparam
__NR_sched_get_priority_max
__NR_sched_get_priority_min
__NR_sched_getscheduler
__NR_sched_rr_get_interval
__NR_sched_setparam
__NR_sched_setscheduler
__NR_sched_yield
__NR_semctl
__NR_semget
__NR_semop
__NR_sendfile64
__NR_setdomainname
__NR_setgid
__NR_setgroups
__NR_sethostname
__NR_setitimer
__NR_setpgid
__NR_setpriority
__NR_setregid
__NR_setreuid
__NR_setrlimit
__NR_set_robust_list
__NR_setsid
__NR_settimeofday
__NR_setuid
__NR_setxattr
__NR_sgetmask
__NR_shmat
__NR_shmctl
__NR_shmdt
__NR_shmget
__NR_signal
__NR_signalfd
__NR_splice
__NR_ssetmask
__NR_stime
__NR_swapoff
__NR_swapon
__NR_symlinkat
__NR_sync
__NR_sync_file_range
__NR_syscalls
__NR_sysinfo
__NR_syslog
__NR_tee
__NR_time
__NR_timerfd_create
__NR_timerfd_gettime
__NR_timerfd_settime
__NR_times
__NR_umask
__NR_umount
__NR_unlink
__NR_unlinkat
__NR_unshare
__NR_uselib
__NR_utimensat
__NR_vhangup
__NR_vmsplice
__NR_write
__NR_writev


> 
> Michal
> 
> 
> 


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

* Re: microblaze syscall list
  2008-05-03  3:49                             ` John Williams
@ 2008-05-03  9:16                               ` Arnd Bergmann
  2008-05-03 15:56                                 ` Ulrich Drepper
  2008-05-05  1:09                                 ` John Williams
  0 siblings, 2 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-03  9:16 UTC (permalink / raw)
  To: John Williams
  Cc: monstr, Matthew Wilcox, Will Newton, Linux Kernel list,
	linux-arch, git, Stephen Neuendorffer, John Linn, Ulrich Drepper

On Saturday 03 May 2008, John Williams wrote:

> As a first pass at assessing the C library impact on a completely 
> renovated syscall list, I took Michal's proposed new unistd.h and used 
> it to grep over both the uClibc implementation that (almost) every 
> existing microblaze user uses (!MMU), plus the glibc (cough cough) 
> implementation that is our default with the emerging MMU support.
> 
> To test the implementation / reference of a syscall number, I grepped 
> the entire source trees for
> 
>    __NR_xxx
> 
> or
> 
>    _system[0-9](.*xxxx    (stripped leading __NR_X)
>
> to try and find any mention at all of a particular syscall in that C 
> library implementation.

I think for glibc, you also need to look for INLINE_SYSCALL and
INTERNAL_SYSCALL, possibly more.

However, note that many of the syscall numbers that are referenced
by glibc are not _required_ by it, because it already contains
alternative implementations.

> The results are interesting, and verbose.  In fact, the lists are so 
> long I'm almost certain I've missed some other obscure way that uClibc 
> or glibc can access a __NR_ macro.  Please let me know if this is the case.
> 
> Certainly there are many implemented in neither, such as as splice and 
> friends.
> 
> Also interesting is e.g. openat() - it is implemented/referenced by 
> neither!  So, surely it would be premature to phase out open() in favour 
> of openat() when the latter is not in any viable MicroBlaze C library yet.

openat was added in glibc-2.4 as a syscall, see
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/openat.c?rev=1.2.2.7&content-type=text/x-cvsweb-markup&cvsroot=glibc

What is not yet there is code to implement open() using openat() in the
absense of __NR_open.

> I guess we need some help to find the other critical ones.

I think your approach is flawed, it doesn't help at all to look at what
your libc currently does if you already think that you will need to change
the libc code.

A more relevant question is what changes should be done in glibc for this
in the first place, and I would like to hear Ulis opinion on that.

Uli: The question at hand is what syscalls a new linux architecture
should implement. To take utimes() as an example, the kernel currently
has utime(), utimes(), futimesat() and utimensat(), while glibc
provides utime(), utimes(), futimes(), futimesat(), futimens() and
utimensat(). In theory, all the glibc interfaces could be provided
on top of the utimensat() syscall, but should they?
Currently, glibc has fallback code to implement utime() using utimes(),
but not any of the others.

The same argument can be made about others, including
{,f}{mknod,mkdir,symlink,rename,access,chmod,open}{,at}
select/pselect,poll/ppoll,epoll_wait/epoll_pwait
vfork/fork/clone
{,rt_}{sigaction,sigsuspend,sigreturn,sigprocmask,sigpending}
any of your newly proposed syscalls with flags

If a new architecture should override these, should that be
done in the architecture specific code, or should the common
code be modified to handle this implicitly?

On a similar note, do you agree that a new 32 bit architecture should
define 32 bit uid_t and 64 bit off_t, and consequently leave
out all the uid16_t and loff_t based syscalls that are then simple
duplicates?

> If there's a cleaner analysis I can do, please let me know and I'll repeat.
> 
> Here goes - uClibc first, then glibc
> 
> ** Not implemented/referenced in uClibc 0.9.27 12 January 2005
> __NR_add_key
> __NR_clock_getres
> __NR_clock_gettime
> __NR_clock_nanosleep
> __NR_clock_settime
> __NR_creat
> __NR_epoll_pwait
> __NR_eventfd
> __NR__exit
> __NR_exit_group
> __NR_faccessat
> __NR_fadvise64_64
> __NR_fallocate
> __NR_fchmodat
> __NR_fchownat
> __NR_fstatat64
> __NR_fstatfs64
> __NR_futex
> __NR_futimesat
> __NR_getcpu
> __NR_get_robust_list
> __NR_gettid
> __NR_inotify_add_watch
> __NR_inotify_init
> __NR_inotify_rm_watch
> __NR_io_cancel
> __NR_io_destroy
> __NR_io_getevents
> __NR_ioprio_get
> __NR_ioprio_set
> __NR_io_setup
> __NR_io_submit
> __NR_kexec_load
> __NR_keyctl
> __NR_linkat
> __NR_lookup_dcookie
> __NR_mkdirat
> __NR_mknodat
> __NR_newfstat
> __NR_newlstat
> __NR_newstat
> __NR_newuname
> __NR_nfsservctl
> __NR_openat
> __NR_ppoll
> __NR_pselect7
> __NR_readahead
> __NR_readlinkat
> __NR_removexattrs
> __NR_renameat
> __NR_request_key
> __NR_restart_syscall
> __NR_rt_sigqueueinfo
> __NR_sched_getaffinity
> __NR_sched_setaffinity
> __NR_semtimedop
> __NR_set_robust_list
> __NR_set_tid_address
> __NR_sgetmask
> __NR_signal
> __NR_signalfd
> __NR_splice
> __NR_ssetmask
> __NR_statfs64
> __NR_symlinkat
> __NR_sync_file_range
> __NR_syscalls
> __NR_tee
> __NR_tgkill
> __NR_timerfd_create
> __NR_timerfd_gettime
> __NR_timerfd_settime
> __NR_tkill
> __NR_unlinkat
> __NR_unshare
> __NR_utimensat
> __NR_vmsplice
> __NR_waitid

This list is possibly more useful as a "what's wrong with uClibc" list.
Most of these syscalls were added recently and should be added in uClibc
eventually, at least the subset of them that is also provided by glibc.

> ** Not implemented/referenced in glibc
> __NR_add_key
> __NR_adjtimex
> __NR_alarm
> __NR_capget
> __NR_capset
> __NR_chdir
> __NR_chown
> __NR_chroot
> __NR_close
> __NR_creat
> __NR_delete_module
> __NR_dup
> __NR_dup2
> __NR_epoll_create
> __NR_epoll_ctl
> __NR_epoll_pwait
> __NR_eventfd
> __NR_execve
> __NR_faccessat
> __NR_fallocate
> __NR_fchdir
> __NR_fchmod
> __NR_fchmodat
> __NR_fchown
> __NR_fchownat
> __NR_fdatasync
> __NR_fgetxattr
> __NR_flistxattr
> __NR_flock
> __NR_fremovexattr
> __NR_fsetxattr
> __NR_fstatat64
> __NR_fsync
> __NR_futimesat
> __NR_getcpu
> __NR_getegid
> __NR_geteuid
> __NR_getgroups
> __NR_getitimer
> __NR_getpgid
> __NR_getpgrp
> __NR_getppid
> __NR_getpriority
> __NR_getrlimit
> __NR_get_robust_list
> __NR_getrusage
> __NR_getsid
> __NR_gettid
> __NR_getxattr
> __NR_init_module
> __NR_inotify_add_watch
> __NR_inotify_init
> __NR_inotify_rm_watch
> __NR_io_cancel
> __NR_io_destroy
> __NR_io_getevents
> __NR_ioprio_get
> __NR_ioprio_set
> __NR_io_setup
> __NR_io_submit
> __NR_kexec_load
> __NR_keyctl
> __NR_kill
> __NR_lgetxattr
> __NR_link
> __NR_linkat
> __NR_listxattr
> __NR_llistxattr
> __NR_lookup_dcookie
> __NR_lremovexattr
> __NR_lseek
> __NR_lsetxattr
> __NR_mkdirat
> __NR_mknodat
> __NR_mount
> __NR_msgctl
> __NR_msgget
> __NR_msgrcv
> __NR_msgsnd
> __NR_munmap
> __NR_nanosleep
> __NR_newfstat
> __NR_newlstat
> __NR_newstat
> __NR_newuname
> __NR_nfsservctl
> __NR_nice
> __NR_openat
> __NR_pause
> __NR_personality
> __NR_pivot_root
> __NR_ppoll
> __NR_prctl
> __NR_pselect7
> __NR_ptrace
> __NR_quotactl
> __NR_read
> __NR_readlinkat
> __NR_readv
> __NR_reboot
> __NR_removexattrs
> __NR_renameat
> __NR_request_key
> __NR_restart_syscall
> __NR_sched_getparam
> __NR_sched_get_priority_max
> __NR_sched_get_priority_min
> __NR_sched_getscheduler
> __NR_sched_rr_get_interval
> __NR_sched_setparam
> __NR_sched_setscheduler
> __NR_sched_yield
> __NR_semctl
> __NR_semget
> __NR_semop
> __NR_sendfile64
> __NR_setdomainname
> __NR_setgid
> __NR_setgroups
> __NR_sethostname
> __NR_setitimer
> __NR_setpgid
> __NR_setpriority
> __NR_setregid
> __NR_setreuid
> __NR_setrlimit
> __NR_set_robust_list
> __NR_setsid
> __NR_settimeofday
> __NR_setuid
> __NR_setxattr
> __NR_sgetmask
> __NR_shmat
> __NR_shmctl
> __NR_shmdt
> __NR_shmget
> __NR_signal
> __NR_signalfd
> __NR_splice
> __NR_ssetmask
> __NR_stime
> __NR_swapoff
> __NR_swapon
> __NR_symlinkat
> __NR_sync
> __NR_sync_file_range
> __NR_syscalls
> __NR_sysinfo
> __NR_syslog
> __NR_tee
> __NR_time
> __NR_timerfd_create
> __NR_timerfd_gettime
> __NR_timerfd_settime
> __NR_times
> __NR_umask
> __NR_umount
> __NR_unlink
> __NR_unlinkat
> __NR_unshare
> __NR_uselib
> __NR_utimensat
> __NR_vhangup
> __NR_vmsplice
> __NR_write
> __NR_writev

You are obviously missing the INLINE_SYSCALL and INTERNAL_SYSCALL here.
I do think that having this list (in a correct form) is useful for the
discussion, so it would be nice if you could do it again, including those.

	Arnd <><

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

* Re: microblaze syscall list
  2008-05-03  9:16                               ` Arnd Bergmann
@ 2008-05-03 15:56                                 ` Ulrich Drepper
  2008-05-03 21:14                                   ` Arnd Bergmann
  2008-05-05  1:09                                 ` John Williams
  1 sibling, 1 reply; 52+ messages in thread
From: Ulrich Drepper @ 2008-05-03 15:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: John Williams, monstr, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, Stephen Neuendorffer,
	John Linn

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Arnd Bergmann wrote:
> Uli: The question at hand is what syscalls a new linux architecture
> should implement. To take utimes() as an example, the kernel currently
> has utime(), utimes(), futimesat() and utimensat(), while glibc
> provides utime(), utimes(), futimes(), futimesat(), futimens() and
> utimensat(). In theory, all the glibc interfaces could be provided
> on top of the utimensat() syscall, but should they?

Yes, this is how it should be.  It's not done because no architecture
glibc officially supports arrived after these and similar syscalls
arrived.  There is no need to implement the not-*at interface, no need
to implement the creat syscall, etc etc.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFIHItI2ijCOnn/RHQRAm+9AJ4zGHVzNxgt9Zbrf0Uj27n4AQH6LACfVpIC
qYnU0uBg3he4hKx0cujQQ7U=
=ozRC
-----END PGP SIGNATURE-----

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

* Re: microblaze syscall list
  2008-05-03 15:56                                 ` Ulrich Drepper
@ 2008-05-03 21:14                                   ` Arnd Bergmann
  0 siblings, 0 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-03 21:14 UTC (permalink / raw)
  To: Ulrich Drepper
  Cc: John Williams, monstr, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, Stephen Neuendorffer,
	John Linn

On Saturday 03 May 2008, Ulrich Drepper wrote:
> Yes, this is how it should be.  It's not done because no architecture
> glibc officially supports arrived after these and similar syscalls
> arrived.  There is no need to implement the not-*at interface, no need
> to implement the creat syscall, etc etc.

Ah, good! So where should the glibc implementation for these calls go?
In the microblaze (and any future architecture) specific source directories,
to be consolidated when you get more of them, or in the common places like
sysdeps/unix/sysv/linux/*.c, with the appropriate #ifndef?

	Arnd <><

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

* Re: microblaze syscall list
  2008-04-27 15:52               ` Michal Simek
  2008-04-27 16:50                 ` Alan Cox
  2008-04-27 20:15                 ` Arnd Bergmann
@ 2008-05-03 21:57                 ` Arnd Bergmann
  2008-05-04  9:12                   ` Michal Simek
  2 siblings, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-03 21:57 UTC (permalink / raw)
  To: monstr
  Cc: microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

On Sunday 27 April 2008, Michal Simek wrote:
> 
> Arnd commented current syscall table and send me long email about(Thanks again).
> On the base on this email I did converted table for future use - for porting old
> application to new version. Below is my table with syscalls and there is a short
> description. (or http://www.monstr.eu/wiki/doku.php?id=kernel:syscall)

Just an update based on the recent discussion:

> /* fs/exec.c */
> ok	.long sys_uselib /* #ifdef __ARCH_WANT_SYS_USELIB */

remove

> /* fs/fcntl.c */
> ok	.long sys_dup
> ok	.long sys_dup2
> 	.long sys_fcntl /* obsolete -> fcntl64 */
> ok	.long sys_fcntl64

actually, if you have 64 bit off_t, it would be more logical
to use just sys_fcntl and leave out sys_fcntl64.
 
> /* fs/open.c */
> 	.long sys_statfs /* obsolete -> statfs64 */
> ok	.long sys_statfs64
> 	.long sys_fstatfs /* obsolete -> fstatfs64 */
> ok	.long sys_fstatfs64
> 	.long sys_truncate /* obsolete -> truncate64 */
> 	.long sys_ftruncate /* obsolete -> ftruncate64 */
> ok	.long sys_truncate64 /* __ARCH_WANT_SYS_TRUNCATE */
> ok	.long sys_ftruncate64 /* __ARCH_WANT_SYS_TRUNCATE */

right, for all these, the *64 version is the right one.

> ok	.long sys_fallocate
> ok	.long sys_faccessat
> 	.long sys_access /* obsolete -> faccessat */
> ok	.long sys_chdir
> ok	.long sys_fchdir
> ok	.long sys_chroot
> ok	.long sys_fchmod
> ok	.long sys_fchmodat
> 	.long sys_chmod /* obsolete -> fchmodat */
> ok	.long sys_chown
> ok	.long sys_fchownat
> ok	.long sys_lchown
> ok	.long sys_fchown
> 	.long sys_open /* obsolete -> openat */
> ok	.long sys_openat
> ok	.long sys_creat
> ok	.long sys_close
> ok	.long sys_vhangup

also, creat -> openat

> /* fs/readdir.c */
> 	.long sys_getdents /* obsolete -> sys_getdents64 */
> ok	.long sys_getdents64

right
 
> /* fs/read_write.c */
> 	.long sys_lseek /* only lseek or llseek */
> ok	.long sys_llseek /* _ARCH_WANT_SYS_LLSEEK */

in this case, only lseek, not llseek

> ok	.long sys_read
> ok	.long sys_readv
> ok	.long sys_write
> ok	.long sys_writev
> ok	.long sys_pread64
> ok	.long sys_pwrite64
> 	.long sys_sendfile /* obsolete -> sys_sendfile64 */
> ok	.long sys_sendfile64

same here, sendfile instead of sendfile64

> /* fs/stat.c */
> 	.long sys_stat /*_ARCH_WANT_OLD_STAT */
> 	.long sys_lstat /* _ARCH_WANT_OLD_STAT */
> 	.long sys_fstat /* _ARCH_WANT_OLD_STAT */
> ok	.long sys_newstat
> ok	.long sys_newlstat
> 	.long sys_newfstatat /* _ARCH_WANT_SYS_NEWFSTATAT */
> ok	.long sys_newfstat
> ok	.long sys_readlinkat
> 	.long sys_readlink /* obsolete -> sys_readlinkat */
> ok	.long sys_stat64 /* _ARCH_WANT_STAT64 */
> ok	.long sys_lstat64 /* _ARCH_WANT_STAT64 */
> ok	.long sys_fstat64 /* _ARCH_WANT_STAT64 */
> ok	.long sys_fstatat64 /* _ARCH_WANT_STAT64 */

you should have sys_newfstatat, but not any sys_*stat64, and consequently
set neither _ARCH_WANT_SYS_NEWFSTATAT nor _ARCH_WANT_STAT64.

> /* fs/timerfd.c */
> ok	.long sys_timerfd_create
> ok	.long sys_timerfd_settime
> ok	.long sys_timerfd_gettime
> 
> /* fs/utimes.c */
> ok	.long sys_utime	/* _ARCH_WANT_SYS_TIME */
> ok	.long sys_utimensat
> ok	.long sys_futimesat
> 	.long sys_utimes /* obsolete -> sys_futimesat */

no sys_utime or sys_futimesat, only sys_utimensat
 
> /* kernel/acct.c */
> opt	.long sys_acct

put it in the syscall table, kernel/sys_ni.c takes care of the
handling in case it's disabled.
 
> /* kernel/compat.c */
> 	.long compat_sys_nanosleep
> 	.long compat_sys_getitimer
> 	.long compat_sys_setitimer
> 	.long compat_sys_times
> 	.long compat_sys_sigpending
> 	.long compat_sys_sigprocmask
> 	.long compat_sys_setrlimit
> 	.long compat_sys_old_getrlimit
> 	.long compat_sys_getrlimit
> 	.long compat_sys_getrusage
> 	.long compat_sys_waitid
> 	.long compat_sys_sched_setaffinity
> 	.long compat_sys_sched_getaffinity
> 	.long compat_sys_time	/* _ARCH_WANT_COMPAT_SYS_TIME */
> 	.long compat_sys_stime	/* _ARCH_WANT_COMPAT_SYS_TIME */
> ok	.long compat_sys_rt_sigsuspend /* _ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND */
> 	.long compat_sys_adjtimex
> 	.long compat_sys_move_pages
> 	.long compat_sys_migrate_pages

no, you don't want compat_sys_rt_sigsuspend either. it's only for 64 bit
systems runnign 32 bit user space, like all compat_sys_* calls.
 
> /* kernel/sched.c */
> ok	.long sys_nice /* __ARCH_WANT_SYS_NICE */
> ok	.long sys_sched_setparam
> ok	.long sys_sched_setscheduler
> ok	.long sys_sched_getscheduler
> ok	.long sys_sched_getparam
> ok	.long sys_sched_setaffinity
> ok	.long sys_sched_getaffinity
> ok	.long sys_sched_yield
> ok	.long sys_sched_get_priority_max
> ok	.long sys_sched_get_priority_min
> ok	.long sys_sched_rr_get_interval

no sys_nice, it can be implemented using sys_setpriority

> /* kernel/signal.c */
> ok	.long sys_restart_syscall
> ok	.long sys_kill
> ok	.long sys_tkill
> ok	.long sys_tgkill
> ok	.long sys_rt_sigsuspend /* _ARCH_WANT_SYS_RT_SIGSUSPEND */
> ok	.long sys_rt_sigaction /* _ARCH_WANT_SYS_RT_SIGACTION */
> ok	.long sys_rt_sigprocmask /* _ARCH_WANT_SYS_SIGPROCMASK */
> ok	.long sys_rt_sigpending	/* _ARCH_WANT_SYS_SIGPENDING */
> ok	.long sys_rt_sigtimedwait
> ok	.long sys_rt_sigqueueinfo
> 	.long sys_sigprocmask /* obsolete -> sys_rt_sigprocmask */
> 	.long sys_sigpending /* obsolete -> sys_rt_sigpending */
> ok	.long sys_signal	/* __ARCH_WANT_SYS_SIGNAL */
> ok	.long sys_pause		/* __ARCH_WANT_SYS_PAUSE */
> ok	.long sys_sgetmask /* __ARCH_WANT_SYS_SGETMASK */
> ok	.long sys_ssetmask /* __ARCH_WANT_SYS_SGETMASK */

signal -> rt_sigaction
sgetmask, ssetmask -> rt_sigprocmask
pause -> rt_sigtimedwait
 
 
> /* kernel/sys.c */
> ok	.long sys_setpriority
> ok	.long sys_getpriority
> ok	.long sys_reboot
> ok	.long sys_setregid
> ok	.long sys_setgid
> ok	.long sys_setreuid
> ok	.long sys_setuid
> ok	.long sys_setresuid
> ok	.long sys_getresuid
> ok	.long sys_setresgid
> ok	.long sys_getresgid
> ok	.long sys_setfsuid
> ok	.long sys_setfsgid
> ok	.long sys_times
> ok	.long sys_setpgid
> ok	.long sys_getpgid
> ok	.long sys_getpgrp /* __ARCH_WANT_SYS_GETPGRP */

getpgrp -> getpgid

> /* kernel/time.c */
> ok	.long sys_time /* __ARCH_WANT_SYS_TIME */
> ok	.long sys_stime /* __ARCH_WANT_SYS_TIME */

time -> gettimeofday
stime -> settimeofday

	.
> /* kernel/timer.c */
> ok	.long sys_alarm /* __ARCH_WANT_SYS_ALARM */
> ok	.long sys_getpid
> ok	.long sys_getppid
> ok	.long sys_getuid
> ok	.long sys_geteuid
> ok	.long sys_getgid
> ok	.long sys_getegid
> ok	.long sys_gettid
> ok	.long sys_sysinfo

alarm -> setitimer

> /* net/socket.c */
> 	.long sys_socket
> 	.long sys_socketpair
> 	.long sys_bind
> 	.long sys_listen
> 	.long sys_accept
> 	.long sys_connect
> 	.long sys_getsockname
> 	.long sys_getpeername
> 	.long sys_sendto
> 	.long sys_send
> 	.long sys_recvfrom
> 	.long sys_recv
> 	.long sys_setsockopt
> 	.long sys_getsockopt
> 	.long sys_shutdown
> 	.long sys_sendmsg
> 	.long sys_recvmsg
> 	.long sys_socketcall /* _ARCH_WANT_SYS_SOCKETCALL - deprecated */

You need all of these, except sys_socketcall, which should not be there.

> /* mm/fremap.c */
> 	.long sys_remap_file_pages

Just put it in there as well, you'll need it for the mmu version.

> /* mm/madvise.c */
> 	.long sys_madvise

same here.

> /* mm/mincore.c */
> 	.long sys_mincore

and here

> /* mm/mremap.c */
> 	.long sys_mremap
> 
> /* mm/msync.c */
> 	.long sys_msync

and here, both

> /* mm/nommu.c */
> ok	.long sys_brk
> ok	.long sys_munmap
> 	.long sys_mremap

mremap is a duplicate, you only need it once ;-)

> /*arch/microblaze/kernel/sys_microblaze.c*/
> 	.long sys_vfork		/* I don't need it if I have clone vfork_wrapper */
> ok	.long sys_clone		/* .long sys_clone_wrapper */
> ok	.long sys_execve	/* .long sys_execve_wrapper */
> ok	.long sys_pipe
> ok	.long sys_mmap2
> 	.long sys_mmap	/* obsolete -> sys_mmap2 */
> 	.long sys_ipc /* obsolete -> replace by subcall */

right. sys_pipe and sys_mmap2 should probably go to fs/pipe.c and mm/mmap.c, but
that does not need to be your worry right now, it's not part of the ABI.

	Arnd <><

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

* Re: microblaze syscall list
  2008-05-03 21:57                 ` Arnd Bergmann
@ 2008-05-04  9:12                   ` Michal Simek
  2008-05-04 19:37                     ` Arnd Bergmann
  2008-05-04 22:09                     ` H. Peter Anvin
  0 siblings, 2 replies; 52+ messages in thread
From: Michal Simek @ 2008-05-04  9:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

Hi Arnd,

>> ok	.long compat_sys_rt_sigsuspend /* _ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND */
> 
> no, you don't want compat_sys_rt_sigsuspend either. it's only for 64 bit
> systems runnign 32 bit user space, like all compat_sys_* calls.

That was my mistake - only rewriting

>> /* mm/nommu.c */
>> ok	.long sys_brk
>> ok	.long sys_munmap
>> 	.long sys_mremap
> 
> mremap is a duplicate, you only need it once ;-)

There are mixed mmu and nommu version - brk, munmap, mrepap are in both version
but they take from different files.

> right. sys_pipe and sys_mmap2 should probably go to fs/pipe.c and mm/mmap.c, but
> that does not need to be your worry right now, it's not part of the ABI.

YES. sys_pipe was remove from all arch today. Patches from Uli. I'll remove
sys_pipe from our sys_microblaze.c.

Here is updated syscall table.

Thanks,
Michal

/* fs/aio.c */
ok	.long sys_io_setup
ok	.long sys_io_destroy
ok	.long sys_io_submit
ok	.long sys_io_cancel
ok	.long sys_io_getevents

/* fs/xattr.c */
ok	.long sys_setxattr
ok	.long sys_lsetxattr
ok	.long sys_fsetxattr
ok	.long sys_getxattr
ok	.long sys_lgetxattr
ok	.long sys_fgetxattr
ok	.long sys_listxattr
ok	.long sys_llistxattr
ok	.long sys_flistxattr
ok	.long sys_removexattrs
ok	.long sys_lremovexattr
ok	.long sys_fremovexattr

/* fs/buffer.c */
	.long sys_bdflush /* obsolete */

/* fs/compat.c */
	.long compat_sys_utime
	.long compat_sys_utimensat
	.long compat_sys_futimesat
	.long compat_sys_utimes
	.long compat_sys_newstat
	.long compat_sys_newlstat
	.long compat_sys_newfstatat
	.long compat_sys_newfstat
	.long compat_sys_statfs
	.long compat_sys_fstatfs
	.long compat_sys_statfs64
	.long compat_sys_fstatfs64
	.long compat_sys_fcntl64
	.long compat_sys_fcntl
	.long compat_sys_mount
	.long compat_sys_old_readdir
	.long compat_sys_getdents
	.long compat_sys_getdents64
	.long compat_sys_select
	.long compat_sys_pselect7
	.long compat_sys_pselect6
	.long compat_sys_ppoll
	.long compat_sys_nfsservctl
	.long compat_sys_nfsservctl
	.long compat_sys_epoll_pwait
	.long compat_sys_signalfd
	.long compat_sys_timerfd_settime
	.long compat_sys_timerfd_gettime

/* fs/compat_ioctl.c */
	.long compat_sys_ioctl

/* fs/dcache.c */
ok	.long sys_getcwd

/* fs/cookies.c */
ok	.long sys_lookup_dcookie

/* fs/eventfd.c */
ok	.long sys_eventfd

/* fs/eventpoll.c */
ok	.long sys_epoll_create
ok	.long sys_epoll_ctl
	.long sys_epoll_wait /* obsolete -> sys_epoll_pwait */
ok	.long sys_epoll_pwait

/* fs/exec.c */
	.long sys_uselib

/* fs/fcntl.c */
ok	.long sys_dup
ok	.long sys_dup2
ok	.long sys_fcntl
	.long sys_fcntl64

/* fs/filesystems.c */
	.long sys_sysfs /* obsolete */


/* fs/inotify_user.c */
ok	.long sys_inotify_init
ok	.long sys_inotify_add_watch
ok	.long sys_inotify_rm_watch

/* fs/ioctl.c */
ok	.long sys_ioctl

/* fs/ioprio.c */
ok	.long sys_ioprio_set
ok	.long sys_ioprio_get

/* fs/locks.c */
ok	.long sys_flock

/* fs/namei.c */
ok	.long sys_mknodat
	.long sys_mknod /* obsolete -> mknodat */
ok	.long sys_mkdirat
	.long sys_mkdir /* obsolete -> mkdirat */
	.long sys_rmdir /* obsolete -> unlinkat */
ok	.long sys_unlinkat
ok	.long sys_unlink
ok	.long sys_symlinkat
	.long sys_symlink /* obsolete -> sys_symlinkat */
ok	.long sys_linkat
ok	.long sys_link
ok	.long sys_renameat
	.long sys_rename /* obsolete -> renameat */

/* fs/namespace.c */
ok	.long sys_umount
	.long sys_oldumount /*_ARCH_WANT_SYS_OLDUMOUNT obsolate -> sys_umount */
ok	.long sys_mount
ok	.long sys_pivot_root


/* fs/nfsctl.c */
ok	.long sys_nfsservctl

/* fs/open.c */
	.long sys_statfs /* obsolete -> statfs64 */
ok	.long sys_statfs64
	.long sys_fstatfs /* obsolete -> fstatfs64 */
ok	.long sys_fstatfs64
	.long sys_truncate /* obsolete -> truncate64 */
	.long sys_ftruncate /* obsolete -> ftruncate64 */
ok	.long sys_truncate64 /* __ARCH_WANT_SYS_TRUNCATE */
ok	.long sys_ftruncate64 /* __ARCH_WANT_SYS_TRUNCATE */
ok	.long sys_fallocate
ok	.long sys_faccessat
	.long sys_access /* obsolete -> faccessat */
ok	.long sys_chdir
ok	.long sys_fchdir
ok	.long sys_chroot
ok	.long sys_fchmod
ok	.long sys_fchmodat
	.long sys_chmod /* obsolete -> fchmodat */
ok	.long sys_chown
ok	.long sys_fchownat
ok	.long sys_lchown
ok	.long sys_fchown
	.long sys_open /* obsolete -> openat */
ok	.long sys_openat
	.long sys_creat /* obsolete -> openat */
ok	.long sys_close
ok	.long sys_vhangup

/* fs/pipe.c */
ok	.long sys_pipe

/* fs/quota.c */
ok	.long sys_quotactl

/* fs/readdir.c */
	.long sys_getdents /* obsolete -> sys_getdents64 */
ok	.long sys_getdents64

/* fs/read_write.c */
ok	.long sys_lseek /* only lseek or llseek */
	.long sys_llseek /* _ARCH_WANT_SYS_LLSEEK */
ok	.long sys_read
ok	.long sys_readv
ok	.long sys_write
ok	.long sys_writev
ok	.long sys_pread64
ok	.long sys_pwrite64
ok	.long sys_sendfile
	.long sys_sendfile64


/* fs/select.c */
	.long sys_select /* obsolete -> sys_pselect6 */
ok	.long sys_pselect7
	.long sys_pselect6 /* obsolete -> sys_pselect7 */
	.long sys_poll /* obsolete -> sys_ppoll */
ok	.long sys_ppoll

/* fs/signalfd.c */
ok	.long sys_signalfd



/* fs/splice.c */
ok	.long sys_vmsplice
ok	.long sys_splice
ok	.long sys_tee

/* fs/stat.c */
	.long sys_stat /*_ARCH_WANT_OLD_STAT */
	.long sys_lstat /* _ARCH_WANT_OLD_STAT */
	.long sys_fstat /* _ARCH_WANT_OLD_STAT */
ok	.long sys_newstat
ok	.long sys_newlstat
ok	.long sys_newfstatat /* _ARCH_WANT_SYS_NEWFSTATAT */
ok	.long sys_newfstat
ok	.long sys_readlinkat
	.long sys_readlink /* obsolete -> sys_readlinkat */
	.long sys_stat64 /* _ARCH_WANT_STAT64 */
	.long sys_lstat64 /* _ARCH_WANT_STAT64 */
	.long sys_fstat64 /* _ARCH_WANT_STAT64 */
	.long sys_fstatat64 /* _ARCH_WANT_STAT64 */

/* fs/super.c */
	.long sys_ustat /* obsolete -> statfs64 */

/* fs/sync.c */
ok	.long sys_sync
ok	.long sys_fsync
ok	.long sys_fdatasync
ok	.long sys_sync_file_range
	/* .long sys_sync_file_range2 */


/* fs/timerfd.c */
ok	.long sys_timerfd_create
ok	.long sys_timerfd_settime
ok	.long sys_timerfd_gettime

/* fs/utimes.c */
	.long sys_utime	/* _ARCH_WANT_SYS_TIME */ /* obsolete -> sys_utimesat */
ok	.long sys_utimensat
	.long sys_futimesat /* obsolete -> sys_utimesat */
	.long sys_utimes /* obsolete -> sys_futimesat */

/* kernel/acct.c */
ok	.long sys_acct /* add it and then I can disable it */

/* kernel/capability.c */
ok	.long sys_capget
ok	.long sys_capset

/* kernel/compat.c */
	.long compat_sys_nanosleep
	.long compat_sys_getitimer
	.long compat_sys_setitimer
	.long compat_sys_times
	.long compat_sys_sigpending
	.long compat_sys_sigprocmask
	.long compat_sys_setrlimit
	.long compat_sys_old_getrlimit
	.long compat_sys_getrlimit
	.long compat_sys_getrusage
	.long compat_sys_waitid
	.long compat_sys_sched_setaffinity
	.long compat_sys_sched_getaffinity
	.long compat_sys_time	/* _ARCH_WANT_COMPAT_SYS_TIME */
	.long compat_sys_stime	/* _ARCH_WANT_COMPAT_SYS_TIME */
	.long compat_sys_rt_sigsuspend /* _ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND */
	.long compat_sys_adjtimex
	.long compat_sys_move_pages
	.long compat_sys_migrate_pages

/* kernel/exec_domain.c */
ok	.long sys_personality

/* kernel/exit.c */
ok	.long sys_exit
ok	.long sys_exit_group
ok	.long sys_waitid
	.long sys_wait4	/* obsolete -> waitid */
	.long sys_waitpid /*_ARCH_WANT_SYS_WAITPID */ /* obsolete -> waitid */

/* kernel/fork.c */
ok	.long sys_set_tid_address
ok	.long sys_unshare

/* kernel/futex.c */
ok	.long sys_futex
ok	.long sys_set_robust_list
ok	.long sys_get_robust_list

/* kernel/futex_compat.c */
	.long compat_sys_futex
	.long compat_sys_set_robust_list
	.long compat_sys_get_robust_list

/* kernel/hrtimer.c */
ok	.long sys_nanosleep

/* kernel/itimer.c */
ok	.long sys_getitimer
ok	.long sys_setitimer


/* kernel/kexec.c */
ok	.long sys_kexec_load
	.long compat_sys_kexec_load

/* kernel/module.c */
ok	.long sys_init_module
ok	.long sys_delete_module


/* kernel/posix-timers.c */
ok	.long sys_timer_create
ok	.long sys_timer_gettime
ok	.long sys_timer_getoverrun
ok	.long sys_timer_settime
ok	.long sys_timer_delete
ok	.long sys_clock_settime
ok	.long sys_clock_gettime
ok	.long sys_clock_getres
ok	.long sys_clock_nanosleep

/* kernel/printk.c */
ok	.long sys_syslog

/* kernel/ptrace.c */
ok	.long sys_ptrace
	.long compat_sys_ptrace /* _ARCH_WANT_COMPAT_SYS_PTRACE */

/* kernel/sched.c */
	.long sys_nice /* __ARCH_WANT_SYS_NICE */ /* can be implemented by
sys_setpriority */
ok	.long sys_sched_setparam
ok	.long sys_sched_setscheduler
ok	.long sys_sched_getscheduler
ok	.long sys_sched_getparam
ok	.long sys_sched_setaffinity
ok	.long sys_sched_getaffinity
ok	.long sys_sched_yield
ok	.long sys_sched_get_priority_max
ok	.long sys_sched_get_priority_min
ok	.long sys_sched_rr_get_interval

/* kernel/signal.c */
ok	.long sys_restart_syscall
ok	.long sys_kill
ok	.long sys_tkill
ok	.long sys_tgkill
ok	.long sys_rt_sigsuspend /* _ARCH_WANT_SYS_RT_SIGSUSPEND */
ok	.long sys_rt_sigaction /* _ARCH_WANT_SYS_RT_SIGACTION */
ok	.long sys_rt_sigprocmask /* _ARCH_WANT_SYS_SIGPROCMASK */
ok	.long sys_rt_sigpending	/* _ARCH_WANT_SYS_SIGPENDING */
ok	.long sys_rt_sigtimedwait
ok	.long sys_rt_sigqueueinfo
	.long sys_sigprocmask /* obsolete -> sys_rt_sigprocmask */
	.long sys_sigpending /* obsolete -> sys_rt_sigpending */
	.long sys_signal	/* __ARCH_WANT_SYS_SIGNAL */ /* obsolete -> sys_rt_sigaction */
	.long sys_pause		/* __ARCH_WANT_SYS_PAUSE */ /* obsolete -> sys_rt_sigtimedwait */
	.long sys_sgetmask /* __ARCH_WANT_SYS_SGETMASK */ /* obsolete ->
sys_rt_sigprocmask */
	.long sys_ssetmask /* __ARCH_WANT_SYS_SGETMASK */ /* obsolete ->
sys_rt_sigprocmask */


/* kernel/sys.c */
ok	.long sys_setpriority
ok	.long sys_getpriority
ok	.long sys_reboot
ok	.long sys_setregid
ok	.long sys_setgid
ok	.long sys_setreuid
ok	.long sys_setuid
ok	.long sys_setresuid
ok	.long sys_getresuid
ok	.long sys_setresgid
ok	.long sys_getresgid
ok	.long sys_setfsuid
ok	.long sys_setfsgid
ok	.long sys_times
ok	.long sys_setpgid
ok	.long sys_getpgid
	.long sys_getpgrp /* __ARCH_WANT_SYS_GETPGRP */ /* obsolete -> sys_getpgid */
ok	.long sys_getsid
ok	.long sys_setsid
ok	.long sys_getgroups
ok	.long sys_setgroups
ok	.long sys_newuname
ok	.long sys_sethostname
	.long sys_gethostname /* _ARCH_WANT_SYS_GETHOSTNAME */
ok	.long sys_setdomainname
ok	.long sys_getrlimit
	.long sys_old_getrlimit /* _ARCH_WANT_SYS_OLD_GETRLIMIT */
ok	.long sys_setrlimit
ok	.long sys_getrusage
ok	.long sys_umask
ok	.long sys_prctl
ok	.long sys_getcpu



/* kernel/sysctl.c */
	.long sys_sysctl /* deprecated */

/* kernel/sys_ni.c */
	.long sys_ni_syscall /*  :-)  */


/* kernel/time.c */
	.long sys_time /* __ARCH_WANT_SYS_TIME */ /* obsolete -> sys_gettimeofday */
	.long sys_stime /* __ARCH_WANT_SYS_TIME */ /* obsolete -> sys_settimeofday */
ok	.long sys_gettimeofday
ok	.long sys_settimeofday
ok	.long sys_adjtimex

	.
/* kernel/timer.c */
	.long sys_alarm /* __ARCH_WANT_SYS_ALARM */ /* obsolete -> sys_setitimer */
ok	.long sys_getpid
ok	.long sys_getppid
ok	.long sys_getuid
ok	.long sys_geteuid
ok	.long sys_getgid
ok	.long sys_getegid
ok	.long sys_gettid
ok	.long sys_sysinfo


/* kernel/uid16.c */ /* all replace by full 32 bit version CONFIG_UID16 */
	.long sys_chown16
	.long sys_lchown16
	.long sys_fchown16
	.long sys_setregid16
	.long sys_setgid16
	.long sys_setreuid16
	.long sys_setuid16
	.long sys_setresuid16
	.long sys_getresuid16
	.long sys_setresgid16
	.long sys_getresgid16
	.long sys_setfsuid16
	.long sys_setfsgid16
	.long sys_getgroups16
	.long sys_setgroups16
	.long sys_getuid16
	.long sys_geteuid16
	.long sys_getgid16
	.long sys_getegid16

/* ipc/compat_mq.c */
	.long compat_sys_mq_open
	.long compat_sys_mq_timedsend
	.long compat_sys_mq_timedreceive
	.long compat_sys_mq_notify
	.long compat_sys_mq_getsetattr

/* ipc/mqueue.c */
ok	.long sys_mq_open
ok	.long sys_mq_unlink
ok	.long sys_mq_timedsend
ok	.long sys_mq_timedreceive
ok	.long sys_mq_notify
ok	.long sys_mq_getsetattr

/* ipc/msg.c */
ok	.long sys_msgget
ok	.long sys_msgctl
ok	.long sys_msgrcv
ok	.long sys_msgsnd

/* ipc/sem.c */
ok	.long sys_semget
ok	.long sys_semctl
ok	.long sys_semtimedop
ok	.long sys_semop

/* ipc/shm.c */
ok	.long sys_shmget
ok	.long sys_shmctl
ok	.long sys_shmat
ok	.long sys_shmdt


/* net/compat.c */
	.long compat_sys_setsockopt
	.long compat_sys_getsockopt
	.long compat_sys_sendmsg
	.long compat_sys_recvmsg
	.long compat_sys_socketcall

/* net/socket.c */
ok	.long sys_socket
ok	.long sys_socketpair
ok	.long sys_bind
ok	.long sys_listen
ok	.long sys_accept
ok	.long sys_connect
ok	.long sys_getsockname
ok	.long sys_getpeername
ok	.long sys_sendto
ok	.long sys_send
ok	.long sys_recvfrom
ok	.long sys_recv
ok	.long sys_setsockopt
ok	.long sys_getsockopt
ok	.long sys_shutdown
ok	.long sys_sendmsg
ok	.long sys_recvmsg
	.long sys_socketcall /* _ARCH_WANT_SYS_SOCKETCALL - deprecated */

/* mm/fadvise.c */
ok	.long sys_fadvise64_64
	.long sys_fadvise64 /*_ARCH_WANT_SYS_FADVISE64 obsolete -> sys_fadvise64_64 */

/* mm/filemap.c */
ok	.long sys_readahead


/* mm/fremap.c */
mmu	.long sys_remap_file_pages

/* mm/madvise.c */
mmu	.long sys_madvise

/* mm/mempolicy.c */
mmu	.long sys_mbind
mmu	.long sys_set_mempolicy
mmu	.long sys_migrate_pages
mmu	.long sys_get_mempolicy
	.long compat_sys_get_mempolicy
	.long compat_sys_set_mempolicy
	.long compat_sys_mbind

/* mm/migrate.c */
mmu	.long sys_move_pages

/* mm/mincore.c */
mmu	.long sys_mincore

/* mm/mlock.c */
mmu	.long sys_mlock
mmu	.long sys_munlock
mmu	.long sys_mlockall
mmu	.long sys_munlockall

/* mm/mmap.c */
mmu	.long sys_brk /* overlap for noMMU and MMU version */
mmu	.long sys_munmap /* overlap for noMMU and MMU version */

/* mm/mremap.c */
mmu	.long sys_mremap /* overlap for noMMU and MMU version */

/* mm/msync.c */
	.long sys_msync

/* mm/nommu.c */
ok	.long sys_brk /* overlap for noMMU and MMU version */
ok	.long sys_munmap /* overlap for noMMU and MMU version */
ok	.long sys_mremap /* overlap for noMMU and MMU version */


/* mm/swapfile.c */
ok	.long sys_swapoff
ok	.long sys_swapon


/* security/keys/compat.c */
	.long compat_sys_keyctl

/* security/keys/keyctl.c */
ok	.long sys_add_key
ok	.long sys_request_key
ok	.long sys_keyctl

/* arch - microblaze specific */
/* arch/microblaze/kernel/signal.c */
	.long sys_sigreturn /* obsolete -> sys_rt_sigreturn */
ok	.long sys_rt_sigreturn_wrapper /*.long sys_rt_sigreturn*/
	.long sys_sigaction /* obsolete -> rt_sigaction */
	.long sys_sigsuspend /* obsolete -> rt_sigsuspend */

/*arch/microblaze/kernel/sys_microblaze.c*/
	.long sys_vfork		/* I don't need it if I have clone vfork_wrapper */
ok	.long sys_clone		/* .long sys_clone_wrapper */
ok	.long sys_execve	/* .long sys_execve_wrapper */
ok	.long sys_mmap2
	.long sys_mmap	/* obsolete -> sys_mmap2 */
	.long sys_ipc /* obsolete -> replace by subcall */

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

* Re: microblaze syscall list
  2008-05-04  9:12                   ` Michal Simek
@ 2008-05-04 19:37                     ` Arnd Bergmann
  2008-05-05  6:18                       ` Michal Simek
  2008-05-04 22:09                     ` H. Peter Anvin
  1 sibling, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-04 19:37 UTC (permalink / raw)
  To: monstr
  Cc: microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

On Sunday 04 May 2008, Michal Simek wrote:

> > mremap is a duplicate, you only need it once ;-)
> 
> There are mixed mmu and nommu version - brk, munmap, mrepap are in both version
> but they take from different files.

That doesn't matter as the kernel is only ever built with one of the
two files. My point was just that you should have only one entry
in the syscall table if you generate it from your list.
 
> > right. sys_pipe and sys_mmap2 should probably go to fs/pipe.c and mm/mmap.c, but
> > that does not need to be your worry right now, it's not part of the ABI.
> 
> YES. sys_pipe was remove from all arch today. Patches from Uli. I'll remove
> sys_pipe from our sys_microblaze.c.

Ah, cool. I guess this leaves sys_mmap2, which we'll take care of eventually.
 
> Here is updated syscall table.

Thanks, looks good. I'd love to get a second opinion on the list though,
it's quite likely that I made a mistake somewhere.

Just three more calls I found:

> ok	.long sys_unlinkat
> ok	.long sys_unlink

> ok	.long sys_linkat
> ok	.long sys_link

> ok	.long sys_chown
> ok	.long sys_fchownat

For all of these, you only need the *at variant, afaict.

	Arnd <><

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

* Re: microblaze syscall list
  2008-05-04  9:12                   ` Michal Simek
  2008-05-04 19:37                     ` Arnd Bergmann
@ 2008-05-04 22:09                     ` H. Peter Anvin
  2008-05-04 22:54                       ` Arnd Bergmann
  2008-05-06  8:33                       ` Michal Simek
  1 sibling, 2 replies; 52+ messages in thread
From: H. Peter Anvin @ 2008-05-04 22:09 UTC (permalink / raw)
  To: monstr
  Cc: Arnd Bergmann, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

Michal Simek wrote:
> /* fs/select.c */
> 	.long sys_select /* obsolete -> sys_pselect6 */
> ok	.long sys_pselect7
> 	.long sys_pselect6 /* obsolete -> sys_pselect7 */

I thought there was some semantic differences between select() and 
pselect()... perhaps those changes have been removed?

> 
> /* kernel/sys_ni.c */
> 	.long sys_ni_syscall /*  :-)  */
> 

There is a school of thought that it's useful to reserve a system call 
number (usually zero) as a system call that is *guaranteed* to have no 
effect.

> /* arch - microblaze specific */
> /* arch/microblaze/kernel/signal.c */
> 	.long sys_sigreturn /* obsolete -> sys_rt_sigreturn */
> ok	.long sys_rt_sigreturn_wrapper /*.long sys_rt_sigreturn*/
> 	.long sys_sigaction /* obsolete -> rt_sigaction */
> 	.long sys_sigsuspend /* obsolete -> rt_sigsuspend */

Btw, please implement rt_sigreturn sanely; on x86, for example, one has 
to pop a word off the stack before one can invoke the system call, when 
used as sa_restorer...

	-hpa


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

* Re: microblaze syscall list
  2008-05-04 22:54                       ` Arnd Bergmann
@ 2008-05-04 22:53                         ` H. Peter Anvin
  0 siblings, 0 replies; 52+ messages in thread
From: H. Peter Anvin @ 2008-05-04 22:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: monstr, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

Arnd Bergmann wrote:
> 
> * POSIX pselect does not update the timeout argument, but linux pselect7
> does, so it's easy to implement both pselect and select based on it.
> * pselect also has a timespec arguement, not timeval as select, but that's
> trivial to convert.
> * pselect obviously takes an extra argument, but if that's NULL, it will
> behave like select (aside from the timeout handling).
> 

Fair enough.

	-hpa

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

* Re: microblaze syscall list
  2008-05-04 22:09                     ` H. Peter Anvin
@ 2008-05-04 22:54                       ` Arnd Bergmann
  2008-05-04 22:53                         ` H. Peter Anvin
  2008-05-06  8:33                       ` Michal Simek
  1 sibling, 1 reply; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-04 22:54 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: monstr, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

On Monday 05 May 2008, H. Peter Anvin wrote:
> Michal Simek wrote:
> > /* fs/select.c */
> >       .long sys_select /* obsolete -> sys_pselect6 */
> > ok    .long sys_pselect7
> >       .long sys_pselect6 /* obsolete -> sys_pselect7 */
> 
> I thought there was some semantic differences between select() and 
> pselect()... perhaps those changes have been removed?

According to the main page, there are three differences:

* POSIX pselect does not update the timeout argument, but linux pselect7
does, so it's easy to implement both pselect and select based on it.
* pselect also has a timespec arguement, not timeval as select, but that's
trivial to convert.
* pselect obviously takes an extra argument, but if that's NULL, it will
behave like select (aside from the timeout handling).

	Arnd <><

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

* Re: microblaze syscall list
  2008-05-03  9:16                               ` Arnd Bergmann
  2008-05-03 15:56                                 ` Ulrich Drepper
@ 2008-05-05  1:09                                 ` John Williams
  2008-05-05 14:08                                   ` Arnd Bergmann
  1 sibling, 1 reply; 52+ messages in thread
From: John Williams @ 2008-05-05  1:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: monstr, Matthew Wilcox, Will Newton, Linux Kernel list,
	linux-arch, git, Stephen Neuendorffer, John Linn, Ulrich Drepper

Arnd Bergmann wrote:

>> As a first pass at assessing the C library impact on a completely 
>> renovated syscall list, I took Michal's proposed new unistd.h and used 
>> it to grep over both the uClibc implementation that (almost) every 
>> existing microblaze user uses (!MMU), plus the glibc (cough cough) 
>> implementation that is our default with the emerging MMU support.
>>
>> To test the implementation / reference of a syscall number, I grepped 
>> the entire source trees for
>>
>>    __NR_xxx
>>
>> or
>>
>>    _system[0-9](.*xxxx    (stripped leading __NR_X)
>>
>> to try and find any mention at all of a particular syscall in that C 
>> library implementation.
> 
> I think for glibc, you also need to look for INLINE_SYSCALL and
> INTERNAL_SYSCALL, possibly more.

OK, new list at the end of this email.

> However, note that many of the syscall numbers that are referenced
> by glibc are not _required_ by it, because it already contains
> alternative implementations.

Sure.

>> The results are interesting, and verbose.  In fact, the lists are so 
>> long I'm almost certain I've missed some other obscure way that uClibc 
>> or glibc can access a __NR_ macro.  Please let me know if this is the case.
>>
>> Certainly there are many implemented in neither, such as as splice and 
>> friends.
>>
>> Also interesting is e.g. openat() - it is implemented/referenced by 
>> neither!  So, surely it would be premature to phase out open() in favour 
>> of openat() when the latter is not in any viable MicroBlaze C library yet.
> 
> openat was added in glibc-2.4 as a syscall, see
> http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/openat.c?rev=1.2.2.7&content-type=text/x-cvsweb-markup&cvsroot=glibc

OK.  Our glibc patches are against 2.3.3.  I realise it's not the most 
recent, but it's the best we've got for now.

> What is not yet there is code to implement open() using openat() in the
> absense of __NR_open.

>> I guess we need some help to find the other critical ones.
> 
> I think your approach is flawed, it doesn't help at all to look at what
> your libc currently does if you already think that you will need to change
> the libc code.

I can't help but feel we've got our wires crossed here.

If, for example, neither C library has code to use openat in the absence 
of __NR_open, then surely it is premature to remove __NR_open from any 
arch, microblaze included?

> A more relevant question is what changes should be done in glibc for this
> in the first place, and I would like to hear Ulis opinion on that.

This is all very reasonable, but it's not clear why broad changes in 
glibc would be part of MicroBlaze's critical path into kernel.org. 
There are already N arch's in the kernel using mixture of obsolete and 
new API's, I don't see the problem with MicroBlaze making it N+1.

> Uli: The question at hand is what syscalls a new linux architecture

<snip>

> This list is possibly more useful as a "what's wrong with uClibc" list.
> Most of these syscalls were added recently and should be added in uClibc
> eventually, at least the subset of them that is also provided by glibc.

I'm not interested in a glibc vs uClibc debate. For deeply embedded 
systems that MicroBlaze targets, uClibc's smaller footprint makes a lot 
of sense.

The installed base of uClibc vs glibc for MicroBlaze is probably 10000:1 
or more in uClibc's favour due to our history being entirely !MMU until 
2008.  I don't expect that to change much once we get the MMU and ld.so 
functionality into our uClibc port.

> You are obviously missing the INLINE_SYSCALL and INTERNAL_SYSCALL here.
> I do think that having this list (in a correct form) is useful for the
> discussion, so it would be nice if you could do it again, including those.

OK, new list below (note glibc 2.3.3) - it's still pretty long but 32 
fewer than the last iteration.

FYI here's the search expression ($syscall is the __NR_ macro)

egrep -R \ 
"(\<$syscall\>|_syscall[0-9].*\<${syscall/#__NR_/}\>|INTERNAL_SYSCALL.*\<${syscall/#__NR_/}\>|INLINE_SYSCALL.*\<${syscall/#__NR_/}\>)"
  $GLIBC_PATH

Not implemented/referenced in glibc
__NR_add_key
__NR_alarm
__NR_capget
__NR_capset
__NR_chdir
__NR_chroot
__NR_creat
__NR_delete_module
__NR_dup
__NR_dup2
__NR_epoll_create
__NR_epoll_ctl
__NR_epoll_pwait
__NR_eventfd
__NR_faccessat
__NR_fallocate
__NR_fchdir
__NR_fchmod
__NR_fchmodat
__NR_fchownat
__NR_fdatasync
__NR_fgetxattr
__NR_flistxattr
__NR_flock
__NR_fremovexattr
__NR_fsetxattr
__NR_fstatat64
__NR_fsync
__NR_futimesat
__NR_getcpu
__NR_getitimer
__NR_getpgid
__NR_getpgrp
__NR_getppid
__NR_get_robust_list
__NR_getrusage
__NR_getsid
__NR_getxattr
__NR_init_module
__NR_inotify_add_watch
__NR_inotify_init
__NR_inotify_rm_watch
__NR_io_cancel
__NR_io_destroy
__NR_io_getevents
__NR_ioprio_get
__NR_ioprio_set
__NR_io_setup
__NR_io_submit
__NR_kexec_load
__NR_keyctl
__NR_lgetxattr
__NR_link
__NR_linkat
__NR_listxattr
__NR_llistxattr
__NR_lookup_dcookie
__NR_lremovexattr
__NR_lseek
__NR_lsetxattr
__NR_mkdirat
__NR_mknodat
__NR_mount
__NR_msgget
__NR_msgrcv
__NR_msgsnd
__NR_nanosleep
__NR_newfstat
__NR_newlstat
__NR_newstat
__NR_newuname
__NR_nfsservctl
__NR_nice
__NR_openat
__NR_pause
__NR_personality
__NR_pivot_root
__NR_ppoll
__NR_pselect7
__NR_quotactl
__NR_readlinkat
__NR_removexattrs
__NR_renameat
__NR_request_key
__NR_restart_syscall
__NR_sched_rr_get_interval
__NR_sched_setparam
__NR_sched_yield
__NR_semget
__NR_semop
__NR_sendfile64
__NR_setdomainname
__NR_setgid
__NR_sethostname
__NR_setitimer
__NR_setpgid
__NR_setpriority
__NR_setregid
__NR_setreuid
__NR_set_robust_list
__NR_setsid
__NR_settimeofday
__NR_setuid
__NR_setxattr
__NR_sgetmask
__NR_shmat
__NR_shmdt
__NR_shmget
__NR_signal
__NR_signalfd
__NR_splice
__NR_ssetmask
__NR_stime
__NR_swapoff
__NR_swapon
__NR_symlinkat
__NR_sync
__NR_sync_file_range
__NR_syscalls
__NR_sysinfo
__NR_syslog
__NR_tee
__NR_time
__NR_timerfd_create
__NR_timerfd_gettime
__NR_timerfd_settime
__NR_umask
__NR_unlink
__NR_unlinkat
__NR_unshare
__NR_uselib
__NR_utimensat
__NR_vhangup
__NR_vmsplice




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

* Re: microblaze syscall list
  2008-05-04 19:37                     ` Arnd Bergmann
@ 2008-05-05  6:18                       ` Michal Simek
  0 siblings, 0 replies; 52+ messages in thread
From: Michal Simek @ 2008-05-05  6:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

Hi Arnd,

>>> mremap is a duplicate, you only need it once ;-)
>> There are mixed mmu and nommu version - brk, munmap, mrepap are in both version
>> but they take from different files.
> 
> That doesn't matter as the kernel is only ever built with one of the
> two files. My point was just that you should have only one entry
> in the syscall table if you generate it from your list.

Yes I know. That's what I meant.

Next update table.

Michal


/* fs/aio.c */
ok	.long sys_io_setup
ok	.long sys_io_destroy
ok	.long sys_io_submit
ok	.long sys_io_cancel
ok	.long sys_io_getevents

/* fs/xattr.c */
ok	.long sys_setxattr
ok	.long sys_lsetxattr
ok	.long sys_fsetxattr
ok	.long sys_getxattr
ok	.long sys_lgetxattr
ok	.long sys_fgetxattr
ok	.long sys_listxattr
ok	.long sys_llistxattr
ok	.long sys_flistxattr
ok	.long sys_removexattrs
ok	.long sys_lremovexattr
ok	.long sys_fremovexattr

/* fs/buffer.c */
	.long sys_bdflush /* obsolete */

/* fs/compat.c */
	.long compat_sys_utime
	.long compat_sys_utimensat
	.long compat_sys_futimesat
	.long compat_sys_utimes
	.long compat_sys_newstat
	.long compat_sys_newlstat
	.long compat_sys_newfstatat
	.long compat_sys_newfstat
	.long compat_sys_statfs
	.long compat_sys_fstatfs
	.long compat_sys_statfs64
	.long compat_sys_fstatfs64
	.long compat_sys_fcntl64
	.long compat_sys_fcntl
	.long compat_sys_mount
	.long compat_sys_old_readdir
	.long compat_sys_getdents
	.long compat_sys_getdents64
	.long compat_sys_select
	.long compat_sys_pselect7
	.long compat_sys_pselect6
	.long compat_sys_ppoll
	.long compat_sys_nfsservctl
	.long compat_sys_nfsservctl
	.long compat_sys_epoll_pwait
	.long compat_sys_signalfd
	.long compat_sys_timerfd_settime
	.long compat_sys_timerfd_gettime

/* fs/compat_ioctl.c */
	.long compat_sys_ioctl

/* fs/dcache.c */
ok	.long sys_getcwd

/* fs/cookies.c */
ok	.long sys_lookup_dcookie

/* fs/eventfd.c */
ok	.long sys_eventfd

/* fs/eventpoll.c */
ok	.long sys_epoll_create
ok	.long sys_epoll_ctl
	.long sys_epoll_wait /* obsolete -> sys_epoll_pwait */
ok	.long sys_epoll_pwait

/* fs/exec.c */
	.long sys_uselib

/* fs/fcntl.c */
ok	.long sys_dup
ok	.long sys_dup2
ok	.long sys_fcntl
	.long sys_fcntl64

/* fs/filesystems.c */
	.long sys_sysfs /* obsolete */


/* fs/inotify_user.c */
ok	.long sys_inotify_init
ok	.long sys_inotify_add_watch
ok	.long sys_inotify_rm_watch

/* fs/ioctl.c */
ok	.long sys_ioctl

/* fs/ioprio.c */
ok	.long sys_ioprio_set
ok	.long sys_ioprio_get

/* fs/locks.c */
ok	.long sys_flock

/* fs/namei.c */
ok	.long sys_mknodat
	.long sys_mknod /* obsolete -> mknodat */
ok	.long sys_mkdirat
	.long sys_mkdir /* obsolete -> mkdirat */
	.long sys_rmdir /* obsolete -> unlinkat */
ok	.long sys_unlinkat
	.long sys_unlink /* obsolete -> unlinkat */
ok	.long sys_symlinkat
	.long sys_symlink /* obsolete -> sys_symlinkat */
ok	.long sys_linkat
	.long sys_link /* obsolete -> linkat */
ok	.long sys_renameat
	.long sys_rename /* obsolete -> renameat */

/* fs/namespace.c */
ok	.long sys_umount
	.long sys_oldumount /*_ARCH_WANT_SYS_OLDUMOUNT obsolate -> sys_umount */
ok	.long sys_mount
ok	.long sys_pivot_root


/* fs/nfsctl.c */
ok	.long sys_nfsservctl

/* fs/open.c */
	.long sys_statfs /* obsolete -> statfs64 */
ok	.long sys_statfs64
	.long sys_fstatfs /* obsolete -> fstatfs64 */
ok	.long sys_fstatfs64
	.long sys_truncate /* obsolete -> truncate64 */
	.long sys_ftruncate /* obsolete -> ftruncate64 */
ok	.long sys_truncate64 /* __ARCH_WANT_SYS_TRUNCATE */
ok	.long sys_ftruncate64 /* __ARCH_WANT_SYS_TRUNCATE */
ok	.long sys_fallocate
ok	.long sys_faccessat
	.long sys_access /* obsolete -> faccessat */
ok	.long sys_chdir
ok	.long sys_fchdir
ok	.long sys_chroot
ok	.long sys_fchmod
ok	.long sys_fchmodat
	.long sys_chmod /* obsolete -> fchmodat */
	.long sys_chown /* obsolete -> fchownat */
ok	.long sys_fchownat
ok	.long sys_lchown
ok	.long sys_fchown
	.long sys_open /* obsolete -> openat */
ok	.long sys_openat
	.long sys_creat /* obsolete -> openat */
ok	.long sys_close
ok	.long sys_vhangup

/* fs/pipe.c */
ok	.long sys_pipe

/* fs/quota.c */
ok	.long sys_quotactl

/* fs/readdir.c */
	.long sys_getdents /* obsolete -> sys_getdents64 */
ok	.long sys_getdents64

/* fs/read_write.c */
ok	.long sys_lseek /* only lseek or llseek */
	.long sys_llseek /* _ARCH_WANT_SYS_LLSEEK */
ok	.long sys_read
ok	.long sys_readv
ok	.long sys_write
ok	.long sys_writev
ok	.long sys_pread64
ok	.long sys_pwrite64
ok	.long sys_sendfile
	.long sys_sendfile64


/* fs/select.c */
	.long sys_select /* obsolete -> sys_pselect6 */
ok	.long sys_pselect7
	.long sys_pselect6 /* obsolete -> sys_pselect7 */
	.long sys_poll /* obsolete -> sys_ppoll */
ok	.long sys_ppoll

/* fs/signalfd.c */
ok	.long sys_signalfd



/* fs/splice.c */
ok	.long sys_vmsplice
ok	.long sys_splice
ok	.long sys_tee

/* fs/stat.c */
	.long sys_stat /*_ARCH_WANT_OLD_STAT */
	.long sys_lstat /* _ARCH_WANT_OLD_STAT */
	.long sys_fstat /* _ARCH_WANT_OLD_STAT */
ok	.long sys_newstat
ok	.long sys_newlstat
ok	.long sys_newfstatat /* _ARCH_WANT_SYS_NEWFSTATAT */
ok	.long sys_newfstat
ok	.long sys_readlinkat
	.long sys_readlink /* obsolete -> sys_readlinkat */
	.long sys_stat64 /* _ARCH_WANT_STAT64 */
	.long sys_lstat64 /* _ARCH_WANT_STAT64 */
	.long sys_fstat64 /* _ARCH_WANT_STAT64 */
	.long sys_fstatat64 /* _ARCH_WANT_STAT64 */

/* fs/super.c */
	.long sys_ustat /* obsolete -> statfs64 */

/* fs/sync.c */
ok	.long sys_sync
ok	.long sys_fsync
ok	.long sys_fdatasync
ok	.long sys_sync_file_range
	/* .long sys_sync_file_range2 */


/* fs/timerfd.c */
ok	.long sys_timerfd_create
ok	.long sys_timerfd_settime
ok	.long sys_timerfd_gettime

/* fs/utimes.c */
	.long sys_utime	/* _ARCH_WANT_SYS_TIME */ /* obsolete -> sys_utimesat */
ok	.long sys_utimensat
	.long sys_futimesat /* obsolete -> sys_utimesat */
	.long sys_utimes /* obsolete -> sys_futimesat */

/* kernel/acct.c */
ok	.long sys_acct /* add it and then I can disable it */

/* kernel/capability.c */
ok	.long sys_capget
ok	.long sys_capset

/* kernel/compat.c */
	.long compat_sys_nanosleep
	.long compat_sys_getitimer
	.long compat_sys_setitimer
	.long compat_sys_times
	.long compat_sys_sigpending
	.long compat_sys_sigprocmask
	.long compat_sys_setrlimit
	.long compat_sys_old_getrlimit
	.long compat_sys_getrlimit
	.long compat_sys_getrusage
	.long compat_sys_waitid
	.long compat_sys_sched_setaffinity
	.long compat_sys_sched_getaffinity
	.long compat_sys_time	/* _ARCH_WANT_COMPAT_SYS_TIME */
	.long compat_sys_stime	/* _ARCH_WANT_COMPAT_SYS_TIME */
	.long compat_sys_rt_sigsuspend /* _ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND */
	.long compat_sys_adjtimex
	.long compat_sys_move_pages
	.long compat_sys_migrate_pages

/* kernel/exec_domain.c */
ok	.long sys_personality

/* kernel/exit.c */
ok	.long sys_exit
ok	.long sys_exit_group
ok	.long sys_waitid
	.long sys_wait4	/* obsolete -> waitid */
	.long sys_waitpid /*_ARCH_WANT_SYS_WAITPID */ /* obsolete -> waitid */

/* kernel/fork.c */
ok	.long sys_set_tid_address
ok	.long sys_unshare

/* kernel/futex.c */
ok	.long sys_futex
ok	.long sys_set_robust_list
ok	.long sys_get_robust_list

/* kernel/futex_compat.c */
	.long compat_sys_futex
	.long compat_sys_set_robust_list
	.long compat_sys_get_robust_list

/* kernel/hrtimer.c */
ok	.long sys_nanosleep

/* kernel/itimer.c */
ok	.long sys_getitimer
ok	.long sys_setitimer


/* kernel/kexec.c */
ok	.long sys_kexec_load
	.long compat_sys_kexec_load

/* kernel/module.c */
ok	.long sys_init_module
ok	.long sys_delete_module


/* kernel/posix-timers.c */
ok	.long sys_timer_create
ok	.long sys_timer_gettime
ok	.long sys_timer_getoverrun
ok	.long sys_timer_settime
ok	.long sys_timer_delete
ok	.long sys_clock_settime
ok	.long sys_clock_gettime
ok	.long sys_clock_getres
ok	.long sys_clock_nanosleep

/* kernel/printk.c */
ok	.long sys_syslog

/* kernel/ptrace.c */
ok	.long sys_ptrace
	.long compat_sys_ptrace /* _ARCH_WANT_COMPAT_SYS_PTRACE */

/* kernel/sched.c */
	.long sys_nice /* __ARCH_WANT_SYS_NICE */ /* can be implemented by
sys_setpriority */
ok	.long sys_sched_setparam
ok	.long sys_sched_setscheduler
ok	.long sys_sched_getscheduler
ok	.long sys_sched_getparam
ok	.long sys_sched_setaffinity
ok	.long sys_sched_getaffinity
ok	.long sys_sched_yield
ok	.long sys_sched_get_priority_max
ok	.long sys_sched_get_priority_min
ok	.long sys_sched_rr_get_interval

/* kernel/signal.c */
ok	.long sys_restart_syscall
ok	.long sys_kill
ok	.long sys_tkill
ok	.long sys_tgkill
ok	.long sys_rt_sigsuspend /* _ARCH_WANT_SYS_RT_SIGSUSPEND */
ok	.long sys_rt_sigaction /* _ARCH_WANT_SYS_RT_SIGACTION */
ok	.long sys_rt_sigprocmask /* _ARCH_WANT_SYS_SIGPROCMASK */
ok	.long sys_rt_sigpending	/* _ARCH_WANT_SYS_SIGPENDING */
ok	.long sys_rt_sigtimedwait
ok	.long sys_rt_sigqueueinfo
	.long sys_sigprocmask /* obsolete -> sys_rt_sigprocmask */
	.long sys_sigpending /* obsolete -> sys_rt_sigpending */
	.long sys_signal	/* __ARCH_WANT_SYS_SIGNAL */ /* obsolete -> sys_rt_sigaction */
	.long sys_pause		/* __ARCH_WANT_SYS_PAUSE */ /* obsolete -> sys_rt_sigtimedwait */
	.long sys_sgetmask /* __ARCH_WANT_SYS_SGETMASK */ /* obsolete ->
sys_rt_sigprocmask */
	.long sys_ssetmask /* __ARCH_WANT_SYS_SGETMASK */ /* obsolete ->
sys_rt_sigprocmask */


/* kernel/sys.c */
ok	.long sys_setpriority
ok	.long sys_getpriority
ok	.long sys_reboot
ok	.long sys_setregid
ok	.long sys_setgid
ok	.long sys_setreuid
ok	.long sys_setuid
ok	.long sys_setresuid
ok	.long sys_getresuid
ok	.long sys_setresgid
ok	.long sys_getresgid
ok	.long sys_setfsuid
ok	.long sys_setfsgid
ok	.long sys_times
ok	.long sys_setpgid
ok	.long sys_getpgid
	.long sys_getpgrp /* __ARCH_WANT_SYS_GETPGRP */ /* obsolete -> sys_getpgid */
ok	.long sys_getsid
ok	.long sys_setsid
ok	.long sys_getgroups
ok	.long sys_setgroups
ok	.long sys_newuname
ok	.long sys_sethostname
	.long sys_gethostname /* _ARCH_WANT_SYS_GETHOSTNAME */
ok	.long sys_setdomainname
ok	.long sys_getrlimit
	.long sys_old_getrlimit /* _ARCH_WANT_SYS_OLD_GETRLIMIT */
ok	.long sys_setrlimit
ok	.long sys_getrusage
ok	.long sys_umask
ok	.long sys_prctl
ok	.long sys_getcpu



/* kernel/sysctl.c */
	.long sys_sysctl /* deprecated */

/* kernel/sys_ni.c */
	.long sys_ni_syscall /*   :-)   */


/* kernel/time.c */
	.long sys_time /* __ARCH_WANT_SYS_TIME */ /* obsolete -> sys_gettimeofday */
	.long sys_stime /* __ARCH_WANT_SYS_TIME */ /* obsolete -> sys_settimeofday */
ok	.long sys_gettimeofday
ok	.long sys_settimeofday
ok	.long sys_adjtimex

	.
/* kernel/timer.c */
	.long sys_alarm /* __ARCH_WANT_SYS_ALARM */ /* obsolete -> sys_setitimer */
ok	.long sys_getpid
ok	.long sys_getppid
ok	.long sys_getuid
ok	.long sys_geteuid
ok	.long sys_getgid
ok	.long sys_getegid
ok	.long sys_gettid
ok	.long sys_sysinfo


/* kernel/uid16.c */ /* all replace by full 32 bit version CONFIG_UID16 */
	.long sys_chown16
	.long sys_lchown16
	.long sys_fchown16
	.long sys_setregid16
	.long sys_setgid16
	.long sys_setreuid16
	.long sys_setuid16
	.long sys_setresuid16
	.long sys_getresuid16
	.long sys_setresgid16
	.long sys_getresgid16
	.long sys_setfsuid16
	.long sys_setfsgid16
	.long sys_getgroups16
	.long sys_setgroups16
	.long sys_getuid16
	.long sys_geteuid16
	.long sys_getgid16
	.long sys_getegid16

/* ipc/compat_mq.c */
	.long compat_sys_mq_open
	.long compat_sys_mq_timedsend
	.long compat_sys_mq_timedreceive
	.long compat_sys_mq_notify
	.long compat_sys_mq_getsetattr

/* ipc/mqueue.c */
ok	.long sys_mq_open
ok	.long sys_mq_unlink
ok	.long sys_mq_timedsend
ok	.long sys_mq_timedreceive
ok	.long sys_mq_notify
ok	.long sys_mq_getsetattr

/* ipc/msg.c */
ok	.long sys_msgget
ok	.long sys_msgctl
ok	.long sys_msgrcv
ok	.long sys_msgsnd

/* ipc/sem.c */
ok	.long sys_semget
ok	.long sys_semctl
ok	.long sys_semtimedop
ok	.long sys_semop

/* ipc/shm.c */
ok	.long sys_shmget
ok	.long sys_shmctl
ok	.long sys_shmat
ok	.long sys_shmdt


/* net/compat.c */
	.long compat_sys_setsockopt
	.long compat_sys_getsockopt
	.long compat_sys_sendmsg
	.long compat_sys_recvmsg
	.long compat_sys_socketcall

/* net/socket.c */
ok	.long sys_socket
ok	.long sys_socketpair
ok	.long sys_bind
ok	.long sys_listen
ok	.long sys_accept
ok	.long sys_connect
ok	.long sys_getsockname
ok	.long sys_getpeername
ok	.long sys_sendto
ok	.long sys_send
ok	.long sys_recvfrom
ok	.long sys_recv
ok	.long sys_setsockopt
ok	.long sys_getsockopt
ok	.long sys_shutdown
ok	.long sys_sendmsg
ok	.long sys_recvmsg
	.long sys_socketcall /* _ARCH_WANT_SYS_SOCKETCALL - deprecated */

/* mm/fadvise.c */
ok	.long sys_fadvise64_64
	.long sys_fadvise64 /*_ARCH_WANT_SYS_FADVISE64 obsolete -> sys_fadvise64_64 */

/* mm/filemap.c */
ok	.long sys_readahead


/* mm/fremap.c */
mmu	.long sys_remap_file_pages

/* mm/madvise.c */
mmu	.long sys_madvise

/* mm/mempolicy.c */
mmu	.long sys_mbind
mmu	.long sys_set_mempolicy
mmu	.long sys_migrate_pages
mmu	.long sys_get_mempolicy
	.long compat_sys_get_mempolicy
	.long compat_sys_set_mempolicy
	.long compat_sys_mbind

/* mm/migrate.c */
mmu	.long sys_move_pages

/* mm/mincore.c */
mmu	.long sys_mincore

/* mm/mlock.c */
mmu	.long sys_mlock
mmu	.long sys_munlock
mmu	.long sys_mlockall
mmu	.long sys_munlockall

/* mm/mmap.c */
mmu	.long sys_brk /* overlap for noMMU and MMU version */
mmu	.long sys_munmap /* overlap for noMMU and MMU version */

/* mm/mremap.c */
mmu	.long sys_mremap /* overlap for noMMU and MMU version */

/* mm/msync.c */
	.long sys_msync

/* mm/nommu.c */
ok	.long sys_brk /* overlap for noMMU and MMU version */
ok	.long sys_munmap /* overlap for noMMU and MMU version */
ok	.long sys_mremap /* overlap for noMMU and MMU version */


/* mm/swapfile.c */
ok	.long sys_swapoff
ok	.long sys_swapon


/* security/keys/compat.c */
	.long compat_sys_keyctl

/* security/keys/keyctl.c */
ok	.long sys_add_key
ok	.long sys_request_key
ok	.long sys_keyctl

/* arch - microblaze specific */
/* arch/microblaze/kernel/signal.c */
	.long sys_sigreturn /* obsolete -> sys_rt_sigreturn */
ok	.long sys_rt_sigreturn /*.long sys_rt_sigreturn_wrapper */
	.long sys_sigaction /* obsolete -> rt_sigaction */
	.long sys_sigsuspend /* obsolete -> rt_sigsuspend */

/*arch/microblaze/kernel/sys_microblaze.c*/
	.long sys_vfork		/* I don't need it if I have clone vfork_wrapper */
ok	.long sys_clone		/* .long sys_clone_wrapper */
ok	.long sys_execve	/* .long sys_execve_wrapper */
ok	.long sys_mmap2
	.long sys_mmap	/* obsolete -> sys_mmap2 */
	.long sys_ipc /* obsolete -> replace by subcall */

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

* Re: microblaze syscall list
  2008-05-05  1:09                                 ` John Williams
@ 2008-05-05 14:08                                   ` Arnd Bergmann
  0 siblings, 0 replies; 52+ messages in thread
From: Arnd Bergmann @ 2008-05-05 14:08 UTC (permalink / raw)
  To: John Williams
  Cc: monstr, Matthew Wilcox, Will Newton, Linux Kernel list,
	linux-arch, git, Stephen Neuendorffer, John Linn, Ulrich Drepper

On Monday 05 May 2008, John Williams wrote:
> Arnd Bergmann wrote:

> OK.  Our glibc patches are against 2.3.3.  I realise it's not the most 
> recent, but it's the best we've got for now.

Right, glibc-2.3 was from 2002, 2.3.3 was released in 2004, which is
still pretty ancient.
 
> > What is not yet there is code to implement open() using openat() in the
> > absense of __NR_open.
> 
> >> I guess we need some help to find the other critical ones.
> > 
> > I think your approach is flawed, it doesn't help at all to look at what
> > your libc currently does if you already think that you will need to change
> > the libc code.
> 
> I can't help but feel we've got our wires crossed here.
> 
> If, for example, neither C library has code to use openat in the absence 
> of __NR_open, then surely it is premature to remove __NR_open from any 
> arch, microblaze included?

For any incompatible change of this sort, you have to do it in the kernel
and libc in parallel. What we're talking about here is much closer to
doing a new glibc port based on microblaze linux-2.6.26 and glibc-2.8+
rather than using the existing glibc-2.3.3 port.

I understand that you care most about uClibc, because that is what
practically anyone is using, but glibc is setting the standard
that uClibc is following.

>From what I understand from Uli, he won't add an implementation of
open() based on openat() unless there is any architecture actually
using it, so there is no point in waiting for glibc here.

> > A more relevant question is what changes should be done in glibc for this
> > in the first place, and I would like to hear Ulis opinion on that.
> 
> This is all very reasonable, but it's not clear why broad changes in 
> glibc would be part of MicroBlaze's critical path into kernel.org. 
> There are already N arch's in the kernel using mixture of obsolete and 
> new API's, I don't see the problem with MicroBlaze making it N+1.

You're probably right that it's not fair to microblaze to demand that
you do it right when all existing architectures before did the wrong
thing. For me it's just the pain of reviewing the same bugs being copied
in every single new Linux port, so my agenda here is to be able to point
the next guy at microblaze, telling them to copy from you instead of
from x86 or m68k.

> I'm not interested in a glibc vs uClibc debate. For deeply embedded 
> systems that MicroBlaze targets, uClibc's smaller footprint makes a lot 
> of sense.
>
> The installed base of uClibc vs glibc for MicroBlaze is probably 10000:1 
> or more in uClibc's favour due to our history being entirely !MMU until 
> 2008.  I don't expect that to change much once we get the MMU and ld.so 
> functionality into our uClibc port.

I wasn't trying to argue against uClibc at all, there is nothing wrong
with you using it. My point was that the (architecture independent)
uClibc developers should take a look at your list and implement the
syscalls, so that you can easily port applications using them from glibc.

> egrep -R \ 
> "(\<$syscall\>|_syscall[0-9].*\<${syscall/#__NR_/}\>|INTERNAL_SYSCALL.*\<${syscall/#__NR_/}\>|INLINE_SYSCALL.*\<${syscall/#__NR_/}\>)"
>   $GLIBC_PATH
> 
> Not implemented/referenced in glibc
> __NR_add_key
> __NR_alarm
> __NR_capget

Looking at glibc-2.8, what I found using your method are:

# not in the scope of glibc currently, but may be used elsewhere:
add_key
keyctl
request_key
get_robust_list
set_robust_list
io_cancel
io_destroy
io_getevents
io_setup
io_submit
ioprio_get
ioprio_set
kexec_load
lookup_dcookie

# used under a different name:
newfstat
newlstat
newstat
newuname
pselect7

# used by the kernel itself:
restart_syscall

# obsolete, should not be used anywhere:
sgetmask
ssetmask

All others from your list are referenced in the glibc source somewhere.

	Arnd <><

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

* Re: microblaze syscall list
  2008-05-04 22:09                     ` H. Peter Anvin
  2008-05-04 22:54                       ` Arnd Bergmann
@ 2008-05-06  8:33                       ` Michal Simek
  1 sibling, 0 replies; 52+ messages in thread
From: Michal Simek @ 2008-05-06  8:33 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Arnd Bergmann, microblaze-uclinux, Matthew Wilcox, Will Newton,
	Linux Kernel list, linux-arch, git, John Williams,
	Stephen Neuendorffer, John Linn

Hi hpa,
>>
>> /* kernel/sys_ni.c */
>>     .long sys_ni_syscall /*  :-)  */
>>
> 
> There is a school of thought that it's useful to reserve a system call
> number (usually zero) as a system call that is *guaranteed* to have no
> effect.

I like your opinion. I'll add it like zero syscall.

Thanks,
M



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

end of thread, other threads:[~2008-05-06  8:32 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-22 12:13 [RFC] Introduce __ARCH_WANT_SYS_SYSFS Will Newton
2008-04-22 13:15 ` Arnd Bergmann
2008-04-23 21:16   ` Michal Simek
2008-04-23 21:38     ` Mike Frysinger
2008-04-24 11:11     ` microblaze syscall list Arnd Bergmann
2008-04-24 18:42       ` Michal Simek
2008-04-24 21:21         ` Arnd Bergmann
2008-04-25  9:36         ` [microblaze-uclinux] " John Williams
2008-04-25 10:06           ` Matthew Wilcox
2008-04-25 11:32             ` Geert Uytterhoeven
2008-04-27  2:04             ` John Williams
2008-04-27 15:52               ` Michal Simek
2008-04-27 16:50                 ` Alan Cox
2008-04-27 20:15                 ` Arnd Bergmann
2008-04-28  0:15                   ` John Williams
2008-04-28 12:31                     ` Arnd Bergmann
2008-05-01 19:17                       ` Arnd Bergmann
2008-05-02  5:38                         ` John Williams
2008-05-02  8:18                           ` Michal Simek
2008-05-03  3:49                             ` John Williams
2008-05-03  9:16                               ` Arnd Bergmann
2008-05-03 15:56                                 ` Ulrich Drepper
2008-05-03 21:14                                   ` Arnd Bergmann
2008-05-05  1:09                                 ` John Williams
2008-05-05 14:08                                   ` Arnd Bergmann
2008-05-03 21:57                 ` Arnd Bergmann
2008-05-04  9:12                   ` Michal Simek
2008-05-04 19:37                     ` Arnd Bergmann
2008-05-05  6:18                       ` Michal Simek
2008-05-04 22:09                     ` H. Peter Anvin
2008-05-04 22:54                       ` Arnd Bergmann
2008-05-04 22:53                         ` H. Peter Anvin
2008-05-06  8:33                       ` Michal Simek
2008-04-24 20:51       ` Michal Simek
2008-04-24 21:37         ` Arnd Bergmann
2008-04-22 15:12 ` [RFC] Introduce __ARCH_WANT_SYS_SYSFS Randy Dunlap
2008-04-22 15:16   ` Will Newton
2008-04-22 15:24     ` Kyle McMartin
2008-04-22 15:34       ` Will Newton
2008-04-22 15:38         ` Kyle McMartin
2008-04-23 14:36           ` Will Newton
2008-04-23 14:59             ` Arnd Bergmann
2008-04-23 15:40             ` Kyle McMartin
2008-04-23 15:50               ` Will Newton
2008-04-23 16:05                 ` Mike Frysinger
2008-04-23 17:59                   ` Mike Frysinger
2008-04-24  9:18                     ` Will Newton
2008-04-23 18:44             ` Sam Ravnborg
2008-04-24 14:51   ` Adrian Bunk
2008-04-22 15:21 ` Kyle McMartin
2008-04-22 15:38   ` Arnd Bergmann
2008-04-22 15:42     ` Kyle McMartin

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).