From: Paul Floyd Date: Wed, 8 May 2024 12:01:09 +0000 (+0200) Subject: FreeBSD: add support for FreeBSD 14.1 X-Git-Tag: VALGRIND_3_24_0~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba7289627903bce049feb7c18f38683f8be0433a;p=thirdparty%2Fvalgrind.git FreeBSD: add support for FreeBSD 14.1 Just one extra syscall that I can see. --- diff --git a/configure.ac b/configure.ac index 46efdc759..22be6e59b 100755 --- a/configure.ac +++ b/configure.ac @@ -415,8 +415,10 @@ case "${host_os}" in freebsd_13_2=1320 AC_DEFINE([FREEBSD_13_3], 1330, [FREEBSD_VERS value for FreeBSD 13.3]) freebsd_13_3=1330 - AC_DEFINE([FREEBSD_14], 1400, [FREEBSD_VERS value for FreeBSD 14.x]) + AC_DEFINE([FREEBSD_14], 1400, [FREEBSD_VERS value for FreeBSD 14.0]) freebsd_14=1400 + AC_DEFINE([FREEBSD_14_1], 1410, [FREEBSD_VERS value for FreeBSD 14.1]) + freebsd_14_1=1410 AC_DEFINE([FREEBSD_15], 1500, [FREEBSD_VERS value for FreeBSD 15.x]) freebsd_15=1500 @@ -477,9 +479,22 @@ case "${host_os}" in esac ;; 14.*) - AC_MSG_RESULT([FreeBSD 14.x (${kernel})]) - AC_DEFINE([FREEBSD_VERS], FREEBSD_14, [FreeBSD version]) - freebsd_vers=$freebsd_14 + case "${kernel}" in + 14.0-*) + AC_MSG_RESULT([FreeBSD 14.0 (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_14_0, [FreeBSD version]) + freebsd_vers=$freebsd_14_0 + ;; + 14.1-*) + AC_MSG_RESULT([FreeBSD 14.1 (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_14_1, [FreeBSD version]) + freebsd_vers=$freebsd_14_1 + ;; + *) + AC_MSG_RESULT([unsupported (${kernel})]) + AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 15.x]) + ;; + esac ;; 15.*) AC_MSG_RESULT([FreeBSD 15.x (${kernel})]) diff --git a/coregrind/m_syswrap/priv_syswrap-freebsd.h b/coregrind/m_syswrap/priv_syswrap-freebsd.h index ed0889d20..9efba4566 100644 --- a/coregrind/m_syswrap/priv_syswrap-freebsd.h +++ b/coregrind/m_syswrap/priv_syswrap-freebsd.h @@ -569,12 +569,14 @@ DECL_TEMPLATE(freebsd, sys_kqueuex) // 583 DECL_TEMPLATE(freebsd, sys_membarrier) // 584 #endif -#if (FREEBSD_VERS >= FREEBSD_15) +#if (FREEBSD_VERS >= FREEBSD_14) DECL_TEMPLATE(freebsd, sys_timerfd_create) // 585 DECL_TEMPLATE(freebsd, sys_timerfd_gettime) // 586 DECL_TEMPLATE(freebsd, sys_timerfd_settime) // 587 +#if (FREEBSD_VERS >= FREEBSD_14_1) DECL_TEMPLATE(freebsd, sys_kcmp) // 588 #endif +#endif DECL_TEMPLATE(freebsd, sys_fake_sigreturn) diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 51c562346..730e1de3f 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -7106,7 +7106,7 @@ PRE(sys_membarrier) #endif -#if (FREEBSD_VERS >= FREEBSD_15) +#if (FREEBSD_VERS >= FREEBSD_14) // SYS_timerfd_create 585 // int timerfd_create(int clockid, int flags); @@ -7181,6 +7181,8 @@ POST(sys_timerfd_settime) } } +#if (FREEBSD_VERS >= FREEBSD_14_1) + // SYS_kcmp 588 // int kcmp(pid_t pid1, pid_t pid2, int type, uintptr_t idx1, uintptr_t idx2); PRE(sys_kcmp) @@ -7205,8 +7207,10 @@ PRE(sys_kcmp) } } +#endif // FREEBSD_14_1 -#endif + +#endif // FREEBSD_14 #undef PRE #undef POST @@ -7937,12 +7941,14 @@ const SyscallTableEntry ML_(syscall_table)[] = { BSDXY(__NR_kqueuex, sys_kqueuex), // 583 BSDX_(__NR_membarrier, sys_membarrier), // 584 #endif -#if (FREEBSD_VERS >= FREEBSD_15) +#if (FREEBSD_VERS >= FREEBSD_14) BSDXY(__NR_timerfd_create, sys_timerfd_create), // 585 BSDXY(__NR_timerfd_settime, sys_timerfd_settime), // 586 BSDXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 587 +#if (FREEBSD_VERS >= FREEBSD_14_1) BSDX_(__NR_kcmp, sys_kcmp), // 588 #endif +#endif BSDX_(__NR_fake_sigreturn, sys_fake_sigreturn), // 1000, fake sigreturn diff --git a/include/vki/vki-scnums-freebsd.h b/include/vki/vki-scnums-freebsd.h index 967cd7835..f9ec98ab1 100644 --- a/include/vki/vki-scnums-freebsd.h +++ b/include/vki/vki-scnums-freebsd.h @@ -683,11 +683,13 @@ #endif -#if (FREEBSD_VERS >= FREEBSD_15) +#if (FREEBSD_VERS >= FREEBSD_14) #define __NR_timerfd_create 585 #define __NR_timerfd_gettime 586 #define __NR_timerfd_settime 587 +#if (FREEBSD_VERS >= FREEBSD_14_1) #define __NR_kcmp 588 +#endif #endif