git: f69d974bf6d2 - main - sys: centralize SV_* flags definitions for several FreeBSD ABIs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 20 Oct 2026 20:55:25 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=f69d974bf6d2f7ccaa3e6a5f9609cfca0d66ec8d
commit f69d974bf6d2f7ccaa3e6a5f9609cfca0d66ec8d
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-20 17:50:34 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-10-20 20:55:16 +0000
sys: centralize SV_* flags definitions for several FreeBSD ABIs
The omitted ABI is compat32 on arm64, which lacks SV_ASLR.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
---
sys/amd64/amd64/elf_machdep.c | 8 ++------
sys/arm/arm/elf_machdep.c | 4 +---
sys/arm64/arm64/elf_machdep.c | 3 +--
sys/compat/ia32/ia32_sysvec.c | 4 +---
sys/i386/i386/elf_machdep.c | 3 +--
sys/powerpc/powerpc/elf32_machdep.c | 3 +--
sys/powerpc/powerpc/elf64_machdep.c | 6 ++----
sys/riscv/riscv/elf_machdep.c | 3 +--
sys/sys/sysent.h | 3 +++
9 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 933f1ac0051f..8652c4c37cd5 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -78,9 +78,7 @@ struct sysentvec elf64_freebsd_sysvec_la48 = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
- SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG |
- SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_DSO_SIG | SV_LP64,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
@@ -121,9 +119,7 @@ struct sysentvec elf64_freebsd_sysvec_la57 = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
- SV_TIMEKEEP | SV_RNG_SEED_VER | SV_DSO_SIG |
- SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_DSO_SIG | SV_LP64,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c
index cf2add0c367c..fcb86fcb41e0 100644
--- a/sys/arm/arm/elf_machdep.c
+++ b/sys/arm/arm/elf_machdep.c
@@ -84,9 +84,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags =
- SV_ASLR | SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER |
- SV_ABI_FREEBSD | SV_ILP32 | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_ILP32,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c
index 207b37180a26..9e8d781f5ea1 100644
--- a/sys/arm64/arm64/elf_machdep.c
+++ b/sys/arm64/arm64/elf_machdep.c
@@ -99,8 +99,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64 |
- SV_ASLR | SV_RNG_SEED_VER | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c
index b9dada4eee7b..e08b7019620f 100644
--- a/sys/compat/ia32/ia32_sysvec.c
+++ b/sys/compat/ia32/ia32_sysvec.c
@@ -126,9 +126,7 @@ struct sysentvec ia32_freebsd_sysvec = {
.sv_setregs = ia32_setregs,
.sv_fixlimit = ia32_fixlimit,
.sv_maxssiz = &ia32_maxssiz,
- .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_ILP32 |
- SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER |
- SV_DSO_SIG | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_DSO_SIG | SV_ILP32,
.sv_set_syscall_retval = ia32_set_syscall_retval,
.sv_fetch_syscall_args = ia32_fetch_syscall_args,
.sv_syscallnames = freebsd32_syscallnames,
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index 14c942942d08..0876f983668e 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -74,8 +74,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_ILP32 |
- SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_ILP32,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c
index 6b904c02ea15..854d866d578b 100644
--- a/sys/powerpc/powerpc/elf32_machdep.c
+++ b/sys/powerpc/powerpc/elf32_machdep.c
@@ -123,8 +123,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_fixlimit = NULL,
#endif
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_ASLR |
- SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_ILP32,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_shared_page_base = FREEBSD32_SHAREDPAGE,
diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c
index 390c5582aeb6..ade4c0420b4a 100644
--- a/sys/powerpc/powerpc/elf64_machdep.c
+++ b/sys/powerpc/powerpc/elf64_machdep.c
@@ -85,8 +85,7 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
.sv_setregs = exec_setregs_funcdesc,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR |
- SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
@@ -129,8 +128,7 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR |
- SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
diff --git a/sys/riscv/riscv/elf_machdep.c b/sys/riscv/riscv/elf_machdep.c
index b52050e56a14..ace8118c6126 100644
--- a/sys/riscv/riscv/elf_machdep.c
+++ b/sys/riscv/riscv/elf_machdep.c
@@ -82,8 +82,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
- .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_TIMEKEEP |
- SV_ASLR | SV_RNG_SEED_VER | SV_SIGSYS,
+ .sv_flags = SV_ABI_FREEBSD_FLAGS | SV_LP64,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 3589f705255a..fb78342831e1 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -187,6 +187,9 @@ struct sysentvec {
#define SV_ABI_FREEBSD 9
#define SV_ABI_UNDEF 255
+#define SV_ABI_FREEBSD_FLAGS (SV_ABI_FREEBSD | SV_ASLR | SV_SHP | \
+ SV_TIMEKEEP | SV_RNG_SEED_VER | SV_SIGSYS)
+
/* sv_coredump flags */
#define SVC_PT_COREDUMP 0x00000001 /* dump requested by ptrace(2) */
#define SVC_NOCOMPRESS 0x00000002 /* disable compression. */