All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] syscall.2: Update superh syscall convention
@ 2020-12-22 12:28 Peter Fröhlich
  2020-12-22 12:33 ` Alejandro Colomar (man-pages)
  2020-12-22 17:16 ` Michael Kerrisk (man-pages)
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Fröhlich @ 2020-12-22 12:28 UTC (permalink / raw)
  To: alx.manpages; +Cc: mtk.manpages, linux-man

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

I noticed this while working on some silly "hello, world" programs,
see https://git.sr.ht/~phf/hello-again if you're curious.
Disassembling sh4 code showed trap #31 all over the place but the
syscall(2) man page talked about trap #0x17 and friends. Checking the
kernel sources I got lucky in arch/sh/kernel/entry-common.S where in
commit 3623d138213ae Rich Felker clarifies the situation. (I would
have cc'ed Rich but I cannot find his email.) I've attached the patch
since I am less than convinced that gmail will properly preserve it
inline.

---
 man2/syscall.2 | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/man2/syscall.2 b/man2/syscall.2
index 986db9d11..87de539dd 100644
--- a/man2/syscall.2
+++ b/man2/syscall.2
@@ -216,7 +216,7 @@ powerpc64    sc    r0    r3    -    cr0.SO    1
 riscv    ecall    a7    a0    a1    -
 s390    svc 0    r1    r2    r3    -    3
 s390x    svc 0    r1    r2    r3    -    3
-superh    trap #0x17    r3    r0    r1    -    4, 6
+superh    trapa #31    r3    r0    r1    -    4, 6
 sparc/32    t 0x10    g1    o0    o1    psr/csr    1, 6
 sparc/64    t 0x6d    g1    o0    o1    psr/csr    1, 6
 tile    swint1    R10    R00    -    R01    1
@@ -252,15 +252,9 @@ For s390 and s390x,
 .I "svc\ NR"
 if it is less than 256.
 .IP [4]
-On SuperH, the trap number controls the maximum number of arguments passed.
-A
-.IR "trap\ #0x10"
-can be used with only 0-argument system calls, a
-.IR "trap\ #0x11"
-can be used with 0- or 1-argument system calls,
-and so on up to
-.IR "trap #0x17"
-for 7-argument system calls.
+On SuperH additional trap numbers are supported for historic reasons, but
+.BR trapa #31
+is the recommended "unified" ABI.
 .IP [5]
 The x32 ABI shares syscall table with x86-64 ABI, but there are some
 nuances:
-- 
2.25.1

[-- Attachment #2: 0001-syscall.2-Update-superh-syscall-convention.patch --]
[-- Type: text/x-patch, Size: 1342 bytes --]

From 63eba0211bfb04747839f4af4c144095637a1e0d Mon Sep 17 00:00:00 2001
From: "Peter H. Froehlich" <peter.hans.froehlich@gmail.com>
Date: Tue, 22 Dec 2020 13:20:53 +0100
Subject: [PATCH] syscall.2: Update superh syscall convention.

---
 man2/syscall.2 | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/man2/syscall.2 b/man2/syscall.2
index 986db9d11..87de539dd 100644
--- a/man2/syscall.2
+++ b/man2/syscall.2
@@ -216,7 +216,7 @@ powerpc64	sc	r0	r3	-	cr0.SO	1
 riscv	ecall	a7	a0	a1	-
 s390	svc 0	r1	r2	r3	-	3
 s390x	svc 0	r1	r2	r3	-	3
-superh	trap #0x17	r3	r0	r1	-	4, 6
+superh	trapa #31	r3	r0	r1	-	4, 6
 sparc/32	t 0x10	g1	o0	o1	psr/csr	1, 6
 sparc/64	t 0x6d	g1	o0	o1	psr/csr	1, 6
 tile	swint1	R10	R00	-	R01	1
@@ -252,15 +252,9 @@ For s390 and s390x,
 .I "svc\ NR"
 if it is less than 256.
 .IP [4]
-On SuperH, the trap number controls the maximum number of arguments passed.
-A
-.IR "trap\ #0x10"
-can be used with only 0-argument system calls, a
-.IR "trap\ #0x11"
-can be used with 0- or 1-argument system calls,
-and so on up to
-.IR "trap #0x17"
-for 7-argument system calls.
+On SuperH additional trap numbers are supported for historic reasons, but
+.BR trapa #31
+is the recommended "unified" ABI.
 .IP [5]
 The x32 ABI shares syscall table with x86-64 ABI, but there are some
 nuances:
-- 
2.25.1


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

* Re: [patch] syscall.2: Update superh syscall convention
  2020-12-22 12:28 [patch] syscall.2: Update superh syscall convention Peter Fröhlich
@ 2020-12-22 12:33 ` Alejandro Colomar (man-pages)
  2020-12-22 17:16 ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 3+ messages in thread
From: Alejandro Colomar (man-pages) @ 2020-12-22 12:33 UTC (permalink / raw)
  To: Peter Fröhlich, Rich Felker; +Cc: mtk.manpages, linux-man

Hi Peter,

I found Rich's email on the lkml archives.

Thanks,

Alex

On 12/22/20 1:28 PM, Peter Fröhlich wrote:
> I noticed this while working on some silly "hello, world" programs,
> see https://git.sr.ht/~phf/hello-again if you're curious.
> Disassembling sh4 code showed trap #31 all over the place but the
> syscall(2) man page talked about trap #0x17 and friends. Checking the
> kernel sources I got lucky in arch/sh/kernel/entry-common.S where in
> commit 3623d138213ae Rich Felker clarifies the situation. (I would
> have cc'ed Rich but I cannot find his email.) I've attached the patch
> since I am less than convinced that gmail will properly preserve it
> inline.
> 
> ---
>  man2/syscall.2 | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/man2/syscall.2 b/man2/syscall.2
> index 986db9d11..87de539dd 100644
> --- a/man2/syscall.2
> +++ b/man2/syscall.2
> @@ -216,7 +216,7 @@ powerpc64    sc    r0    r3    -    cr0.SO    1
>  riscv    ecall    a7    a0    a1    -
>  s390    svc 0    r1    r2    r3    -    3
>  s390x    svc 0    r1    r2    r3    -    3
> -superh    trap #0x17    r3    r0    r1    -    4, 6
> +superh    trapa #31    r3    r0    r1    -    4, 6
>  sparc/32    t 0x10    g1    o0    o1    psr/csr    1, 6
>  sparc/64    t 0x6d    g1    o0    o1    psr/csr    1, 6
>  tile    swint1    R10    R00    -    R01    1
> @@ -252,15 +252,9 @@ For s390 and s390x,
>  .I "svc\ NR"
>  if it is less than 256.
>  .IP [4]
> -On SuperH, the trap number controls the maximum number of arguments passed.
> -A
> -.IR "trap\ #0x10"
> -can be used with only 0-argument system calls, a
> -.IR "trap\ #0x11"
> -can be used with 0- or 1-argument system calls,
> -and so on up to
> -.IR "trap #0x17"
> -for 7-argument system calls.
> +On SuperH additional trap numbers are supported for historic reasons, but
> +.BR trapa #31
> +is the recommended "unified" ABI.
>  .IP [5]
>  The x32 ABI shares syscall table with x86-64 ABI, but there are some
>  nuances:
> 

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

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

* Re: [patch] syscall.2: Update superh syscall convention
  2020-12-22 12:28 [patch] syscall.2: Update superh syscall convention Peter Fröhlich
  2020-12-22 12:33 ` Alejandro Colomar (man-pages)
@ 2020-12-22 17:16 ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-12-22 17:16 UTC (permalink / raw)
  To: Peter Fröhlich, alx.manpages; +Cc: mtk.manpages, linux-man

On 12/22/20 1:28 PM, Peter Fröhlich wrote:
> I noticed this while working on some silly "hello, world" programs,
> see https://git.sr.ht/~phf/hello-again if you're curious.
> Disassembling sh4 code showed trap #31 all over the place but the
> syscall(2) man page talked about trap #0x17 and friends. Checking the
> kernel sources I got lucky in arch/sh/kernel/entry-common.S where in
> commit 3623d138213ae Rich Felker clarifies the situation. (I would
> have cc'ed Rich but I cannot find his email.) I've attached the patch
> since I am less than convinced that gmail will properly preserve it
> inline.

Thanks, Peter. Patch applied.

Cheers,

Michael


> ---
>  man2/syscall.2 | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/man2/syscall.2 b/man2/syscall.2
> index 986db9d11..87de539dd 100644
> --- a/man2/syscall.2
> +++ b/man2/syscall.2
> @@ -216,7 +216,7 @@ powerpc64    sc    r0    r3    -    cr0.SO    1
>  riscv    ecall    a7    a0    a1    -
>  s390    svc 0    r1    r2    r3    -    3
>  s390x    svc 0    r1    r2    r3    -    3
> -superh    trap #0x17    r3    r0    r1    -    4, 6
> +superh    trapa #31    r3    r0    r1    -    4, 6
>  sparc/32    t 0x10    g1    o0    o1    psr/csr    1, 6
>  sparc/64    t 0x6d    g1    o0    o1    psr/csr    1, 6
>  tile    swint1    R10    R00    -    R01    1
> @@ -252,15 +252,9 @@ For s390 and s390x,
>  .I "svc\ NR"
>  if it is less than 256.
>  .IP [4]
> -On SuperH, the trap number controls the maximum number of arguments passed.
> -A
> -.IR "trap\ #0x10"
> -can be used with only 0-argument system calls, a
> -.IR "trap\ #0x11"
> -can be used with 0- or 1-argument system calls,
> -and so on up to
> -.IR "trap #0x17"
> -for 7-argument system calls.
> +On SuperH additional trap numbers are supported for historic reasons, but
> +.BR trapa #31
> +is the recommended "unified" ABI.
>  .IP [5]
>  The x32 ABI shares syscall table with x86-64 ABI, but there are some
>  nuances:
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

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

end of thread, other threads:[~2020-12-22 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 12:28 [patch] syscall.2: Update superh syscall convention Peter Fröhlich
2020-12-22 12:33 ` Alejandro Colomar (man-pages)
2020-12-22 17:16 ` Michael Kerrisk (man-pages)

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.