Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 2024 03:55:57 +0000
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: c29cba408d19 - main - stand: Narrow the 'signal emulation' we provide
Message-ID:  <CBB3C014-A7FB-4758-A77E-AC35ABD88EAD@freebsd.org>
In-Reply-To: <202411200335.4AK3ZnVU099504@gitrepo.freebsd.org>
References:  <202411200335.4AK3ZnVU099504@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20 Nov 2024, at 03:35, Warner Losh <imp@FreeBSD.org> wrote:
>=20
> The branch main has been updated by imp:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dc29cba408d197ed2c267d0605e4225bb=
54153e01
>=20
> commit c29cba408d197ed2c267d0605e4225bb54153e01
> Author:     Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-11-20 03:05:11 +0000
> Commit:     Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-11-20 03:24:41 +0000
>=20
>    stand: Narrow the 'signal emulation' we provide
>=20
>    We only need to provide sig_atomic_t in emulation. However, =
including
>    machine/signal.h brings in too much namespace pollution related to
>    signals. Instead, define sig_atomic_t as long. Setting long is =
async
>    atomic on all platforms (though powerpc64 defines it to an int), =
though
>    that doesn't matter since the boot loader doesn't use signals.
>=20
>    Sponsored by:           Netflix
> ---
> stand/libsa/stand.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>=20
> diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h
> index 260defa3a33d..e1188fb73a26 100644
> --- a/stand/libsa/stand.h
> +++ b/stand/libsa/stand.h
> @@ -82,8 +82,13 @@
> #define EOFFSET (ELAST+8) /* relative seek not supported */
> #define ESALAST (ELAST+8) /* */
>=20
> -/* Partial signal emulation for sig_atomic_t */
> -#include <machine/signal.h>
> +/*
> + * LUA needs sig_atomic_t. This is defined to be long or int on all =
our
> + * platforms. On all but powerpc, these are all the same thing as =
long. 64-bit
> + * powerpc defines this as int, but long can also be accessed =
atomically. It's
> + * also OK because we don't have signal handlers in the boot loader.
> + */

Presumably an oversight when adding the powerpc64* ports :( Probably we
should fix this by taking advantage of being able to break ABI for tier
2 architectures between major versions. Shame it wasn=E2=80=99t done the =
same
time as ELFv1 -> ELFv2. We fixed riscv and arm64=E2=80=99s =
SIG_ATOMIC_MIN/MAX
recently, but the underlying types were still long in that case,
thankfully.

Jess

> +typedef long sig_atomic_t;
>=20
> __BEGIN_DECLS
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CBB3C014-A7FB-4758-A77E-AC35ABD88EAD>