]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 480052 - WARNING: unhandled amd64-freebsd syscall: 580
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 20 Jan 2024 20:14:37 +0000 (21:14 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 20 Jan 2024 20:14:37 +0000 (21:14 +0100)
NEWS
coregrind/m_syswrap/priv_syswrap-freebsd.h
coregrind/m_syswrap/syswrap-freebsd.c
include/vki/vki-freebsd.h
include/vki/vki-scnums-freebsd.h

diff --git a/NEWS b/NEWS
index 864c078143a3306167a29553597e8f80eeca1049..1aaea801141d4b3c34a2297d7485aed0c17356c3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
         (unhandled instruction bytes: 0x2E 0x8D 0xB4 0x26
 478837  valgrind fails to read debug info for rust binaries
 479041  Executables without RW sections do not trigger debuginfo reading
+480052  WARNING: unhandled amd64-freebsd syscall: 580
 n-i-bz  Add redirect for memccpy
 
 To see details of a given bug, visit
index 30b90ca37fe733d3d9fb9ef94ea644c5102c232a..f40e3c7d2fed57aaca707dc7a5adb47502066a25 100644 (file)
@@ -556,17 +556,20 @@ DECL_TEMPLATE(freebsd, sys_aio_readv)   // 579
 
 #if (FREEBSD_VERS >= FREEBSD_13_1)
 
-// unimpl __NR_fspacectl           580
+#if (FREEBSD_VERS >= FREEBSD_14)
+// there was a hole in the numbering
+DECL_TEMPLATE(freebsd, sys_fspacectl) // 580
+#endif
 // unimpl __NR_sched_getcpu        581
 DECL_TEMPLATE(freebsd, sys_swapoff) // 582
 #endif
 
 #if (FREEBSD_VERS >= FREEBSD_15)
-DECL_TEMPLATE(freebsd, sys_kqueuex); // 583
-DECL_TEMPLATE(freebsd, sys_membarrier); // 584
-DECL_TEMPLATE(freebsd, sys_timerfd_create); // 585
-DECL_TEMPLATE(freebsd, sys_timerfd_gettime); // 586
-DECL_TEMPLATE(freebsd, sys_timerfd_settime); // 587
+DECL_TEMPLATE(freebsd, sys_kqueuex) // 583
+DECL_TEMPLATE(freebsd, sys_membarrier) // 584
+DECL_TEMPLATE(freebsd, sys_timerfd_create) // 585
+DECL_TEMPLATE(freebsd, sys_timerfd_gettime) // 586
+DECL_TEMPLATE(freebsd, sys_timerfd_settime) // 587
 #endif
 
 DECL_TEMPLATE(freebsd, sys_fake_sigreturn)
index c2435f6adb1eb3c27ac932db1224422122deea3b..bfb1cf876e8cc798e999751f240a0e5f0577fde3 100644 (file)
@@ -6985,6 +6985,28 @@ POST(sys_aio_readv)
 
 #if (FREEBSD_VERS >= FREEBSD_13_1)
 
+#if (FREEBSD_VERS >= FREEBSD_14)
+// SYS_fspacectl 580
+// int fspacectl(int fd, int cmd, const struct spacectl_range *rqsr, int flags,
+//     struct spacectl_range *rmsr);
+PRE(sys_fspacectl)
+{
+   PRINT("fspacectl ( %" FMT_REGWORD "d, %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %#" FMT_REGWORD "x )", SARG1, SARG2, ARG3, SARG4, ARG5);
+   PRE_REG_READ5(int, "fspacectl", int, fd, int, cmd, const struct spacectl_range *, rqsr, int, flags, struct spacectl_range *, rmsr);
+   PRE_MEM_READ("fspacectl(rqsr)", (Addr)ARG3, sizeof(struct vki_spacectl_range));
+   if (ARG5) {
+      PRE_MEM_WRITE("fspacectl(rmsr)", (Addr)ARG5, sizeof(struct vki_spacectl_range));
+   }
+}
+
+POST(sys_fspacectl)
+{
+   if (ARG5) {
+      POST_MEM_WRITE((Addr)ARG5, sizeof(struct vki_spacectl_range));
+   }
+}
+#endif
+
 // SYS_swapoff 582
 // int swapoff(const char *special, u_int flags);
 PRE(sys_swapoff)
@@ -7817,7 +7839,10 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 #endif
 
 #if (FREEBSD_VERS >= FREEBSD_13_1)
-   // unimpl __NR_fspacectl           580
+
+#if (FREEBSD_VERS >= FREEBSD_14)
+   BSDXY(__NR_fspacectl,        sys_fspacectl),        //  580
+#endif
    // unimpl __NR_sched_getcpu        581
    BSDX_(__NR_swapoff,          sys_swapoff),           // 582
 #endif
index a7fed64339c7918e45fb608681069d3bc90a440a..d19c8de0184dc81b5bc7618b682de36b04118083 100644 (file)
@@ -1593,6 +1593,12 @@ struct vki_dirent {
 #define VKI_F_SEAL_GROW    0x0004
 #define VKI_F_SEAL_WRITE   0x0008
 
+struct vki_spacectl_range {
+   vki_off_t   r_offset;
+   vki_off_t   r_len;
+};
+
+
 //----------------------------------------------------------------------
 // From sys/unistd.h
 //----------------------------------------------------------------------
index 0b68383383c1e20a83225f7294228312f1760c1a..1be22fa5016a571d2b37d2d30cf1a26f3c24cd10 100644 (file)
 
 #if (FREEBSD_VERS >= FREEBSD_13_1)
 
+#if (FREEBSD_VERS >= FREEBSD_14)
 #define __NR_fspacectl           580
+#endif
 #define __NR_sched_getcpu        581
 #define __NR_swapoff             582