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/