hurd: Fix setting up signal thread stack alignment

x86_64 needs special alignment when calling functions, so we have to use
MACHINE_THREAD_STATE_SETUP_CALL for the signal thread when forking.
This commit is contained in:
Samuel Thibault 2023-05-28 00:29:14 +02:00
parent 0660ab264f
commit 9ffdcf5b79

View File

@ -481,13 +481,11 @@ retry:
MACHINE_THREAD_STATE_FLAVOR,
(natural_t *) &state, &statecount))
LOSE;
#ifdef STACK_GROWTH_UP
state.SP = __hurd_sigthread_stack_base;
#else
state.SP = __hurd_sigthread_stack_end;
#endif
MACHINE_THREAD_STATE_SET_PC (&state,
(unsigned long int) _hurd_msgport_receive);
MACHINE_THREAD_STATE_SETUP_CALL(&state,
__hurd_sigthread_stack_base,
__hurd_sigthread_stack_end - __hurd_sigthread_stack_base,
(uintptr_t) _hurd_msgport_receive);
/* Do special signal thread setup for TLS if needed. */
if (err = _hurd_tls_fork (sigthread, _hurd_msgport_thread, &state))