hurd: Fix setting up pthreads
authorSergey Bugaev <bugaevc@gmail.com>
Wed, 17 May 2023 19:14:34 +0000 (22:14 +0300)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 17 May 2023 21:02:08 +0000 (23:02 +0200)
commit70fd6b3b230f58782a196b1075513a24f2376077
treeb4a24d3c3f83d31928655714976af336a56f0d8a
parent2f8ecb58a59eb82c43214d000842d99644a662d1
hurd: Fix setting up pthreads

On x86_64, we have to pass function arguments in registers, not on the
stack. We also have to align the stack pointer in a specific way. Since
sharing the logic with i386 does not bring much benefit, split the file
back into i386- and x86_64-specific versions, and fix the x86_64 version
to set up the thread properly.

Bonus: i386 keeps doing the extra RPC inside __thread_set_pcsptp to
fetch the state of the thread before setting it; but x86_64 no lnoger
does that.

Checked on x86_64-gnu and i686-gnu.

Fixes be6d002ca277ffc90058d382396150cb0e785b9c
"hurd: Set up the basic tree for x86_64-gnu"

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230517191436.73636-9-bugaevc@gmail.com>
sysdeps/mach/hurd/i386/htl/pt-setup.c [moved from sysdeps/mach/hurd/x86/htl/pt-setup.c with 98% similarity]
sysdeps/mach/hurd/x86_64/htl/pt-setup.c [new file with mode: 0644]