All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: N64: Define getdents64
@ 2013-05-21 14:37 Aron Xu
  2013-05-21 18:55 ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: Aron Xu @ 2013-05-21 14:37 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Aron Xu

As a relatively new ABI, N64 only had getdents syscall while other modern
architectures have getdents64.

This was noticed when Python 3.3 shifted to the latter one for aarch64.

Signed-off-by: Aron Xu <aron@debian.org>
---
 arch/mips/include/uapi/asm/unistd.h |    5 +++--
 arch/mips/kernel/scall64-64.S       |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
index 16338b8..1dee279 100644
--- a/arch/mips/include/uapi/asm/unistd.h
+++ b/arch/mips/include/uapi/asm/unistd.h
@@ -694,16 +694,17 @@
 #define __NR_process_vm_writev		(__NR_Linux + 305)
 #define __NR_kcmp			(__NR_Linux + 306)
 #define __NR_finit_module		(__NR_Linux + 307)
+#define __NR_getdents64			(__NR_Linux + 308)
 
 /*
  * Offset of the last Linux 64-bit flavoured syscall
  */
-#define __NR_Linux_syscalls		307
+#define __NR_Linux_syscalls		308
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux			5000
-#define __NR_64_Linux_syscalls		307
+#define __NR_64_Linux_syscalls		308
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 36cfd40..97a5909 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -423,4 +423,5 @@ sys_call_table:
 	PTR	sys_process_vm_writev		/* 5305 */
 	PTR	sys_kcmp
 	PTR	sys_finit_module
+	PTR	sys_getdents64
 	.size	sys_call_table,.-sys_call_table
-- 
1.7.10.4

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

* Re: [PATCH] MIPS: N64: Define getdents64
  2013-05-21 14:37 [PATCH] MIPS: N64: Define getdents64 Aron Xu
@ 2013-05-21 18:55 ` David Daney
  2013-05-22 13:41   ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2013-05-21 18:55 UTC (permalink / raw)
  To: Aron Xu, Ralf Baechle; +Cc: linux-mips

On 05/21/2013 07:37 AM, Aron Xu wrote:
> As a relatively new ABI, N64 only had getdents syscall while other modern
> architectures have getdents64.
>
> This was noticed when Python 3.3 shifted to the latter one for aarch64.
>
> Signed-off-by: Aron Xu <aron@debian.org>

This looks correct to me.  The getdents64 call returns more information 
than getdents (it adds a field for the file type).  So, although in n64 
the widths of the d_ino and d_off fields are the same for getdents64 and 
getdents, we still need to add this syscall.

Acked-by: David Daney <david.daney@cavium.com>

> ---
>   arch/mips/include/uapi/asm/unistd.h |    5 +++--
>   arch/mips/kernel/scall64-64.S       |    1 +
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
> index 16338b8..1dee279 100644
> --- a/arch/mips/include/uapi/asm/unistd.h
> +++ b/arch/mips/include/uapi/asm/unistd.h
> @@ -694,16 +694,17 @@
>   #define __NR_process_vm_writev		(__NR_Linux + 305)
>   #define __NR_kcmp			(__NR_Linux + 306)
>   #define __NR_finit_module		(__NR_Linux + 307)
> +#define __NR_getdents64			(__NR_Linux + 308)
>
>   /*
>    * Offset of the last Linux 64-bit flavoured syscall
>    */
> -#define __NR_Linux_syscalls		307
> +#define __NR_Linux_syscalls		308
>
>   #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
>
>   #define __NR_64_Linux			5000
> -#define __NR_64_Linux_syscalls		307
> +#define __NR_64_Linux_syscalls		308
>
>   #if _MIPS_SIM == _MIPS_SIM_NABI32
>
> diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
> index 36cfd40..97a5909 100644
> --- a/arch/mips/kernel/scall64-64.S
> +++ b/arch/mips/kernel/scall64-64.S
> @@ -423,4 +423,5 @@ sys_call_table:
>   	PTR	sys_process_vm_writev		/* 5305 */
>   	PTR	sys_kcmp
>   	PTR	sys_finit_module
> +	PTR	sys_getdents64
>   	.size	sys_call_table,.-sys_call_table
>

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

* Re: [PATCH] MIPS: N64: Define getdents64
  2013-05-21 18:55 ` David Daney
@ 2013-05-22 13:41   ` Ralf Baechle
  0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2013-05-22 13:41 UTC (permalink / raw)
  To: David Daney; +Cc: Aron Xu, linux-mips

On Tue, May 21, 2013 at 11:55:42AM -0700, David Daney wrote:

> On 05/21/2013 07:37 AM, Aron Xu wrote:
> >As a relatively new ABI, N64 only had getdents syscall while other modern
> >architectures have getdents64.
> >
> >This was noticed when Python 3.3 shifted to the latter one for aarch64.
> >
> >Signed-off-by: Aron Xu <aron@debian.org>
> 
> This looks correct to me.  The getdents64 call returns more
> information than getdents (it adds a field for the file type).  So,
> although in n64 the widths of the d_ino and d_off fields are the
> same for getdents64 and getdents, we still need to add this syscall.
> 
> Acked-by: David Daney <david.daney@cavium.com>

Yes, the patch is looking good but I was really wondering why the other
ABIs had getdents64 wired up but not the native N64, so I started
digging.

Commit 1a1d77dd589de5a567fa95e36aa6999c704ceca4 [Merge with 2.4.0-test7.]
added N64 getdents(2) to arch/mips64/kernel/scall_64.S as syscall 5213,
then dropped again in 578720675c44e54e8aa7c68f6dce59ed37ce3d3b [Overhaul
of the 64-bit syscall interface.  Now heritage free.] for 2.5.18 in 2002.

It took a while to be noticed ;)

Thanks a lot!

  Ralf

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

end of thread, other threads:[~2013-05-22 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21 14:37 [PATCH] MIPS: N64: Define getdents64 Aron Xu
2013-05-21 18:55 ` David Daney
2013-05-22 13:41   ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.