Re: [Uclinux-dist-devel] Re: [PATCH] Blackfin arch: add some missing syscall

Previous thread: Bad hotplug/scheduler interaction? by Rick Lindsley on Thursday, September 13, 2007 - 3:52 am. (1 message)

Next thread: sata_nv issues with MCP51 SATA controller by Jon Ivar Rykkelid on Thursday, September 13, 2007 - 3:18 am. (2 messages)
To: Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 3:56 am

When compiling the Blackfin kernel, checksyscalls.pl will report lots of missing syscalls warnings.
This patch will add some missing syscalls which make sense on Blackfin arch.

Also add ignored syscall list to kill remaining warnings.

After appling this patch, toolchain should be rebuilt. Then recompiling the kernel with the new
toolchain.

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
arch/blackfin/mach-common/entry.S | 18 ++++++++++--
include/asm-blackfin/unistd.h | 54 ++++++++++++++++++++++++++++++++++---
2 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index d61bba9..ef60f2e 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -815,7 +815,7 @@ _extable:

ALIGN
ENTRY(_sys_call_table)
- .long _sys_ni_syscall /* 0 - old "setup()" system call*/
+ .long _sys_restart_syscall /* 0 */
.long _sys_exit
.long _sys_fork
.long _sys_read
@@ -984,7 +984,7 @@ ENTRY(_sys_call_table)
.long _sys_ni_syscall /* for vm86 */
.long _sys_ni_syscall /* old "query_module" */
.long _sys_ni_syscall /* sys_poll */
- .long _sys_ni_syscall /* sys_nfsservctl */
+ .long _sys_nfsservctl
.long _sys_setresgid /* setresgid16 */ /* 170 */
.long _sys_getresgid /* getresgid16 */
.long _sys_prctl
@@ -1040,7 +1040,7 @@ ENTRY(_sys_call_table)
.long _sys_ni_syscall /* reserved for TUX */
.long _sys_ni_syscall
.long _sys_gettid
- .long _sys_ni_syscall /* 225 */ /* sys_readahead */
+ .long _sys_readahead /* 225 */
.long _sys_setxattr
.long _sys_lsetxattr
.long _sys_fsetxattr
@@ -1157,6 +1157,18 @@ ENTRY(_sys_call_table)
.long _sys_shmctl
.long _sys_shmdt /* 340 */
.long _sys_shmget
+ .long _sys_splice
+ .long _sys_sync_file_range
+ .long _sys_tee
+ .long _sys_vmsplice /* 345 */
+ .long _sys_epoll_pwait
+ .long _sys_utimensat
+ .long _sys_signalfd
+ .l...

To: Bryan Wu <bryan.wu@...>
Cc: Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 4:18 am

I thought this list seemed a little long, so I investigated a couple
of them. mbind makes sense (it's only implemented for NUMA ... a NUMA
embedded platform? not the kind which runs applications that use mbind),
but mremap doesn't -- there's even an implementation in mm/nommu.c.
Could you check the rest of these over to see if they truly don't need
to be implemented for no-mmu? I think you'll want the *robust_list

--
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."
-

To: Matthew Wilcox <matthew@...>
Cc: Bryan Wu <bryan.wu@...>, Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 4:47 am

There are embedded platforms that are using NUMA memory policies,
including mbind() in applications for setting them. Page migration is a
little iffier, but that can be turned off. Embedded platforms with
multiple memories (and a different cost per memory) are quite common, and
they're getting large enough to offset the overhead of a pgdat + bootmem
map. We have them on nommu also, but that's not been hacked up generically yet.
-

To: Matthew Wilcox <matthew@...>
Cc: Bryan Wu <bryan.wu@...>, Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 4:37 am

sorry, i dont quite follow ... you're saying it does or doesnt make
sense to have NUMA syscalls on a no-mmu platform ? my [limited]
understanding of NUMA is that it, by definition, requires a MMU in

lack of man pages on these made be lazy and dump em into the mmu pile

useful only with SMP so i guess we should do it
-mike
-

To: Mike Frysinger <vapier.adi@...>, <bernd.schmidt@...>
Cc: Matthew Wilcox <matthew@...>, Paul Mundt <lethal@...>, Bryan Wu <bryan.wu@...>, Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 4:57 am

Yes, I do think so, both sys_mremap and sys_munmap are implemented in

No man pages for this fancy syscalls. I found some info here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commi...

also the brand new syscall fallocate should be added as Paul said:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commi...

Thanks a lot
-Bryan

-

To: <bryan.wu@...>
Cc: Mike Frysinger <vapier.adi@...>, <bernd.schmidt@...>, <linux-arch@...>, Matthew Wilcox <matthew@...>, Linux Kernel <linux-kernel@...>, Paul Mundt <lethal@...>, <uclinux-dist-devel@...>, Andrew Morton <akpm@...>
Date: Thursday, September 13, 2007 - 7:03 am

There's a mremap in nommu.c, but it doesn't do a lot that is useful.
With some further mm changes in our tree, it's little more than a fancy
way of saying munmap, and uClibc does not use it, so there's no
compelling need to have it in userspace.

Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
-

To: Bernd Schmidt <bernds_cb1@...>
Cc: <bryan.wu@...>, Mike Frysinger <vapier.adi@...>, <bernd.schmidt@...>, <linux-arch@...>, Matthew Wilcox <matthew@...>, Linux Kernel <linux-kernel@...>, Paul Mundt <lethal@...>, <uclinux-dist-devel@...>, Andrew Morton <akpm@...>
Date: Friday, September 14, 2007 - 1:45 am

Make sense. So currently Blackfin uClinux use the mremap/munmap in
uClibc?

Thanks
-Bryan
-

To: <bryan.wu@...>
Cc: Bernd Schmidt <bernds_cb1@...>, <bernd.schmidt@...>, <linux-arch@...>, Matthew Wilcox <matthew@...>, Linux Kernel <linux-kernel@...>, Paul Mundt <lethal@...>, <uclinux-dist-devel@...>, Andrew Morton <akpm@...>
Date: Friday, September 14, 2007 - 2:44 am

most functions like this dont have any real libc component ... uClibc
will define userspace symbols that merely make a syscall iff the __NR_
exists in the headers

if we have __NR_mremap in our unistd.h, we'll automagically get the
mremap() symbol in uClibc which simply passes along the args to the
kernel
-mike
-

To: Mike Frysinger <vapier.adi@...>
Cc: <bryan.wu@...>, Bernd Schmidt <bernds_cb1@...>, <bernd.schmidt@...>, <linux-arch@...>, Matthew Wilcox <matthew@...>, Linux Kernel <linux-kernel@...>, Paul Mundt <lethal@...>, <uclinux-dist-devel@...>, Andrew Morton <akpm@...>
Date: Friday, September 14, 2007 - 3:32 am

Yes, I know this. But currently, __NR_mremap does not exit in Blackfin
unistd.h:
/* 163 __NR_mremap */.

So the implementation of this kind syscalls should be in uClibc, right?

And Bernd said that the kernel version mremap/munmap is not very useful
for Blackfin arch. I think mremap/munmap can be ignored in Blackfin.

Thanks
-Bryan
-

To: <bryan.wu@...>
Cc: Bernd Schmidt <bernds_cb1@...>, <bernd.schmidt@...>, <linux-arch@...>, Matthew Wilcox <matthew@...>, Linux Kernel <linux-kernel@...>, Paul Mundt <lethal@...>, <uclinux-dist-devel@...>, Andrew Morton <akpm@...>
Date: Friday, September 14, 2007 - 9:28 pm

no ... if the kernel supports it, uClibc supports ... if the kernel
doesnt support, uClibc doesnt support it

adding a ghetto userspace implementation to workaround this is weak
... that'll just mean random bugs may crop up on us that dont exist
for any other architecture simply because we opted not to hook up the
common kernel version

either we support it and have the kernel pull in the common one or we
dont support ... no middle ground here
-mike
-

To: Bryan Wu <bryan.wu@...>
Cc: Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 4:07 am

Err, why did you change __NR_syscall? This is going to break the ABI for
anything using it, which is generally bad form.

You also missed sys_fallocate(), another reason to be using git, rather
than some silly subversion tree ;-)
-

To: Bryan Wu <bryan.wu@...>, Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <uclinux-dist-devel@...>, <linux-arch@...>
Date: Thursday, September 13, 2007 - 4:09 am

I can't read or think today, nevermind. The sys_fallocate() thing still
stands, though.
-

Previous thread: Bad hotplug/scheduler interaction? by Rick Lindsley on Thursday, September 13, 2007 - 3:52 am. (1 message)

Next thread: sata_nv issues with MCP51 SATA controller by Jon Ivar Rykkelid on Thursday, September 13, 2007 - 3:18 am. (2 messages)