FEATURE compat_freebsd_32bit: only report on arm64 when support is present

depending on hardware support for aarch32.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42641
This commit is contained in:
Konstantin Belousov 2023-11-16 23:06:36 +02:00
parent 46f3a29ee1
commit 5a2bbacea5
3 changed files with 16 additions and 1 deletions

View file

@ -160,6 +160,8 @@ register_elf32_brand(void *arg)
if (ID_AA64PFR0_EL0_VAL(READ_SPECIALREG(id_aa64pfr0_el1)) ==
ID_AA64PFR0_EL0_64_32) {
elf32_insert_brand_entry(&freebsd32_brand_info);
} else {
compat_freebsd_32bit = 0;
}
}
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, register_elf32_brand, NULL);

View file

@ -123,7 +123,18 @@
#include <compat/freebsd32/freebsd32_signal.h>
#include <compat/freebsd32/freebsd32_proto.h>
FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD");
int compat_freebsd_32bit = 1;
static void
register_compat32_feature(void *arg)
{
if (!compat_freebsd_32bit)
return;
FEATURE_ADD("compat_freebsd_32bit", "Compatible with 32-bit FreeBSD");
}
SYSINIT(freebsd32, SI_SUB_EXEC, SI_ORDER_ANY, register_compat32_feature,
NULL);
struct ptrace_io_desc32 {
int piod_op;

View file

@ -122,4 +122,6 @@ struct image_args;
int freebsd32_exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, uint32_t *argv, uint32_t *envv);
extern int compat_freebsd_32bit;
#endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */