]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 481874 - Add arm64 support for FreeBSD
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 16 Apr 2024 05:39:33 +0000 (07:39 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 16 Apr 2024 05:39:33 +0000 (07:39 +0200)
89 files changed:
Makefile.all.am
Makefile.tool.am
NEWS
VEX/auxprogs/genoffsets.c
VEX/priv/guest_arm64_defs.h
VEX/priv/guest_arm64_helpers.c
VEX/pub/libvex_guest_amd64.h
VEX/pub/libvex_guest_arm64.h
configure.ac
coregrind/Makefile.am
coregrind/launcher-freebsd.c
coregrind/m_aspacemgr/aspacemgr-common.c
coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_coredump/coredump-elf.c
coregrind/m_debuginfo/d3basics.c
coregrind/m_debuginfo/debuginfo.c
coregrind/m_debuginfo/readdwarf.c
coregrind/m_debuginfo/readelf.c
coregrind/m_debuglog.c
coregrind/m_dispatch/dispatch-arm64-freebsd.S [new file with mode: 0644]
coregrind/m_initimg/initimg-freebsd.c
coregrind/m_libcassert.c
coregrind/m_libcfile.c
coregrind/m_libcproc.c
coregrind/m_libcsetjmp.c
coregrind/m_machine.c
coregrind/m_main.c
coregrind/m_redir.c
coregrind/m_scheduler/scheduler.c
coregrind/m_sigframe/sigframe-arm64-freebsd.c [new file with mode: 0644]
coregrind/m_signals.c
coregrind/m_stacktrace.c
coregrind/m_syscall.c
coregrind/m_syswrap/priv_types_n_macros.h
coregrind/m_syswrap/syscall-arm64-freebsd.S [new file with mode: 0644]
coregrind/m_syswrap/syswrap-arm64-freebsd.c [new file with mode: 0644]
coregrind/m_syswrap/syswrap-freebsd.c
coregrind/m_syswrap/syswrap-main.c
coregrind/m_trampoline.S
coregrind/m_translate.c
coregrind/pub_core_machine.h
coregrind/pub_core_mallocfree.h
coregrind/pub_core_syscall.h
coregrind/pub_core_trampoline.h
coregrind/vgdb-invoker-freebsd.c
freebsd-drd.supp
freebsd-helgrind.supp
freebsd.supp
gdbserver_tests/mcsignopass.stderr.exp
gdbserver_tests/mcsignopass.stdoutB.exp
gdbserver_tests/mcsigpass.stderr.exp
gdbserver_tests/mcsigpass.stdoutB.exp
helgrind/tests/tc07_hbl1.c
helgrind/tests/tc08_hbl2.c
helgrind/tests/tc11_XCHG.c
include/Makefile.am
include/pub_tool_libcsetjmp.h
include/pub_tool_machine.h
include/pub_tool_vkiscnums_asm.h
include/valgrind.h.in
include/vki/vki-arm64-freebsd.h [new file with mode: 0644]
include/vki/vki-freebsd.h
include/vki/vki-machine-types-arm64-freebsd.h [new file with mode: 0644]
massif/tests/Makefile.am
massif/tests/pages_as_heap.vgtest
memcheck/tests/Makefile.am
memcheck/tests/brk2.vgtest
memcheck/tests/freebsd/Makefile.am
memcheck/tests/freebsd/filter_context
memcheck/tests/freebsd/filter_realpathat
memcheck/tests/freebsd/get_set_context.c
memcheck/tests/freebsd/get_set_context.stderr.exp
memcheck/tests/freebsd/realpathat.stderr.exp
memcheck/tests/freebsd/scalar.c
memcheck/tests/freebsd/scalar.stderr.exp-arm64 [new file with mode: 0644]
memcheck/tests/leak-segv-jmp.c
memcheck/tests/leak-segv-jmp.stderr.exp
memcheck/tests/leak.h
memcheck/tests/overlap.stderr.exp-no_memcpy [new file with mode: 0644]
none/tests/arm64/Makefile.am
none/tests/arm64/filter_nan [new file with mode: 0755]
none/tests/arm64/fmadd_sub.c
none/tests/arm64/fp_and_simd.vgtest
none/tests/faultstatus.c
none/tests/freebsd/Makefile.am
none/tests/freebsd/auxv.stderr.exp-arm64 [new file with mode: 0644]
shared/vg_replace_strmem.c
tests/arch_test.c
tests/arm64_features.c

index 7cb7e87256443c80e903ec2ba4b790f2ccf15a1c..dcea2690ebcb019b06491cb4cc99d6cb01bd0bf0 100755 (executable)
@@ -250,6 +250,9 @@ AM_CFLAGS_AMD64_FREEBSD     = @FLAG_M64@ \
 AM_CFLAGS_PSO_AMD64_FREEBSD = @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
 AM_CCASFLAGS_AMD64_FREEBSD  = @FLAG_M64@ -g
 
+AM_CFLAGS_ARM64_FREEBSD    = @FLAG_M64@ $(AM_CFLAGS_BASE)
+AM_CFLAGS_PSO_ARM64_FREEBSD= @FLAG_M64@ $(AM_CFLAGS_BASE) $(AM_CFLAGS_PSO_BASE)
+AM_CCASFLAGS_ARM64_FREEBSD = @FLAG_M64@ -g
 
 AM_FLAG_M3264_X86_DARWIN = -arch i386
 AM_CFLAGS_X86_DARWIN     = $(WERROR) -arch i386 $(AM_CFLAGS_BASE) \
@@ -340,8 +343,9 @@ PRELOAD_LDFLAGS_PPC64BE_LINUX  = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
 PRELOAD_LDFLAGS_PPC64LE_LINUX  = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
 PRELOAD_LDFLAGS_ARM_LINUX      = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
 PRELOAD_LDFLAGS_ARM64_LINUX    = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
-PRELOAD_LDFLAGS_X86_FREEBSD  = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@
-PRELOAD_LDFLAGS_AMD64_FREEBSD= $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
+PRELOAD_LDFLAGS_X86_FREEBSD    = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@
+PRELOAD_LDFLAGS_AMD64_FREEBSD  = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
+PRELOAD_LDFLAGS_ARM64_FREEBSD  = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
 PRELOAD_LDFLAGS_X86_DARWIN     = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386
 PRELOAD_LDFLAGS_AMD64_DARWIN   = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64
 PRELOAD_LDFLAGS_S390X_LINUX    = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
index 8923ea6ab4c049cd11df36a82e6f64b930ef3504..c779596e714df802187cd35bd9494c32515b84c2 100644 (file)
@@ -85,6 +85,9 @@ TOOL_LDFLAGS_ARM_LINUX = \
 TOOL_LDFLAGS_ARM64_LINUX = \
        $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
 
+TOOL_LDFLAGS_ARM64_FREEBSD = \
+       $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
+
 TOOL_LDFLAGS_S390X_LINUX = \
        $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ @FLAG_S390_PGSTE@
 
@@ -160,6 +163,9 @@ LIBREPLACEMALLOC_ARM64_LINUX = \
 LIBREPLACEMALLOC_AMD64_FREEBSD = \
        $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-freebsd.a
 
+LIBREPLACEMALLOC_ARM64_FREEBSD = \
+       $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-freebsd.a
+
 LIBREPLACEMALLOC_X86_DARWIN = \
        $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
 
@@ -226,6 +232,11 @@ LIBREPLACEMALLOC_LDFLAGS_AMD64_FREEBSD = \
        $(LIBREPLACEMALLOC_AMD64_FREEBSD) \
        -Wl,--no-whole-archive
 
+LIBREPLACEMALLOC_LDFLAGS_ARM64_FREEBSD = \
+       -Wl,--whole-archive \
+       $(LIBREPLACEMALLOC_ARM64_FREEBSD) \
+       -Wl,--no-whole-archive
+
 LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
        $(LIBREPLACEMALLOC_X86_DARWIN)
 
diff --git a/NEWS b/NEWS
index 66449f2359e0448a3fae3a38659d7fe119ae7cb3..dcca47cd3de9888e006866edf90d384c0f32fa98 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,8 +4,8 @@ Release 3.23.0 (?? Apr 2024)
 This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux,
 PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux,
 MIPS64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android,
-X86/Solaris, AMD64/Solaris, AMD64/MacOSX 10.12, X86/FreeBSD and
-AMD64/FreeBSD.  There is also preliminary support for X86/macOS 10.13,
+X86/Solaris, AMD64/Solaris, AMD64/MacOSX 10.12, X86/FreeBSD, AMD64/FreeBSD
+and ARM64/FreeBSD  There is also preliminary support for X86/macOS 10.13,
 AMD64/macOS 10.13 and nanoMIPS/Linux.
 
 * ==================== CORE CHANGES ===================
@@ -24,6 +24,8 @@ AMD64/macOS 10.13 and nanoMIPS/Linux.
 
 * ================== PLATFORM CHANGES =================
 
+Added ARM64 support for FreeBSD.
+
 * ==================== TOOL CHANGES ===================
 
 * ==================== FIXED BUGS ====================
@@ -84,6 +86,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 481127  amd64: Implement VFMADD213 for Iop_MAddF32
 481131  [PATCH] x86 regtest: fix clobber lists in generated asm statements
 481676  Build failure on Raspberry Pi 5 Ubuntu 23.10 with clang
+481874  Add arm64 support for FreeBSD
 483786  Incorrect parameter indexing in FreeBSD clock_nanosleep syscall wrapper
 484002  Add suppression for invalid read in glibc's __wcpncpy_avx2() via wcsxfrm()
 484426  aarch64: 0.5 gets rounded to 0
index 81cf77e417ea5c70a6296d92c6ebd02630064256..6b70cd087d351ebf4dfb4f3d9473262bc6fc76e2 100644 (file)
@@ -173,6 +173,7 @@ void foo ( void )
    GENOFFSET(ARM64,arm64,X8);
    GENOFFSET(ARM64,arm64,XSP);
    GENOFFSET(ARM64,arm64,PC);
+   GENOFFSET(ARM64,arm64,SETC);
 
    // s390x
    GENOFFSET(S390X,s390x,r2);
index a8d1685510908483c965655d0c71051f363c9989..0aa9f783dbc3969c11ced7ca97ba2ac0ef19945a 100644 (file)
@@ -180,7 +180,7 @@ void arm64g_dirtyhelper_SHA256SU1 ( /*OUT*/V128* res, ULong dHi, ULong dLo,
 //ZZ 
 //ZZ #define ARMG_CC_MASK_N    (1 << ARMG_CC_SHIFT_N)
 //ZZ #define ARMG_CC_MASK_Z    (1 << ARMG_CC_SHIFT_Z)
-//ZZ #define ARMG_CC_MASK_C    (1 << ARMG_CC_SHIFT_C)
+#define ARM64G_CC_MASK_C    (1 << ARM64G_CC_SHIFT_C)
 //ZZ #define ARMG_CC_MASK_V    (1 << ARMG_CC_SHIFT_V)
 //ZZ #define ARMG_CC_MASK_Q    (1 << ARMG_CC_SHIFT_Q)
 
index 5af2f51ba32400a07851437dc644742b52664fcc..6f2d41f7e1c1fa9f100762ff2fb77f8028903d36 100644 (file)
@@ -587,6 +587,26 @@ ULong arm64g_calculate_flags_nzcv ( ULong cc_op, ULong cc_dep1,
    return res;
 }
 
+void LibVEX_GuestARM64_put_nzcv_c ( ULong new_carry_flag,
+                                  /*MOD*/VexGuestARM64State* vex_state )
+{
+   ULong nzcv = arm64g_calculate_flags_nzcv(
+      vex_state->guest_CC_OP,
+      vex_state->guest_CC_DEP1,
+      vex_state->guest_CC_DEP2,
+      vex_state->guest_CC_NDEP
+      );
+   if (new_carry_flag & 1) {
+      nzcv |= ARM64G_CC_MASK_C;
+   } else {
+      nzcv &= ~ARM64G_CC_MASK_C;
+   }
+   vex_state->guest_CC_OP   = ARM64G_CC_OP_COPY;
+   vex_state->guest_CC_DEP1 = nzcv;
+   vex_state->guest_CC_DEP2 = 0;
+   vex_state->guest_CC_NDEP = 0;
+}
+
 //ZZ 
 //ZZ /* CALLED FROM GENERATED CODE: CLEAN HELPER */
 //ZZ /* Calculate the QC flag from the arguments, in the lowest bit
@@ -1774,6 +1794,7 @@ IRExpr* guest_arm64_spechelper ( const HChar* function_name,
 //ZZ }
 //ZZ #endif
 
+/* negative zero carry o-v-erflow flags */
 /* VISIBLE TO LIBVEX CLIENT */
 ULong LibVEX_GuestARM64_get_nzcv ( /*IN*/const VexGuestARM64State* vex_state )
 {
@@ -1812,6 +1833,7 @@ ULong LibVEX_GuestARM64_get_nzcv ( /*IN*/const VexGuestARM64State* vex_state )
    return nzcv;
 }
 
+/* floating point status resgister */
 /* VISIBLE TO LIBVEX CLIENT */
 ULong LibVEX_GuestARM64_get_fpsr ( const VexGuestARM64State* vex_state )
 {
index c0520d2f6dd00c40366628f3a6f3e5fb32d0efd2..8f6bb560cb12eb8403fa1310fd0f9d7d21d54748 100644 (file)
@@ -206,13 +206,6 @@ void
 LibVEX_GuestAMD64_put_rflag_c ( ULong new_carry_flag,
                                 /*MOD*/VexGuestAMD64State* vex_state );
 
-#if defined(VGO_freebsd) || defined(VGO_darwin)
-void _______VVVVVVVV_after_GuestAMD64_put_rflag_c_VVVVVVVV_______ (void);
-extern Addr addr_amd64g_calculate_rflags_all_WRK;
-extern Addr addr________VVVVVVVV_amd64g_calculate_rflags_all_WRK_VVVVVVVV_______;
-#endif
-
-
 /* Do FXSAVE from the supplied VexGuestAMD64tate structure and store the
    result at the given address which represents a buffer of at least 416
    bytes. */
index 91d06bd754facd84e6455c8984638b64880ce0fd..298f4fcfaa5cc2e67b7435d688cfe94ba965153c 100644 (file)
@@ -166,9 +166,16 @@ typedef
       ULong guest_LLSC_DATA_LO64; // Original value at _ADDR+0.
       ULong guest_LLSC_DATA_HI64; // Original value at _ADDR+8.
 
+      /* Used for FreeBSD syscall dispatching. */
+      ULong guest_SC_CLASS;
+      /* Used for FreeBSD client syscall when putting the carry flag
+         value into VEX. */
+      UInt guest_SETC;
+      UInt pad_end_0;
       /* Padding to make it have an 16-aligned size */
-      /* UInt  pad_end_0; */
-      /* ULong pad_end_1; */
+      /* UInt  pad_end_1; */
+      /* ULong pad_end_2; */
+
    }
    VexGuestARM64State;
 
@@ -190,6 +197,11 @@ extern
 ULong LibVEX_GuestARM64_get_nzcv ( /*IN*/
                                    const VexGuestARM64State* vex_state );
 
+/* Put a new value in the carry flag. */
+extern
+void LibVEX_GuestARM64_put_nzcv_c ( /*IN*/  ULong new_carry_flag,
+                                    /*MOD*/ VexGuestARM64State* vex_state );
+
 /* Calculate the ARM64 FPSR state from the saved data, in the format
    36x0:qc:27x0 */
 extern
index b191eabcbacfb282ef8333355f396157b383ea69..6d0b5053ec67c242ef6dd50066db1cfced6e1459 100755 (executable)
@@ -274,22 +274,22 @@ case "${host_cpu}" in
         ;;
 
      armv8*)
-       AC_MSG_RESULT([ok (${host_cpu})])
-       VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
-       ARCH_MAX="arm"
-       ;;
+        AC_MSG_RESULT([ok (${host_cpu})])
+        VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
+        ARCH_MAX="arm"
+        ;;
 
      armv7*)
-       AC_MSG_RESULT([ok (${host_cpu})])
-       VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
-       ARCH_MAX="arm"
-       ;;
+        AC_MSG_RESULT([ok (${host_cpu})])
+        VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
+        ARCH_MAX="arm"
+        ;;
 
      arm*)
-       AC_MSG_RESULT([ok (${host_cpu})])
-       VGCONF_PLATFORM_ARM_ARCH="-march=armv6"
-       ARCH_MAX="arm"
-       ;;
+        AC_MSG_RESULT([ok (${host_cpu})])
+        VGCONF_PLATFORM_ARM_ARCH="-march=armv6"
+        ARCH_MAX="arm"
+        ;;
 
      aarch64*)
        AC_MSG_RESULT([ok (${host_cpu})])
@@ -823,8 +823,8 @@ case "$ARCH_MAX-$VGCONF_OS" in
            VGCONF_PLATFORM_PRI_CAPS="AMD64_FREEBSD"
            VGCONF_PLATFORM_SEC_CAPS="X86_FREEBSD"
         fi
-       # These work with either base clang or ports installed gcc
-       # Hand rolled compilers probably need INSTALL_DIR/lib (at least for gcc)
+        # These work with either base clang or ports installed gcc
+        # Hand rolled compilers probably need INSTALL_DIR/lib (at least for gcc)
         if test x$is_clang = xclang ; then
            FLAG_32ON64="-B/usr/lib32"
         else
@@ -839,6 +839,17 @@ case "$ARCH_MAX-$VGCONF_OS" in
         valt_load_address_sec_inner="0x28000000"
         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
         ;;
+     arm64-freebsd)
+        VGCONF_ARCH_PRI="arm64"
+        VGCONF_ARCH_SEC=""
+        VGCONF_PLATFORM_PRI_CAPS="ARM64_FREEBSD"
+        VGCONF_PLATFORM_SEC_CAPS=""
+        valt_load_address_pri_norml="0x38000000"
+        valt_load_address_pri_inner="0x28000000"
+        valt_load_address_sec_norml="0xUNSET"
+        valt_load_address_sec_inner="0xUNSET"
+        AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
+        ;;
      # Darwin gets identified as 32-bit even when it supports 64-bit.
      # (Not sure why, possibly because 'uname' returns "i386"?)  Just about
      # all Macs support both 32-bit and 64-bit, so we just build both.  If
@@ -848,43 +859,43 @@ case "$ARCH_MAX-$VGCONF_OS" in
         ARCH_MAX="amd64"
         valt_load_address_sec_norml="0xUNSET"
         valt_load_address_sec_inner="0xUNSET"
-       if test x$vg_cv_only64bit = xyes; then
+        if test x$vg_cv_only64bit = xyes; then
            VGCONF_ARCH_PRI="amd64"
            VGCONF_ARCH_SEC=""
-          VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
-          VGCONF_PLATFORM_SEC_CAPS=""
+           VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
+           VGCONF_PLATFORM_SEC_CAPS=""
            valt_load_address_pri_norml="0x158000000"
            valt_load_address_pri_inner="0x138000000"
-       elif test x$vg_cv_only32bit = xyes; then
+        elif test x$vg_cv_only32bit = xyes; then
            VGCONF_ARCH_PRI="x86"
            VGCONF_ARCH_SEC=""
-          VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
-          VGCONF_PLATFORM_SEC_CAPS=""
-          VGCONF_ARCH_PRI_CAPS="x86"
+           VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
+           VGCONF_PLATFORM_SEC_CAPS=""
+           VGCONF_ARCH_PRI_CAPS="x86"
            valt_load_address_pri_norml="0x58000000"
            valt_load_address_pri_inner="0x38000000"
-       else
+        else
            VGCONF_ARCH_PRI="amd64"
            VGCONF_ARCH_SEC="x86"
-          VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
-          VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
+           VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
+           VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
            valt_load_address_pri_norml="0x158000000"
            valt_load_address_pri_inner="0x138000000"
            valt_load_address_sec_norml="0x58000000"
            valt_load_address_sec_inner="0x38000000"
-       fi
+        fi
         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
-       ;;
+        ;;
      arm-linux) 
-       VGCONF_ARCH_PRI="arm"
-       VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
-       VGCONF_PLATFORM_SEC_CAPS=""
-       valt_load_address_pri_norml="0x58000000"
-       valt_load_address_pri_inner="0x38000000"
+        VGCONF_ARCH_PRI="arm"
+        VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
+        VGCONF_PLATFORM_SEC_CAPS=""
+        valt_load_address_pri_norml="0x58000000"
+        valt_load_address_pri_inner="0x38000000"
         valt_load_address_sec_norml="0xUNSET"
         valt_load_address_sec_inner="0xUNSET"
-       AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
-       ;;
+        AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
+        ;;
      arm64-linux)
         valt_load_address_sec_norml="0xUNSET"
         valt_load_address_sec_inner="0xUNSET"
@@ -1060,7 +1071,8 @@ AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
                test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
                  -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64, 
-               test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX )
+               test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
+               -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_FREEBSD )
 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
                test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
@@ -1105,6 +1117,8 @@ AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_FREEBSD,
                  -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_FREEBSD)
 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD, 
                test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
+AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_FREEBSD, 
+               test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_FREEBSD)
 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
                  -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
@@ -1134,7 +1148,8 @@ AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
                  -o x$VGCONF_PLATFORM_PRI_CAPS = xNANOMIPS_LINUX)
 AM_CONDITIONAL(VGCONF_OS_IS_FREEBSD,
                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
-                 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD)
+                 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
+                 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_FREEBSD)
 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
                  -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
@@ -1144,6 +1159,7 @@ AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS,
 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN_OR_FREEBSD,
                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_FREEBSD \
                  -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
+                 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_FREEBSD \
                  -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
                  -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
 
@@ -4970,6 +4986,7 @@ AC_CHECK_FUNCS([     \
         close_range  \
         wcsncpy      \
         free_aligned_sized \
+       sbrk         \
         wcpncpy      \
         wcsxfrm      \
         sem_timedwait \
@@ -5013,6 +5030,8 @@ AM_CONDITIONAL([HAVE_STRLCPY],
                [test x$ac_cv_func_strlcpy = xyes])
 AM_CONDITIONAL([HAVE_FREE_ALIGNED_SIZED],
                [test x$ac_cv_func_free_aligned_sized = xyes])
+AM_CONDITIONAL([HAVE_SBRK],
+               [test x$ac_cv_func_sbrk = xyes])
 AM_CONDITIONAL([HAVE_WCPNCPY],
                [test x$ac_cv_func_wcpncpy = xyes])
 AM_CONDITIONAL([HAVE_WCSXFRM],
@@ -5053,6 +5072,7 @@ elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
        -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_FREEBSD \
        -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
        -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
+       -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_FREEBSD \
        -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \
        -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
   mflag_primary=$FLAG_M64
index f1815b411fda7e4718e0b87ab87620ec32e72d54..024dfbbff16dfdb222d1fc2a07a6ca9db7f36d0f 100644 (file)
@@ -389,6 +389,7 @@ COREGRIND_SOURCES_COMMON = \
        m_dispatch/dispatch-nanomips-linux.S \
        m_dispatch/dispatch-x86-freebsd.S \
        m_dispatch/dispatch-amd64-freebsd.S \
+       m_dispatch/dispatch-arm64-freebsd.S \
        m_dispatch/dispatch-x86-darwin.S \
        m_dispatch/dispatch-amd64-darwin.S \
        m_dispatch/dispatch-x86-solaris.S \
@@ -430,6 +431,7 @@ COREGRIND_SOURCES_COMMON = \
        m_sigframe/sigframe-amd64-linux.c \
        m_sigframe/sigframe-x86-freebsd.c \
        m_sigframe/sigframe-amd64-freebsd.c \
+       m_sigframe/sigframe-arm64-freebsd.c \
        m_sigframe/sigframe-ppc32-linux.c \
        m_sigframe/sigframe-ppc64-linux.c \
        m_sigframe/sigframe-arm-linux.c \
@@ -454,6 +456,7 @@ COREGRIND_SOURCES_COMMON = \
        m_syswrap/syscall-nanomips-linux.S \
        m_syswrap/syscall-x86-freebsd.S \
        m_syswrap/syscall-amd64-freebsd.S \
+       m_syswrap/syscall-arm64-freebsd.S \
        m_syswrap/syscall-x86-darwin.S \
        m_syswrap/syscall-amd64-darwin.S \
        m_syswrap/syscall-x86-solaris.S \
@@ -471,6 +474,7 @@ COREGRIND_SOURCES_COMMON = \
        m_syswrap/syswrap-ppc64-linux.c \
        m_syswrap/syswrap-x86-freebsd.c \
        m_syswrap/syswrap-amd64-freebsd.c \
+       m_syswrap/syswrap-arm64-freebsd.c \
        m_syswrap/syswrap-arm-linux.c \
        m_syswrap/syswrap-arm64-linux.c \
        m_syswrap/syswrap-s390x-linux.c \
index 8687de3f59513b2d813dc2e107ea3193c9a835ed..1675fbcf5d8f462d9824c74454993290b945023a 100644 (file)
@@ -174,10 +174,11 @@ static const char *select_platform(const char *clientname)
       } else if ((size_t)n_bytes >= sizeof(Elf64_Ehdr) && header[EI_CLASS] == ELFCLASS64) {
          const Elf64_Ehdr *ehdr = (Elf64_Ehdr *)header;
 
-         if (header[EI_DATA] == ELFDATA2LSB) {
-            if (ehdr->e_machine == EM_X86_64 &&
-                  ehdr->e_ident[EI_OSABI] == ELFOSABI_FREEBSD) {
+         if (header[EI_DATA] == ELFDATA2LSB && ehdr->e_ident[EI_OSABI] == ELFOSABI_FREEBSD) {
+            if (ehdr->e_machine == EM_X86_64) {
                platform = "amd64-freebsd";
+            } else if (ehdr->e_machine == EM_AARCH64) {
+               platform = "arm64-freebsd";
             }
          }
       }
index 7ad1b40acfa3c6db132bf3eed2fc816ffb61c949..a0c18efac14137e4029eb1ff3395703870a547aa 100644 (file)
@@ -177,7 +177,7 @@ SysRes VG_(am_do_mmap_NO_NOTIFY)( Addr start, SizeT length, UInt prot,
       fd = -1;
    res = VG_(do_syscall7)(__NR_mmap, (UWord)start, length,
                          prot, flags, fd, offset, offset >> 32ul);
-#  elif defined(VGP_amd64_freebsd)
+#  elif defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    if ((flags & VKI_MAP_ANONYMOUS) && fd == 0)
       fd = -1;
    res = VG_(do_syscall6)(__NR_mmap, (UWord)start, length,
index 4ed8e40ff9e5acd3dc0a122828feb76c329169e0..83875e89b445189caa2b379fdb67db027ad4c970 100644 (file)
@@ -3942,6 +3942,12 @@ static char* maybe_merge_procmap_stack(char* p,  struct vki_kinfo_vmentry *kve,
    if ( *pEndPlusOne + kern_sgrowsiz - kve->kve_start == 64ULL*1024ULL*1024ULL) {
       return p;
    }
+#elif defined(VGP_arm64_freebsd)
+   if ( *pEndPlusOne + kern_sgrowsiz - kve->kve_start == 1024ULL*1024ULL*1024ULL) {
+      return p;
+   }
+#else
+#    error Unknown platform
 #endif
 
    while (kve_next->kve_protection & VKI_KVME_PROT_READ &&
index 4a8c29c529a75900680260a49da99a9d2cf9671f..a4632d9e285919e7e86972387e2e57fc7a81400d 100644 (file)
@@ -528,6 +528,43 @@ static void fill_prstatus(const ThreadState *tst,
    regs->fs     = arch->vex.guest_FS;
    regs->gs     = arch->vex.guest_GS;
 
+#elif defined(VGP_arm64_freebsd)
+   regs->gp_x[0]  = arch->vex.guest_X0;
+   regs->gp_x[1]  = arch->vex.guest_X1;
+   regs->gp_x[2]  = arch->vex.guest_X2;
+   regs->gp_x[3]  = arch->vex.guest_X3;
+   regs->gp_x[4]  = arch->vex.guest_X4;
+   regs->gp_x[5]  = arch->vex.guest_X5;
+   regs->gp_x[6]  = arch->vex.guest_X6;
+   regs->gp_x[7]  = arch->vex.guest_X7;
+   regs->gp_x[8]  = arch->vex.guest_X8;
+   regs->gp_x[9]  = arch->vex.guest_X9;
+   regs->gp_x[10] = arch->vex.guest_X10;
+   regs->gp_x[11] = arch->vex.guest_X11;
+   regs->gp_x[12] = arch->vex.guest_X12;
+   regs->gp_x[13] = arch->vex.guest_X13;
+   regs->gp_x[14] = arch->vex.guest_X14;
+   regs->gp_x[15] = arch->vex.guest_X15;
+   regs->gp_x[16] = arch->vex.guest_X16;
+   regs->gp_x[17] = arch->vex.guest_X17;
+   regs->gp_x[18] = arch->vex.guest_X18;
+   regs->gp_x[19] = arch->vex.guest_X19;
+   regs->gp_x[20] = arch->vex.guest_X20;
+   regs->gp_x[21] = arch->vex.guest_X21;
+   regs->gp_x[22] = arch->vex.guest_X22;
+   regs->gp_x[23] = arch->vex.guest_X23;
+   regs->gp_x[24] = arch->vex.guest_X24;
+   regs->gp_x[25] = arch->vex.guest_X25;
+   regs->gp_x[26] = arch->vex.guest_X26;
+   regs->gp_x[27] = arch->vex.guest_X27;
+   regs->gp_x[28] = arch->vex.guest_X28;
+   regs->gp_x[29] = arch->vex.guest_X29;
+   regs->gp_lr    = arch->vex.guest_X30;
+   regs->gp_sp    = arch->vex.guest_XSP;
+   regs->gp_elr   = arch->vex.guest_PC;
+   regs->gp_spsr  = LibVEX_GuestARM64_get_nzcv( &arch->vex ); /* is this correct? */
+
+
 #else
 #  error Unknown ELF platform
 #endif
@@ -664,6 +701,42 @@ static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
    DO(8);  DO(9);  DO(10); DO(11); DO(12); DO(13); DO(14); DO(15);
 #  undef DO
 
+#elif defined(VGP_arm64_freebsd)
+   fpu->fp_q[0]  = *(const __uint128_t*)arch->vex.guest_Q0;
+   fpu->fp_q[1]  = *(const __uint128_t*)arch->vex.guest_Q1;
+   fpu->fp_q[2]  = *(const __uint128_t*)arch->vex.guest_Q2;
+   fpu->fp_q[3]  = *(const __uint128_t*)arch->vex.guest_Q3;
+   fpu->fp_q[4]  = *(const __uint128_t*)arch->vex.guest_Q4;
+   fpu->fp_q[5]  = *(const __uint128_t*)arch->vex.guest_Q5;
+   fpu->fp_q[6]  = *(const __uint128_t*)arch->vex.guest_Q6;
+   fpu->fp_q[7]  = *(const __uint128_t*)arch->vex.guest_Q7;
+   fpu->fp_q[8]  = *(const __uint128_t*)arch->vex.guest_Q8;
+   fpu->fp_q[9]  = *(const __uint128_t*)arch->vex.guest_Q9;
+   fpu->fp_q[10] = *(const __uint128_t*)arch->vex.guest_Q10;
+   fpu->fp_q[11] = *(const __uint128_t*)arch->vex.guest_Q11;
+   fpu->fp_q[12] = *(const __uint128_t*)arch->vex.guest_Q12;
+   fpu->fp_q[13] = *(const __uint128_t*)arch->vex.guest_Q13;
+   fpu->fp_q[14] = *(const __uint128_t*)arch->vex.guest_Q14;
+   fpu->fp_q[15] = *(const __uint128_t*)arch->vex.guest_Q15;
+   fpu->fp_q[16] = *(const __uint128_t*)arch->vex.guest_Q16;
+   fpu->fp_q[17] = *(const __uint128_t*)arch->vex.guest_Q17;
+   fpu->fp_q[18] = *(const __uint128_t*)arch->vex.guest_Q18;
+   fpu->fp_q[19] = *(const __uint128_t*)arch->vex.guest_Q19;
+   fpu->fp_q[20] = *(const __uint128_t*)arch->vex.guest_Q20;
+   fpu->fp_q[21] = *(const __uint128_t*)arch->vex.guest_Q21;
+   fpu->fp_q[22] = *(const __uint128_t*)arch->vex.guest_Q22;
+   fpu->fp_q[23] = *(const __uint128_t*)arch->vex.guest_Q23;
+   fpu->fp_q[24] = *(const __uint128_t*)arch->vex.guest_Q24;
+   fpu->fp_q[25] = *(const __uint128_t*)arch->vex.guest_Q25;
+   fpu->fp_q[26] = *(const __uint128_t*)arch->vex.guest_Q26;
+   fpu->fp_q[27] = *(const __uint128_t*)arch->vex.guest_Q27;
+   fpu->fp_q[28] = *(const __uint128_t*)arch->vex.guest_Q28;
+   fpu->fp_q[29] = *(const __uint128_t*)arch->vex.guest_Q29;
+   fpu->fp_q[30] = *(const __uint128_t*)arch->vex.guest_Q30;
+   fpu->fp_q[31] = *(const __uint128_t*)arch->vex.guest_Q31;
+   fpu->fp_sr     = *(const vki_uint32_t*)arch->vex.guest_QCFLAG;
+   fpu->fp_cr     = arch->vex.guest_FPCR;
+
 #else
 #  error Unknown ELF platform
 #endif
index bcfd456151745f615b7d3c124f63326195e9d317..97ecbdaf4cbfa6dea952361f5620751d2b30ac06 100644 (file)
@@ -552,7 +552,7 @@ static Bool get_Dwarf_Reg( /*OUT*/Addr* a, Word regno, const RegSummary* regs )
 #  elif defined(VGP_mips64_linux)
    if (regno == 29) { *a = regs->sp; return True; }
    if (regno == 30) { *a = regs->fp; return True; }
-#  elif defined(VGP_arm64_linux)
+#  elif defined(VGP_arm64_linux)  || defined(VGP_arm64_freebsd)
    if (regno == 31) { *a = regs->sp; return True; }
    if (regno == 29) { *a = regs->fp; return True; }
 #  else
index 6f923c736e5b032808ab6d027efc60357db34c9b..cc79429bd6016bd8ada99e113e42a357d7d9766b 100644 (file)
@@ -3089,7 +3089,7 @@ UWord evalCfiExpr ( const XArray* exprs, Int ix,
             case Creg_MIPS_RA: return eec->uregs->ra;
 #           elif defined(VGA_ppc32) || defined(VGA_ppc64be) \
                || defined(VGA_ppc64le)
-#           elif defined(VGP_arm64_linux)
+#           elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
             case Creg_ARM64_SP: return eec->uregs->sp;
             case Creg_ARM64_X30: return eec->uregs->x30;
             case Creg_ARM64_X29: return eec->uregs->x29;
@@ -3366,6 +3366,14 @@ static Addr compute_cfa ( const D3UnwindRegs* uregs,
       case CFIC_ARM64_X29REL: 
          cfa = cfsi_m->cfa_off + uregs->x29;
          break;
+#     elif defined(VGP_arm64_freebsd)
+   case CFIC_ARM64_SPREL:
+      cfa = cfsi_m->cfa_off + uregs->sp;
+      break;
+   case CFIC_ARM64_X29REL:
+      cfa = cfsi_m->cfa_off + uregs->x29;
+      break;
+
 #     else
 #       error "Unsupported arch"
 #     endif
@@ -3511,6 +3519,8 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindRegs* uregsHere,
 #  elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
 #  elif defined(VGP_arm64_linux)
    ipHere = uregsHere->pc;
+#  elif defined(VGP_arm64_freebsd)
+   ipHere = uregsHere->pc;
 #  else
 #    error "Unknown arch"
 #  endif
@@ -3651,7 +3661,7 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindRegs* uregsHere,
    COMPUTE(uregsPrev.sp, uregsHere->sp, cfsi_m->sp_how, cfsi_m->sp_off);
    COMPUTE(uregsPrev.fp, uregsHere->fp, cfsi_m->fp_how, cfsi_m->fp_off);
 #  elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
-#  elif defined(VGP_arm64_linux)
+#  elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
    COMPUTE(uregsPrev.pc,  uregsHere->pc,  cfsi_m->ra_how,  cfsi_m->ra_off);
    COMPUTE(uregsPrev.sp,  uregsHere->sp,  cfsi_m->sp_how,  cfsi_m->sp_off);
    COMPUTE(uregsPrev.x30, uregsHere->x30, cfsi_m->x30_how, cfsi_m->x30_off);
index 7b8187ee6fbb5a3015fde336ad62fed6a5026658..48df2e73ecbece0dac83b536f48cc2b7f337e5dc 100644 (file)
@@ -2042,7 +2042,7 @@ void ML_(read_debuginfo_dwarf1) (
 #  define FP_REG         12
 #  define SP_REG         13
 #  define RA_REG_DEFAULT 14
-#elif defined(VGP_arm64_linux)
+#elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
 #  define FP_REG         29
 #  define SP_REG         31
 #  define RA_REG_DEFAULT 30
@@ -2080,7 +2080,7 @@ void ML_(read_debuginfo_dwarf1) (
 # define N_CFI_REGS 72
 #elif defined(VGP_arm_linux)
 # define N_CFI_REGS 320
-#elif defined(VGP_arm64_linux)
+#elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
 # define N_CFI_REGS 128
 #elif defined(VGP_s390x_linux)
 # define N_CFI_REGS 66
index 7a654e15137511caac04241aff59f04e56b9e450..735f830441aed157dba2b0b1edab84e6b08a4a0f 100644 (file)
@@ -2706,7 +2706,8 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
          || defined(VGP_mips32_linux) || defined(VGP_mips64_linux) \
          || defined(VGP_arm64_linux) || defined(VGP_nanomips_linux) \
          || defined(VGP_x86_solaris) || defined(VGP_amd64_solaris) \
-         || defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
+         || defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) \
+         || defined(VGP_arm64_freebsd)
       /* Accept .plt where mapped as rx (code) */
       if (0 == VG_(strcmp)(name, ".plt")) {
          if (inrx && !di->plt_present) {
index e4ab846f54c1b25a3ad833caf7d419a0cda6b448..cad95bcbe203c2f2bd70df86bc62784ef592980c 100644 (file)
@@ -518,6 +518,42 @@ static UInt local_sys_getpid ( void )
    return __res;
 }
 
+#elif defined(VGP_arm64_freebsd)
+
+static UInt local_sys_write_stderr ( const HChar* buf, SizeT n )
+{
+   volatile ULong block[2];
+   block[0] = (ULong)buf;
+   block[1] = (ULong)n;
+   __asm__ volatile (
+      "mov  x0, #2\n"          /* stderr */
+      "ldr  x1, [%0]\n"        /* buf */
+      "ldr  x2, [%0, #8]\n"    /* n */
+      "mov  x8, #"VG_STRINGIFY(__NR_write)"\n"
+      "svc  0x0\n"             /* write() */
+      "str  x0, [%0]\n"
+      :
+      : "r" (block)
+      : "x0","x1","x2","x8","cc","memory"
+      );
+   if (block[0] < 0)
+      block[0] = -1;
+   return (UInt)block[0];
+}
+
+static UInt local_sys_getpid ( void )
+{
+   ULong res;
+   __asm__ volatile (
+      "mov x8, #"VG_STRINGIFY(__NR_getpid)"\n"
+      "svc 0x0\n"             /* getpid() */
+      "mov %0, x0\n"          /* set res = x0 */
+      : "=r" (res)
+      :
+      : "x8", "x0", "x1", "cc" );
+   return (UInt)res;
+}
+
 #elif defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
 
 static UInt local_sys_write_stderr ( const HChar* buf, Int n )
diff --git a/coregrind/m_dispatch/dispatch-arm64-freebsd.S b/coregrind/m_dispatch/dispatch-arm64-freebsd.S
new file mode 100644 (file)
index 0000000..fcc222d
--- /dev/null
@@ -0,0 +1,316 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The core dispatch loop, for jumping to a code address.       ---*/
+/*---                                     dispatch-arm64-freebsd.S ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+  This file is part of Valgrind, a dynamic binary instrumentation
+  framework.
+
+  Copyright (C) 2024 Paul Floyd
+      pjfloyd@wanadoo.fr
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+  The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics_asm.h"
+
+#if defined(VGP_arm64_freebsd)
+
+#include "pub_core_dispatch_asm.h"
+#include "pub_core_transtab_asm.h"
+#include "libvex_guest_offsets.h"      /* for OFFSET_arm_R* */
+
+
+/*------------------------------------------------------------*/
+/*---                                                      ---*/
+/*--- The dispatch loop.  VG_(disp_run_translations) is    ---*/
+/*--- used to run all translations,                        ---*/
+/*--- including no-redir ones.                             ---*/
+/*---                                                      ---*/
+/*------------------------------------------------------------*/
+
+/*----------------------------------------------------*/
+/*--- Entry and preamble (set everything up)       ---*/
+/*----------------------------------------------------*/
+
+/* signature:
+void VG_(disp_run_translations)( UWord* two_words,
+                                 void*  guest_state,
+                                 Addr   host_addr );
+*/
+.text
+.global VG_(disp_run_translations)
+VG_(disp_run_translations):
+        /* x0  holds two_words
+           x1  holds guest_state
+           x2  holds host_addr
+        */
+        /* Push the callee-saved registers.  Unclear if x19/x20 are
+           callee-saved, but be on the safe side.  Note this sequence
+           maintains 16-alignment of sp.  Also save x0 since it will
+           be needed in the postamble. */
+        stp  x29, x30, [sp, #-16]!
+        stp  x27, x28, [sp, #-16]!
+        stp  x25, x26, [sp, #-16]!
+        stp  x23, x24, [sp, #-16]!
+        stp  x21, x22, [sp, #-16]!
+        stp  x19, x20, [sp, #-16]!
+        stp  x0,  xzr, [sp, #-16]!
+
+        /* set FPSCR to vex-required default value */
+        // FIXME
+        // mov  r4, #0
+        // fmxr fpscr, r4
+
+        /* Set up the guest state pointer */
+        mov x21, x1
+
+        /* and jump into the code cache.  Chained translations in
+           the code cache run, until for whatever reason, they can't
+           continue.  When that happens, the translation in question
+           will jump (or call) to one of the continuation points
+           VG_(cp_...) below. */
+        br x2
+        /* NOTREACHED */
+
+/*----------------------------------------------------*/
+/*--- Postamble and exit.                          ---*/
+/*----------------------------------------------------*/
+
+postamble:
+        /* At this point, r1 and r2 contain two
+           words to be returned to the caller.  r1
+           holds a TRC value, and r2 optionally may
+           hold another word (for CHAIN_ME exits, the
+           address of the place to patch.) */
+
+        /* We're leaving.  Check that nobody messed with
+           FPSCR in ways we don't expect. */
+        // FIXME
+        // fmrx r4, fpscr
+        // bic  r4, #0xF8000000 /* mask out NZCV and QC */
+        // bic  r4, #0x0000009F /* mask out IDC,IXC,UFC,OFC,DZC,IOC */
+        // cmp  r4, #0
+        // beq  remove_frame /* we're OK */
+        /* otherwise we have an invariant violation */
+        // movw r1, #VG_TRC_INVARIANT_FAILED
+        // movw r2, #0
+        /* fall through */
+
+remove_frame:
+        /* Restore int regs, including importantly x0 (two_words),
+           but not x1 */
+        ldp  x0,  xzr, [sp], #16
+        ldp  x19, x20, [sp], #16
+        ldp  x21, x22, [sp], #16
+        ldp  x23, x24, [sp], #16
+        ldp  x25, x26, [sp], #16
+        ldp  x27, x28, [sp], #16
+        ldp  x29, x30, [sp], #16
+
+        /* Stash return values */
+        str  x1, [x0, #0]
+        str  x2, [x0, #8]
+        ret
+
+/*----------------------------------------------------*/
+/*--- Continuation points                          ---*/
+/*----------------------------------------------------*/
+
+/* ------ Chain me to slow entry point ------ */
+.global VG_(disp_cp_chain_me_to_slowEP)
+VG_(disp_cp_chain_me_to_slowEP):
+        /* We got called.  The return address indicates
+           where the patching needs to happen.  Collect
+           the return address and, exit back to C land,
+           handing the caller the pair (Chain_me_S, RA) */
+        mov  x1, #VG_TRC_CHAIN_ME_TO_SLOW_EP
+        mov  x2, x30 // 30 == LR
+        /* 4 = movw x9, disp_cp_chain_me_to_slowEP[15:0]
+           4 = movk x9, disp_cp_chain_me_to_slowEP[31:16], lsl 16
+           4 = movk x9, disp_cp_chain_me_to_slowEP[47:32], lsl 32
+           4 = movk x9, disp_cp_chain_me_to_slowEP[63:48], lsl 48
+           4 = blr  x9
+        */
+        sub  x2, x2, #4+4+4+4+4
+        b    postamble
+
+/* ------ Chain me to fast entry point ------ */
+.global VG_(disp_cp_chain_me_to_fastEP)
+VG_(disp_cp_chain_me_to_fastEP):
+        /* We got called.  The return address indicates
+           where the patching needs to happen.  Collect
+           the return address and, exit back to C land,
+           handing the caller the pair (Chain_me_F, RA) */
+        mov  x1, #VG_TRC_CHAIN_ME_TO_FAST_EP
+        mov  x2, x30 // 30 == LR
+        /* 4 = movw x9, disp_cp_chain_me_to_fastEP[15:0]
+           4 = movk x9, disp_cp_chain_me_to_fastEP[31:16], lsl 16
+           4 = movk x9, disp_cp_chain_me_to_fastEP[47:32], lsl 32
+           4 = movk x9, disp_cp_chain_me_to_fastEP[63:48], lsl 48
+           4 = blr  x9
+        */
+        sub  x2, x2, #4+4+4+4+4
+        b    postamble
+
+/* ------ Indirect but boring jump ------ */
+.global VG_(disp_cp_xindir)
+VG_(disp_cp_xindir):
+       // Where are we going?
+        ldr  x0, [x21, #OFFSET_arm64_PC]
+
+        // stats only
+        adrp x4,           VG_(stats__n_xIndirs_32)
+        add  x4, x4, :lo12:VG_(stats__n_xIndirs_32)
+        ldr  w5, [x4, #0]
+        add  w5, w5, #1
+        str  w5, [x4, #0]
+
+        // LIVE: x21 (guest state ptr), x0 (guest address to go to).
+        // We use 6 temporaries:
+        //   x6 (to point at the relevant FastCacheSet),
+        //   x1, x2, x3 (scratch, for swapping entries within a set)
+        //   x4, x5 (other scratch)
+
+        /* Try a fast lookup in the translation cache.  This is pretty much
+           a handcoded version of VG_(lookupInFastCache). */
+
+        // Compute x6 = VG_TT_FAST_HASH(guest)
+        lsr  x6, x0, #2                       // g2 = guest >> 2
+        eor  x6, x6, x6, LSR #VG_TT_FAST_BITS // (g2 >> VG_TT_FAST_BITS) ^ g2
+        mov  x4, #VG_TT_FAST_MASK             // VG_TT_FAST_MASK
+        and  x6, x6, x4                       // setNo
+
+        // Compute x6 = &VG_(tt_fast)[x6]
+        adrp x4,           VG_(tt_fast)
+        add  x4, x4, :lo12:VG_(tt_fast)              // &VG_(tt_fast)[0]
+        add  x6, x4, x6, LSL #VG_FAST_CACHE_SET_BITS // &VG_(tt_fast)[setNo]
+
+        // LIVE: x21 (guest state ptr), x0 (guest addr), x6 (cache set)
+        // try way 0
+        ldp  x4, x5, [x6, #FCS_g0]  // x4 = .guest0, x5 = .host0
+        cmp  x4, x0   // cmp against .guest0
+        bne  1f
+        // hit at way 0
+        // goto .host0
+        br   x5
+        /*NOTREACHED*/
+
+1:      // try way 1
+        ldr  x4, [x6, #FCS_g1]
+        cmp  x4, x0   // cmp against .guest1
+        bne  2f
+        // hit at way 1; swap upwards
+        ldr  x1, [x6, #FCS_g0]   // x1 = old .guest0
+        ldr  x2, [x6, #FCS_h0]   // x2 = old .host0
+        ldr  x3, [x6, #FCS_h1]   // x3 = old .host1
+        str  x0, [x6, #FCS_g0]   // new .guest0 = guest
+        str  x3, [x6, #FCS_h0]   // new .host0 = old .host1
+        str  x1, [x6, #FCS_g1]   // new .guest1 = old .guest0
+        str  x2, [x6, #FCS_h1]   // new .host1 = old .host0
+        // stats only
+        adrp x4,           VG_(stats__n_xIndir_hits1_32)
+        add  x4, x4, :lo12:VG_(stats__n_xIndir_hits1_32)
+        ldr  w5, [x4, #0]
+        add  w5, w5, #1
+        str  w5, [x4, #0]
+        // goto old .host1 a.k.a. new .host0
+        br   x3
+        /*NOTREACHED*/
+
+2:      // try way 2
+        ldr  x4, [x6, #FCS_g2]
+        cmp  x4, x0   // cmp against .guest2
+        bne  3f
+        // hit at way 2; swap upwards
+        ldr  x1, [x6, #FCS_g1]
+        ldr  x2, [x6, #FCS_h1]
+        ldr  x3, [x6, #FCS_h2]
+        str  x0, [x6, #FCS_g1]
+        str  x3, [x6, #FCS_h1]
+        str  x1, [x6, #FCS_g2]
+        str  x2, [x6, #FCS_h2]
+        // stats only
+        adrp x4,           VG_(stats__n_xIndir_hits2_32)
+        add  x4, x4, :lo12:VG_(stats__n_xIndir_hits2_32)
+        ldr  w5, [x4, #0]
+        add  w5, w5, #1
+        str  w5, [x4, #0]
+        // goto old .host2 a.k.a. new .host1
+        br   x3
+        /*NOTREACHED*/
+
+3:      // try way 3
+        ldr  x4, [x6, #FCS_g3]
+        cmp  x4, x0   // cmp against .guest3
+        bne  4f
+        // hit at way 3; swap upwards
+        ldr  x1, [x6, #FCS_g2]
+        ldr  x2, [x6, #FCS_h2]
+        ldr  x3, [x6, #FCS_h3]
+        str  x0, [x6, #FCS_g2]
+        str  x3, [x6, #FCS_h2]
+        str  x1, [x6, #FCS_g3]
+        str  x2, [x6, #FCS_h3]
+        // stats only
+        adrp x4,           VG_(stats__n_xIndir_hits3_32)
+        add  x4, x4, :lo12:VG_(stats__n_xIndir_hits3_32)
+        ldr  w5, [x4, #0]
+        add  w5, w5, #1
+        str  w5, [x4, #0]
+        // goto old .host3 a.k.a. new .host2
+        br   x3
+        /*NOTREACHED*/
+
+4:      // fast lookup failed
+        adrp x4,           VG_(stats__n_xIndir_misses_32)
+        add  x4, x4, :lo12:VG_(stats__n_xIndir_misses_32)
+        ldr  w5, [x4, #0]
+        add  w5, w5, #1
+        str  w5, [x4, #0]
+
+       mov  x1, #VG_TRC_INNER_FASTMISS
+        mov  x2, #0
+       b    postamble
+
+/* ------ Assisted jump ------ */
+.global VG_(disp_cp_xassisted)
+VG_(disp_cp_xassisted):
+        /* x21 contains the TRC */
+        mov  x1, x21
+        mov  x2, #0
+        b    postamble
+
+/* ------ Event check failed ------ */
+.global VG_(disp_cp_evcheck_fail)
+VG_(disp_cp_evcheck_fail):
+        mov  x1, #VG_TRC_INNER_COUNTERZERO
+        mov  x2, #0
+       b    postamble
+
+
+.size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
+#endif // defined(VGP_arm64_freebsd)
+
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
+/*--------------------------------------------------------------------*/
+/*--- end                                 dispatch-arm64-freebsd.S ---*/
+/*--------------------------------------------------------------------*/
index db0d6ec67dd6f1a787e70ac3e74b82f59f4bb73c..53dbf7961f6280e2b7ab77b07a1ece90500edf28 100644 (file)
@@ -1099,6 +1099,27 @@ void VG_(ii_finalise_image)( IIFinaliseImageInfo iifii )
    arch->vex.guest_RDI = iifii.initial_client_SP;
    arch->vex.guest_RIP = iifii.initial_client_IP;
 
+#elif defined(VGP_arm64_freebsd)
+
+   vg_assert(0 == sizeof(VexGuestARM64State) % 16);
+
+   /* Zero out the initial state, and set up the simulated FPU in a
+      sane way. */
+   LibVEX_GuestARM64_initialise(&arch->vex);
+
+   /* Zero out the shadow areas. */
+   VG_(memset)(&arch->vex_shadow1, 0, sizeof(VexGuestARM64State));
+   VG_(memset)(&arch->vex_shadow2, 0, sizeof(VexGuestARM64State));
+
+   /* Put essential stuff into the new state. */
+   //arch->vex.guest_XSP = ((iifii.initial_client_SP - 8) & ~0xFUL) + 8;
+   arch->vex.guest_XSP = iifii.initial_client_SP;
+   arch->vex.guest_X0 = iifii.initial_client_SP;
+   if (iifii.initial_client_SP % 16) {
+      arch->vex.guest_X0 += 8;
+   }
+   arch->vex.guest_PC = iifii.initial_client_IP;
+
 #  else
 #    error Unknown platform
 #  endif
index 0b04bfcc1d571fa7012546f52f695bae9ab32a5d..db9d43d8741df066afe6451adafb0266e043a41a 100644 (file)
         (srP)->misc.ARM.r11 = block[4];                   \
         (srP)->misc.ARM.r7  = block[5];                   \
       }
-#elif defined(VGP_arm64_linux)
+#elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
 #  define GET_STARTREGS(srP)                              \
       { ULong block[4];                                   \
         __asm__ __volatile__(                             \
index 5d3a349f2bb2cc23d85a82f03e9fd87fa7cd723d..6098bc5813a8f040221e403e9da7aa0b467f4665 100644 (file)
@@ -428,7 +428,7 @@ Int VG_(pipe) ( Int fd[2] )
 
 Off64T VG_(lseek) ( Int fd, Off64T offset, Int whence )
 {
-#  if defined(VGO_linux) || defined(VGP_amd64_darwin) || defined(VGP_amd64_freebsd)
+#  if defined(VGO_linux) || defined(VGP_amd64_darwin) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
 #  if defined(__NR__llseek)
    Off64T result;
    SysRes res = VG_(do_syscall5)(__NR__llseek, fd,
@@ -1143,7 +1143,7 @@ SysRes VG_(pread) ( Int fd, void* buf, Int count, OffT offset )
       || defined(VGP_mips64_linux) || defined(VGP_arm64_linux)
    res = VG_(do_syscall4)(__NR_pread64, fd, (UWord)buf, count, offset);
    return res;
-#  elif defined(VGP_amd64_freebsd)
+#  elif defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    vg_assert(sizeof(OffT) == 8);
    res = VG_(do_syscall4)(__NR_pread, fd, (UWord)buf, count, offset);
    return res;
index 02f636748b867ce620f55d8107a8ed88ce1ccbb3..11dabe768f590679c304a2898adb42e1dcbc76d7 100644 (file)
@@ -1236,7 +1236,7 @@ Int VG_(getosreldate)(void)
 
 Bool VG_(is32on64)(void)
 {
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    return False;
 #elif defined(VGP_x86_freebsd)
    SysRes res;
@@ -1298,7 +1298,7 @@ void VG_(invalidate_icache) ( void *ptr, SizeT nbytes )
    Addr endaddr   = startaddr + nbytes;
    VG_(do_syscall2)(__NR_ARM_cacheflush, startaddr, endaddr);
 
-#  elif defined(VGP_arm64_linux)
+#  elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
    // This arm64_linux section of this function VG_(invalidate_icache)
    // is copied from
    // https://github.com/armvixl/vixl/blob/master/src/a64/cpu-a64.cc
index aa1749032dc26928fd69f19b941fe991d080c480..02324daab7570e7e777f9b20895b1af212b78614 100644 (file)
@@ -781,7 +781,7 @@ __asm__(
 );
 #endif /* VGP_s390x_linux */
 
-#if defined(__clang__) && (defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd))
+#if defined(__clang__) && defined(VGP_arm64_linux)
 
 // __builtin_setjmp is not implemented by the standard C library
 // used on Android in current llvm-based toolchains as of NDK r19.
@@ -887,6 +887,50 @@ void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env))
 
 #endif
 
+#if defined(VGP_arm64_freebsd)
+
+__asm__(
+   ".text\n"
+
+   ".globl VG_MINIMAL_SETJMP"  "\n"
+   "VG_MINIMAL_SETJMP:"  "\n" // x0 = jmp_buf
+   "        mov             x1, sp\n" /* can't STP from sp */
+   "        stp             x19, x20,       [x0, #0x00]\n"
+   "        stp             x21, x22,       [x0, #0x10]\n"
+   "        stp             x23, x24,       [x0, #0x20]\n"
+   "        stp             x25, x26,       [x0, #0x30]\n"
+   "        stp             x27, x28,       [x0, #0x40]\n"
+   "        stp             x29, x30,       [x0, #0x50]\n"
+   "        stp             x1, xzr,        [x0, #0x60]\n"
+   "        stp             d8, d9,         [x0, #0x70]\n"
+   "        stp             d10, d11,       [x0, #0x80]\n"
+   "        stp             d12, d13,       [x0, #0x90]\n"
+   "        stp             d14, d15,       [x0, #0xA0]\n"
+   "        mov             x0, #0\n" // return 0 on the first return
+   "        ret\n"
+   ".previous\n"
+
+   ".globl VG_MINIMAL_LONGJMP"  "\n"
+   "      VG_MINIMAL_LONGJMP:"  "\n" // x0 = jmp_buf
+   "        ldp             x19, x20,       [x0, #0x00]\n"
+   "        ldp             x21, x22,       [x0, #0x10]\n"
+   "        ldp             x23, x24,       [x0, #0x20]\n"
+   "        ldp             x25, x26,       [x0, #0x30]\n"
+   "        ldp             x27, x28,       [x0, #0x40]\n"
+   "        ldp             x29, x30,       [x0, #0x50]\n"
+   "        ldp             x1, xzr,        [x0, #0x60]\n"
+   "        ldp             d8, d9,         [x0, #0x70]\n"
+   "        ldp             d10, d11,       [x0, #0x80]\n"
+   "        ldp             d12, d13,       [x0, #0x90]\n"
+   "        ldp             d14, d15,       [x0, #0xA0]\n"
+   "        mov             sp, x1\n"
+   "        mov             x0, #1\n" // return non-zero on the second return
+   "        br              lr\n"
+   ".previous\n"
+   );
+
+#endif
+
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
 /*--------------------------------------------------------------------*/
index 81fb810643cf86fb44bcb087c5b58742161974a2..36db3ab9cfe0fc31e8b592166e60d4d0ef8640ec 100644 (file)
@@ -1843,10 +1843,13 @@ Bool VG_(machine_get_hwcaps)( void )
 
      VG_(machine_get_cache_info)(&vai);
 
+     // @todo PJF ARM64 if we need this then we can't parse anything in /proc
+#if !defined(VGP_arm64_freebsd)
      /* Check whether we need to use the fallback LLSC implementation.
         If the check fails, give up. */
      if (! VG_(parse_cpuinfo)())
         return False;
+#endif
 
      /* 0 denotes 'not set'.  The range of legitimate values here,
         after being set that is, is 2 though 17 inclusive. */
index 7ff57ce6631bb3c35d63da92c9f82eef8e235313..ac9e3f76b24c6506648621645206137f6dad8079 100644 (file)
@@ -3463,6 +3463,37 @@ asm("\n"
     "\thlt\n"
     ".previous\n"
 );
+
+#elif defined(VGP_arm64_freebsd)
+
+
+// on entry
+// x0 contains a pointer to argc
+// sp contains a pointer either to the same address
+//    or 8 below it depending on whether the stack pointer
+//    was 16byte aligned
+//
+// before calling we want
+// x0 to contain a pointer to argc - just leave it alone
+// x1 to contain a pointer to the original stack in case we need it like amd64
+// sp to contain a pointer to the end of VG_(interim_stack)
+asm("\n"
+    ".text\n"
+    "\t.align 2\n"
+    "\t.type _start,#function\n"
+    "\t.global _start\n"
+    "_start:\n"
+    "\tadrp x2, vgPlain_interim_stack\n"
+    "\tadd  x2, x2, :lo12:vgPlain_interim_stack\n"
+    "\tldr  x3, ="VG_STRINGIFY(VG_STACK_GUARD_SZB)"\n"
+    "\tadd  x2, x2, x3\n"
+    "\tldr  x3, ="VG_STRINGIFY(VG_DEFAULT_STACK_ACTIVE_SZB)"\n"
+    "\tadd  x2, x2, x3\n"
+    "\tand  x2, x2, -16\n"
+    "\tmov  x1, sp\n"
+    "\tmov  sp, x2\n"
+    "\tb _start_in_C_freebsd\n"
+);
 #endif
 
 void *memcpy(void *dest, const void *src, size_t n);
@@ -3496,7 +3527,7 @@ void _start_in_C_freebsd ( UWord* pArgc, UWord *initial_sp )
    VG_(memset)( &the_iicii, 0, sizeof(the_iicii) );
    VG_(memset)( &the_iifii, 0, sizeof(the_iifii) );
 
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    the_iicii.sp_at_startup = (Addr)initial_sp;
 #else
    the_iicii.sp_at_startup = (Addr)pArgc;
index ce6073a62190a639e1651834730e77c5893cf0bb..f50624c2ba99fa8df2b821dd7cb2ce7bd84fab27 100644 (file)
@@ -1567,7 +1567,7 @@ void VG_(redir_initialise) ( void )
 #     endif
    }
 
-#  elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
+#  elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
 /* XXX do something real if needed */
 #  elif defined(VGP_x86_darwin)
    /* If we're using memcheck, use these intercepts right from
index 6456eb1ac65ea7a7bda97d90f3f1cbe71322193a..56194516017ae005d73dd476ef0163dc354d1699 100644 (file)
@@ -1003,7 +1003,7 @@ void run_thread_for_a_while ( /*OUT*/HWord* two_words,
 #  if defined(VGP_mips32_linux) || defined(VGP_mips64_linux) \
       || defined(VGP_nanomips_linux)
    tst->arch.vex.guest_LLaddr = (RegWord)(-1);
-#  elif defined(VGP_arm64_linux)
+#  elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
    tst->arch.vex.guest_LLSC_SIZE = 0;
 #  endif
 
diff --git a/coregrind/m_sigframe/sigframe-arm64-freebsd.c b/coregrind/m_sigframe/sigframe-arm64-freebsd.c
new file mode 100644 (file)
index 0000000..854e0eb
--- /dev/null
@@ -0,0 +1,412 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Create/destroy signal delivery frames.                       ---*/
+/*---                                     sigframe-arm64-freebsd.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2024
+      pjfloyd@wanadoo.fr
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#if defined(VGP_arm64_freebsd)
+
+#include "priv_sigframe.h"
+#include "pub_core_aspacemgr.h"
+#include "pub_core_basics.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
+#include "pub_core_options.h"
+#include "pub_core_sigframe.h"
+#include "pub_core_signals.h"
+#include "pub_core_threadstate.h"
+#include "pub_core_tooliface.h"
+#include "pub_core_trampoline.h"
+#include "pub_core_vki.h"
+
+const UInt MAGIC_PI = 0x31415927U;
+const UInt MAGIC_E  = 0x27182818U;
+
+struct vg_sigframe {
+   /* Sanity check word. */
+   UInt magicPI;
+
+   UInt handlerflags; /* flags for signal handler */
+
+   /* Safely-saved version of sigNo, as described above. */
+   Int sigNo_private;
+
+   /* XXX This is wrong.  Surely we should store the shadow values
+      into the shadow memory behind the actual values? */
+   VexGuestARM64State vex_shadow1;
+   VexGuestARM64State vex_shadow2;
+
+   /* HACK ALERT */
+   VexGuestARM64State vex;
+   /* end HACK ALERT */
+
+   /* saved signal mask to be restored when handler returns */
+   vki_sigset_t mask;
+
+   /* Sanity check word.  Is the highest-addressed word; do not
+      move!*/
+   UInt magicE;
+};
+
+struct sigframe {
+   struct vki_ucontext uContext;
+   vki_siginfo_t       sigInfo;
+   // amd64 has fpstate, for arm64 it is in the ucontext
+   struct vg_sigframe vg;
+};
+
+/*------------------------------------------------------------*/
+/*--- Creating signal frames                               ---*/
+/*------------------------------------------------------------*/
+
+/* Create a plausible-looking sigcontext from the thread's
+   Vex guest state.
+*/
+static void synth_ucontext(ThreadId             tid,
+                           const vki_siginfo_t* si,
+                           UWord                trapno,
+                           UWord                err,
+                           const vki_sigset_t*  set,
+                           struct vki_ucontext* uc)
+{
+
+   ThreadState*         tst = VG_(get_ThreadState)(tid);
+   struct vki_mcontext* sc  = &uc->uc_mcontext;
+
+   VG_(memset)(uc, 0, sizeof(*uc));
+
+   uc->uc_flags   = 0;
+   uc->uc_link    = 0;
+   uc->uc_sigmask = *set;
+   uc->uc_stack   = tst->altstack;
+
+#define TO_CTX(reg) sc->mc_gpregs.gp_x[reg] = tst->arch.vex.guest_X##reg
+   TO_CTX(0);
+   TO_CTX(1);
+   TO_CTX(2);
+   TO_CTX(3);
+   TO_CTX(4);
+   TO_CTX(5);
+   TO_CTX(6);
+   TO_CTX(7);
+   TO_CTX(8);
+   TO_CTX(9);
+   TO_CTX(10);
+   TO_CTX(11);
+   TO_CTX(12);
+   TO_CTX(13);
+   TO_CTX(14);
+   TO_CTX(15);
+   TO_CTX(16);
+   TO_CTX(17);
+   TO_CTX(18);
+   TO_CTX(19);
+   TO_CTX(20);
+   TO_CTX(21);
+   TO_CTX(22);
+   TO_CTX(23);
+   TO_CTX(24);
+   TO_CTX(25);
+   TO_CTX(26);
+   TO_CTX(27);
+   TO_CTX(28);
+   TO_CTX(29);
+#undef TO_CTX
+   sc->mc_gpregs.gp_lr   = tst->arch.vex.guest_X30;
+   sc->mc_gpregs.gp_sp   = tst->arch.vex.guest_XSP;
+   sc->mc_gpregs.gp_elr  = tst->arch.vex.guest_PC;
+   sc->mc_gpregs.gp_spsr = LibVEX_GuestARM64_get_nzcv(&tst->arch.vex);
+}
+
+/* Extend the stack segment downwards if needed so as to ensure the
+   new signal frames are mapped to something.  Return a Bool
+   indicating whether or not the operation was successful.
+*/
+static Bool extend(ThreadState* tst, Addr addr, SizeT size)
+{
+   ThreadId        tid      = tst->tid;
+   NSegment const* stackseg = NULL;
+
+   if (VG_(extend_stack)(tid, addr)) {
+      stackseg = VG_(am_find_nsegment)(addr);
+      if (0 && stackseg) {
+         VG_(printf)("frame=%#lx seg=%#lx-%#lx\n", addr, stackseg->start,
+                     stackseg->end);
+      }
+   }
+
+   if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
+      VG_(message)(
+         Vg_UserMsg,
+         "Can't extend stack to %#lx during signal delivery for thread %u:\n",
+         addr, tid);
+      if (stackseg == NULL) {
+         VG_(message)(Vg_UserMsg, "  no stack segment\n");
+      } else {
+         VG_(message)(Vg_UserMsg, "  too small or bad protection modes\n");
+      }
+
+      /* set SIGSEGV to default handler */
+      VG_(set_default_handler)(VKI_SIGSEGV);
+      VG_(synth_fault_mapping)(tid, addr);
+
+      /* The whole process should be about to die, since the default
+      action of SIGSEGV to kill the whole process. */
+      return False;
+   }
+
+   /* For tracking memory events, indicate the entire frame has been
+      allocated. */
+   VG_TRACK(new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
+            size + VG_STACK_REDZONE_SZB, tid);
+
+   return True;
+}
+
+/* Build the Valgrind-specific part of a signal frame. */
+
+static void build_vg_sigframe(struct vg_sigframe* frame,
+                              ThreadState*        tst,
+                              const vki_sigset_t* mask,
+                              UInt                flags,
+                              Int                 sigNo)
+{
+   frame->sigNo_private = sigNo;
+   frame->magicPI       = MAGIC_PI;
+   frame->vex_shadow1   = tst->arch.vex_shadow1;
+   frame->vex_shadow2   = tst->arch.vex_shadow2;
+   /* HACK ALERT */
+   frame->vex = tst->arch.vex;
+   /* end HACK ALERT */
+   frame->mask         = tst->sig_mask;
+   frame->handlerflags = flags;
+   frame->magicE       = MAGIC_E;
+}
+
+static Addr build_sigframe(ThreadState*               tst,
+                           Addr                       sp_top_of_frame,
+                           const vki_siginfo_t*       siginfo,
+                           const struct vki_ucontext* siguc,
+                           void*                      handler,
+                           UInt                       flags,
+                           const vki_sigset_t*        mask,
+                           void*                      restorer)
+{
+   struct sigframe* frame;
+   Addr             sp    = sp_top_of_frame;
+   Int              sigNo = siginfo->si_signo;
+   UWord            trapno;
+   UWord            err;
+
+   sp -= sizeof(*frame);
+   sp    = VG_ROUNDDN(sp, 16) - 8;
+   frame = (struct sigframe*)sp;
+
+   if (!extend(tst, sp, sizeof(*frame))) {
+      return sp_top_of_frame;
+   }
+
+   /* retaddr, siginfo, uContext fields are to be written */
+   VG_TRACK(pre_mem_write, Vg_CoreSignal, tst->tid, "signal handler frame", sp,
+            offsetof(struct sigframe, vg));
+
+   // on amd64 these are in the ucontext
+   trapno = 0;
+   err    = 0;
+
+   VG_(memcpy)(&frame->sigInfo, siginfo, sizeof(vki_siginfo_t));
+
+   if (sigNo == VKI_SIGILL && siginfo->si_code > 0) {
+      frame->sigInfo.si_addr = (void*)tst->arch.vex.guest_PC;
+   }
+
+   synth_ucontext(tst->tid, siginfo, trapno, err, mask, &frame->uContext);
+
+   VG_TRACK(post_mem_write, Vg_CoreSignal, tst->tid, sp,
+            offsetof(struct sigframe, vg));
+
+   build_vg_sigframe(&frame->vg, tst, mask, flags, sigNo);
+
+   return sp;
+}
+
+/* EXPORTED */
+void VG_(sigframe_create)(ThreadId                   tid,
+                          Bool                       on_altstack,
+                          Addr                       sp_top_of_frame,
+                          const vki_siginfo_t*       siginfo,
+                          const struct vki_ucontext* siguc,
+                          void*                      handler,
+                          UInt                       flags,
+                          const vki_sigset_t*        mask,
+                          void*                      restorer)
+{
+   Addr             sp;
+   struct sigframe* frame;
+   ThreadState*     tst = VG_(get_ThreadState)(tid);
+
+   sp    = build_sigframe(tst, sp_top_of_frame, siginfo, siguc, handler, flags,
+                          mask, restorer);
+   frame = (struct sigframe*)sp;
+
+   VG_(set_SP)(tid, sp);
+   VG_TRACK(post_reg_write, Vg_CoreSignal, tid, VG_O_STACK_PTR, sizeof(Addr));
+
+   tst->arch.vex.guest_PC = (Addr)handler;
+   tst->arch.vex.guest_X0 = (ULong)siginfo->si_signo;
+   tst->arch.vex.guest_X1 = (Addr)&frame->sigInfo;
+   tst->arch.vex.guest_X2 = (Addr)&frame->uContext;
+
+   tst->arch.vex.guest_X30 = (Addr)&VG_(arm64_freebsd_SUBST_FOR_sigreturn);
+
+   /* And tell the tool that these registers have been written. */
+   VG_TRACK(post_reg_write, Vg_CoreSignal, tst->tid,
+            offsetof(VexGuestARM64State, guest_PC), sizeof(UWord));
+   VG_TRACK(post_reg_write, Vg_CoreSignal, tst->tid,
+            offsetof(VexGuestARM64State, guest_X0), sizeof(UWord));
+   VG_TRACK(post_reg_write, Vg_CoreSignal, tst->tid,
+            offsetof(VexGuestARM64State, guest_X1), sizeof(UWord));
+   VG_TRACK(post_reg_write, Vg_CoreSignal, tst->tid,
+            offsetof(VexGuestARM64State, guest_X2), sizeof(UWord));
+   VG_TRACK(post_reg_write, Vg_CoreSignal, tst->tid,
+            offsetof(VexGuestARM64State, guest_X30), sizeof(UWord));
+}
+
+/*------------------------------------------------------------*/
+/*--- Destroying signal frames                             ---*/
+/*------------------------------------------------------------*/
+
+/* Return False and don't do anything, just set the client to take a
+   segfault, if it looks like the frame is corrupted. */
+static Bool
+restore_vg_sigframe(ThreadState* tst, struct vg_sigframe* frame, Int* sigNo)
+{
+   if (frame->magicPI != MAGIC_PI || frame->magicE != MAGIC_E) {
+      VG_(message)(Vg_UserMsg,
+                   "Thread %u return signal frame "
+                   "corrupted.  Killing process.\n",
+                   tst->tid);
+      VG_(set_default_handler)(VKI_SIGSEGV);
+      VG_(synth_fault)(tst->tid);
+      *sigNo = VKI_SIGSEGV;
+      return False;
+   }
+   tst->sig_mask         = frame->mask;
+   tst->tmp_sig_mask     = frame->mask;
+   tst->arch.vex_shadow1 = frame->vex_shadow1;
+   tst->arch.vex_shadow2 = frame->vex_shadow2;
+   /* HACK ALERT */
+   tst->arch.vex = frame->vex;
+   /* end HACK ALERT */
+   *sigNo = frame->sigNo_private;
+   return True;
+}
+
+static void restore_sigcontext(ThreadState* tst, struct vki_mcontext* sc)
+{
+#define FROM_CTX(reg) tst->arch.vex.guest_X##reg = sc->mc_gpregs.gp_x[reg]
+   FROM_CTX(0);
+   FROM_CTX(1);
+   FROM_CTX(2);
+   FROM_CTX(3);
+   FROM_CTX(4);
+   FROM_CTX(5);
+   FROM_CTX(6);
+   FROM_CTX(7);
+   FROM_CTX(8);
+   FROM_CTX(9);
+   FROM_CTX(10);
+   FROM_CTX(11);
+   FROM_CTX(12);
+   FROM_CTX(13);
+   FROM_CTX(14);
+   FROM_CTX(15);
+   FROM_CTX(16);
+   FROM_CTX(17);
+   FROM_CTX(18);
+   FROM_CTX(19);
+   FROM_CTX(20);
+   FROM_CTX(21);
+   FROM_CTX(22);
+   FROM_CTX(23);
+   FROM_CTX(24);
+   FROM_CTX(25);
+   FROM_CTX(26);
+   FROM_CTX(27);
+   FROM_CTX(28);
+   FROM_CTX(29);
+#undef FROM_CTX
+   tst->arch.vex.guest_X30 = sc->mc_gpregs.gp_lr;
+   tst->arch.vex.guest_PC  = sc->mc_gpregs.gp_elr;
+}
+
+static SizeT
+restore_sigframe(ThreadState* tst, struct sigframe* frame, Int* sigNo)
+{
+   if (restore_vg_sigframe(tst, &frame->vg, sigNo)) {
+      restore_sigcontext(tst, &frame->uContext.uc_mcontext);
+   }
+
+   return sizeof(*frame);
+}
+
+void VG_(sigframe_destroy)(ThreadId tid)
+{
+   vg_assert(VG_(is_valid_tid)(tid));
+
+   Addr         sp;
+   ThreadState* tst;
+   SizeT        size;
+   Int          sigNo;
+
+   tst = VG_(get_ThreadState)(tid);
+
+   /* Correctly reestablish the frame base address. */
+   sp = tst->arch.vex.guest_XSP;
+
+   size = restore_sigframe(tst, (struct sigframe*)sp, &sigNo);
+
+   VG_TRACK(die_mem_stack_signal, sp - VG_STACK_REDZONE_SZB,
+            size + VG_STACK_REDZONE_SZB);
+
+   if (VG_(clo_trace_signals)) {
+      VG_(message)(
+         Vg_DebugMsg,
+         "VG_(sigframe_destroy) (thread %u): valid magic; RIP=%#llx\n", tid,
+         tst->arch.vex.guest_PC);
+   }
+
+   /* tell the tools */
+   VG_TRACK(post_deliver_signal, tid, sigNo);
+}
+
+#endif // defined(VGP_arm64_freebsd)
+
+/*--------------------------------------------------------------------*/
+/*--- end                                 sigframe-arm64-freebsd.c ---*/
+/*--------------------------------------------------------------------*/
index cd3128d2b4bb9e0ac39ab64404ee520828c482b8..09acb7cb7ab9f6e70446e467a37a58d9bb928f71 100644 (file)
@@ -549,6 +549,21 @@ VgHashTable *ht_sigchld_ignore = NULL;
         (srP)->r_sp = (uc)->uc_mcontext.rsp;             \
         (srP)->misc.AMD64.r_rbp = (uc)->uc_mcontext.rbp; \
       }
+#elif defined(VGP_arm64_freebsd)
+
+#  define VG_UCONTEXT_INSTR_PTR(uc)       ((UWord)((uc)->uc_mcontext.mc_gpregs.gp_elr))
+#  define VG_UCONTEXT_STACK_PTR(uc)       ((UWord)((uc)->uc_mcontext.mc_gpregs.gp_sp))
+#  define VG_UCONTEXT_SYSCALL_SYSRES(uc)                        \
+      /* Convert the value in uc_mcontext.regs[0] into a SysRes. */ \
+      VG_(mk_SysRes_arm64_freebsd)( (uc)->uc_mcontext.mc_gpregs.gp_x[0], \
+         (uc)->uc_mcontext.mc_gpregs.gp_x[1], \
+         ((uc)->uc_mcontext.mc_gpregs.gp_spsr & VKI_PSR_C) != 0 ? True : False )
+#  define VG_UCONTEXT_TO_UnwindStartRegs(srP, uc)           \
+      { (srP)->r_pc = (uc)->uc_mcontext.mc_gpregs.gp_elr;   \
+        (srP)->r_sp = (uc)->uc_mcontext.mc_gpregs.gp_sp;    \
+        (srP)->misc.ARM64.x29 = (uc)->uc_mcontext.mc_gpregs.gp_x[29]; \
+        (srP)->misc.ARM64.x30 = (uc)->uc_mcontext.mc_gpregs.gp_lr; \
+      }
 
 #elif defined(VGP_s390x_linux)
 
@@ -1068,6 +1083,14 @@ extern void my_sigreturn(void);
     "my_sigreturn:\n" \
     "ud2\n" \
     ".previous\n"
+#elif defined(VGP_arm64_freebsd)
+/* Not used on FreeBSD */
+# define _MY_SIGRETURN(name) \
+".text\n" \
+   ".globl my_sigreturn\n" \
+   "my_sigreturn:\n" \
+   "udf #0\n" \
+   ".previous\n"
 #else
 #  error Unknown platform
 #endif
index 0ec6f5993a10a1abbc45881be9eafcb5aa4635cd..0889a6517c01c041f40e3f82ae88041fcca98845 100644 (file)
@@ -1161,7 +1161,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
 
 /* ------------------------ arm64 ------------------------- */
 
-#if defined(VGP_arm64_linux)
+#if defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
 
 UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
                                /*OUT*/Addr* ips, UInt max_n_ips,
@@ -1207,14 +1207,20 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
    /* vg_assert(fp_min <= fp_max);*/
    // On Darwin, this kicks in for pthread-related stack traces, so they're
    // only 1 entry long which is wrong.
+#  if defined(VGO_linux)
    if (fp_min + 512 >= fp_max) {
+#  elif defined(VGO_freebsd)
+   if (fp_max == 0) {
+#endif
+#  if defined(VGO_linux) || defined(VGO_freebsd)
       /* If the stack limits look bogus, don't poke around ... but
          don't bomb out either. */
       if (sps) sps[0] = uregs.sp;
       if (fps) fps[0] = uregs.x29;
       ips[0] = uregs.pc;
       return 1;
-   } 
+   }
+#endif
 
    /* */
 
index 1e49ed4121b3b987cb13922c9aba8973d38d4885..6ab20694d696ac506400a33035e1259002ba6099 100644 (file)
@@ -383,6 +383,14 @@ SysRes VG_(mk_SysRes_amd64_freebsd) ( ULong val, ULong val2, Bool err ) {
    return r;
 }
 
+SysRes VG_(mk_SysRes_arm64_freebsd) ( ULong val, ULong val2, Bool err ) {
+   SysRes r;
+   r._isError = err;
+   r._val = val;
+   r._val2 = val2;
+   return r;
+}
+
 /* Generic constructors. */
 SysRes VG_(mk_SysRes_Error) ( UWord err ) {
    SysRes r;
@@ -785,6 +793,40 @@ asm(
 ".previous\n"
 );
 
+#elif defined(VGP_arm64_freebsd)
+
+/*
+ * Arguments a1 to a8 are in registers x0 to x7.
+ * Which is just what we want for a syscall.
+ *
+ * The syscall number is on the top of the stack
+ * pointed to by sp. The flags are at sp+8 and
+ * second return value at sp+16.
+ */
+
+extern UWord do_syscall_WRK (
+   UWord a1, UWord a2, UWord a3,
+   UWord a4, UWord a5, UWord a6,
+   UWord a7, UWord a8,
+   UWord syscall_no,
+   UInt *flags,  UWord *rv2
+   );
+asm(
+   ".text\n"
+   ".globl do_syscall_WRK\n"
+   "do_syscall_WRK:\n"
+   "        ldr  x8, [sp]\n"          // retrieve syscall_no, put it in x8
+   "        svc  0x0\n"               // do the syscall
+   "        mov  x9, 1\n"             // flags for error will be 1 or 0
+   "        csel x9, x9, xzr, cs\n"   // conditionally select 1 or 0 into x9
+   "        ldr  x10, [sp, #8]\n"     // load the address of flags
+   "        str  w9, [x10]\n"         // store flags result
+   "        ldr  x10, [sp, #16]\n"    // load the addres of rv2
+   "        str  x1, [x10]\n"         // store rv2 result
+   "        ret\n"
+   ".previous\n"
+   );
+
 #elif defined(VGP_x86_darwin)
 
 /* Incoming args (syscall number + up to 8 args) come in on the stack
@@ -1156,6 +1198,14 @@ SysRes VG_(do_syscall) ( UWord sysno, RegWord a1, RegWord a2, RegWord a3,
                         a6, a7, a8, &err, &val2);
    return VG_(mk_SysRes_amd64_freebsd)( val, val2, (err & 1) != 0 ? True : False);
 
+#  elif defined(VGP_arm64_freebsd)
+   UWord val;
+   UWord val2 = 0;
+   UInt err = 0;
+   val = do_syscall_WRK(a1, a2, a3, a4, a5,
+                        a6, a7, a8, sysno, &err, &val2);
+   return VG_(mk_SysRes_arm64_freebsd)( val, val2, (err & 1) != 0 ? True : False);
+
 #  elif defined(VGP_ppc32_linux)
    ULong ret     = do_syscall_WRK(sysno,a1,a2,a3,a4,a5,a6);
    UInt  val     = (UInt)(ret>>32);
index dd241839a670db9211d35c43528769e85faa90d7..6be22f8e762ab2e98bc7df1a44e085571884ad2e 100644 (file)
@@ -50,9 +50,6 @@
 /* Arguments for a syscall. */
 typedef
    struct SyscallArgs {
-#if defined(VGO_freebsd)
-      Word klass;
-#endif
       Word sysno;
       RegWord arg1;
       RegWord arg2;
@@ -62,6 +59,9 @@ typedef
       RegWord arg6;
       RegWord arg7;
       RegWord arg8;
+#if defined(VGO_freebsd)
+      Word klass;
+#endif
    }
    SyscallArgs;
 
@@ -137,6 +137,15 @@ typedef
       Int s_arg7;
       Int s_arg8;
       Bool arg6_is_reg;
+#     elif defined(VGP_arm64_freebsd)
+      Int o_arg1;
+      Int o_arg2;
+      Int o_arg3;
+      Int o_arg4;
+      Int o_arg5;
+      Int o_arg6;
+      Int o_arg7;
+      Int o_arg8;
 #     elif defined(VGP_mips32_linux)
       Int o_arg1;
       Int o_arg2;
@@ -499,6 +508,17 @@ static inline UWord getERR ( SyscallStatus* st ) {
 #  define PRA7(s,t,a) PSRAn(7,s,t,a)
 #  define PRA8(s,t,a) PSRAn(8,s,t,a)
 
+#elif defined(VGP_arm64_freebsd)
+   /* Up to 7 parameters, all in registers. */
+#  define PRA1(s,t,a) PRRAn(1,s,t,a)
+#  define PRA2(s,t,a) PRRAn(2,s,t,a)
+#  define PRA3(s,t,a) PRRAn(3,s,t,a)
+#  define PRA4(s,t,a) PRRAn(4,s,t,a)
+#  define PRA5(s,t,a) PRRAn(5,s,t,a)
+#  define PRA6(s,t,a) PRRAn(6,s,t,a)
+#  define PRA7(s,t,a) PRRAn(7,s,t,a)
+#  define PRA8(s,t,a) PRRAn(8,s,t,a)
+
 #elif defined(VGP_x86_darwin) || defined(VGP_x86_solaris)
    /* Up to 8 parameters, all on the stack. */
 #  define PRA1(s,t,a) PSRAn(1,s,t,a)
diff --git a/coregrind/m_syswrap/syscall-arm64-freebsd.S b/coregrind/m_syswrap/syscall-arm64-freebsd.S
new file mode 100644 (file)
index 0000000..52ba022
--- /dev/null
@@ -0,0 +1,192 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Support for doing system calls.      syscall-arm64-freebsd.S ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+  This file is part of Valgrind, a dynamic binary instrumentation
+  framework.
+
+  Copyright (C) 2024 Paul Floyd
+     pjfloyd@wanadoo.fr
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+  The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics_asm.h"
+
+#if defined(VGP_arm64_freebsd)
+
+#include "pub_core_vkiscnums_asm.h"
+#include "libvex_guest_offsets.h"
+
+/*----------------------------------------------------------------*/
+/*
+        Perform a syscall for the client.  This will run a syscall
+        with the client's specific per-thread signal mask.
+
+        The structure of this function is such that, if the syscall is
+        interrupted by a signal, we can determine exactly what
+        execution state we were in with respect to the execution of
+        the syscall by examining the value of IP in the signal
+        handler.  This means that we can always do the appropriate
+        thing to precisely emulate the kernel's signal/syscall
+        interactions.
+
+        The syscall number is taken from the argument, even though it
+        should also be in guest_state->guest_X8.  The syscall result
+       is written back to guest_state->guest_X0 on completion.
+
+        Returns 0 if the syscall was successfully called (even if the
+        syscall itself failed), or a nonzero error code in the lowest
+        8 bits if one of the sigprocmasks failed (there's no way to
+        determine which one failed).  And there's no obvious way to
+        recover from that either, but nevertheless we want to know.
+
+        VG_(fixup_guest_state_after_syscall_interrupted) does the
+        thread state fixup in the case where we were interrupted by a
+        signal.
+
+        Prototype:
+
+   UWord ML_(do_syscall_for_client_WRK)(
+              Int syscallno,                 // x0
+              void* guest_state,             // x1
+              const vki_sigset_t *sysmask,   // x2
+              const vki_sigset_t *postmask,  // x3
+              Int nsigwords)                 // x4
+*/
+/* from vki-arm64-freebsd.h */
+#define VKI_SIG_SETMASK 3
+
+.globl ML_(do_syscall_for_client_WRK)
+ML_(do_syscall_for_client_WRK):
+
+   /* Stash callee-saves and our args on the stack */
+   stp  x29, x30, [sp, #-16]!
+   stp  x27, x28, [sp, #-16]!
+   stp  x25, x26, [sp, #-16]!
+   stp  x23, x24, [sp, #-16]!
+   stp  x21, x22, [sp, #-16]!
+   stp  x19, x20, [sp, #-16]!
+   stp  x4,  x5,  [sp, #-16]!
+   stp  x2,  x3,  [sp, #-16]!
+   stp  x0,  x1,  [sp, #-16]!
+
+1:
+
+   mov x8, #__NR_sigprocmask
+   mov x0, #VKI_SIG_SETMASK
+   mov x1, x2 /* sysmask */
+   mov x2, x3 /* postmask */
+   mov x3, x4 /* nsigwords */
+   svc 0x00000000
+
+   ldr x9, [sp, #8] /* saved x1 == guest_state */
+
+   ldr x8, [sp, #0] /* saved x0 == syscall# */
+   ldr x0, [x9, #OFFSET_arm64_X0]
+   ldr x1, [x9, #OFFSET_arm64_X1]
+   ldr x2, [x9, #OFFSET_arm64_X2]
+   ldr x3, [x9, #OFFSET_arm64_X3]
+   ldr x4, [x9, #OFFSET_arm64_X4]
+   ldr x5, [x9, #OFFSET_arm64_X5]
+   ldr x6, [x9, #OFFSET_arm64_X6]
+   ldr x7, [x9, #OFFSET_arm64_X7]
+
+2: svc 0x00000000
+3:
+
+   /* stash returned carry flag */
+   mov x4, 1
+   csel x4, x4, xzr, cs
+
+   ldr x5, [sp, #8] /* saved x1 == guest_state */
+   str x0, [x5, #OFFSET_arm64_X0]
+   str x1, [x5, #OFFSET_arm64_X1]
+
+   /* save carry flag to VEX */
+   mov x0, x4       /* arg1 = new flag */
+   ldr x1, [sp, #8] /* arg2 = vex state */
+   mov x20, 1
+   str x20, [x1, #OFFSET_arm64_SETC]
+   bl LibVEX_GuestARM64_put_nzcv_c
+   ldr x1, [sp, #8] /* arg2 = vex state */
+   mov x20, 0
+   str x20, [x1, #OFFSET_arm64_SETC]
+
+4:
+   mov x8, #__NR_sigprocmask
+   mov x0, #VKI_SIG_SETMASK
+   ldr x1, [sp, #24] /* saved x3 == postmask */
+   mov x2, #0
+   ldr x3, [sp, #32] /* saved x4 == nsigwords */
+   cmn     xzr, xzr /* clear the carry flag */
+   svc 0x00000000
+
+   blt 7f
+
+5: /* Success: return zero */
+   mov  x0, #0
+   ldp  xzr, x1,  [sp], #16
+   ldp  x2,  x3,  [sp], #16
+   ldp  x4,  x5,  [sp], #16
+   ldp  x19, x20, [sp], #16
+   ldp  x21, x22, [sp], #16
+   ldp  x23, x24, [sp], #16
+   ldp  x25, x26, [sp], #16
+   ldp  x27, x28, [sp], #16
+   ldp  x29, x30, [sp], #16
+   ret
+
+7: /* Failure: return 0x8000 | error code */
+   orr  x0, x0, #0x8000
+   ldp  xzr, x1,  [sp], #16
+   ldp  x2,  x3,  [sp], #16
+   ldp  x4,  x5,  [sp], #16
+   ldp  x19, x20, [sp], #16
+   ldp  x21, x22, [sp], #16
+   ldp  x23, x24, [sp], #16
+   ldp  x25, x26, [sp], #16
+   ldp  x27, x28, [sp], #16
+   ldp  x29, x30, [sp], #16
+   ret
+
+.section .rodata
+/* export the ranges so that
+   VG_(fixup_guest_state_after_syscall_interrupted) can do the
+   right thing */
+
+.align 3
+.globl ML_(blksys_setup)
+.globl ML_(blksys_restart)
+.globl ML_(blksys_complete)
+.globl ML_(blksys_committed)
+.globl ML_(blksys_finished)
+ML_(blksys_setup):      .quad 1b
+ML_(blksys_restart):    .quad 2b
+ML_(blksys_complete):   .quad 3b
+ML_(blksys_committed):  .quad 4b
+ML_(blksys_finished):   .quad 5b
+
+#endif // defined(VGP_arm_freebsd)
+
+/* Let the linker know we don't need an executable stack */
+MARK_STACK_NO_EXEC
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/coregrind/m_syswrap/syswrap-arm64-freebsd.c b/coregrind/m_syswrap/syswrap-arm64-freebsd.c
new file mode 100644 (file)
index 0000000..391c8b3
--- /dev/null
@@ -0,0 +1,1057 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Platform-specific syscalls stuff.    syswrap-arm64-freebsd.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2024 Paul Floyd
+      pjfloyd@wanadoo.fr
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+/*
+ * This port of Valgrind was done in the first quarter of 2024
+ * The FreeBSD platforms supported at that time were
+ * 13.3-RELEASE - not tested but should work
+ * 14.0-RELEASE - the platform used for porting
+ * 15.0-CURRENT - tested and should work
+ *
+ * Old syscalls that are specific releases are not handled. In the
+ * unlikely event that they are ever needed they can probably just be
+ * copied from the amd64 implementation. The first FreeBSD version with
+ * arm64 support was 11.0-RELEASE
+ */
+
+#if defined(VGP_arm64_freebsd)
+
+#include "pub_core_aspacemgr.h"
+#include "pub_core_basics.h"
+#include "pub_core_debuglog.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_libcprint.h"
+#include "pub_core_libcproc.h"
+#include "pub_core_libcsignal.h"
+#include "pub_core_machine.h"
+#include "pub_core_options.h"
+#include "pub_core_scheduler.h"
+#include "pub_core_sigframe.h"
+#include "pub_core_signals.h"
+#include "pub_core_stacks.h" // VG_(register_stack)
+#include "pub_core_syscall.h"
+#include "pub_core_syswrap.h"
+#include "pub_core_threadstate.h"
+#include "pub_core_tooliface.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
+
+#include "priv_syswrap-freebsd.h" /* for decls of freebsd-ish wrappers */
+#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
+#include "priv_syswrap-main.h"
+#include "priv_types_n_macros.h"
+
+/* ---------------------------------------------------------------------
+   clone() handling
+   ------------------------------------------------------------------ */
+
+/* Call f(arg1), but first switch stacks, using 'stack' as the new
+   stack, and use 'retaddr' as f's return-to address.  Also, clear all
+   the integer registers before entering f. */
+__attribute__((noreturn)) void ML_(call_on_new_stack_0_1)(Addr stack,
+                                                          Addr retaddr,
+                                                          void (*f)(Word),
+                                                          Word arg1);
+//    r0 = stack
+//    r1 = retaddr
+//    r2 = f
+//    r3 = arg1
+asm(
+   ".text\n"
+   ".globl vgModuleLocal_call_on_new_stack_0_1\n"
+   "vgModuleLocal_call_on_new_stack_0_1:\n"
+   "   mov    sp, x0\n\t"  /* Stack pointer */
+   "   mov    x30, x1\n\t" /* Return address (x30 is LR) */
+   "   mov    x0, x3\n\t"  /* First argument */
+   "   mov    x9, x2\n\t" /* 'f': x9 won't be zeroed at start of f.  Oh well. */
+   "   mov    x1, #0\n\t" /* Clear our GPRs */
+   "   mov    x2, #0\n\t"
+   "   mov    x3, #0\n\t"
+   "   mov    x4, #0\n\t"
+   "   mov    x5, #0\n\t"
+   "   mov    x6, #0\n\t"
+   "   mov    x7, #0\n\t"
+   "   mov    x8, #0\n\t"
+   /* don't zero out x9 */
+   "   mov    x10, #0\n\t"
+   "   mov    x11, #0\n\t"
+   "   mov    x12, #0\n\t"
+   "   mov    x13, #0\n\t"
+   "   mov    x14, #0\n\t"
+   "   mov    x15, #0\n\t"
+   "   mov    x16, #0\n\t"
+   "   mov    x17, #0\n\t"
+   /* "   mov    x18, #0\n\t"*/
+   "   mov    x19, #0\n\t"
+   "   mov    x20, #0\n\t"
+   "   mov    x21, #0\n\t"
+   "   mov    x22, #0\n\t"
+   "   mov    x23, #0\n\t"
+   "   mov    x24, #0\n\t"
+   "   mov    x25, #0\n\t"
+   "   mov    x26, #0\n\t"
+   "   mov    x27, #0\n\t"
+   "   mov    x28, #0\n\t"
+   "   mov    x29, sp\n\t" /* FP = SP, in the absence of better suggestions */
+   "   br     x9\n\t"
+   /*   "   ret x30\n"    */ // jump to f
+   "   udf #0\n"             // should never get here
+   ".previous\n");
+
+/* ---------------------------------------------------------------------
+   More thread stuff
+   ------------------------------------------------------------------ */
+
+void VG_(cleanup_thread)(ThreadArchState* arch) {}
+
+/* ---------------------------------------------------------------------
+   PRE/POST wrappers for amd64/FreeBSD-specific syscalls
+   ------------------------------------------------------------------ */
+
+#define PRE(name)  DEFN_PRE_TEMPLATE(freebsd, name)
+#define POST(name) DEFN_POST_TEMPLATE(freebsd, name)
+
+// SYS_sysarch 165
+// int sysarch(int number, void *args);
+PRE(sys_sysarch)
+{
+   PRINT("sys_sysarch ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x )", ARG1, ARG2);
+   PRE_REG_READ2(int, "sysarch", int, number, void*, args);
+   // returns ENOTSUP on arm64
+}
+
+POST(sys_sysarch) {}
+
+// SYS_clock_getcpuclockid2   247
+// no manpage for this, from syscalls.master
+// int clock_getcpuclockid2(id_t id, int which, _Out_ clockid_t *clock_id);
+PRE(sys_clock_getcpuclockid2)
+{
+   PRINT("sys_clock_getcpuclockid2( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %#" FMT_REGWORD "x )",
+         SARG1, SARG2, ARG3);
+   PRE_REG_READ3(int, "clock_getcpuclockid2", id_t, id, int, len, clockid_t*,
+                 clock_id);
+   PRE_MEM_WRITE("clock_getcpuclockid2(clock_id)", ARG3, sizeof(vki_clockid_t));
+}
+
+// SYS_rfork 251
+// pid_t rfork(int flags);
+PRE(sys_rfork)
+{
+   PRINT("sys_rfork ( %#" FMT_REGWORD "x )", ARG1);
+   PRE_REG_READ1(pid_t, "rfork", int, flags);
+
+   VG_(message)(Vg_UserMsg, "warning: rfork() not implemented\n");
+
+   if ((UInt)ARG1 == VKI_RFSPAWN) {
+      // posix_spawn uses RFSPAWN and it will fall back to vfork
+      // if it sees EINVAL
+      SET_STATUS_Failure(VKI_EINVAL);
+   } else {
+      SET_STATUS_Failure(VKI_ENOSYS);
+   }
+}
+
+// SYS_preadv  289
+// ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset);
+PRE(sys_preadv)
+{
+   Int               i;
+   struct vki_iovec* vec;
+   char              buf[sizeof("preadv(iov[])") + 11];
+   *flags |= SfMayBlock;
+   PRINT("sys_preadv ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD
+         "d, %" FMT_REGWORD "d )",
+         SARG1, ARG2, SARG3, SARG4);
+   PRE_REG_READ4(ssize_t, "preadv", int, fd, const struct iovec*, iov, int,
+                 iovcnt, vki_off_t, offset);
+   if (!ML_(fd_allowed)(ARG1, "preadv", tid, False)) {
+      SET_STATUS_Failure(VKI_EBADF);
+   } else {
+      if ((Int)ARG3 > 0) {
+         PRE_MEM_READ("preadv(iov)", ARG2, ARG3 * sizeof(struct vki_iovec));
+      }
+
+      if (ML_(safe_to_deref)((struct vki_iovec*)ARG2,
+                             ARG3 * sizeof(struct vki_iovec))) {
+         vec = (struct vki_iovec*)(Addr)ARG2;
+         for (i = 0; i < (Int)ARG3; i++) {
+            VG_(sprintf)(buf, "preadv(iov[%d])", i);
+            PRE_MEM_WRITE(buf, (Addr)vec[i].iov_base, vec[i].iov_len);
+         }
+      }
+   }
+}
+
+POST(sys_preadv)
+{
+   vg_assert(SUCCESS);
+   if (RES > 0) {
+      Int               i;
+      struct vki_iovec* vec     = (struct vki_iovec*)(Addr)ARG2;
+      Int               remains = RES;
+
+      /* RES holds the number of bytes read. */
+      for (i = 0; i < (Int)ARG3; i++) {
+         Int nReadThisBuf = vec[i].iov_len;
+         if (nReadThisBuf > remains) {
+            nReadThisBuf = remains;
+         }
+         POST_MEM_WRITE((Addr)vec[i].iov_base, nReadThisBuf);
+         remains -= nReadThisBuf;
+         if (remains < 0) {
+            VG_(core_panic)("preadv: remains < 0");
+         }
+      }
+   }
+}
+
+// SYS_pwritev 290
+// ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);
+PRE(sys_pwritev)
+{
+   Int               i;
+   struct vki_iovec* vec;
+   char              buf[sizeof("pwritev(iov[])") + 11];
+   *flags |= SfMayBlock;
+   PRINT("sys_pwritev ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD
+         "d, %" FMT_REGWORD "d )",
+         SARG1, ARG2, SARG3, SARG4);
+
+   PRE_REG_READ4(ssize_t, "pwritev", int, fd, const struct iovec*, iov, int,
+                 iovcnt, vki_off_t, offset);
+   if (!ML_(fd_allowed)(ARG1, "pwritev", tid, False)) {
+      SET_STATUS_Failure(VKI_EBADF);
+   } else {
+      if ((Int)ARG3 >= 0) {
+         PRE_MEM_READ("pwritev(vector)", ARG2, ARG3 * sizeof(struct vki_iovec));
+      }
+      if (ML_(safe_to_deref)((struct vki_iovec*)ARG2,
+                             ARG3 * sizeof(struct vki_iovec))) {
+         vec = (struct vki_iovec*)(Addr)ARG2;
+         for (i = 0; i < (Int)ARG3; i++) {
+            VG_(sprintf)(buf, "pwritev(iov[%d])", i);
+            PRE_MEM_READ(buf, (Addr)vec[i].iov_base, vec[i].iov_len);
+         }
+      }
+   }
+}
+
+// SYS_sendfile   393
+// int sendfile(int fd, int s, off_t offset, size_t nbytes,
+//         struct sf_hdtr *hdtr, off_t *sbytes, int flags);
+PRE(sys_sendfile)
+{
+   *flags |= SfMayBlock;
+
+   PRINT("sys_sendfile ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %lu, %" FMT_REGWORD "u, %#" FMT_REGWORD "x, %#" FMT_REGWORD
+         "x, %" FMT_REGWORD "d )",
+         SARG1, SARG2, ARG3, ARG4, ARG5, ARG6, SARG7);
+   PRE_REG_READ7(int, "sendfile", int, fd, int, s, vki_off_t, offset, size_t,
+                 nbytes, void*, hdtr, vki_off_t*, sbytes, int, flags);
+
+   if (ARG5 != 0) {
+      PRE_MEM_READ("sendfile(hdtr)", ARG5, sizeof(struct vki_sf_hdtr));
+   }
+
+   if (ARG6 != 0) {
+      PRE_MEM_WRITE("sendfile(sbytes)", ARG6, sizeof(vki_off_t));
+   }
+}
+
+POST(sys_sendfile)
+{
+   if (ARG6 != 0) {
+      POST_MEM_WRITE(ARG6, sizeof(vki_off_t));
+   }
+}
+
+// SYS_sigreturn  417
+// int sigreturn(const ucontext_t *scp);
+PRE(sys_sigreturn)
+{
+   PRINT("sys_sigreturn ( %#" FMT_REGWORD "x )", ARG1);
+   PRE_REG_READ1(int, "sigreturn", struct vki_ucontext*, scp);
+
+   PRE_MEM_READ("sigreturn(scp)", ARG1, sizeof(struct vki_ucontext));
+   PRE_MEM_WRITE("sigreturn(scp)", ARG1, sizeof(struct vki_ucontext));
+}
+
+static void restore_mcontext(ThreadState* tst, struct vki_mcontext* sc)
+{
+   tst->arch.vex.guest_X0  = sc->mc_gpregs.gp_x[0];
+   tst->arch.vex.guest_X1  = sc->mc_gpregs.gp_x[1];
+   tst->arch.vex.guest_X2  = sc->mc_gpregs.gp_x[2];
+   tst->arch.vex.guest_X3  = sc->mc_gpregs.gp_x[3];
+   tst->arch.vex.guest_X4  = sc->mc_gpregs.gp_x[4];
+   tst->arch.vex.guest_X5  = sc->mc_gpregs.gp_x[5];
+   tst->arch.vex.guest_X6  = sc->mc_gpregs.gp_x[6];
+   tst->arch.vex.guest_X7  = sc->mc_gpregs.gp_x[7];
+   tst->arch.vex.guest_X8  = sc->mc_gpregs.gp_x[8];
+   tst->arch.vex.guest_X9  = sc->mc_gpregs.gp_x[9];
+   tst->arch.vex.guest_X10 = sc->mc_gpregs.gp_x[10];
+   tst->arch.vex.guest_X11 = sc->mc_gpregs.gp_x[11];
+   tst->arch.vex.guest_X12 = sc->mc_gpregs.gp_x[12];
+   tst->arch.vex.guest_X13 = sc->mc_gpregs.gp_x[13];
+   tst->arch.vex.guest_X14 = sc->mc_gpregs.gp_x[14];
+   tst->arch.vex.guest_X15 = sc->mc_gpregs.gp_x[15];
+   tst->arch.vex.guest_X16 = sc->mc_gpregs.gp_x[16];
+   tst->arch.vex.guest_X17 = sc->mc_gpregs.gp_x[17];
+   tst->arch.vex.guest_X18 = sc->mc_gpregs.gp_x[18];
+   tst->arch.vex.guest_X19 = sc->mc_gpregs.gp_x[19];
+   tst->arch.vex.guest_X20 = sc->mc_gpregs.gp_x[20];
+   tst->arch.vex.guest_X21 = sc->mc_gpregs.gp_x[21];
+   tst->arch.vex.guest_X22 = sc->mc_gpregs.gp_x[22];
+   tst->arch.vex.guest_X23 = sc->mc_gpregs.gp_x[23];
+   tst->arch.vex.guest_X24 = sc->mc_gpregs.gp_x[24];
+   tst->arch.vex.guest_X25 = sc->mc_gpregs.gp_x[25];
+   tst->arch.vex.guest_X26 = sc->mc_gpregs.gp_x[26];
+   tst->arch.vex.guest_X27 = sc->mc_gpregs.gp_x[27];
+   tst->arch.vex.guest_X28 = sc->mc_gpregs.gp_x[28];
+   tst->arch.vex.guest_X29 = sc->mc_gpregs.gp_x[29];
+   tst->arch.vex.guest_X30 = sc->mc_gpregs.gp_lr;
+   tst->arch.vex.guest_XSP = sc->mc_gpregs.gp_sp;
+   tst->arch.vex.guest_PC  = sc->mc_gpregs.gp_elr;
+   /*
+    * XXX: missing support for other flags.
+    */
+   if (sc->mc_flags & VKI_PSR_C)
+      LibVEX_GuestARM64_put_nzcv_c(1, &tst->arch.vex);
+   else
+      LibVEX_GuestARM64_put_nzcv_c(0, &tst->arch.vex);
+}
+
+static void fill_mcontext(ThreadState* tst, struct vki_mcontext* sc)
+{
+   sc->mc_gpregs.gp_x[0]  = tst->arch.vex.guest_X0;
+   sc->mc_gpregs.gp_x[1]  = tst->arch.vex.guest_X1;
+   sc->mc_gpregs.gp_x[2]  = tst->arch.vex.guest_X2;
+   sc->mc_gpregs.gp_x[3]  = tst->arch.vex.guest_X3;
+   sc->mc_gpregs.gp_x[4]  = tst->arch.vex.guest_X4;
+   sc->mc_gpregs.gp_x[5]  = tst->arch.vex.guest_X5;
+   sc->mc_gpregs.gp_x[6]  = tst->arch.vex.guest_X6;
+   sc->mc_gpregs.gp_x[7]  = tst->arch.vex.guest_X7;
+   sc->mc_gpregs.gp_x[8]  = tst->arch.vex.guest_X8;
+   sc->mc_gpregs.gp_x[9]  = tst->arch.vex.guest_X9;
+   sc->mc_gpregs.gp_x[10] = tst->arch.vex.guest_X10;
+   sc->mc_gpregs.gp_x[11] = tst->arch.vex.guest_X11;
+   sc->mc_gpregs.gp_x[12] = tst->arch.vex.guest_X12;
+   sc->mc_gpregs.gp_x[13] = tst->arch.vex.guest_X13;
+   sc->mc_gpregs.gp_x[14] = tst->arch.vex.guest_X14;
+   sc->mc_gpregs.gp_x[15] = tst->arch.vex.guest_X15;
+   sc->mc_gpregs.gp_x[16] = tst->arch.vex.guest_X16;
+   sc->mc_gpregs.gp_x[17] = tst->arch.vex.guest_X17;
+   sc->mc_gpregs.gp_x[18] = tst->arch.vex.guest_X18;
+   sc->mc_gpregs.gp_x[19] = tst->arch.vex.guest_X19;
+   sc->mc_gpregs.gp_x[20] = tst->arch.vex.guest_X20;
+   sc->mc_gpregs.gp_x[21] = tst->arch.vex.guest_X21;
+   sc->mc_gpregs.gp_x[22] = tst->arch.vex.guest_X22;
+   sc->mc_gpregs.gp_x[23] = tst->arch.vex.guest_X23;
+   sc->mc_gpregs.gp_x[24] = tst->arch.vex.guest_X24;
+   sc->mc_gpregs.gp_x[25] = tst->arch.vex.guest_X25;
+   sc->mc_gpregs.gp_x[26] = tst->arch.vex.guest_X26;
+   sc->mc_gpregs.gp_x[27] = tst->arch.vex.guest_X27;
+   sc->mc_gpregs.gp_x[28] = tst->arch.vex.guest_X28;
+   sc->mc_gpregs.gp_x[29] = tst->arch.vex.guest_X29;
+   sc->mc_gpregs.gp_lr    = tst->arch.vex.guest_X30;
+   sc->mc_gpregs.gp_sp    = tst->arch.vex.guest_XSP;
+   sc->mc_gpregs.gp_elr   = tst->arch.vex.guest_PC;
+   sc->mc_gpregs.gp_spsr  = LibVEX_GuestARM64_get_nzcv(&tst->arch.vex);
+
+   // @todo PJF ARM64 floating point
+   // https://github.com/freebsd/freebsd-src/blob/main/sys/arm64/arm64/exec_machdep.c#L511
+}
+
+// SYS_getcontext 421
+// int getcontext(ucontext_t *ucp);
+PRE(sys_getcontext)
+{
+   ThreadState*         tst;
+   struct vki_ucontext* uc;
+
+   PRINT("sys_getcontext ( %#" FMT_REGWORD "x )", ARG1);
+   PRE_REG_READ1(int, "getcontext", struct vki_ucontext*, ucp);
+   PRE_MEM_WRITE("getcontext(ucp)", ARG1, sizeof(struct vki_ucontext));
+   uc = (struct vki_ucontext*)ARG1;
+   if (!ML_(safe_to_deref)(uc, sizeof(struct vki_ucontext))) {
+      SET_STATUS_Failure(VKI_EFAULT);
+      return;
+   }
+   tst = VG_(get_ThreadState)(tid);
+   fill_mcontext(tst, &uc->uc_mcontext);
+   uc->uc_mcontext.mc_gpregs.gp_x[0] = 0;
+   uc->uc_mcontext.mc_gpregs.gp_spsr &= ~VKI_PSR_C;
+   uc->uc_sigmask = tst->sig_mask;
+   VG_(memset)(uc->__spare__, 0, sizeof(uc->__spare__));
+   SET_STATUS_Success(0);
+}
+
+// SYS_setcontext 422
+// int setcontext(const ucontext_t *ucp);
+PRE(sys_setcontext)
+{
+   ThreadState*         tst;
+   struct vki_ucontext* uc;
+
+   PRINT("sys_setcontext ( %#" FMT_REGWORD "x )", ARG1);
+   PRE_REG_READ1(long, "setcontext", struct vki_ucontext*, ucp);
+
+   PRE_MEM_READ("setcontext(ucp)", ARG1, sizeof(struct vki_ucontext));
+   PRE_MEM_WRITE("setcontext(ucp)", ARG1, sizeof(struct vki_ucontext));
+
+   vg_assert(VG_(is_valid_tid)(tid));
+   vg_assert(tid >= 1 && tid < VG_N_THREADS);
+   vg_assert(VG_(is_running_thread)(tid));
+
+   tst = VG_(get_ThreadState)(tid);
+   uc  = (struct vki_ucontext*)ARG1;
+   if (!ML_(safe_to_deref)(uc, sizeof(struct vki_ucontext)) /*|| uc->uc_mcontext.len != sizeof(uc->uc_mcontext)*/) {
+      SET_STATUS_Failure(VKI_EFAULT);
+      return;
+   }
+
+   restore_mcontext(tst, &uc->uc_mcontext);
+   tst->sig_mask     = uc->uc_sigmask;
+   tst->tmp_sig_mask = uc->uc_sigmask;
+
+   /* Tell the driver not to update the guest state with the "result",
+      and set a bogus result to keep it happy. */
+   *flags |= SfNoWriteResult;
+   SET_STATUS_Success(0);
+
+   /* Check to see if some any signals arose as a result of this. */
+   *flags |= SfPollAfter;
+}
+
+// SYS_swapcontext   423
+// int swapcontext(ucontext_t *oucp, const ucontext_t *ucp);
+PRE(sys_swapcontext)
+{
+   struct vki_ucontext* ucp;
+   struct vki_ucontext* oucp;
+   ThreadState*         tst;
+
+   PRINT("sys_swapcontext ( %#" FMT_REGWORD "x, %#" FMT_REGWORD "x )", ARG1,
+         ARG2);
+   PRE_REG_READ2(long, "swapcontext", struct vki_ucontext*, oucp,
+                 struct vki_ucontext*, ucp);
+
+   PRE_MEM_READ("swapcontext(ucp)", ARG2, sizeof(struct vki_ucontext));
+   PRE_MEM_WRITE("swapcontext(oucp)", ARG1, sizeof(struct vki_ucontext));
+
+   oucp = (struct vki_ucontext*)ARG1;
+   ucp  = (struct vki_ucontext*)ARG2;
+   if (!ML_(safe_to_deref)(oucp, sizeof(struct vki_ucontext)) ||
+         !ML_(safe_to_deref)(ucp, sizeof(struct vki_ucontext)) /*||
+         ucp->uc_mcontext.len != sizeof(ucp->uc_mcontext)*/) {
+      SET_STATUS_Failure(VKI_EINVAL);
+      return;
+   }
+   tst = VG_(get_ThreadState)(tid);
+
+   /*
+    * Save the context.
+    */
+   fill_mcontext(tst, &oucp->uc_mcontext);
+   oucp->uc_mcontext.mc_gpregs.gp_x[0] = 0;
+   oucp->uc_mcontext.mc_gpregs.gp_x[1] = 0;
+   oucp->uc_mcontext.mc_gpregs.gp_spsr &= ~VKI_PSR_C;
+   oucp->uc_sigmask = tst->sig_mask;
+   VG_(memset)(oucp->__spare__, 0, sizeof(oucp->__spare__));
+
+   /*
+    * Switch to new one.
+    */
+   restore_mcontext(tst, &ucp->uc_mcontext);
+   tst->sig_mask     = ucp->uc_sigmask;
+   tst->tmp_sig_mask = ucp->uc_sigmask;
+
+   /* Tell the driver not to update the guest state with the "result",
+      and set a bogus result to keep it happy. */
+   *flags |= SfNoWriteResult;
+   SET_STATUS_Success(0);
+
+   /* Check to see if some any signals arose as a result of this. */
+   *flags |= SfPollAfter;
+}
+
+// SYS_thr_new 455
+// int thr_new(struct thr_param *param, int param_size);
+PRE(sys_thr_new)
+{
+   static const Bool debug = False;
+
+   ThreadId             ctid = VG_(alloc_ThreadState)();
+   ThreadState*         ptst = VG_(get_ThreadState)(tid);
+   ThreadState*         ctst = VG_(get_ThreadState)(ctid);
+   SysRes               res;
+   vki_sigset_t         blockall;
+   vki_sigset_t         savedmask;
+   struct vki_thr_param tp;
+   Addr                 stk;
+
+   PRINT("thr_new ( %#" FMT_REGWORD "x, %" FMT_REGWORD "u )", ARG1, ARG2);
+   PRE_REG_READ2(int, "thr_new", struct thr_param*, param, int, param_size);
+
+   PRE_MEM_READ("thr_new(param)", ARG1, offsetof(struct vki_thr_param, spare));
+   if (!ML_(safe_to_deref)((void*)ARG1,
+                           offsetof(struct vki_thr_param, spare))) {
+      SET_STATUS_Failure(VKI_EFAULT);
+      return;
+   }
+   VG_(memset)(&tp, 0, sizeof(tp));
+   VG_(memcpy)(&tp, (void*)ARG1, offsetof(struct vki_thr_param, spare));
+   PRE_MEM_WRITE("thr_new(parent_tidptr)", (Addr)tp.parent_tid, sizeof(long));
+   PRE_MEM_WRITE("thr_new(child_tidptr)", (Addr)tp.child_tid, sizeof(long));
+
+   VG_(sigfillset)(&blockall);
+
+   vg_assert(VG_(is_running_thread)(tid));
+   vg_assert(VG_(is_valid_tid)(ctid));
+
+   /* Copy register state
+
+      On linux, both parent and child return to the same place, and the code
+      following the clone syscall works out which is which, so we
+      don't need to worry about it.
+      On FreeBSD, thr_new arranges a direct call.  We don't actually need any
+      of this gunk.
+
+      The parent gets the child's new tid returned from clone, but the
+      child gets 0.
+
+      If the clone call specifies a NULL rsp for the new thread, then
+      it actually gets a copy of the parent's rsp.
+   */
+   /* We inherit our parent's guest state. */
+   ctst->arch.vex         = ptst->arch.vex;
+   ctst->arch.vex_shadow1 = ptst->arch.vex_shadow1;
+   ctst->arch.vex_shadow2 = ptst->arch.vex_shadow2;
+
+   /* Make thr_new appear to have returned Success(0) in the
+      child. */
+   ctst->arch.vex.guest_X0 = 0;
+   ctst->arch.vex.guest_X1 = 0;
+   LibVEX_GuestARM64_put_nzcv_c(0, &ctst->arch.vex);
+
+   ctst->os_state.parent = tid;
+
+   /* inherit signal mask */
+   ctst->sig_mask     = ptst->sig_mask;
+   ctst->tmp_sig_mask = ptst->sig_mask;
+
+   /* Linux has to guess, we don't */
+   ctst->client_stack_highest_byte = (Addr)tp.stack_base + tp.stack_size;
+   ctst->client_stack_szB          = tp.stack_size;
+   ctst->os_state.stk_id           = VG_(register_stack)(
+      (Addr)tp.stack_base, (Addr)tp.stack_base + tp.stack_size);
+
+   /* Assume the thr_new will succeed, and tell any tool that wants to
+      know that this thread has come into existence.  If the thr_new
+      fails, we'll send out a ll_exit notification for it at the out:
+      label below, to clean up. */
+   VG_TRACK(pre_thread_ll_create, tid, ctid);
+
+   if (debug) {
+      VG_(printf)("clone child has SETTLS: tls at %#lx\n", (Addr)tp.tls_base);
+   }
+
+   ctst->arch.vex.guest_TPIDR_EL0 = (UWord)tp.tls_base;
+   tp.tls_base                    = 0; /* Don't have the kernel do it too */
+
+   /* start the thread with everything blocked */
+   VG_(sigprocmask)(VKI_SIG_SETMASK, &blockall, &savedmask);
+
+   /* Set the client state for scheduler to run libthr's trampoline */
+   ctst->arch.vex.guest_X0 = (Addr)tp.arg;
+   /* XXX: align on 16-byte boundary? */
+   ctst->arch.vex.guest_XSP = (Addr)tp.stack_base + tp.stack_size - 8;
+   ctst->arch.vex.guest_PC  = (Addr)tp.start_func;
+
+   /* But this is for thr_new() to run valgrind's trampoline */
+   tp.start_func = (void*)ML_(start_thread_NORETURN);
+   tp.arg        = &VG_(threads)[ctid];
+
+   /* And valgrind's trampoline on its own stack */
+   stk = ML_(allocstack)(ctid);
+   if (stk == (Addr)NULL) {
+      res = VG_(mk_SysRes_Error)(VKI_ENOMEM);
+      goto fail;
+   }
+   tp.stack_base = (void*)ctst->os_state.valgrind_stack_base;
+   tp.stack_size = (Addr)stk - (Addr)tp.stack_base;
+
+   /* Create the new thread */
+   res = VG_(do_syscall2)(__NR_thr_new, (UWord)&tp, sizeof(tp));
+
+   VG_(sigprocmask)(VKI_SIG_SETMASK, &savedmask, NULL);
+
+fail:
+   if (sr_isError(res)) {
+      /* thr_new failed */
+      VG_(cleanup_thread)(&ctst->arch);
+      ctst->status = VgTs_Empty;
+      /* oops.  Better tell the tool the thread exited in a hurry :-) */
+      VG_TRACK(pre_thread_ll_exit, ctid);
+   } else {
+
+      POST_MEM_WRITE((Addr)tp.parent_tid, sizeof(long));
+      POST_MEM_WRITE((Addr)tp.child_tid, sizeof(long));
+
+      /* Thread creation was successful; let the child have the chance
+         to run */
+      *flags |= SfYieldAfter;
+   }
+
+   /* "Complete" the syscall so that the wrapper doesn't call the kernel again.
+    */
+   SET_STATUS_from_SysRes(res);
+}
+
+// SYS_pread   475
+// ssize_t pread(int fd, void *buf, size_t nbytes, off_t offset);
+PRE(sys_pread)
+{
+   *flags |= SfMayBlock;
+   PRINT("sys_pread ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "u )",
+         ARG1, ARG2, ARG3, ARG4);
+   PRE_REG_READ4(ssize_t, "pread", unsigned int, fd, char*, buf, vki_size_t,
+                 count, unsigned long, off);
+
+   if (!ML_(fd_allowed)(ARG1, "read", tid, False)) {
+      SET_STATUS_Failure(VKI_EBADF);
+   } else {
+      PRE_MEM_WRITE("pread(buf)", ARG2, ARG3);
+   }
+}
+
+POST(sys_pread)
+{
+   vg_assert(SUCCESS);
+   POST_MEM_WRITE(ARG2, RES);
+}
+
+// SYS_pwrite  476
+// ssize_t pwrite(int fd, const void *buf, size_t nbytes, off_t offset);
+PRE(sys_pwrite)
+{
+   Bool ok;
+   *flags |= SfMayBlock;
+   PRINT("sys_pwrite ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "u )",
+         ARG1, ARG2, ARG3, ARG4);
+   PRE_REG_READ4(ssize_t, "pwrite", int, fd, const char*, buf, vki_size_t,
+                 nbytes, vki_off_t, offset);
+   /* check to see if it is allowed.  If not, try for an exemption from
+      --sim-hints=enable-outer (used for self hosting). */
+   ok = ML_(fd_allowed)(ARG1, "pwrite", tid, False);
+   if (!ok && ARG1 == 2 /*stderr*/
+       && SimHintiS(SimHint_enable_outer, VG_(clo_sim_hints)))
+      ok = True;
+   if (!ok) {
+      SET_STATUS_Failure(VKI_EBADF);
+   } else {
+      PRE_MEM_READ("pwrite(buf)", ARG2, ARG3);
+   }
+}
+
+// SYS_mmap 477
+/* FreeBSD-7 introduces a "regular" version of mmap etc. */
+// void * mmap(void *addr, size_t len, int prot, int flags, int fd, off_t
+// offset);
+PRE(sys_mmap)
+{
+   SysRes r;
+
+   PRINT("sys_mmap ( %#" FMT_REGWORD "x, %" FMT_REGWORD "u, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "u, %" FMT_REGWORD "u, 0x%" FMT_REGWORD "x)",
+         ARG1, (UWord)ARG2, ARG3, ARG4, ARG5, ARG6);
+   PRE_REG_READ6(void*, "mmap", void*, addr, size_t, len, int, prot, int, flags,
+                 int, fd, off_t, offset);
+
+   r = ML_(generic_PRE_sys_mmap)(tid, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
+   SET_STATUS_from_SysRes(r);
+}
+
+// SYS_lseek 478
+// off_t lseek(int fildes, off_t offset, int whence);
+PRE(sys_lseek)
+{
+   PRINT("sys_lseek ( %" FMT_REGWORD "u, 0x%" FMT_REGWORD "x, %" FMT_REGWORD
+         "u )",
+         ARG1, ARG2, ARG3);
+   PRE_REG_READ3(long, "lseek", unsigned int, fd, unsigned long, offset,
+                 unsigned int, whence);
+}
+
+// SYS_truncate   479
+// int truncate(const char *path, off_t length);
+PRE(sys_truncate)
+{
+   *flags |= SfMayBlock;
+   PRINT("sys_truncate ( %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u )", ARG1,
+         (char*)ARG1, ARG2);
+   PRE_REG_READ2(long, "truncate", const char*, path, unsigned long, length);
+   PRE_MEM_RASCIIZ("truncate(path)", ARG1);
+}
+
+// SYS_ftruncate  480
+// int ftruncate(int fd, off_t length);
+PRE(sys_ftruncate)
+{
+   *flags |= SfMayBlock;
+   PRINT("sys_ftruncate ( %" FMT_REGWORD "u, %" FMT_REGWORD "u )", ARG1, ARG2);
+   PRE_REG_READ2(long, "ftruncate", unsigned int, fd, unsigned long, length);
+}
+
+// SYS_cpuset_setid  485
+// int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid);
+PRE(sys_cpuset_setid)
+{
+   PRINT("sys_cpuset_setid ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %#" FMT_REGWORD "x )",
+         SARG1, SARG2, ARG3);
+   PRE_REG_READ3(int, "cpuset_setid", vki_cpuwhich_t, which, vki_id_t, id,
+                 vki_cpusetid_t*, setid);
+}
+
+// SYS_cpuset_getid  486
+// int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id,
+//                  cpusetid_t *setid);
+PRE(sys_cpuset_getid)
+{
+   PRINT("sys_cpuset_getid ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %" FMT_REGWORD "d, %#" FMT_REGWORD "x )",
+         SARG1, SARG2, SARG3, ARG4);
+   PRE_REG_READ4(int, "cpuset_getid", vki_cpulevel_t, level, vki_cpuwhich_t,
+                 which, vki_id_t, id, vki_cpusetid_t, setid);
+   PRE_MEM_WRITE("cpuset_getid(setid)", ARG4, sizeof(vki_cpusetid_t));
+}
+
+POST(sys_cpuset_getid) { POST_MEM_WRITE(ARG4, sizeof(vki_cpusetid_t)); }
+
+// SYS_cpuset_getaffinity  487
+// int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id,
+//                        size_t setsize, cpuset_t *mask);
+PRE(sys_cpuset_getaffinity)
+{
+   PRINT("sys_cpuset_getaffinity ( %" FMT_REGWORD "u, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "d, %" FMT_REGWORD "u, %#" FMT_REGWORD "x )",
+         ARG1, ARG2, SARG3, ARG4, ARG5);
+   PRE_REG_READ5(int, "cpuset_getaffinity", vki_cpulevel_t, level,
+                 vki_cpuwhich_t, which, vki_id_t, id, size_t, setsize, void*,
+                 mask);
+   PRE_MEM_WRITE("cpuset_getaffinity", ARG5, ARG4);
+}
+
+POST(sys_cpuset_getaffinity)
+{
+   vg_assert(SUCCESS);
+   if (RES == 0)
+      POST_MEM_WRITE(ARG5, ARG4);
+}
+
+// SYS_cpuset_setaffinity  488
+// int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id,
+//                        size_t setsize, const cpuset_t *mask);
+PRE(sys_cpuset_setaffinity)
+{
+
+   PRINT("sys_cpuset_setaffinity ( %" FMT_REGWORD "u, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "d, %" FMT_REGWORD "u, %#" FMT_REGWORD "x )",
+         ARG1, ARG2, SARG3, ARG4, ARG5);
+   PRE_REG_READ5(int, "cpuset_setaffinity", vki_cpulevel_t, level,
+                 vki_cpuwhich_t, which, vki_id_t, id, size_t, setsize, void*,
+                 mask);
+   PRE_MEM_READ("cpuset_setaffinity", ARG5, ARG4);
+}
+
+// SYS_posix_fallocate 530
+// int posix_fallocate(int fd, off_t offset, off_t len);
+PRE(sys_posix_fallocate)
+{
+   PRINT("sys_posix_fallocate ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "u )",
+         SARG1, ARG2, ARG3);
+   PRE_REG_READ3(long, "posix_fallocate", int, fd, vki_off_t, offset, vki_off_t,
+                 len);
+}
+
+// SYS_posix_fadvise 531
+// int posix_fadvise(int fd, off_t offset, off_t len, int advice);
+PRE(sys_posix_fadvise)
+{
+   PRINT("sys_posix_fadvise ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "u, %" FMT_REGWORD "u, %" FMT_REGWORD "d )",
+         SARG1, ARG2, ARG3, SARG4);
+   PRE_REG_READ4(long, "posix_fadvise", int, fd, off_t, offset, off_t, len, int,
+                 advice);
+   // @todo PJF advice can be 0 to 5 inclusive
+}
+
+// SYS_wait6   532
+// pid_t wait6(idtype_t idtype, id_t id, int *status, int options,
+//             struct __wrusage *wrusage, siginfo_t *infop);
+PRE(sys_wait6)
+{
+   PRINT("sys_wait6 ( %" FMT_REGWORD "d, %" FMT_REGWORD "d, %#" FMT_REGWORD
+         "x, %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %#" FMT_REGWORD "x )",
+         SARG1, SARG2, ARG3, SARG4, ARG5, ARG6);
+   PRE_REG_READ6(pid_t, "wait6", vki_idtype_t, idtype, vki_id_t, id, int*,
+                 status, int, options, struct vki___wrusage*, wrusage,
+                 vki_siginfo_t*, infop);
+   PRE_MEM_WRITE("wait6(status)", ARG3, sizeof(int));
+   if (ARG5) {
+      PRE_MEM_WRITE("wait6(wrusage)", ARG5, sizeof(struct vki___wrusage));
+   }
+   if (ARG6) {
+      PRE_MEM_WRITE("wait6(infop)", ARG6, sizeof(vki_siginfo_t));
+   }
+}
+
+POST(sys_wait6)
+{
+   POST_MEM_WRITE(ARG3, sizeof(int));
+   if (ARG5) {
+      POST_MEM_WRITE(ARG5, sizeof(struct vki___wrusage));
+   }
+
+   if (ARG6) {
+      POST_MEM_WRITE(ARG6, sizeof(vki_siginfo_t));
+   }
+}
+
+// the man page is inconsistent for the last argument
+// See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247386
+// will stick to 'arg' for simplicity
+
+// SYS_procctl 544
+// int procctl(idtype_t idtype, id_t id, int cmd, void *arg);
+PRE(sys_procctl)
+{
+   PRINT("sys_procctl ( %" FMT_REGWORD "d, %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %#" FMT_REGWORD "x )",
+         SARG1, SARG2, SARG3, ARG4);
+   PRE_REG_READ4(int, "procctl", vki_idtype_t, idtype, vki_id_t, id, int, cmd,
+                 void*, arg);
+   switch (ARG3) {
+   case VKI_PROC_ASLR_CTL:
+   case VKI_PROC_SPROTECT:
+   case VKI_PROC_TRACE_CTL:
+   case VKI_PROC_TRAPCAP_CTL:
+   case VKI_PROC_PDEATHSIG_CTL:
+   case VKI_PROC_STACKGAP_CTL:
+   case VKI_PROC_NO_NEW_PRIVS_CTL:
+   case VKI_PROC_WXMAP_CTL:
+      PRE_MEM_READ("procctl(arg)", ARG4, sizeof(int));
+      break;
+   case VKI_PROC_REAP_STATUS:
+      PRE_MEM_READ("procctl(arg)", ARG4,
+                   sizeof(struct vki_procctl_reaper_status));
+      break;
+   case VKI_PROC_REAP_GETPIDS:
+      PRE_MEM_READ("procctl(arg)", ARG4,
+                   sizeof(struct vki_procctl_reaper_pids));
+      break;
+   case VKI_PROC_REAP_KILL:
+      /* The first three fields are reads
+       * int rk_sig;
+       * u_int rk_flags;
+       * pid_t rk_subtree;
+       *
+       * The last two fields are writes
+       * u_int rk_killed;
+       * pid_t rk_fpid;
+       *
+       * There is also a pad field
+       */
+      PRE_MEM_READ("procctl(arg)", ARG4,
+                   sizeof(int) + sizeof(u_int) + sizeof(vki_pid_t));
+      PRE_MEM_WRITE("procctl(arg)",
+                    ARG4 + offsetof(struct vki_procctl_reaper_kill, rk_killed),
+                    sizeof(u_int) + sizeof(vki_pid_t));
+      break;
+   case VKI_PROC_ASLR_STATUS:
+   case VKI_PROC_PDEATHSIG_STATUS:
+   case VKI_PROC_STACKGAP_STATUS:
+   case VKI_PROC_TRAPCAP_STATUS:
+   case VKI_PROC_TRACE_STATUS:
+   case VKI_PROC_NO_NEW_PRIVS_STATUS:
+   case VKI_PROC_WXMAP_STATUS:
+      PRE_MEM_WRITE("procctl(arg)", ARG4, sizeof(int));
+   case VKI_PROC_REAP_ACQUIRE:
+   case VKI_PROC_REAP_RELEASE:
+   default:
+      break;
+   }
+}
+
+POST(sys_procctl)
+{
+   switch (ARG3) {
+   case VKI_PROC_REAP_KILL:
+      POST_MEM_WRITE(ARG4 + offsetof(struct vki_procctl_reaper_kill, rk_killed),
+                     sizeof(u_int) + sizeof(vki_pid_t));
+      break;
+   case VKI_PROC_ASLR_STATUS:
+   case VKI_PROC_PDEATHSIG_STATUS:
+   case VKI_PROC_STACKGAP_STATUS:
+   case VKI_PROC_TRAPCAP_STATUS:
+   case VKI_PROC_TRACE_STATUS:
+   case VKI_PROC_NO_NEW_PRIVS_STATUS:
+   case VKI_PROC_WXMAP_STATUS:
+      POST_MEM_WRITE(ARG4, sizeof(int));
+   default:
+      break;
+   }
+}
+
+// SYS_mknodat 559
+// int mknodat(int fd, const char *path, mode_t mode, dev_t dev);
+PRE(sys_mknodat)
+{
+   PRINT("sys_mknodat ( %" FMT_REGWORD "u, %#" FMT_REGWORD
+         "x(%s), 0x%" FMT_REGWORD "x, 0x%" FMT_REGWORD "x )",
+         ARG1, ARG2, (char*)ARG2, ARG3, ARG4);
+   PRE_REG_READ4(long, "mknodat", int, fd, const char*, path, vki_mode_t, mode,
+                 vki_dev_t, dev);
+   PRE_MEM_RASCIIZ("mknodat(pathname)", ARG2);
+}
+
+#if (FREEBSD_VERS >= FREEBSD_12)
+
+// SYS_cpuset_getdomain 561
+// int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id,
+//                      size_t setsize, domainset_t *mask, int *policy);
+PRE(sys_cpuset_getdomain)
+{
+   PRINT("sys_cpuset_getdomain ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %" FMT_REGWORD "d, %" FMT_REGWORD "u, %#" FMT_REGWORD
+         "x, %#" FMT_REGWORD "x )",
+         SARG1, SARG2, SARG3, ARG4, ARG5, ARG6);
+   PRE_REG_READ6(int, "cpuset_getdomain", cpulevel_t, level, cpuwhich_t, which,
+                 id_t, id, size_t, setsize, vki_domainset_t*, mask, int*,
+                 policy);
+   // man page says that setsize (ARG4) "is usually provided by calling
+   // sizeof(mask)"
+   PRE_MEM_WRITE("cpuset_getdomain(mask)", ARG5, ARG4);
+   PRE_MEM_WRITE("cpuset_getdomain(policy)", ARG6, sizeof(int));
+}
+
+POST(sys_cpuset_getdomain)
+{
+   POST_MEM_WRITE(ARG5, ARG4);
+   POST_MEM_WRITE(ARG6, sizeof(int));
+}
+
+// SYS_cpuset_setdomain 562
+// int cuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id,
+//                     size_t setsize, const domainset_t *mask, int policy);
+PRE(sys_cpuset_setdomain)
+{
+   PRINT("sys_cpuget_getdomain ( %" FMT_REGWORD "d, %" FMT_REGWORD
+         "d, %" FMT_REGWORD "d, %" FMT_REGWORD "u, %#" FMT_REGWORD
+         "x, %" FMT_REGWORD "d )",
+         SARG1, SARG2, SARG3, ARG4, ARG5, SARG6);
+   PRE_REG_READ6(int, "cpuset_getdomain", cpulevel_t, level, cpuwhich_t, which,
+                 id_t, id, size_t, setsize, vki_domainset_t*, mask, int,
+                 policy);
+   // man page says that setsize (ARG4) "is usually provided by calling
+   // sizeof(mask)"
+   PRE_MEM_READ("cpuset_getdomain(mask)", ARG5, ARG4);
+}
+
+#endif
+
+PRE(sys_fake_sigreturn)
+{
+   ThreadState*         tst;
+   struct vki_ucontext* uc;
+   ULong                rflags;
+
+   PRINT("sys_sigreturn ( %#" FMT_REGWORD "x )", ARG1);
+   PRE_REG_READ1(long, "sigreturn", struct vki_ucontext*, scp);
+
+   PRE_MEM_READ("sigreturn(scp)", ARG1, sizeof(struct vki_ucontext));
+   PRE_MEM_WRITE("sigreturn(scp)", ARG1, sizeof(struct vki_ucontext));
+
+   vg_assert(VG_(is_valid_tid)(tid));
+   vg_assert(tid >= 1 && tid < VG_N_THREADS);
+   vg_assert(VG_(is_running_thread)(tid));
+
+   tst = VG_(get_ThreadState)(tid);
+
+   uc = (struct vki_ucontext*)ARG1;
+   if (uc == NULL) {
+      SET_STATUS_Failure(VKI_EINVAL);
+      return;
+   }
+
+   /* This is only so that the EIP is (might be) useful to report if
+      something goes wrong in the sigreturn */
+   ML_(fixup_guest_state_to_restart_syscall)(&tst->arch);
+
+   VG_(sigframe_destroy)(tid);
+
+   /* For unclear reasons, it appears we need the syscall to return
+      without changing %RAX.  Since %RAX is the return value, and can
+      denote either success or failure, we must set up so that the
+      driver logic copies it back unchanged.  Also, note %RAX is of
+      the guest registers written by VG_(sigframe_destroy). */
+   rflags = LibVEX_GuestARM64_get_nzcv(&tst->arch.vex);
+   SET_STATUS_from_SysRes(VG_(mk_SysRes_amd64_freebsd)(
+      tst->arch.vex.guest_X0, tst->arch.vex.guest_X1,
+      (rflags & VKI_PSR_C) != 0U ? True : False));
+
+   /*
+    * Signal handler might have changed the signal mask.  Respect that.
+    */
+   tst->sig_mask     = uc->uc_sigmask;
+   tst->tmp_sig_mask = uc->uc_sigmask;
+
+   /* Tell the driver not to update the guest state with the "result",
+      and set a bogus result to keep it happy. */
+   *flags |= SfNoWriteResult;
+   SET_STATUS_Success(0);
+
+   /* Check to see if some any signals arose as a result of this. */
+   *flags |= SfPollAfter;
+}
+
+#undef PRE
+#undef POST
+
+#endif /* defined(VGP_arm64_freebsd) */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
index a9efabe2e5661035717d0b222010f6a17a1d6240..28ea9a7c526e4e28d4cdbb72c8f78eba14831f9c 100644 (file)
@@ -278,6 +278,16 @@ static void run_a_thread_NORETURN ( Word tidW )
          : "n" (VgTs_Empty), "n" (__NR_thr_exit), "m" (tst->os_state.exitcode)
          : "rax", "rdi"
       );
+#elif defined(VGP_arm64_freebsd)
+      __asm__ volatile (
+         "str  %w1, %0\n"     /* set tst->status = VgTs_Empty (32-bit store) */
+         "mov  x8,  %2\n"     /* set %x8 = __NR_thr_exit */
+         "ldr  x0,  %3\n"     /* set %x0 = tst->os_state.exitcode */
+         "svc  0x00000000\n"  /* exit(tst->os_state.exitcode) */
+         : "=m" (tst->status)
+         : "r" (VgTs_Empty), "n" (__NR_thr_exit), "m" (tst->os_state.exitcode)
+         : "x0", "x8"
+      );
 #else
 # error Unknown platform
 #endif
@@ -5438,7 +5448,7 @@ PRE(sys_mkdirat)
    *flags |= SfMayBlock;
    PRINT("sys_mkdirat ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u )", ARG1,ARG2,(char*)ARG2,ARG3);
    PRE_REG_READ3(int, "mkdirat",
-                 int, fd, const char *, path, int, mode);
+                 int, fd, const char *, path, unsigned int, mode);
    PRE_MEM_RASCIIZ( "mkdirat(path)", ARG2 );
 }
 
@@ -5477,7 +5487,6 @@ PRE(sys_mknodat)
 // int openat(int fd, const char *path, int flags, ...);
 PRE(sys_openat)
 {
-
    if (ARG3 & VKI_O_CREAT) {
       // 4-arg version
       PRINT("sys_openat ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u, %" FMT_REGWORD "u )",ARG1,ARG2,(char*)ARG2,ARG3,ARG4);
@@ -7188,7 +7197,11 @@ const SyscallTableEntry ML_(syscall_table)[] = {
    // 4.3 lstat                                            40
    GENXY(__NR_dup,              sys_dup),               // 41
 
+#if defined(VGP_arm64_freebsd)
+   GENX_(__NR_freebsd10_pipe,   sys_ni_syscall),        // 42
+#else
    BSDXY(__NR_freebsd10_pipe,   sys_pipe),              // 42
+#endif
    GENX_(__NR_getegid,          sys_getegid),           // 43
 
    GENX_(__NR_profil,           sys_ni_syscall),        // 44
index eae3f8a6259c5bb16f1d77dcadb1b6764a4af0dc..be4ac0f08143aeb0d257e40a434f73684239061d 100644 (file)
@@ -351,7 +351,7 @@ void do_syscall_for_client ( Int syscallno,
    vki_sigset_t saved;
    UWord err;
 #  if defined(VGO_freebsd)
-   Int real_syscallno;
+   Word real_syscallno;
 #  endif
 #  if defined(VGO_linux)
    err = ML_(do_syscall_for_client_WRK)(
@@ -623,6 +623,40 @@ void getSyscallArgsFromGuestState ( /*OUT*/SyscallArgs*       canonical,
       canonical->arg8  = stack[2];
    }
 
+#elif defined(VGP_arm64_freebsd)
+   VexGuestARM64State* gst = (VexGuestARM64State*)gst_vanilla;
+   switch (gst->guest_X8) {
+   case __NR_syscall:
+      canonical->klass = VG_FREEBSD_SYSCALL0;
+      canonical->sysno = gst->guest_X0;
+      break;
+   case __NR___syscall:
+      canonical->klass = VG_FREEBSD_SYSCALL198;
+      canonical->sysno = gst->guest_X0;
+      break;
+   default:
+      canonical->klass = 0;
+      canonical->sysno = gst->guest_X8;
+      break;
+   }
+   if (canonical->klass == VG_FREEBSD_SYSCALL0 || canonical->klass == VG_FREEBSD_SYSCALL198) {
+      canonical->arg1  = gst->guest_X1;
+      canonical->arg2  = gst->guest_X2;
+      canonical->arg3  = gst->guest_X3;
+      canonical->arg4  = gst->guest_X4;
+      canonical->arg5  = gst->guest_X5;
+      canonical->arg6  = gst->guest_X6;
+      canonical->arg7  = gst->guest_X7;
+   } else {
+      canonical->arg1  = gst->guest_X0;
+      canonical->arg2  = gst->guest_X1;
+      canonical->arg3  = gst->guest_X2;
+      canonical->arg4  = gst->guest_X3;
+      canonical->arg5  = gst->guest_X4;
+      canonical->arg6  = gst->guest_X5;
+      canonical->arg7  = gst->guest_X6;
+   }
+
 #elif defined(VGP_arm_linux)
    VexGuestARMState* gst = (VexGuestARMState*)gst_vanilla;
    canonical->sysno = gst->guest_R7;
@@ -1015,6 +1049,38 @@ void putSyscallArgsIntoGuestState ( /*IN*/ SyscallArgs*       canonical,
        stack[2]       = canonical->arg8;
    }
 
+#elif defined(VGP_arm64_freebsd)
+   VexGuestARM64State* gst = (VexGuestARM64State*)gst_vanilla;
+   switch (canonical->klass) {
+   case VG_FREEBSD_SYSCALL0:
+      gst->guest_X8 = __NR_syscall;
+      break;
+   case VG_FREEBSD_SYSCALL198:
+      gst->guest_X8 = __NR___syscall;
+      break;
+   default:
+      gst->guest_X8 = canonical->sysno;
+      break;
+   }
+   if (canonical->klass == VG_FREEBSD_SYSCALL0 || canonical->klass == VG_FREEBSD_SYSCALL198) {
+      gst->guest_X0 = canonical->sysno;
+      gst->guest_X1 = canonical->arg1;
+      gst->guest_X2 = canonical->arg2;
+      gst->guest_X3 = canonical->arg3;
+      gst->guest_X4 = canonical->arg4;
+      gst->guest_X5 = canonical->arg5;
+      gst->guest_X6 = canonical->arg6;
+      gst->guest_X7 = canonical->arg7;
+   } else {
+      gst->guest_X0 = canonical->arg1;
+      gst->guest_X1 = canonical->arg2;
+      gst->guest_X2 = canonical->arg3;
+      gst->guest_X3 = canonical->arg4;
+      gst->guest_X4 = canonical->arg5;
+      gst->guest_X5 = canonical->arg6;
+      gst->guest_X6 = canonical->arg7;
+   }
+
 #elif defined(VGP_arm_linux)
    VexGuestARMState* gst = (VexGuestARMState*)gst_vanilla;
    gst->guest_R7 = canonical->sysno;
@@ -1240,6 +1306,7 @@ void getSyscallStatusFromGuestState ( /*OUT*/SyscallStatus*     canonical,
    RegWord  a0 = gst->guest_r4;    // a0
    canonical->sres = VG_(mk_SysRes_nanomips_linux)(a0);
    canonical->what = SsComplete;
+
 #  elif defined(VGP_amd64_freebsd)
    /* duplicates logic in m_signals.VG_UCONTEXT_SYSCALL_SYSRES */
    VexGuestAMD64State* gst = (VexGuestAMD64State*)gst_vanilla;
@@ -1248,6 +1315,13 @@ void getSyscallStatusFromGuestState ( /*OUT*/SyscallStatus*     canonical,
                         (flags & 1) != 0 ? True : False);
    canonical->what = SsComplete;
 
+#  elif defined(VGP_arm64_freebsd)
+   VexGuestARM64State* gst = (VexGuestARM64State*)gst_vanilla;
+   ULong flags = LibVEX_GuestARM64_get_nzcv(gst);
+   canonical->sres = VG_(mk_SysRes_arm64_freebsd)(gst->guest_X0, gst->guest_X1,
+                                                  (flags & VKI_PSR_C) != 0 ? True : False);
+   canonical->what = SsComplete;
+
 #  elif defined(VGP_x86_darwin)
    /* duplicates logic in m_signals.VG_UCONTEXT_SYSCALL_SYSRES */
    VexGuestX86State* gst = (VexGuestX86State*)gst_vanilla;
@@ -1488,6 +1562,26 @@ void putSyscallStatusIntoGuestState ( /*IN*/ ThreadId tid,
    // GrP fixme sets defined for entire eflags, not just bit c
    VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
       offsetof(VexGuestAMD64State, guest_CC_DEP1), sizeof(ULong) );
+
+#  elif defined(VGP_arm64_freebsd)
+   VexGuestARM64State* gst = (VexGuestARM64State*)gst_vanilla;
+   vg_assert(canonical->what == SsComplete);
+   if (sr_isError(canonical->sres)) {
+      gst->guest_X0 = sr_Err(canonical->sres);
+      LibVEX_GuestARM64_put_nzcv_c(1, gst);
+   } else {
+      gst->guest_X0 = sr_Res(canonical->sres);
+      gst->guest_X1 = sr_ResHI(canonical->sres);
+      LibVEX_GuestARM64_put_nzcv_c(0, gst);
+   }
+
+   VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+            OFFSET_arm64_X0, sizeof(ULong) );
+   VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+            OFFSET_arm64_X1, sizeof(ULong) );
+   VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+            offsetof(VexGuestARM64State, guest_CC_DEP1), sizeof(ULong) );
+
 #elif defined(VGP_x86_darwin)
    VexGuestX86State* gst = (VexGuestX86State*)gst_vanilla;
    SysRes sres = canonical->sres;
@@ -1745,6 +1839,17 @@ void getSyscallArgLayout ( /*OUT*/SyscallArgLayout* layout )
    layout->s_arg8   = sizeof(UWord) * 2;
    layout->arg6_is_reg = True;
 
+#elif defined(VGP_arm64_freebsd)
+   layout->o_sysno  = OFFSET_arm64_X8;
+   layout->o_arg1   = OFFSET_arm64_X0;
+   layout->o_arg2   = OFFSET_arm64_X1;
+   layout->o_arg3   = OFFSET_arm64_X2;
+   layout->o_arg4   = OFFSET_arm64_X3;
+   layout->o_arg5   = OFFSET_arm64_X4;
+   layout->o_arg6   = OFFSET_arm64_X5;
+   layout->o_arg7   = OFFSET_arm64_X6;
+   layout->o_arg8   = OFFSET_arm64_X7;
+
 #elif defined(VGP_arm_linux)
    layout->o_sysno  = OFFSET_arm_R7;
    layout->o_arg1   = OFFSET_arm_R0;
@@ -1862,10 +1967,11 @@ void getSyscallArgLayout ( /*OUT*/SyscallArgLayout* layout )
 #endif
 }
 
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
 static
 void getSyscallArgLayout_0_198 ( /*OUT*/SyscallArgLayout* layout )
 {
+#if defined(VGP_amd64_freebsd)
    VG_(bzero_inline)(layout, sizeof(*layout));
    layout->o_sysno  = OFFSET_amd64_RDI;
    layout->o_arg1   = OFFSET_amd64_RSI;
@@ -1877,6 +1983,16 @@ void getSyscallArgLayout_0_198 ( /*OUT*/SyscallArgLayout* layout )
    layout->s_arg7   = sizeof(UWord) * 2;
    layout->s_arg8   = sizeof(UWord) * 3;
    layout->arg6_is_reg = False;
+#else
+   layout->o_sysno  = OFFSET_arm64_X0;
+   layout->o_arg1   = OFFSET_arm64_X1;
+   layout->o_arg2   = OFFSET_arm64_X2;
+   layout->o_arg3   = OFFSET_arm64_X3;
+   layout->o_arg4   = OFFSET_arm64_X4;
+   layout->o_arg5   = OFFSET_arm64_X5;
+   layout->o_arg6   = OFFSET_arm64_X6;
+   layout->o_arg7   = OFFSET_arm64_X7;
+#endif
 }
 #endif
 
@@ -2189,7 +2305,7 @@ void VG_(client_syscall) ( ThreadId tid, UInt trc )
       action.  This info is needed so that the scalar syscall argument
       checks (PRE_REG_READ calls) know which bits of the guest state
       they need to inspect. */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined (VGP_arm64_freebsd)
    // PJF - somewhat unfortunate uglificaton of the code, but the current code handles two
    // types of syscall with different register use. Mixing them up is not good.
    // I've avoided modifying the existing function (I could have added
@@ -2201,7 +2317,7 @@ void VG_(client_syscall) ( ThreadId tid, UInt trc )
 
    getSyscallArgLayout( &layout );
 
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    }
 #endif
 
@@ -2787,6 +2903,27 @@ void ML_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch )
       vg_assert(p[0] == 0x0F && p[1] == 0x05);
    }
 
+#elif defined(VGP_arm64_freebsd)
+   arch->vex.guest_PC -= 4;             // sizeof(arm64 instr)
+
+   /* Make sure our caller is actually sane, and we're really backing
+      back over a syscall.
+
+       svc #0 == d4 00 00 01
+    */
+   {
+      UChar *p = (UChar *)arch->vex.guest_PC;
+
+      if (p[0] != 0x01 || p[1] != 0x00 || p[2] != 0x00 || p[3] != 0xD4)
+         VG_(message)(
+            Vg_DebugMsg,
+            "?! restarting over syscall at %#llx %02x %02x %02x %02x\n",
+            arch->vex.guest_PC, p[0], p[1], p[2], p[3]
+            );
+
+      vg_assert(p[0] == 0x01 && p[1] == 0x00 && p[2] == 0x00 && p[3] == 0xD4);
+   }
+
 #elif defined(VGP_x86_darwin)
    arch->vex.guest_EIP = arch->vex.guest_IP_AT_SYSCALL; 
 
@@ -3234,6 +3371,13 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
         else
            LibVEX_GuestAMD64_put_rflag_c(0, &th_regs->vex);
       }
+#elif defined(VGP_arm64_freebsd)
+      if (!(sci->flags & SfNoWriteResult)) {
+         if (sr_isError(sres))
+            LibVEX_GuestARM64_put_nzcv_c(1, &th_regs->vex);
+         else
+            LibVEX_GuestARM64_put_nzcv_c(0, &th_regs->vex);
+      }
 #endif
       if (VG_(clo_trace_signals))
          VG_(message)( Vg_DebugMsg,
index 716afb2121b84b5786cebcbf838cf5ac865e4fef..e897963be21a46ae2c8b674cd9d67ed4bb4b82c4 100644 (file)
@@ -962,6 +962,48 @@ VG_(trampoline_stuff_end):
 #      undef UD2_1024
 #      undef UD2_PAGE
 
+/*---------------- arm64-freebsd ----------------*/
+#else
+#if defined(VGP_arm64_freebsd)
+
+#       define UD2_4      .word 0xFFFFFFFF
+#      define UD2_16     UD2_4    ; UD2_4    ; UD2_4    ; UD2_4
+#      define UD2_64     UD2_16   ; UD2_16   ; UD2_16   ; UD2_16
+#      define UD2_256    UD2_64   ; UD2_64   ; UD2_64   ; UD2_64
+#      define UD2_1024   UD2_256  ; UD2_256  ; UD2_256  ; UD2_256
+#      define UD2_PAGE   UD2_1024 ; UD2_1024 ; UD2_1024 ; UD2_1024
+
+       /* a leading page of unexecutable code */
+       UD2_PAGE
+
+.global VG_(trampoline_stuff_start)
+VG_(trampoline_stuff_start):
+
+.global VG_(arm64_freebsd_SUBST_FOR_sigreturn)
+.type   VG_(arm64_freebsd_SUBST_FOR_sigreturn),#function
+VG_(arm64_freebsd_SUBST_FOR_sigreturn):
+       mov x8, # __NR_fake_sigreturn
+        mov x0, sp
+        svc #0
+        .long 0xFFFFFFFF /*illegal insn*/
+.size VG_(arm64_freebsd_SUBST_FOR_sigreturn), \
+        .-VG_(arm64_freebsd_SUBST_FOR_sigreturn)
+
+.global VG_(trampoline_stuff_end)
+VG_(trampoline_stuff_end):
+
+       /* and a trailing page of unexecutable code */
+       UD2_PAGE
+
+#      undef UD2_4
+#      undef UD2_16
+#      undef UD2_64
+#      undef UD2_256
+#      undef UD2_1024
+#      undef UD2_PAGE
+
+
+
 /*---------------- x86-darwin ----------------*/
 #else
 #if defined(VGP_x86_darwin)
@@ -1742,6 +1784,7 @@ VG_(trampoline_stuff_end):
 #endif
 #endif
 #endif
+#endif
 
 /* Let the linker know we don't need an executable stack */
 MARK_STACK_NO_EXEC
index 0dd36082d22616ca52ff62fb4b9c1f3157850375..5696dc4dca643ccd1172a88f8549d7b758a1a275 100644 (file)
@@ -1742,7 +1742,7 @@ Bool VG_(translate) ( ThreadId tid,
          = SimHintiS(SimHint_fallback_llsc, VG_(clo_sim_hints));
 #endif
 
-#  if defined(VGP_arm64_linux)
+#  if defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
    vex_abiinfo.guest__use_fallback_LLSC
       = /* The user asked explicitly */
         SimHintiS(SimHint_fallback_llsc, VG_(clo_sim_hints))
index a9b7dd8b17cabf80511eedf27f1275c02ca07416..a1afbe61c086ba3c7e389ff4e05a518248510f36 100644 (file)
@@ -69,7 +69,7 @@
 #  define VG_ELF_MACHINE      EM_ARM
 #  define VG_ELF_CLASS        ELFCLASS32
 #  undef  VG_PLAT_USES_PPCTOC
-#elif defined(VGP_arm64_linux)
+#elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
 #  define VG_ELF_DATA2XXX     ELFDATA2LSB
 #  define VG_ELF_MACHINE      EM_AARCH64
 #  define VG_ELF_CLASS        ELFCLASS64
index b5922ca50123d29a7b70d32d2fd30113529a03f0..bbde837e2c428a226f309dc1b6eb7f47961c9818 100644 (file)
@@ -80,6 +80,7 @@ typedef Int ArenaId;
       (defined(VGP_mips64_linux) && !defined(VGABI_N32)) || \
       defined(VGP_x86_freebsd)    || \
       defined(VGP_amd64_freebsd)  || \
+      defined(VGP_arm64_freebsd)  || \
       defined(VGP_x86_darwin)     || \
       defined(VGP_amd64_darwin)   || \
       defined(VGP_arm64_linux)    || \
index 6c4f825918333c7b4d01ab73725a6c89866f77b0..5c42821c8ac0d477ff3c541d7453ac17c9ded917 100644 (file)
@@ -93,6 +93,7 @@ extern SysRes VG_(mk_SysRes_ppc32_linux) ( UInt  val, UInt  cr0so );
 extern SysRes VG_(mk_SysRes_ppc64_linux) ( ULong val, ULong cr0so, UInt flag );
 extern SysRes VG_(mk_SysRes_x86_freebsd) ( UInt val, UInt val2, Bool err);
 extern SysRes VG_(mk_SysRes_amd64_freebsd)( ULong val, ULong val2, Bool err );
+extern SysRes VG_(mk_SysRes_arm64_freebsd)( ULong val, ULong val2, Bool err );
 extern SysRes VG_(mk_SysRes_arm_linux)   ( Int val );
 extern SysRes VG_(mk_SysRes_arm64_linux) ( Long val );
 extern SysRes VG_(mk_SysRes_x86_darwin)  ( UChar scclass, Bool isErr,
index dd660131c582427bc4b4034421091b65ee678b70..d0bd6b859742263e1da59e24e855e5b2ad19dc9e 100644 (file)
@@ -64,6 +64,10 @@ extern void VG_(x86_freebsd_SUBST_FOR_sigreturn);
 extern void VG_(amd64_freebsd_SUBST_FOR_sigreturn);
 #endif
 
+#if defined(VGP_arm64_freebsd)
+extern void VG_(arm64_freebsd_SUBST_FOR_sigreturn);
+#endif
+
 #if defined(VGP_x86_linux)
 extern Addr VG_(x86_linux_SUBST_FOR_sigreturn);
 extern Addr VG_(x86_linux_SUBST_FOR_rt_sigreturn);
index 27e19436854b5e520f1cad3084d667f1ff54e4bc..df34e0a1515280b0fb124a6b7b4a53f6fd4a3d19 100644 (file)
@@ -470,6 +470,8 @@ Bool invoker_invoke_gdbserver (pid_t pid)
      DEBUG(1, "Sign extending %8.8lx to %8.8lx\n",
            reg_mod.r_rax, reg_save.r_rax);
    }
+#elif defined(VGA_arm64)
+   sp = reg_mod.sp;
 #else
    I_die_here : (sp) architecture missing in vgdb-invoker-freebsd.c
 #endif
@@ -519,10 +521,10 @@ Bool invoker_invoke_gdbserver (pid_t pid)
       reg_mod.r_rbp = sp; // bp set to sp
       reg_mod.r_rsp = sp;
       reg_mod.r_rip = shared32->invoke_gdbserver;
-#else
-      I_die_here : not x86 or amd64 in x86/amd64 section/
 #endif
 
+#elif defined(VGA_arm64)
+      XERROR(0, "TBD arm64: vgdb a 32 bits executable with a 64 bits exe\n");
 #else
       I_die_here : architecture missing in vgdb-invoker-freebsd.c
 #endif
@@ -557,6 +559,12 @@ Bool invoker_invoke_gdbserver (pid_t pid)
       reg_mod.r_rbp = sp; // bp set to sp
       reg_mod.r_rsp = sp;
       reg_mod.r_rip = shared64->invoke_gdbserver;
+#elif defined(VGA_arm64)
+      reg_mod.x[0] = check;
+      reg_mod.sp = sp;
+      reg_mod.elr = shared64->invoke_gdbserver;
+      /* put NULL return address in Link Register */
+      reg_mod.lr = bad_return;
 
 #else
       I_die_here: architecture missing in vgdb-invoker-freebsd.c
index 23625084fd8cf6961e00542666885c999b995730..6995d230b5aa0094a713a9cc281ff46faaacec34 100644 (file)
@@ -53,7 +53,6 @@
    drd:ConflictingAccess
    ...
    fun:dl_iterate_phdr
-   obj:*/lib*/libgcc_s.so.1
 }
 {
    DRD-PTHREAD-DETACH1
    ...
    fun:_malloc_thread_cleanup
 }
+{
+   DRD-FREEEBSD14-ARM64-_UMTX_OP
+   drd:ConflictingAccess
+   fun:_umtx_op
+}
+{
+   DRD-FREEEBSD14-ARM64-PTHREAD_ONCE_INTERCEPT
+   drd:ConflictingAccess
+   fun:pthread_once_intercept
+}
index 676dd0f61844215b3b20eb6f8372b73203a1da43..dd998f15c5297faec591fa718833e369112b2b9e 100644 (file)
    Helgrind:Race
    fun:_ZL18__gthread_active_pv
 }
+{
+   FREEBSD14-ARM64-_EXIT
+   Helgrind:Race
+   fun:thr_exit
+}
 
index d4a997f12956b69a21b9c82d2b0eae6988ad419d..483aa365142e29e846c2ba90bc456351fb33520c 100644 (file)
    fun:calloc
    obj:*/lib*/libthr.so.3
 }
+{
+   MEMCHECK-LIBC-GETC
+   Memcheck:Leak
+   match-leak-kinds: reachable
+   fun:malloc
+   obj:*/lib*/libc.so.7
+   obj:*/lib*/libc.so.7
+   fun:__srget
+}
index d5860a9eeff2ed9658a55609d05125c1fc588816..acbb5f24bbdfc64b57f3e0706c16822cfad566c4 100644 (file)
@@ -1,7 +1,7 @@
 (action at startup) vgdb me ... 
 Test 1: Invalid write of size 4
-   at 0x........: test1 (faultstatus.c:117)
-   by 0x........: main (faultstatus.c:184)
+   at 0x........: test1 (faultstatus.c:121)
+   by 0x........: main (faultstatus.c:188)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
   PASS
 Test 2:   PASS
index 28985117f81c67bc97d88f14b9e4169cf4c41c55..ae00feebbcdc68e6772dea40eb76e03e09a0f4f1 100644 (file)
@@ -6,54 +6,54 @@ Signal        Stop    Print   Pass to program Description
 SIGFPE        Yes      Yes     Yes             Arithmetic exception
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Signal        Stop     Print   Pass to program Description
 SIGSEGV       No       Yes     Yes             Segmentation fault
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
 Program received signal SIGBUS, Bus error.
-test3 () at faultstatus.c:127
-127            mapping[FILESIZE+10];
+test3 () at faultstatus.c:131
+131            mapping[FILESIZE+10];
 Continuing.
 Program received signal SIGFPE, Arithmetic exception.
index 889ee3ceabe074344a2fff7485aa950a906455f8..35619ae74d026de948ba63dd7eb2a5cba5ac5de3 100644 (file)
@@ -1,7 +1,7 @@
 (action at startup) vgdb me ... 
 Test 1: Invalid write of size 4
-   at 0x........: test1 (faultstatus.c:117)
-   by 0x........: main (faultstatus.c:184)
+   at 0x........: test1 (faultstatus.c:121)
+   by 0x........: main (faultstatus.c:188)
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
   PASS
 Test 2:   PASS
index 05e37ec5ec7443d4bbf80ddef50768569de5ca4a..8131e37c25726dfeb907dbf25bce1f0c5a2407e2 100644 (file)
@@ -1,14 +1,14 @@
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test1 () at faultstatus.c:117
-117            *BADADDR = 'x';
+test1 () at faultstatus.c:121
+121            *BADADDR = 'x';
 Continuing.
 Program received signal SIGSEGV, Segmentation fault.
-test2 () at faultstatus.c:122
-122            mapping[0] = 'x';
+test2 () at faultstatus.c:126
+126            mapping[0] = 'x';
 Continuing.
 Program received signal SIGBUS, Bus error.
-test3 () at faultstatus.c:127
-127            mapping[FILESIZE+10];
+test3 () at faultstatus.c:131
+131            mapping[FILESIZE+10];
 Continuing.
 Program received signal SIGFPE, Arithmetic exception.
index 54297dee6847feca1aa62d1dcfe2b9a3fdc51663..a4250c62c43df2000607abac5d2108bf4c2527d4 100644 (file)
@@ -10,6 +10,7 @@
 #undef PLAT_amd64_darwin
 #undef PLAT_x86_freebsd
 #undef PLAT_amd64_freebsd
+#undef PLAT_arm64_freebsd
 #undef PLAT_x86_linux
 #undef PLAT_amd64_linux
 #undef PLAT_ppc32_linux
@@ -29,6 +30,8 @@
 #  define PLAT_x86_freebsd 1
 #elif defined(__FreeBSD__) && defined(__amd64__)
 #  define PLAT_amd64_freebsd 1
+#elif defined(__FreeBSD__) && defined(__aarch64__)
+#  define PLAT_arm64_freebsd 1
 #elif defined(__linux__) && defined(__i386__)
 #  define PLAT_x86_linux 1
 #elif defined(__linux__) && defined(__x86_64__)
@@ -83,7 +86,7 @@
       : /*out*/ : /*in*/ "r"(&(_lval))       \
       : /*trash*/ "r8", "r9", "cc", "memory" \
   );
-#elif defined(PLAT_arm64_linux)
+#elif defined(PLAT_arm64_linux) || defined(PLAT_arm64_freebsd)
 #  define INC(_lval,_lqual) \
   __asm__ __volatile__( \
       "1:\n"                                 \
index c3a2ec79465086ba2c619657c3ac95e732a4db76..6a8543fa1d6fa6b0396ba91b287c37ec01bdd810 100644 (file)
@@ -26,6 +26,7 @@
 #undef PLAT_amd64_darwin
 #undef PLAT_x86_freebsd
 #undef PLAT_amd64_freebsd
+#undef PLAT_arm64_freebsd
 #undef PLAT_x86_linux
 #undef PLAT_amd64_linux
 #undef PLAT_ppc32_linux
@@ -46,6 +47,8 @@
 #  define PLAT_x86_freebsd 1
 #elif defined(__FreeBSD__) && defined(__amd64__)
 #  define PLAT_amd64_freebsd 1
+#elif defined(__FreeBSD__) && defined(__aarch64__)
+#  define PLAT_arm64_freebsd 1
 #elif defined(__linux__) && defined(__i386__)
 #  define PLAT_x86_linux 1
 #elif defined(__linux__) && defined(__x86_64__)
       : /*out*/ : /*in*/ "r"(&(_lval))       \
       : /*trash*/ "r8", "r9", "cc", "memory" \
   );
-#elif defined(PLAT_arm64_linux)
+#elif defined(PLAT_arm64_linux) || defined(PLAT_arm64_freebsd)
 #  define INC(_lval,_lqual) \
   __asm__ __volatile__( \
       "1:\n"                                 \
index 08e34a0b577a42141f647fa9d74023f3ab0f1316..cc00ba38fed87506d59dbf6a1a7f9156e554996b 100644 (file)
@@ -13,6 +13,7 @@
 #undef PLAT_amd64_darwin
 #undef PLAT_x86_freebsd
 #undef PLAT_amd64_freebsd
+#undef PLAT_arm64_freebsd
 #undef PLAT_x86_linux
 #undef PLAT_amd64_linux
 #undef PLAT_ppc32_linux
@@ -31,6 +32,8 @@
 #  define PLAT_x86_freebsd 1
 #elif defined(__FreeBSD__) && defined(__amd64__)
 #  define PLAT_amd64_freebsd 1
+#elif defined(__FreeBSD__) && defined(__aarch64__)
+#  define PLAT_arm64_freebsd 1
 #elif defined(__linux__) && defined(__i386__)
 #  define PLAT_x86_linux 1
 #elif defined(__linux__) && defined(__x86_64__)
       XCHG_M_R(_addr,_lval)
 
 #elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \
-      || defined(PLAT_arm_linux) || defined(PLAT_arm64_linux)
+      || defined(PLAT_arm_linux) || defined(PLAT_arm64_linux) \
+      || defined(PLAT_arm64_freebsd)
 #  if defined(HAVE_BUILTIN_ATOMIC)
 #    define XCHG_M_R(_addr,_lval)                                           \
         do {                                                                \
index 972d394b8f73468056e6079efe1fa042b55c762f..8012d73749b3fd0409acf0079a0206e60eb2c720 100644 (file)
@@ -52,6 +52,7 @@ nobase_pkginclude_HEADERS = \
        vki/vki-solaris.h               \
        vki/vki-solaris-repcache.h      \
        vki/vki-machine-types-amd64-freebsd.h   \
+       vki/vki-machine-types-arm64-freebsd.h   \
        vki/vki-machine-types-x86-freebsd.h     \
        vki/vki-posixtypes-amd64-linux.h \
        vki/vki-posixtypes-arm64-linux.h \
@@ -69,6 +70,7 @@ nobase_pkginclude_HEADERS = \
        vki/vki-ppc64-linux.h           \
        vki/vki-x86-linux.h             \
        vki/vki-amd64-freebsd.h         \
+       vki/vki-arm64-freebsd.h         \
        vki/vki-x86-freebsd.h           \
        vki/vki-arm-linux.h             \
        vki/vki-s390x-linux.h           \
index ee9e1dc8be90df568b213c4b9187ae49b5ecbe63..e9638c3d04a52f1405b5c6e1eb7252dffaf226f0 100644 (file)
@@ -134,7 +134,7 @@ UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
 __attribute__((noreturn))
 void  VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
 
-#elif defined(__clang__) && (defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd))
+#elif defined(__clang__) && defined(VGP_arm64_linux)
 
 #define VG_MINIMAL_JMP_BUF(_name)        UWord _name [13]
 __attribute__((returns_twice))
@@ -142,6 +142,14 @@ UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
 __attribute__((noreturn))
 void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
 
+#elif defined(VGP_arm64_freebsd)
+
+#define VG_MINIMAL_JMP_BUF(_name)        UWord _name [22]
+__attribute__((returns_twice))
+UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+__attribute__((noreturn))
+void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
 #else
 
 /* The default implementation. */
index 9bdd4f514358cac476979891f830558fcc3c35ff..f462072572873df4cdc83620d4268c08471b070d 100644 (file)
@@ -65,7 +65,7 @@
 #  define VG_CLREQ_SZB             20
 #  define VG_STACK_REDZONE_SZB      0
 
-#elif defined(VGP_arm64_linux)
+#elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
 #  define VG_MIN_INSTR_SZB          4
 #  define VG_MAX_INSTR_SZB          4 
 #  define VG_CLREQ_SZB             20
index 3d15459991fb7a4ba841f58f62fc5d86dbc188b5..8a26f834a93e1a659a47a71f26925735367164ac 100644 (file)
@@ -75,7 +75,7 @@
 #  include "vki/vki-scnums-shared-linux.h"
 #  include "vki/vki-scnums-mips64-linux.h"
 
-#elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
+#elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
 #  include "vki/vki-scnums-freebsd.h"
 
 #elif defined(VGP_x86_darwin) || defined(VGP_amd64_darwin)
index 45f6522f348487bf3559527098d3bb25022d5e74..bc18f40f76e06adb5dbda6258dd5378f2496f67e 100644 (file)
 #undef PLAT_amd64_darwin
 #undef PLAT_x86_freebsd
 #undef PLAT_amd64_freebsd
+#undef PLAT_arm64_freebsd
 #undef PLAT_x86_win32
 #undef PLAT_amd64_win64
 #undef PLAT_x86_linux
 #  define PLAT_x86_freebsd 1
 #elif defined(__FreeBSD__) && defined(__amd64__)
 #  define PLAT_amd64_freebsd 1
+#elif defined(__FreeBSD__) && defined(__aarch64__) && !defined(__arm__)
+#  define PLAT_arm64_freebsd 1
 #elif (defined(__MINGW32__) && defined(__i386__)) \
       || defined(__CYGWIN32__) \
       || (defined(_WIN32) && defined(_M_IX86))
@@ -768,9 +771,9 @@ typedef
 
 #endif /* PLAT_arm_linux */
 
-/* ------------------------ arm64-linux ------------------------- */
+/* ------------------------ arm64-{linux,freebsd} ------------------------- */
 
-#if defined(PLAT_arm64_linux)
+#if defined(PLAT_arm64_linux) || defined(PLAT_arm64_freebsd)
 
 typedef
    struct { 
@@ -835,7 +838,7 @@ typedef
                     );                                           \
  } while (0)
 
-#endif /* PLAT_arm64_linux */
+#endif /* PLAT_arm64_linux || PLAT_arm64_freebsd */
 
 /* ------------------------ s390x-linux ------------------------ */
 
@@ -4283,7 +4286,7 @@ typedef
 
 /* ------------------------ arm64-linux ------------------------ */
 
-#if defined(PLAT_arm64_linux)
+#if defined(PLAT_arm64_linux) || defined(PLAT_arm64_freebsd)
 
 /* These regs are trashed by the hidden call. */
 #define __CALLER_SAVED_REGS \
diff --git a/include/vki/vki-arm64-freebsd.h b/include/vki/vki-arm64-freebsd.h
new file mode 100644 (file)
index 0000000..32e81db
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2024 Paul Floyd
+      pjfloyd@wanadoo.fr
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef VKI_ARM64_FREEBSD_H
+#define VKI_ARM64_FREEBSD_H
+
+//----------------------------------------------------------------------
+// arm/param.h
+//----------------------------------------------------------------------
+
+/* PAGE_SHIFT determines the page size. */
+#define VKI_PAGE_SHIFT     12UL
+#define VKI_PAGE_SIZE      (1UL << VKI_PAGE_SHIFT)
+#define VKI_MAX_PAGE_SHIFT VKI_PAGE_SHIFT
+#define VKI_MAX_PAGE_SIZE  VKI_PAGE_SIZE
+
+//----------------------------------------------------------------------
+// machine/_limits.h
+//----------------------------------------------------------------------
+#define VKI_MINSIGSTKSZ (1024 * 4)
+
+//----------------------------------------------------------------------
+// sys/_sigset.h
+//----------------------------------------------------------------------
+#define _VKI_NSIG_WORDS 4
+#define _VKI_NSIG       128
+#define _VKI_NSIG_BPW   ((_VKI_NSIG) / (_VKI_NSIG_WORDS))
+
+#include "vki-machine-types-arm64-freebsd.h"
+
+typedef struct {
+   vki_uint32_t sig[_VKI_NSIG_WORDS];
+} vki_sigset_t;
+
+//----------------------------------------------------------------------
+// machine/armreg.h
+//----------------------------------------------------------------------
+
+/* mainly for the carry flag, used to signifify syscall success/failure */
+#define VKI_PSR_IL    0x00100000UL
+#define VKI_PSR_SS    0x00200000UL
+#define VKI_PSR_V     0x10000000UL
+#define VKI_PSR_C     0x20000000UL
+#define VKI_PSR_Z     0x40000000UL
+#define VKI_PSR_N     0x80000000UL
+#define VKI_PSR_FLAGS 0xf0000000UL
+
+//----------------------------------------------------------------------
+// machine/reg.h
+// Used by PTRACE and coredump-elf.h */
+//----------------------------------------------------------------------
+
+/*
+struct vki_reg {
+   vki_uint64_t x[30];
+   vki_uint64_t lr;
+   vki_uint64_t sp;
+   vki_uint64_t elr;
+   vki_uint64_t spsr;
+};
+*/
+
+struct vki_dbreg {
+   vki_uint8_t db_debug_ver;
+   vki_uint8_t db_nbkpts;
+   vki_uint8_t db_nwtpts;
+   vki_uint8_t db_pad[5];
+
+   struct {
+      vki_uint64_t dbr_addr;
+      vki_uint32_t dbr_ctrl;
+      vki_uint32_t dbr_pad;
+   } db_breakregs[16];
+   struct {
+      vki_uint64_t dbw_addr;
+      vki_uint32_t dbw_ctrl;
+      vki_uint32_t dbw_pad;
+   } db_watchregs[16];
+};
+
+//----------------------------------------------------------------------
+// machine/ucontext.h
+//----------------------------------------------------------------------
+
+/* It's a bit stupid having the struct layout as reg.h struct reg */
+struct vki_gpregs {
+   __vki_register_t gp_x[30];
+   __vki_register_t gp_lr;
+   __vki_register_t gp_sp;
+   __vki_register_t gp_elr;
+   vki_uint64_t     gp_spsr;
+};
+
+/* coredump-elf.c compatibility */
+#define vki_user_regs_struct vki_gpregs
+
+/* Like Linux */
+typedef unsigned long vki_elf_greg_t;
+#define VKI_ELF_NGREG (sizeof(struct vki_gpregs) / sizeof(vki_elf_greg_t))
+typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
+
+struct vki_fpregs {
+   __uint128_t  fp_q[32];
+   vki_uint32_t fp_sr;
+   vki_uint32_t fp_cr;
+   int          fp_flags;
+   int          fp_pad;
+};
+
+/* amd64 compatibility */
+#define vki_fpreg vki_fpregs
+
+/* fpregs in FreeBSD headers fpreg */
+// #define vki_fpreg vki_fpregs
+
+// On Linux the equivalent of the above is smaller, without the fp_flags annd
+// padding
+typedef struct vki_fpregs vki_elf_fpregset_t;
+
+struct vki_mcontext {
+   struct vki_gpregs mc_gpregs;
+   struct vki_fpregs mc_fpregs;
+   int               mc_flags;
+#define _MC_FP_VALID 0x1     /* Set when mc_fpregs has valid data */
+   int          mc_pad;      /* Padding */
+   vki_uint64_t mc_spare[8]; /* Space for expansion, set to zero */
+};
+
+struct vki_sigaction_base {
+   void (*ksa_handler)(int);
+   int          sa_flags;
+   vki_sigset_t sa_mask; /* mask last for extensibility */
+};
+typedef struct vki_sigaction_base vki_sigaction_toK_t;
+typedef struct vki_sigaction_base vki_sigaction_fromK_t;
+
+//----------------------------------------------------------------------
+// sys/vdso.h and machine/vdso.h
+//----------------------------------------------------------------------
+#define VKI_VDSO_TIMEHANDS_MD                                                  \
+   uint32_t th_physical;                                                       \
+   uint32_t th_res[7];
+
+struct vki_bintime {
+   vki_time_t   sec;
+   vki_uint64_t frac;
+};
+
+struct vki_vdso_timehands {
+   vki_uint32_t       th_algo;
+   vki_uint32_t       th_gen;
+   vki_uint64_t       th_scale;
+   vki_uint32_t       th_offset_count;
+   vki_uint32_t       th_counter_mask;
+   struct vki_bintime th_offset;
+   struct vki_bintime th_boottime;
+   VKI_VDSO_TIMEHANDS_MD
+};
+
+#endif /* VKI_ARM64_FREEBSD_H */
index 0cf17cc7b5639858a3e49c6aece0ec4104ba842c..14b1703886e88cae73f47132fc462caff4589437 100644 (file)
@@ -53,6 +53,8 @@
 #  include "vki-machine-types-x86-freebsd.h"
 #elif defined(VGA_amd64)
 #  include "vki-machine-types-amd64-freebsd.h"
+#elif defined(VGA_arm64)
+#  include "vki-machine-types-arm64-freebsd.h"
 #else
 #  error Unknown platform
 #endif
@@ -195,6 +197,8 @@ typedef __vki_fd_set    vki_fd_set;
 #  include "vki-x86-freebsd.h"
 #elif defined(VGA_amd64)
 #  include "vki-amd64-freebsd.h"
+#elif defined(VGA_arm64)
+#  include "vki-arm64-freebsd.h"
 #else
 #  error Unknown platform
 #endif
@@ -1241,12 +1245,12 @@ struct vki_mq_attr {
 #define  VKI_UCF_SWAPPED   1
 
 struct vki_ucontext {
-   vki_sigset_t      uc_sigmask;
+   vki_sigset_t         uc_sigmask;
    struct vki_mcontext  uc_mcontext;
-   struct vki_ucontext  *uc_link;
-   vki_stack_t    uc_stack;
-   int         uc_flags;
-   unsigned int      __spare__[4];
+   struct vki_ucontextuc_link;
+   vki_stack_t          uc_stack;
+   int                  uc_flags;
+   unsigned int         __spare__[4];
 };
 
 //----------------------------------------------------------------------
@@ -1977,7 +1981,7 @@ typedef union vki_modspecific {
 #if defined(VGP_x86_freebsd)
    vki_int32_t longval;
    vki_uint32_t   u_longval;
-#elif defined(VGP_amd64_freebsd)
+#elif defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    vki_int64_t longval;
    vki_uint64_t   u_longval;
 #else
@@ -2570,6 +2574,38 @@ struct vki_ps_strings {
 #define VKI_NT_FREEBSD_FCTL_STKGAP_DISABLE 0x00000004
 #define VKI_NT_FREEBSD_FCTL_WXNEEDED 0x00000008
 
+
+/*
+ * PJF this is a bit messy
+ *
+ * mode_t is uint16_t
+ * No problem on x86/amd64
+ * On arm64 there are syscalls that take mode_t but that doesn't
+ * work with memcheck validation - arm64 doesn't have any 16bit
+ * registers.
+ *
+ * I can't just change mode_t to be 32bit. that will mess up
+ * the 'stat' structures in thie file.
+ *
+ * Instead I'll just do what the compiler does, and promote
+ * it to 32bits.
+ *
+ * In the kernel, the syscall interface just pushes all
+ * possible syscall args onto the stack and then
+ * memcpy's them into an array of register sized args.
+ * There's a struct defined for each syscall's arguments
+ * that uses padding to type pun the values back to
+ * the type passed in from userland. The structs are
+ * generated from the syscall table.
+ *
+ * vki_mode_t is only used in syswrap files so there shouldn't
+ * be any other side effects.
+ */
+
+#if defined(VGP_arm64_freebsd)
+#define vki_mode_t vki_int32_t
+#endif
+
 // See syswrap-freebsd.c PRE/POST(sys_ioctl)
 #if 0
 
diff --git a/include/vki/vki-machine-types-arm64-freebsd.h b/include/vki/vki-machine-types-arm64-freebsd.h
new file mode 100644 (file)
index 0000000..dda1f86
--- /dev/null
@@ -0,0 +1,76 @@
+
+/*--------------------------------------------------------------------*/
+/*--- x86/FreeBSD-specific kernel interface: posix types.          ---*/
+/*---                               vki_posixtypes-arm64-freebsd.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2000-2005 Julian Seward
+      jseward@acm.org
+   Copyright (C) 2024 Paul Floyd
+      pjfloyd@wanadoo.fr
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef VKI_MACHINE_TYPES_ARM64_FREEBSD_H
+#define VKI_MACHINE_TYPES_ARM64_FREEBSD_H
+
+//----------------------------------------------------------------------
+// From sys/i386/include/_types.h
+//----------------------------------------------------------------------
+
+typedef __signed char  vki_int8_t;
+typedef unsigned char  vki_uint8_t;
+typedef short          vki_int16_t;
+typedef unsigned short vki_uint16_t;
+typedef int            vki_int32_t;
+typedef unsigned int   vki_uint32_t;
+typedef long           vki_int64_t;
+typedef unsigned long  vki_uint64_t;
+typedef unsigned long  vki_uintptr_t;
+typedef long           vki_intptr_t;
+
+typedef unsigned int __vki_clock_t;
+typedef unsigned int __vki_cpumask_t;
+typedef char*        __vki_caddr_t; /* QQQ 32 on 64 */
+typedef double       __vki_double_t;
+typedef double       __vki_float_t;
+typedef vki_int64_t  __vki_intfptr_t;
+typedef vki_int64_t  __vki_intmax_t;
+typedef vki_int64_t  __vki_ptrdiff_t;
+typedef vki_int64_t  __vki_register_t;
+typedef vki_int64_t  __vki_segsz_t;
+typedef vki_uint64_t __vki_size_t;
+typedef vki_int64_t  __vki_ssize_t;
+typedef vki_int64_t  __vki_time_t;
+typedef vki_uint64_t __vki_uintfptr_t;
+typedef vki_uint64_t __vki_uintmax_t;
+typedef vki_uint64_t __vki_u_register_t;
+typedef vki_uint64_t __vki_vm_offset_t;
+typedef vki_int64_t  __vki_vm_ooffset_t;
+typedef vki_uint64_t __vki_vm_paddr_t; /* QQQ int64 for PAE */
+typedef vki_uint64_t __vki_vm_pindex_t;
+typedef vki_uint64_t __vki_vm_size_t;
+
+#endif // VKI_MACHINE_TYPES_ARM64_FREEBSD_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
index 76557d4cbe63c41f91b7cd8f670d0bfa41705ea7..ab781fa933197cb7f2df57e9efe88e75d5ddf939 100644 (file)
@@ -72,12 +72,15 @@ check_PROGRAMS = \
        new-cpp \
        null \
        one \
-       pages_as_heap \
        peak \
        realloc \
        thresholds \
        zero
 
+if HAVE_SBRK
+check_PROGRAMS += pages_as_heap
+endif
+
 if HAVE_ALIGNED_CXX_ALLOC
 check_PROGRAMS += overloaded-new
 endif
index 78344601fc01927610faaf01ce8d233810f6ad0d..0ed73ea13625e19b5b4816a7af03bc33c28d04da 100644 (file)
@@ -1,3 +1,4 @@
+prereq: test -e ./pages_as_heap
 prog: pages_as_heap
 vgopts: --stacks=no --time-unit=B --heap-admin=0 --pages-as-heap=yes --massif-out-file=massif.out --detailed-freq=3
 vgopts: --ignore-fn=mmap
index 3168028a992e2e5748e42470c75d4eb8a0eef2e9..4da5bfecbf06427d9af76e7fe9af3125cd1db216 100644 (file)
@@ -314,6 +314,7 @@ EXTRA_DIST = \
        origin6-fp.stderr.exp-glibc25-amd64 \
        origin6-fp.stderr.exp-glibc27-ppc64 \
        overlap.stderr.exp overlap.stdout.exp overlap.vgtest \
+               overlap.stderr.exp-no_memcpy \
        partiallydefinedeq.vgtest partiallydefinedeq.stderr.exp \
        partiallydefinedeq.stderr.exp4 \
        partiallydefinedeq.stderr.exp3 \
@@ -464,7 +465,6 @@ check_PROGRAMS = \
        badpoll \
        badrw \
        big_blocks_freed_list \
-       brk2 \
        buflen_check \
        bug155125 \
        bug287260 \
@@ -556,8 +556,10 @@ check_PROGRAMS += long_namespace_xml
 endif
 
 if DWARF4
+if HAVE_SBRK
 check_PROGRAMS += dw4
 endif
+endif
 
 bug464969_d_demangle_SOURCES = bug464969_d_demangle.cpp
 bug464969_d_demangle_CXXFLAGS = $(AM_CXXFLAGS) @FLAG_W_NO_UNINITIALIZED@
@@ -578,6 +580,10 @@ cdebug_zlib_gnu_SOURCES = cdebug.c
 cdebug_zlib_gnu_CFLAGS = $(AM_CFLAGS) -g -gz=zlib-gnu @FLAG_W_NO_UNINITIALIZED@
 endif
 
+if HAVE_SBRK
+check_PROGRAMS += brk2
+endif
+
 if HAVE_ALIGNED_CXX_ALLOC
 check_PROGRAMS += cxx17_aligned_new sized_aligned_new_delete_args \
        new_aligned_delete_default \
index 331464e5f19fae928a959f7e7b137d099d40a9b6..2261ec5aa3411d722ac04b7b84ead84293fbd98d 100644 (file)
@@ -1,2 +1,3 @@
+prereq: test -e ./brk2
 prog: brk2
 stderr_filter: filter_allocs
index d16ab2e920460783d4d338bfce7f2df5cb304461..16b439b7803235aa01cca08fc202b656193b2b54 100644 (file)
@@ -87,6 +87,7 @@ EXTRA_DIST = \
        revoke.stderr.exp \
        scalar.h scalar.vgtest \
        scalar.stderr.exp \
+               scalar.stderr.exp-arm64 \
                scalar.stderr.exp-x86 \
        scalar_abort2.vgtest \
        scalar_13_plus.vgtest \
index d6decdbef0bbff3b5dd18e323e12945a2308fc25..e5046a97ceb6141f85a1e0912056a7c3de1f6b85 100755 (executable)
@@ -2,4 +2,5 @@
 
 ../filter_stderr "$@" |
 
-gsed 's/size ... free/size ... free/'
+gsed 's/size ... free/size ... free/' |
+gsed 's/size ... alloc/size ... alloc/'
index 9628723fab2f2787c1eed015e2a6a94a2d79b593..38a710227431d20e750b4163560fe5759c14cf58 100755 (executable)
@@ -3,6 +3,7 @@
 gsed 's/Invalid write of size 8/Invalid write of size 4/' |
 gsed 's/is [4-9][0-9] bytes inside a block of size 100 free/is ... bytes inside a block of size 100 free/' |
 gsed '/___realpathat/d' |
+gsed 's/Invalid write of size 2/Invalid write of size 1/' |
 
 
 ../filter_stderr "$@"
index 4a0de6d796f3e98d276b2c922e5d5bb5369fc87a..e0b7db63b1b07a33b16b0c57c7d7af79c68da4b9 100644 (file)
@@ -13,8 +13,9 @@
 #include <assert.h>
 #include <unistd.h>
 #include <assert.h>
+#include "../../memcheck.h"
 
-int main()
+int main(void)
 {
    ucontext_t uc;
    volatile int flag = 0;
@@ -42,9 +43,36 @@ int main()
    assert(flag == 5);
  
    // error section
-   ucontext_t* ucp = malloc(sizeof(ucontext_t));
+   ucontext_t* ucp = malloc(sizeof(*ucp));
+   ucontext_t* ucp2 = malloc(sizeof(*ucp2));
+   (void)VALGRIND_MAKE_MEM_NOACCESS(ucp, sizeof(*ucp));
+   (void)VALGRIND_MAKE_MEM_NOACCESS(ucp2, sizeof(*ucp2));
+   flag = 0;
+   if (-1 == getcontext(ucp)) {
+      perror("getcontext failed: ");
+   }
+
+   flag++;
+
+   if (flag == 1) {
+      (void)VALGRIND_MAKE_MEM_NOACCESS(ucp, sizeof(*ucp));
+      if (-1 == setcontext(ucp)) {
+         perror("setcontext failed: ");
+      }
+      fprintf(stderr, "should never see setcontext return\n");
+   }
+
+   flag++;
+
+   if (flag == 3) {
+      (void)VALGRIND_MAKE_MEM_NOACCESS(ucp, sizeof(*ucp));
+      if (-1 == swapcontext(ucp2, ucp)) {
+         perror("swapcontext failed: ");
+      }
+      fprintf(stderr, "should never see swapcontest return\n");
+   }
+
+   assert(flag == 5);
    free(ucp);
-   setcontext(ucp);
-   swapcontext(ucp, ucp);
-   getcontext(ucp);
+   free(ucp2);
 }
index 29b1e6288ca10be3b81f18d1bcbf660e8b36d168..fda41dc7a53f88361bccbdb8579e68bf75519013 100644 (file)
@@ -1,40 +1,28 @@
-Syscall param setcontext(ucp) points to unaddressable byte(s)
+Syscall param getcontext(ucp) points to unaddressable byte(s)
    ...
-   by 0x........: main (get_set_context.c:47)
- Address 0x........ is 0 bytes inside a block of size ... free'd
-   at 0x........: free (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:46)
- Block was alloc'd at
+   by 0x........: main (get_set_context.c:51)
+ Address 0x........ is 0 bytes inside a block of size ... alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:45)
+   by 0x........: main (get_set_context.c:46)
 
-Syscall param swapcontext(ucp) points to unaddressable byte(s)
+Syscall param setcontext(ucp) points to unaddressable byte(s)
    ...
-   by 0x........: main (get_set_context.c:48)
- Address 0x........ is 0 bytes inside a block of size ... free'd
-   at 0x........: free (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:46)
- Block was alloc'd at
+   by 0x........: main (get_set_context.c:59)
+ Address 0x........ is 0 bytes inside a block of size ... alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:45)
+   by 0x........: main (get_set_context.c:46)
 
-Syscall param swapcontext(oucp) points to unaddressable byte(s)
+Syscall param swapcontext(ucp) points to unaddressable byte(s)
    ...
-   by 0x........: main (get_set_context.c:48)
- Address 0x........ is 0 bytes inside a block of size ... free'd
-   at 0x........: free (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:46)
- Block was alloc'd at
+   by 0x........: main (get_set_context.c:69)
+ Address 0x........ is 0 bytes inside a block of size ... alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:45)
+   by 0x........: main (get_set_context.c:46)
 
-Syscall param getcontext(ucp) points to unaddressable byte(s)
+Syscall param swapcontext(oucp) points to unaddressable byte(s)
    ...
-   by 0x........: main (get_set_context.c:49)
- Address 0x........ is 0 bytes inside a block of size ... free'd
-   at 0x........: free (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:46)
- Block was alloc'd at
+   by 0x........: main (get_set_context.c:69)
+ Address 0x........ is 0 bytes inside a block of size ... alloc'd
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (get_set_context.c:45)
+   by 0x........: main (get_set_context.c:47)
 
index e299abcba8dbe9be593bd1327c8195ff40041147..5f9494f22d1598b86052ad0dc19009e9bb9c69e9 100644 (file)
@@ -117,7 +117,7 @@ Invalid read of size 1
    ...
    by 0x........: main (realpathat.c:28)
 
-Invalid write of size 2
+Invalid write of size 1
    ...
    by 0x........: main (realpathat.c:32)
  Address 0x........ is ... bytes inside a block of size 100 free'd
index eb49e01ca23ba84c1e7c2f15317cf036015e6161..ebbffae2a74e414382b21fa9fa7b38fcd95e6b6d 100644 (file)
@@ -196,6 +196,7 @@ int main(void)
    GO(SYS_dup, "1s 0m");
    SY(SYS_dup, x0-1); FAIL;
 
+#if !defined(VGP_arm64_freebsd)
    /* freebsd10_pipe              42 */
 #if (FREEBSD_VERS >= FREEBSD_11)
    GO(SYS_freebsd10_pipe, "0s 0m");
@@ -203,6 +204,7 @@ int main(void)
 #else
    GO(SYS_pipe, "0s 0m");
    SY(SYS_pipe, x0); SUCC;
+#endif
 #endif
 
    /* getegid                     43 */
@@ -624,6 +626,8 @@ int main(void)
 
    GO(SYS_sysarch, "2s 0m");
    SY(SYS_sysarch, x0+AMD64_SET_FSBASE, x0); FAIL;
+#elif defined(VGP_arm64_freebsd)
+// does not exist
 #else
 #error "freebsd platform not defined"
 #endif
@@ -965,7 +969,7 @@ int main(void)
    /* netbsd lstat                280 */
 
    /* SYS_preadv                  289 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    GO(SYS_preadv, "4s 0m");
    /* 0m because of the bogus fd */
    SY(SYS_preadv, x0+9999999, x0+1, x0+16, x0+20); FAIL;
@@ -975,7 +979,7 @@ int main(void)
 #endif
 
    /* SYS_pwritev                    290 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    GO(SYS_pwritev, "4s 0m");
    SY(SYS_pwritev, x0+9999999, x0+1, x0+16, x0+20); FAIL;
 #else
@@ -1617,7 +1621,7 @@ int main(void)
    SY(SYS_mmap, x0+1, x0, x0+123456, x0+234567, x0+99, x0+3); FAIL;
 
    /* SYS_lseek                   478 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    GO(SYS_lseek, "3s 0m");
    SY(SYS_lseek, x0+99, x0+1, x0+55); FAIL;
 #else
@@ -1626,7 +1630,7 @@ int main(void)
 #endif
 
    /* SYS_truncate                479 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    GO(SYS_truncate, "2s 1m");
    SY(SYS_truncate, x0+1, x0+1); FAIL;
 #else
@@ -1635,7 +1639,7 @@ int main(void)
 #endif
 
    /* SYS_ftruncate               480 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    GO(SYS_ftruncate, "2s 0m");
    SY(SYS_ftruncate, x0+99, x0+1); FAIL;
 #else
@@ -1669,7 +1673,7 @@ int main(void)
    SY(SYS_cpuset, x0+1); FAIL;
 
    /* cpuset_setid                485 */
-#if defined (VGP_amd64_freebsd)
+#if defined (VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
    GO(SYS_cpuset_setid, "3s 0m");
    SY(SYS_cpuset_setid, x0, x0, x0); FAIL;
 #else
@@ -1867,7 +1871,7 @@ int main(void)
     SY(SYS_rctl_remove_rule, x0+1, x0+1, x0+2, x0+16); FAIL;
 
     /* SYS_posix_fallocate        530 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
     GO(SYS_posix_fallocate, "3s 0m");
     SY(SYS_posix_fallocate, x0+99999, x0+10, x0+20); SUCC;
 #else
@@ -1934,9 +1938,9 @@ int main(void)
     SY(SYS_aio_mlock, x0+1); FAIL;
 
     /* SYS_procctl                544 */
-#if defined(VGP_amd64_freebsd)
+#if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
     GO(SYS_procctl, "(PROC_REAP_RELEASE) 3s 0m");
-    SY(SYS_procctl, x0+9999, x0+9999, x0+PROC_REAP_RELEASE); FAIL;
+    SY(SYS_procctl, x0+9999, x0+9999, x0+PROC_REAP_RELEASE, NULL); FAIL;
 
     GO(SYS_procctl, "(PROC_REAP_GETPIDS) 4s 1m");
     SY(SYS_procctl, x0+9999, x0+9999, x0+PROC_REAP_GETPIDS, x0+1); FAIL;
diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-arm64 b/memcheck/tests/freebsd/scalar.stderr.exp-arm64
new file mode 100644 (file)
index 0000000..78f61f9
--- /dev/null
@@ -0,0 +1,5452 @@
+---------------------------------------------------------
+  1:                SYS_exit below
+---------------------------------------------------------
+---------------------------------------------------------
+  2:                SYS_fork other
+---------------------------------------------------------
+---------------------------------------------------------
+  3:                SYS_read 1+3s 0m
+---------------------------------------------------------
+Syscall param (syscallno) contains uninitialised byte(s)
+   ...
+
+Syscall param read(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param read(count) contains uninitialised byte(s)
+   ...
+
+Syscall param read(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+  4:               SYS_write 3s 1m
+---------------------------------------------------------
+Syscall param write(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param write(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param write(count) contains uninitialised byte(s)
+   ...
+
+Syscall param write(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+  5:                SYS_open (2-args) 2s 1m
+---------------------------------------------------------
+Syscall param open(filename) contains uninitialised byte(s)
+   ...
+
+Syscall param open(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param open(filename) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+  5:                SYS_open (3-args) 1s 0m
+---------------------------------------------------------
+Syscall param open(mode) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+  6:               SYS_close 1s 0m
+---------------------------------------------------------
+Syscall param close(fd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+  7:               SYS_wait4 4s 2m
+---------------------------------------------------------
+Syscall param wait4(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param wait4(status) contains uninitialised byte(s)
+   ...
+
+Syscall param wait4(options) contains uninitialised byte(s)
+   ...
+
+Syscall param wait4(rusage) contains uninitialised byte(s)
+   ...
+
+Syscall param wait4(status) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param wait4(rusage) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+  9:                SYS_link 2s 2m
+---------------------------------------------------------
+Syscall param link(oldpath) contains uninitialised byte(s)
+   ...
+
+Syscall param link(newpath) contains uninitialised byte(s)
+   ...
+
+Syscall param link(oldpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param link(newpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 10:              SYS_unlink 1s 1m
+---------------------------------------------------------
+Syscall param unlink(pathname) contains uninitialised byte(s)
+   ...
+
+Syscall param unlink(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 12:               SYS_chdir 1s 1m
+---------------------------------------------------------
+Syscall param chdir(path) contains uninitialised byte(s)
+   ...
+
+Syscall param chdir(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 13:              SYS_fchdir 1s 0m
+---------------------------------------------------------
+Syscall param fchdir(fd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 14:     SYS_freebsd11_mknod 3s 1m
+---------------------------------------------------------
+Syscall param mknod(pathname) contains uninitialised byte(s)
+   ...
+
+Syscall param mknod(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mknod(dev) contains uninitialised byte(s)
+   ...
+
+Syscall param mknod(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 15:               SYS_chmod 2s 1m
+---------------------------------------------------------
+Syscall param chmod(path) contains uninitialised byte(s)
+   ...
+
+Syscall param chmod(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param chmod(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 16:               SYS_chown 3s 1m
+---------------------------------------------------------
+Syscall param chown(path) contains uninitialised byte(s)
+   ...
+
+Syscall param chown(owner) contains uninitialised byte(s)
+   ...
+
+Syscall param chown(group) contains uninitialised byte(s)
+   ...
+
+Syscall param chown(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 17:               SYS_break 1s 1m
+---------------------------------------------------------
+Syscall param brk(end_data_segment) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 20:              SYS_getpid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 21:               SYS_mount 4s 2m
+---------------------------------------------------------
+Syscall param mount(type) contains uninitialised byte(s)
+   ...
+
+Syscall param mount(dir) contains uninitialised byte(s)
+   ...
+
+Syscall param mount(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param mount(data) contains uninitialised byte(s)
+   ...
+
+Syscall param mount(type) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param mount(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 22:             SYS_unmount 2s 1m
+---------------------------------------------------------
+Syscall param unmount(dir) contains uninitialised byte(s)
+   ...
+
+Syscall param unmount(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param unmount(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 23:              SYS_setuid 1s 0m
+---------------------------------------------------------
+Syscall param setuid(uid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 24:              SYS_getuid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 25:             SYS_geteuid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 26:              SYS_ptrace 4s 0m
+---------------------------------------------------------
+Syscall param ptrace(request) contains uninitialised byte(s)
+   ...
+
+Syscall param ptrace(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param ptrace(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param ptrace(data) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 27:             SYS_recvmsg 3s 0m
+---------------------------------------------------------
+Syscall param recvmsg(s) contains uninitialised byte(s)
+   ...
+
+Syscall param recvmsg(msg) contains uninitialised byte(s)
+   ...
+
+Syscall param recvmsg(flags) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 28:             SYS_sendmsg 3s 0m
+---------------------------------------------------------
+Syscall param sendmsg(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sendmsg(msg) contains uninitialised byte(s)
+   ...
+
+Syscall param sendmsg(flags) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 29:            SYS_recvfrom 6+1s 0m
+---------------------------------------------------------
+Syscall param recvfrom(s) contains uninitialised byte(s)
+   ...
+
+Syscall param recvfrom(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param recvfrom(len) contains uninitialised byte(s)
+   ...
+
+Syscall param recvfrom(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param recvfrom(from) contains uninitialised byte(s)
+   ...
+
+Syscall param recvfrom(fromlen) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.recvfrom(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param socketcall.recvfrom(fromlen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 30:              SYS_accept 3+1s 0m
+---------------------------------------------------------
+Syscall param accept(s) contains uninitialised byte(s)
+   ...
+
+Syscall param accept(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param accept(*addrlen) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.accept(addrlen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 31:         SYS_getpeername 3s 1m
+---------------------------------------------------------
+Syscall param getpeername(s) contains uninitialised byte(s)
+   ...
+
+Syscall param getpeername(name) contains uninitialised byte(s)
+   ...
+
+Syscall param getpeername(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.getpeername(namelen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 32:         SYS_getsockname 3s 1m
+---------------------------------------------------------
+Syscall param getsockname(s) contains uninitialised byte(s)
+   ...
+
+Syscall param getsockname(name) contains uninitialised byte(s)
+   ...
+
+Syscall param getsockname(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.getsockname(namelen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 25:             SYS_geteuid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 34:             SYS_chflags 2s 1m
+---------------------------------------------------------
+Syscall param chflags(path) contains uninitialised byte(s)
+   ...
+
+Syscall param chflags(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param chflags(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 35:            SYS_fchflags 2s 0m
+---------------------------------------------------------
+Syscall param fchflags(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fchflags(flags) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 36:                SYS_sync 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 37:                SYS_kill 2s 0m
+---------------------------------------------------------
+Syscall param kill(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param kill(signal) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 39:             SYS_getppid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 41:                 SYS_dup 1s 0m
+---------------------------------------------------------
+Syscall param dup(oldfd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 43:             SYS_getegid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 44:              SYS_profil ni
+---------------------------------------------------------
+---------------------------------------------------------
+ 45:              SYS_ktrace ni
+---------------------------------------------------------
+---------------------------------------------------------
+ 47:              SYS_getgid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 49:            SYS_getlogin 2s 1m
+---------------------------------------------------------
+Syscall param getlogin(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param getlogin(len) contains uninitialised byte(s)
+   ...
+
+Syscall param getlogin(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 50:            SYS_setlogin 1s 1m
+---------------------------------------------------------
+Syscall param setlogin(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param setlogin(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 51:                SYS_acct 1s 1m
+---------------------------------------------------------
+Syscall param acct(filename) contains uninitialised byte(s)
+   ...
+
+Syscall param acct(filename) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 53:         SYS_sigaltstack 2s 2m
+---------------------------------------------------------
+Syscall param sigaltstack(ss) contains uninitialised byte(s)
+   ...
+
+Syscall param sigaltstack(oss) contains uninitialised byte(s)
+   ...
+
+Syscall param sigaltstack(ss) points to unaddressable byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param sigaltstack(oss) points to unaddressable byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+ 54:               SYS_ioctl 3s 1m
+---------------------------------------------------------
+Syscall param ioctl(fd) contains uninitialised byte(s)
+   ...
+
+
+More than 100 errors detected.  Subsequent errors
+will still be recorded, but in less detail than before.
+Syscall param ioctl(request) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(arg) contains uninitialised byte(s)
+   ...
+
+Syscall param ioctl(generic) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 56:              SYS_revoke 1s 1m
+---------------------------------------------------------
+Syscall param revoke(path) contains uninitialised byte(s)
+   ...
+
+Syscall param revoke(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 57:             SYS_symlink 2s 2m
+---------------------------------------------------------
+Syscall param symlink(oldpath) contains uninitialised byte(s)
+   ...
+
+Syscall param symlink(newpath) contains uninitialised byte(s)
+   ...
+
+Syscall param symlink(oldpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param symlink(newpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 58:            SYS_readlink 3s 2m
+---------------------------------------------------------
+Syscall param readlink(path) contains uninitialised byte(s)
+   ...
+
+Syscall param readlink(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param readlink(bufsiz) contains uninitialised byte(s)
+   ...
+
+Syscall param readlink(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param readlink(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 59:              SYS_execve 3s 1m
+---------------------------------------------------------
+Syscall param execve(filename) contains uninitialised byte(s)
+   ...
+
+Syscall param execve(argv) contains uninitialised byte(s)
+   ...
+
+Syscall param execve(envp) contains uninitialised byte(s)
+   ...
+
+Syscall param execve(filename) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param execve(argv) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 60:               SYS_umask 1s 0m
+---------------------------------------------------------
+Syscall param umask(mask) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 61:              SYS_chroot 1s 1m
+---------------------------------------------------------
+Syscall param chroot(path) contains uninitialised byte(s)
+   ...
+
+Syscall param chroot(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 65:               SYS_msync 3s 1m
+---------------------------------------------------------
+Syscall param msync(start) contains uninitialised byte(s)
+   ...
+
+Syscall param msync(length) contains uninitialised byte(s)
+   ...
+
+Syscall param msync(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param msync(start) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 66:               SYS_vfork other
+---------------------------------------------------------
+---------------------------------------------------------
+ 69:                SYS_sbrk 1s 1m
+---------------------------------------------------------
+Syscall param sbrk(incr) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 73:              SYS_munmap 2s 0m
+---------------------------------------------------------
+Syscall param munmap(start) contains uninitialised byte(s)
+   ...
+
+Syscall param munmap(length) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 74:            SYS_mprotect 3s 0m
+---------------------------------------------------------
+Syscall param mprotect(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param mprotect(len) contains uninitialised byte(s)
+   ...
+
+Syscall param mprotect(prot) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 75:             SYS_madvise 3s 0m
+---------------------------------------------------------
+Syscall param madvise(start) contains uninitialised byte(s)
+   ...
+
+Syscall param madvise(length) contains uninitialised byte(s)
+   ...
+
+Syscall param madvise(advice) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 78:             SYS_mincore 3s 1m
+---------------------------------------------------------
+Syscall param mincore(start) contains uninitialised byte(s)
+   ...
+
+Syscall param mincore(length) contains uninitialised byte(s)
+   ...
+
+Syscall param mincore(vec) contains uninitialised byte(s)
+   ...
+
+Syscall param mincore(vec) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 79:           SYS_getgroups 2s 1m
+---------------------------------------------------------
+Syscall param getgroups(size) contains uninitialised byte(s)
+   ...
+
+Syscall param getgroups(list) contains uninitialised byte(s)
+   ...
+
+Syscall param getgroups(list) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 80:           SYS_setgroups 2s 1m
+---------------------------------------------------------
+Syscall param setgroups(size) contains uninitialised byte(s)
+   ...
+
+Syscall param setgroups(list) contains uninitialised byte(s)
+   ...
+
+Syscall param setgroups(list) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 81:             SYS_getpgrp 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 82:             SYS_setpgid 2s 0m
+---------------------------------------------------------
+Syscall param setpgid(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param setpgid(pgid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 83:           SYS_setitimer 3s 2m
+---------------------------------------------------------
+Syscall param setitimer(which) contains uninitialised byte(s)
+   ...
+
+Syscall param setitimer(value) contains uninitialised byte(s)
+   ...
+
+Syscall param setitimer(ovalue) contains uninitialised byte(s)
+   ...
+
+Syscall param setitimer(&value->it_interval) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param setitimer(&value->it_value) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param setitimer(&ovalue->it_interval) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param setitimer(&ovalue->it_value) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 85:              SYS_swapon 1s 1m
+---------------------------------------------------------
+Syscall param swapon(special) contains uninitialised byte(s)
+   ...
+
+Syscall param swapon(special) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 86:           SYS_getitimer 2s 1m
+---------------------------------------------------------
+Syscall param getitimer(which) contains uninitialised byte(s)
+   ...
+
+Syscall param getitimer(value) contains uninitialised byte(s)
+   ...
+
+Syscall param getitimer(&value->it_interval) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getitimer(&value->it_value) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 89:       SYS_getdtablesize 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+ 90:                SYS_dup2 2s 0m
+---------------------------------------------------------
+Syscall param dup2(oldfd) contains uninitialised byte(s)
+   ...
+
+Syscall param dup2(newfd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 92:               SYS_fcntl (GETFD) 2s 0m
+---------------------------------------------------------
+Syscall param fcntl(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fcntl(cmd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 92:               SYS_fcntl (DUPFD) 1s 0m
+---------------------------------------------------------
+Syscall param fcntl(arg) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 93:              SYS_select 5s 4m
+---------------------------------------------------------
+Syscall param select(n) contains uninitialised byte(s)
+   ...
+
+Syscall param select(readfds) contains uninitialised byte(s)
+   ...
+
+Syscall param select(writefds) contains uninitialised byte(s)
+   ...
+
+Syscall param select(exceptfds) contains uninitialised byte(s)
+   ...
+
+Syscall param select(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param select(readfds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param select(writefds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param select(exceptfds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param select(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+ 95:               SYS_fsync 1s 0m
+---------------------------------------------------------
+Syscall param fsync(fd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 96:         SYS_setpriority 3s 0m
+---------------------------------------------------------
+Syscall param setpriority(which) contains uninitialised byte(s)
+   ...
+
+Syscall param setpriority(who) contains uninitialised byte(s)
+   ...
+
+Syscall param setpriority(prio) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 97:              SYS_socket 3s 0m
+---------------------------------------------------------
+Syscall param socket(domain) contains uninitialised byte(s)
+   ...
+
+Syscall param socket(type) contains uninitialised byte(s)
+   ...
+
+Syscall param socket(protocol) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+ 98:             SYS_connect 3s 0m
+---------------------------------------------------------
+Syscall param connect(s) contains uninitialised byte(s)
+   ...
+
+Syscall param connect(name) contains uninitialised byte(s)
+   ...
+
+Syscall param connect(namelen) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+100:         SYS_getpriority 2s 0m
+---------------------------------------------------------
+Syscall param getpriority(which) contains uninitialised byte(s)
+   ...
+
+Syscall param getpriority(who) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+104:                SYS_bind 3s 0m
+---------------------------------------------------------
+Syscall param bind(s) contains uninitialised byte(s)
+   ...
+
+Syscall param bind(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param bind(addrlen) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+105:          SYS_setsockopt 5s 0m
+---------------------------------------------------------
+Syscall param setsockopt(s) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(level) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(optname) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(optval) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(optlen) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+106:              SYS_listen 2s 0m
+---------------------------------------------------------
+Syscall param listen(s) contains uninitialised byte(s)
+   ...
+
+Syscall param listen(backlog) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+116:        SYS_gettimeofday 2s 2m
+---------------------------------------------------------
+Syscall param gettimeofday(tv) contains uninitialised byte(s)
+   ...
+
+Syscall param gettimeofday(tz) contains uninitialised byte(s)
+   ...
+
+Syscall param gettimeofday(tv) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param gettimeofday(tz) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+117:           SYS_getrusage 2s 1m
+---------------------------------------------------------
+Syscall param getrusage(who) contains uninitialised byte(s)
+   ...
+
+Syscall param getrusage(usage) contains uninitialised byte(s)
+   ...
+
+Syscall param getrusage(usage) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+105:          SYS_setsockopt 5s 1m
+---------------------------------------------------------
+Syscall param setsockopt(s) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(level) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(optname) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(optval) contains uninitialised byte(s)
+   ...
+
+Syscall param setsockopt(optlen) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+120:               SYS_readv 3s 1m
+---------------------------------------------------------
+Syscall param readv(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param readv(vector) contains uninitialised byte(s)
+   ...
+
+Syscall param readv(count) contains uninitialised byte(s)
+   ...
+
+Syscall param readv(vector) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+121:              SYS_writev 3s 1m
+---------------------------------------------------------
+Syscall param writev(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param writev(vector) contains uninitialised byte(s)
+   ...
+
+Syscall param writev(count) contains uninitialised byte(s)
+   ...
+
+Syscall param writev(vector) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+122:        SYS_settimeofday 2s 2m
+---------------------------------------------------------
+Syscall param settimeofday(tv) contains uninitialised byte(s)
+   ...
+
+Syscall param settimeofday(tz) contains uninitialised byte(s)
+   ...
+
+Syscall param settimeofday(tv) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param settimeofday(tz) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+123:              SYS_fchown 3s 0m
+---------------------------------------------------------
+Syscall param fchown(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fchown(owner) contains uninitialised byte(s)
+   ...
+
+Syscall param fchown(group) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+124:              SYS_fchmod 2s 0m
+---------------------------------------------------------
+Syscall param fchmod(fildes) contains uninitialised byte(s)
+   ...
+
+Syscall param fchmod(mode) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+126:            SYS_setreuid 2s 0m
+---------------------------------------------------------
+Syscall param setreuid(ruid) contains uninitialised byte(s)
+   ...
+
+Syscall param setreuid(euid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+127:            SYS_setregid 2s 0m
+---------------------------------------------------------
+Syscall param setregid(rgid) contains uninitialised byte(s)
+   ...
+
+Syscall param setregid(egid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+128:              SYS_rename 2s 2m
+---------------------------------------------------------
+Syscall param rename(oldpath) contains uninitialised byte(s)
+   ...
+
+Syscall param rename(newpath) contains uninitialised byte(s)
+   ...
+
+Syscall param rename(oldpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param rename(newpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+131:               SYS_flock 2s 0m
+---------------------------------------------------------
+Syscall param flock(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param flock(operation) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+132:              SYS_mkfifo 2s 1m
+---------------------------------------------------------
+Syscall param mkfifo(path) contains uninitialised byte(s)
+   ...
+
+Syscall param mkfifo(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mkfifo(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+133:              SYS_sendto 6s 0m
+---------------------------------------------------------
+Syscall param sendto(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sendto(msg) contains uninitialised byte(s)
+   ...
+
+Syscall param sendto(len) contains uninitialised byte(s)
+   ...
+
+Syscall param sendto(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param sendto(to) contains uninitialised byte(s)
+   ...
+
+Syscall param sendto(tolen) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+135:          SYS_socketpair 4s 1m
+---------------------------------------------------------
+Syscall param socketpair(domain) contains uninitialised byte(s)
+   ...
+
+Syscall param socketpair(type) contains uninitialised byte(s)
+   ...
+
+Syscall param socketpair(protocol) contains uninitialised byte(s)
+   ...
+
+Syscall param socketpair(sv) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.socketpair(sv) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+136:               SYS_mkdir 2s 1m
+---------------------------------------------------------
+Syscall param mkdir(pathname) contains uninitialised byte(s)
+   ...
+
+Syscall param mkdir(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mkdir(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+137:               SYS_rmdir 1s 1m
+---------------------------------------------------------
+Syscall param rmdir(pathname) contains uninitialised byte(s)
+   ...
+
+Syscall param rmdir(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+138:              SYS_utimes 2s 2m
+---------------------------------------------------------
+Syscall param utimes(filename) contains uninitialised byte(s)
+   ...
+
+Syscall param utimes(tvp) contains uninitialised byte(s)
+   ...
+
+Syscall param utimes(filename) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param utimes(tvp[0]) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param utimes(tvp[1]) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+140:             SYS_adjtime 2s 1m
+---------------------------------------------------------
+Syscall param adjtime(delta) contains uninitialised byte(s)
+   ...
+
+Syscall param adjtime(olddelta) contains uninitialised byte(s)
+   ...
+
+Syscall param adjtime(delta) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+147:              SYS_setsid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+148:            SYS_quotactl (Q_QUOTAOFF) 2s 0m
+---------------------------------------------------------
+Syscall param quotactl(path) contains uninitialised byte(s)
+   ...
+
+Syscall param quotactl(cmd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+148:            SYS_quotactl (Q_QUOTAON) 4s 2m
+---------------------------------------------------------
+Syscall param quotactl(path) contains uninitialised byte(s)
+   ...
+
+Syscall param quotactl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param quotactl(id) contains uninitialised byte(s)
+   ...
+
+Syscall param quotactl(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param quotactl(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+160:              SYS_lgetfh 2s 2m
+---------------------------------------------------------
+Syscall param lgetfh(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lgetfh(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param lgetfh(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param lgetfh(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+161:               SYS_getfh 2s 2m
+---------------------------------------------------------
+Syscall param getfh(path) contains uninitialised byte(s)
+   ...
+
+Syscall param getfh(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param getfh(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getfh(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+166:              SYS_rtprio (GET) 3s 1m
+---------------------------------------------------------
+Syscall param rtprio(function) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio(rtp) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio(rtp#lookup) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+166:              SYS_rtprio (SET) 3s 1m
+---------------------------------------------------------
+Syscall param rtprio(function) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio(rtp) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio(rtp#set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+175:              SYS_setfib 1s 0m
+---------------------------------------------------------
+Syscall param setfib(fib) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+181:              SYS_setgid 1s 0m
+---------------------------------------------------------
+Syscall param setgid(gid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+182:             SYS_setegid 1s 0m
+---------------------------------------------------------
+Syscall param setegid(gid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+183:             SYS_seteuid 1s 0m
+---------------------------------------------------------
+Syscall param seteuid(uid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+188:      SYS_freebsd11_stat 2s 2m
+---------------------------------------------------------
+Syscall param stat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param stat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param stat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param stat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+189:     SYS_freebsd11_fstat 2s 1m
+---------------------------------------------------------
+Syscall param fstat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fstat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param fstat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+190:     SYS_freebsd11_lstat 2s 2m
+---------------------------------------------------------
+Syscall param lstat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lstat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param lstat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param lstat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+191:            SYS_pathconf 2s 1m
+---------------------------------------------------------
+Syscall param pathconf(path) contains uninitialised byte(s)
+   ...
+
+Syscall param pathconf(name) contains uninitialised byte(s)
+   ...
+
+Syscall param pathconf(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+192:           SYS_fpathconf 2s 0m
+---------------------------------------------------------
+Syscall param fpathconf(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fpathconf(name) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+194:           SYS_getrlimit 2s 1m
+---------------------------------------------------------
+Syscall param getrlimit(resource) contains uninitialised byte(s)
+   ...
+
+Syscall param getrlimit(rlim) contains uninitialised byte(s)
+   ...
+
+Syscall param getrlimit(rlim) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+195:           SYS_setrlimit 2s 1m
+---------------------------------------------------------
+Syscall param setrlimit(resource) contains uninitialised byte(s)
+   ...
+
+Syscall param setrlimit(rlim) contains uninitialised byte(s)
+   ...
+
+Syscall param setrlimit(rlim) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+196:SYS_freebsd11_getdirentries 4s 2m
+---------------------------------------------------------
+Syscall param getdirentries(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(basep) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getdirentries(basep) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+202:            SYS___sysctl (getoldlen) 3s 2m
+---------------------------------------------------------
+Syscall param __sysctl(name) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(oldlenp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(newlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sysctl(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sysctl(oldlenp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+202:            SYS___sysctl (getold) 4s 2m
+---------------------------------------------------------
+Syscall param __sysctl(name) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(oldp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(oldlenp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(newlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sysctl(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sysctl(oldlenp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Warning: Bad oldlenp address 0x........ in sysctl
+---------------------------------------------------------
+202:            SYS___sysctl (putnew) 4s 2m
+---------------------------------------------------------
+Syscall param __sysctl(name) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(newp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctl(newlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sysctl(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sysctl(newp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+203:               SYS_mlock 2s 0m
+---------------------------------------------------------
+Syscall param mlock(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param mlock(len) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+204:             SYS_munlock 2s 0m
+---------------------------------------------------------
+Syscall param munlock(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param munlock(len) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+205:            SYS_undelete 1s 1m
+---------------------------------------------------------
+Syscall param undelete(path) contains uninitialised byte(s)
+   ...
+
+Syscall param undelete(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+206:             SYS_futimes 2s 0m
+---------------------------------------------------------
+Syscall param futimes(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param futimes(times) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+207:             SYS_getpgid 1s 0m
+---------------------------------------------------------
+Syscall param getpgid(pid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+209:                SYS_poll 2s 2m
+---------------------------------------------------------
+Syscall param poll(ufds) contains uninitialised byte(s)
+   ...
+
+Syscall param poll(nfds) contains uninitialised byte(s)
+   ...
+
+Syscall param poll(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param poll(ufds.fd) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param poll(ufds.revents) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+209:                SYS_poll 0s 2m
+---------------------------------------------------------
+Syscall param poll(ufds.fd) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param poll(ufds.events) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+220:   SYS_freebsd7___semctl (IPC_STAT) 4s 1m
+---------------------------------------------------------
+Syscall param semctl(semid) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(semnum) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(arg) contains uninitialised byte(s)
+   ...
+
+Syscall param sys_freebsd7___semctl(arg) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+220:   SYS_freebsd7___semctl (bogus cmd) 3s 0m
+---------------------------------------------------------
+Syscall param semctl(semid) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(semnum) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(cmd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+221:              SYS_semget 3s 0m
+---------------------------------------------------------
+Syscall param semget(key) contains uninitialised byte(s)
+   ...
+
+Syscall param semget(nsems) contains uninitialised byte(s)
+   ...
+
+Syscall param semget(flag) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+222:               SYS_semop 3s 0m
+---------------------------------------------------------
+Syscall param semop(semid) contains uninitialised byte(s)
+   ...
+
+Syscall param semop(array) contains uninitialised byte(s)
+   ...
+
+Syscall param semop(nops) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+224:     SYS_freebsd7_msgctl (set) 3s 1m
+---------------------------------------------------------
+Syscall param msgctl(msqid) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(IPC_SET, buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+224:     SYS_freebsd7_msgctl (stat) 3s 1m
+---------------------------------------------------------
+Syscall param msgctl(msqid) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(IPC_STAT, buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+225:              SYS_msgget 2s 0m
+---------------------------------------------------------
+Syscall param msgget(key) contains uninitialised byte(s)
+   ...
+
+Syscall param msgget(msgflg) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+226:              SYS_msgsnd 4s 1m
+---------------------------------------------------------
+Syscall param msgsnd(msqid) contains uninitialised byte(s)
+   ...
+
+Syscall param msgsnd(msgp) contains uninitialised byte(s)
+   ...
+
+Syscall param msgsnd(msgsz) contains uninitialised byte(s)
+   ...
+
+Syscall param msgsnd(msgflg) contains uninitialised byte(s)
+   ...
+
+Syscall param msgsnd(msgp->mtype) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+227:              SYS_msgrcv 4+1s 1m
+---------------------------------------------------------
+Syscall param msgrcv(msqid) contains uninitialised byte(s)
+   ...
+
+Syscall param msgrcv(msgp) contains uninitialised byte(s)
+   ...
+
+Syscall param msgrcv(msgsz) contains uninitialised byte(s)
+   ...
+
+Syscall param msgrcv(msgtyp) contains uninitialised byte(s)
+   ...
+
+Syscall param msgrcv(msgflg) contains uninitialised byte(s)
+   ...
+
+Syscall param msgrcv(msgp->mtype) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param msgrcv(msgp->mtext) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+228:               SYS_shmat 3s 0m
+---------------------------------------------------------
+Syscall param shmat(shmid) contains uninitialised byte(s)
+   ...
+
+Syscall param shmat(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param shmat(flag) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+229:     SYS_freebsd7_shmctl 3s 0m
+---------------------------------------------------------
+Syscall param shmctl(shmid) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(buf) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+229:     SYS_freebsd7_shmctl (bogus cmd) 3s 0m
+---------------------------------------------------------
+Syscall param shmctl(shmid) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(buf) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+230:               SYS_shmdt 1s 0m
+---------------------------------------------------------
+Syscall param shmdt(addr) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+231:              SYS_shmget 3s 0m
+---------------------------------------------------------
+Syscall param shmget(key) contains uninitialised byte(s)
+   ...
+
+Syscall param shmget(size) contains uninitialised byte(s)
+   ...
+
+Syscall param shmget(flag) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+232:       SYS_clock_gettime 2s 1m
+---------------------------------------------------------
+Syscall param clock_gettime(clk_id) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_gettime(tp) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_gettime(tp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+233:       SYS_clock_settime 2s 1m
+---------------------------------------------------------
+Syscall param clock_settime(clk_id) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_settime(tp) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_settime(tp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+234:        SYS_clock_getres 2s 1m
+---------------------------------------------------------
+Syscall param clock_getres(clock_id) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_getres(tp) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_getres(tp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+235:       SYS_ktimer_create 3s 2m
+---------------------------------------------------------
+Syscall param timer_create(clockid) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_create(evp) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_create(timerid) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_create(evp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param timer_create(timerid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+236:       SYS_ktimer_delete 1s 0m
+---------------------------------------------------------
+Syscall param timer_delete(timerid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+237:      SYS_ktimer_settime 4s 2m
+---------------------------------------------------------
+Syscall param timer_settime(timerid) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_settime(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_settime(value) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_settime(ovalue) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_settime(value) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param timer_settime(ovalue) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+238:      SYS_ktimer_gettime 2s 1m
+---------------------------------------------------------
+Syscall param timer_gettime(timerid) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_gettime(value) contains uninitialised byte(s)
+   ...
+
+Syscall param timer_gettime(value) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+239:   SYS_ktimer_getoverrun 1s 0m
+---------------------------------------------------------
+Syscall param timer_getoverrun(timerid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+240:           SYS_nanosleep 2s 2m
+---------------------------------------------------------
+Syscall param nanosleep(req) contains uninitialised byte(s)
+   ...
+
+Syscall param nanosleep(rem) contains uninitialised byte(s)
+   ...
+
+Syscall param nanosleep(req) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param nanosleep(rem) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+244:     SYS_clock_nanosleep 4s 2m
+---------------------------------------------------------
+Syscall param clock_nanosleep(clock_id) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_nanosleep(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_nanosleep(rqtp) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_nanosleep(rmtp) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_nanosleep(rqtp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param clock_nanosleep(rmtp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+247:SYS_clock_getcpuclockid2 3s 1m
+---------------------------------------------------------
+Syscall param clock_getcpuclockid2(id) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_getcpuclockid2(len) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_getcpuclockid2(clock_id) contains uninitialised byte(s)
+   ...
+
+Syscall param clock_getcpuclockid2(clock_id) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+250:            SYS_minherit @todo
+---------------------------------------------------------
+---------------------------------------------------------
+251:               SYS_rfork other
+---------------------------------------------------------
+---------------------------------------------------------
+253:           SYS_issetugid 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+254:              SYS_lchown 3s 1m
+---------------------------------------------------------
+Syscall param lchown(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lchown(owner) contains uninitialised byte(s)
+   ...
+
+Syscall param lchown(group) contains uninitialised byte(s)
+   ...
+
+Syscall param lchown(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+255:            SYS_aio_read 1s 1m
+---------------------------------------------------------
+Syscall param aio_read(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_read(iocb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+256:           SYS_aio_write 1s 1m
+---------------------------------------------------------
+Syscall param aio_write(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_write(iocb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+257:          SYS_lio_listio 4s 2m
+---------------------------------------------------------
+Syscall param lio_listio(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param lio_listio(list) contains uninitialised byte(s)
+   ...
+
+Syscall param lio_listio(nent) contains uninitialised byte(s)
+   ...
+
+Syscall param lio_listio(sig) contains uninitialised byte(s)
+   ...
+
+Syscall param lio_listio(list) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param lio_listio(sig) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+272:  SYS_freebsd11_getdents 3s 1m
+---------------------------------------------------------
+Syscall param getdents(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param getdents(dirp) contains uninitialised byte(s)
+   ...
+
+Syscall param getdents(count) contains uninitialised byte(s)
+   ...
+
+Syscall param getdents(dirp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+274:              SYS_lchmod 2s 1m
+---------------------------------------------------------
+Syscall param lchmod(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lchmod(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param lchmod(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+276:             SYS_lutimes 3s 2m
+---------------------------------------------------------
+Syscall param lutimes(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lutimes(times) contains uninitialised byte(s)
+   ...
+
+Syscall param lutimes(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param lutimes(times) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+289:              SYS_preadv 4s 0m
+---------------------------------------------------------
+Syscall param preadv(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param preadv(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param preadv(iovcnt) contains uninitialised byte(s)
+   ...
+
+Syscall param preadv(offset) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+290:             SYS_pwritev 4s 0m
+---------------------------------------------------------
+Syscall param pwritev(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param pwritev(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param pwritev(iovcnt) contains uninitialised byte(s)
+   ...
+
+Syscall param pwritev(offset) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+298:              SYS_fhopen 2s 1m
+---------------------------------------------------------
+Syscall param fhopen(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhopen(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param fhopen(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+553:              SYS_fhstat 2s 2m
+---------------------------------------------------------
+Syscall param fhstat(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstat(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhstat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+300:             SYS_modnext 1s 0m
+---------------------------------------------------------
+Syscall param modnext(modid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+301:             SYS_modstat 2s 1m
+---------------------------------------------------------
+Syscall param modstat(modid) contains uninitialised byte(s)
+   ...
+
+Syscall param modstat(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param modstat(stat) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+302:            SYS_modfnext 1s 0m
+---------------------------------------------------------
+Syscall param modfnext(modid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+303:             SYS_modfind 1s 1m
+---------------------------------------------------------
+Syscall param modfind(modname) contains uninitialised byte(s)
+   ...
+
+Syscall param modfind(modname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+304:             SYS_kldload 1s 1m
+---------------------------------------------------------
+Syscall param kldload("file") contains uninitialised byte(s)
+   ...
+
+Syscall param kldload(file) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+305:           SYS_kldunload 1s 0m
+---------------------------------------------------------
+Syscall param kldunload("fileid") contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+306:             SYS_kldfind 1s 1m
+---------------------------------------------------------
+Syscall param kldfind(file) contains uninitialised byte(s)
+   ...
+
+Syscall param kldfind(file) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+307:             SYS_kldnext 1s 0m
+---------------------------------------------------------
+Syscall param kldnext(fileid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+308:             SYS_kldstat 2s 1m
+---------------------------------------------------------
+Syscall param kldstat(fileid) contains uninitialised byte(s)
+   ...
+
+Syscall param kldstat(stat) contains uninitialised byte(s)
+   ...
+
+Syscall param kldstat(stat) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+309:         SYS_kldfirstmod 1s 0m
+---------------------------------------------------------
+Syscall param kldfirstmod(fileid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+310:              SYS_getsid 1s 0m
+---------------------------------------------------------
+Syscall param getsid(pid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+311:           SYS_setresuid 3s 0m
+---------------------------------------------------------
+Syscall param setresuid(ruid) contains uninitialised byte(s)
+   ...
+
+Syscall param setresuid(euid) contains uninitialised byte(s)
+   ...
+
+Syscall param setresuid(suid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+312:           SYS_setresgid 3s 0m
+---------------------------------------------------------
+Syscall param setresgid(rgid) contains uninitialised byte(s)
+   ...
+
+Syscall param setresgid(egid) contains uninitialised byte(s)
+   ...
+
+Syscall param setresgid(sgid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+314:          SYS_aio_return 1s 1m
+---------------------------------------------------------
+Syscall param aio_return(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_return(iocb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+315:         SYS_aio_suspend 3s 2m
+---------------------------------------------------------
+Syscall param aio_suspend(iocbs) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_suspend(nbiocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_suspend(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_suspend(iocbs) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param aio_suspend(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+316:          SYS_aio_cancel 2s 1m
+---------------------------------------------------------
+Syscall param aio_cancel(fildes) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_cancel(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_cancel(iocb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+317:           SYS_aio_error 1s 1m
+---------------------------------------------------------
+Syscall param aio_error(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_error(iocb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+321:               SYS_yield 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+324:            SYS_mlockall 1s 0m
+---------------------------------------------------------
+Syscall param mlockall(flags) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+325:          SYS_munlockall 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+326:            SYS___getcwd 2s 1m
+---------------------------------------------------------
+Syscall param __getcwd(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param __getcwd(buflen) contains uninitialised byte(s)
+   ...
+
+Syscall param __getcwd(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+327:      SYS_sched_setparam 2s 1m
+---------------------------------------------------------
+Syscall param sched_setparam(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_setparam(param) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_setparam(param) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+328:      SYS_sched_getparam 2s 1m
+---------------------------------------------------------
+Syscall param sched_getparam(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_getparam(param) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_getparam(param) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+329:  SYS_sched_setscheduler 3s 1m
+---------------------------------------------------------
+Syscall param sched_setscheduler(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_setscheduler(policy) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_setscheduler(param) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_setscheduler(param) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+330:  SYS_sched_getscheduler 1s 0m
+---------------------------------------------------------
+Syscall param sched_getscheduler(pid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+331:         SYS_sched_yield 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+332:SYS_sched_get_priority_max 1s 0m
+---------------------------------------------------------
+Syscall param sched_get_priority_max(policy) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+333:SYS_sched_get_priority_min 1s 0m
+---------------------------------------------------------
+Syscall param sched_get_priority_min(policy) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+334:SYS_sched_rr_get_interval 2s 1m
+---------------------------------------------------------
+Syscall param sched_rr_get_interval(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param sched_rr_get_interval(interval) contains uninitialised byte(s)
+   ...
+
+Syscall param sys_sched_rr_get_interval(interval) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+335:              SYS_utrace 2s 1m
+---------------------------------------------------------
+Syscall param utrace(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param utrace(len) contains uninitialised byte(s)
+   ...
+
+Syscall param utrace(addr) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+337:              SYS_kldsym 3s 1m
+---------------------------------------------------------
+Syscall param kldsym(fileid) contains uninitialised byte(s)
+   ...
+
+Syscall param kldsym(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param kldsym(data) contains uninitialised byte(s)
+   ...
+
+Syscall param kldsym(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+338:                SYS_jail 1s 1m
+---------------------------------------------------------
+Syscall param jail(jail) contains uninitialised byte(s)
+   ...
+
+Syscall param jail(jail) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+340:         SYS_sigprocmask 2s 1m
+---------------------------------------------------------
+Syscall param sigprocmask(how) contains uninitialised byte(s)
+   ...
+
+Syscall param sigprocmask(oset) contains uninitialised byte(s)
+   ...
+
+Syscall param sigprocmask(oset) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Warning: Bad oldset address 0x........ in sigprocmask
+---------------------------------------------------------
+340:         SYS_sigprocmask 3s 2m
+---------------------------------------------------------
+Syscall param sigprocmask(how) contains uninitialised byte(s)
+   ...
+
+Syscall param sigprocmask(set) contains uninitialised byte(s)
+   ...
+
+Syscall param sigprocmask(oset) contains uninitialised byte(s)
+   ...
+
+Syscall param sigprocmask(set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigprocmask(oset) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Warning: Bad set handler address 0x........ in sigprocmask
+---------------------------------------------------------
+341:          SYS_sigsuspend 1s 1m
+---------------------------------------------------------
+Syscall param sigsuspend(sigmask) contains uninitialised byte(s)
+   ...
+
+Syscall param sigsuspend(sigmask) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+343:          SYS_sigpending 1s 1m
+---------------------------------------------------------
+Syscall param sigpending(set) contains uninitialised byte(s)
+   ...
+
+Syscall param sigpending(set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+345:        SYS_sigtimedwait 3s 3m
+---------------------------------------------------------
+Syscall param sigtimedwait(set) contains uninitialised byte(s)
+   ...
+
+Syscall param sigtimedwait(info) contains uninitialised byte(s)
+   ...
+
+Syscall param sigtimedwait(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param sigtimedwait(set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigtimedwait(info) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigtimedwait(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+346:         SYS_sigwaitinfo 2s 2m
+---------------------------------------------------------
+Syscall param sigwaitinfo(set) contains uninitialised byte(s)
+   ...
+
+Syscall param sigwaitinfo(info) contains uninitialised byte(s)
+   ...
+
+Syscall param sigwaitinfo(set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigwaitinfo(info) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+347:      SYS___acl_get_file 3s 2m
+---------------------------------------------------------
+Syscall param acl_get_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_file(type) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_file(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_file(path points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param acl_get_file(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+348:      SYS___acl_set_file 3s 2m
+---------------------------------------------------------
+Syscall param acl_set_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_set_file(type) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_set_file(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_set_file(path points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param acl_set_file(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+349:        SYS___acl_get_fd 3s 1m
+---------------------------------------------------------
+Syscall param acl_get_fd(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_fd(type) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_fd(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_file(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+350:        SYS___acl_set_fd 3s 1m
+---------------------------------------------------------
+Syscall param acl_set_fd(filedes) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_set_fd(type) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_set_fd(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_get_file(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+351:   SYS___acl_delete_file 2s 1m
+---------------------------------------------------------
+Syscall param acl_set_file(path points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param acl_delete_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_delete_file(type) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+352:     SYS___acl_delete_fd 2s 0m
+---------------------------------------------------------
+Syscall param acl_delete_fd(filedes) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_delete_fd(acltype) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+353: SYS___acl_aclcheck_file 3s 2m
+---------------------------------------------------------
+Syscall param acl_aclcheck_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_aclcheck_file(type) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_aclcheck_file(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_set_file(path points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param acl_aclcheck_file(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+354:   SYS___acl_aclcheck_fd 3s 1m
+---------------------------------------------------------
+Syscall param acl_aclcheck_fd(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_aclcheck_fd(type) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_aclcheck_fd(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param acl_aclcheck_fd(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+355:          SYS_extattrctl 5s 3m
+---------------------------------------------------------
+Syscall param extattrctl(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattrctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param extattrctl(filename) contains uninitialised byte(s)
+   ...
+
+Syscall param extattrctl(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattrctl(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattrctl(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattrctl(filename) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattrctl(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+356:    SYS_extattr_set_file 5s 3m
+---------------------------------------------------------
+Syscall param extattr_set_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_set_file(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+357:    SYS_extattr_get_file 5s 3m
+---------------------------------------------------------
+Syscall param extattr_get_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_file(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_file(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_file(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_file(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_file(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_get_file(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_get_file(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+358: SYS_extattr_delete_file 3s 2m
+---------------------------------------------------------
+Syscall param extattr_delete_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_file(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_file(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_file(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_delete_file(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+359:    SYS_aio_waitcomplete 2s 2m
+---------------------------------------------------------
+Syscall param aio_waitcomplete(iocbp) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_waitcomplete(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_waitcomplete(timeout points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param aio_waitcomplete(iocbp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+360:           SYS_getresuid 3s 3m
+---------------------------------------------------------
+Syscall param getresuid(ruid) contains uninitialised byte(s)
+   ...
+
+Syscall param getresuid(euid) contains uninitialised byte(s)
+   ...
+
+Syscall param getresuid(suid) contains uninitialised byte(s)
+   ...
+
+Syscall param getresuid(ruid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getresuid(euid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getresuid(suid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+361:           SYS_getresgid 3s 3m
+---------------------------------------------------------
+Syscall param getresgid(rgid) contains uninitialised byte(s)
+   ...
+
+Syscall param getresgid(egid) contains uninitialised byte(s)
+   ...
+
+Syscall param getresgid(sgid) contains uninitialised byte(s)
+   ...
+
+Syscall param getresgid(rgid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getresgid(egid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getresgid(sgid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+362:              SYS_kqueue 0s 0m
+---------------------------------------------------------
+---------------------------------------------------------
+363:    SYS_freebsd11_kevent 6s 3m
+---------------------------------------------------------
+Syscall param kevent(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(changelist) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(nchanges) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(eventlist) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(nevents) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(changelist) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param kevent(eventlist) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param kevent(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+371:      SYS_extattr_set_fd 5s 2m
+---------------------------------------------------------
+Syscall param extattr_set_fd(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_fd(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_fd(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_fd(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_fd(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_fd(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_set_fd(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+372:      SYS_extattr_get_fd 5s 2m
+---------------------------------------------------------
+Syscall param extattr_get_fd(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_fd(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_fd(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_fd(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_fd(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_fd(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_get_fd(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+373:   SYS_extattr_delete_fd 3s 1m
+---------------------------------------------------------
+Syscall param extattr_delete_fd(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_fd(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_fd(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_fd(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+374:           SYS___setugid 1s 0m
+---------------------------------------------------------
+Syscall param __setugid(flag) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+376:             SYS_eaccess 2s 1m
+---------------------------------------------------------
+Syscall param eaccess(path) contains uninitialised byte(s)
+   ...
+
+Syscall param eaccess(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param eaccess(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+378:              SYS_nmount 3s 1m
+---------------------------------------------------------
+Syscall param nmount(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param nmount(niov) contains uninitialised byte(s)
+   ...
+
+Syscall param nmount(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param nmount(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+390:                SYS_kenv (KENV_GET) 4s 1m
+---------------------------------------------------------
+Syscall param kenv(action) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(name) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(value) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(len) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+390:                SYS_kenv (KENV_DUMP) 4s 0m
+---------------------------------------------------------
+Syscall param kenv(action) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(name) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(value) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(len) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+390:                SYS_kenv (bogus) 4s 0m
+---------------------------------------------------------
+Syscall param kenv(action) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(name) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(value) contains uninitialised byte(s)
+   ...
+
+Syscall param kenv(len) contains uninitialised byte(s)
+   ...
+
+Warning: Bad action 20 in kenv
+---------------------------------------------------------
+391:            SYS_lchflags 2s 1m
+---------------------------------------------------------
+Syscall param lchflags(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lchflags(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param lchflags(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+392:             SYS_uuidgen 2s 1m
+---------------------------------------------------------
+Syscall param uuidgen(store) contains uninitialised byte(s)
+   ...
+
+Syscall param uuidgen(count) contains uninitialised byte(s)
+   ...
+
+Syscall param uuidgen(store) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+393:            SYS_sendfile 7s 2m
+---------------------------------------------------------
+Syscall param sendfile(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(offset) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(hdtr) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(sbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param sendfile(hdtr) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sendfile(sbytes) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+395: SYS_freebsd11_getfsstat 3s 1m
+---------------------------------------------------------
+Syscall param getfsstat(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param getfsstat(bufsize) contains uninitialised byte(s)
+   ...
+
+Syscall param getfsstat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param getfsstat(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+396:    SYS_freebsd11_statfs 2s 2m
+---------------------------------------------------------
+Syscall param statfs(path) contains uninitialised byte(s)
+   ...
+
+Syscall param statfs(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param statfs(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param statfs(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+397:   SYS_freebsd11_fstatfs 2s 1m
+---------------------------------------------------------
+Syscall param fstatfs(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatfs(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatfs(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+398:  SYS_freebsd11_fhstatfs 2s 2m
+---------------------------------------------------------
+Syscall param fhstatfs(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstatfs(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstatfs(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhstatfs(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+412:    SYS_extattr_set_link 5s 3m
+---------------------------------------------------------
+Syscall param extattr_set_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_set_file(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_set_file(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+413:    SYS_extattr_get_link 5s 3m
+---------------------------------------------------------
+Syscall param extattr_get_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_link(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_link(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_link(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_link(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_get_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_get_link(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_get_link(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+414: SYS_extattr_delete_link 3s 2m
+---------------------------------------------------------
+Syscall param extattr_delete_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_link(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_link(attrname) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_delete_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_delete_link(attrname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+416:           SYS_sigaction 3s 2+2m
+---------------------------------------------------------
+Syscall param sigaction(sign) contains uninitialised byte(s)
+   ...
+
+Syscall param sigaction(act) contains uninitialised byte(s)
+   ...
+
+Syscall param sigaction(oact) contains uninitialised byte(s)
+   ...
+
+Syscall param sigaction(act->sa_handler) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigaction(act->sa_mask) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigaction(act->sa_flags) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigaction(oact) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Warning: bad act handler address 0x........ in sigaction()
+---------------------------------------------------------
+417:           SYS_sigreturn 1s 1m
+---------------------------------------------------------
+Syscall param sigreturn(scp) contains uninitialised byte(s)
+   ...
+
+Syscall param sigreturn(scp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+421:          SYS_getcontext 1s 1m
+---------------------------------------------------------
+Syscall param getcontext(ucp) contains uninitialised byte(s)
+   ...
+
+Syscall param getcontext(ucp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+422:          SYS_setcontext 1s 1m
+---------------------------------------------------------
+Syscall param setcontext(ucp) contains uninitialised byte(s)
+   ...
+
+Syscall param setcontext(ucp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+423:         SYS_swapcontext 2s 2m
+---------------------------------------------------------
+Syscall param swapcontext(oucp) contains uninitialised byte(s)
+   ...
+
+Syscall param swapcontext(ucp) contains uninitialised byte(s)
+   ...
+
+Syscall param swapcontext(ucp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param swapcontext(oucp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+424:             SYS_swapoff 1s 1m
+---------------------------------------------------------
+Syscall param swapoff(special) contains uninitialised byte(s)
+   ...
+
+Syscall param swapoff(special) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+425:      SYS___acl_get_link 3s 2m
+---------------------------------------------------------
+Syscall param __acl_get_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_get_link(acltype) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_get_link(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_get_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __acl_get_link(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+426:      SYS___acl_set_link 3s 2m
+---------------------------------------------------------
+Syscall param __acl_set_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_set_link(acltype) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_set_link(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_set_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __acl_set_link(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+427:   SYS___acl_delete_link 2s 1m
+---------------------------------------------------------
+Syscall param __acl_delete_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __acl_delete_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_delete_link(acltype) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+428: SYS___acl_aclcheck_link 3s 2m
+---------------------------------------------------------
+Syscall param __acl_aclcheck_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_aclcheck_link(acltype) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_aclcheck_link(aclp) contains uninitialised byte(s)
+   ...
+
+Syscall param __acl_check_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __acl_aclcheck_link(aclp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+429:             SYS_sigwait 2s 2m
+---------------------------------------------------------
+Syscall param sigwait(set) contains uninitialised byte(s)
+   ...
+
+Syscall param sigwait(sig) contains uninitialised byte(s)
+   ...
+
+Syscall param sigwait(set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigwait(sig) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+431:            SYS_thr_exit other
+---------------------------------------------------------
+---------------------------------------------------------
+432:            SYS_thr_self 1s 1m
+---------------------------------------------------------
+Syscall param thr_self(id) contains uninitialised byte(s)
+   ...
+
+Syscall param thr_self() points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+433:            SYS_thr_kill 2s 0m
+---------------------------------------------------------
+Syscall param thr_kill(id) contains uninitialised byte(s)
+   ...
+
+Syscall param thr_kill(sig) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+436:         SYS_jail_attach 1s 0m
+---------------------------------------------------------
+Syscall param jail_attach(jid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+437:     SYS_extattr_list_fd 4s 1m
+---------------------------------------------------------
+Syscall param extattr_list_fd(id) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_fd(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_fd(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_fd(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_fd(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+438:   SYS_extattr_list_file 4s 2m
+---------------------------------------------------------
+Syscall param extattr_list_file(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_file(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_file(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_file(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_file(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_list_file(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+439:   SYS_extattr_list_link 4s 2m
+---------------------------------------------------------
+Syscall param extattr_list_link(path) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_link(attrnamespace) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_link(data) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_link(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param extattr_list_link(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param extattr_list_link(data) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+443:            SYS_thr_wake 1s 0m
+---------------------------------------------------------
+Syscall param thr_wake(id) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+444:          SYS_kldunloadf 1s 0m
+---------------------------------------------------------
+Syscall param kldunloadf(fileid) contains uninitialised byte(s)
+   ...
+
+Syscall param kldunloadf(flags) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+454:            SYS__umtx_op 5s 2m
+---------------------------------------------------------
+Syscall param _umtx_op_wait_uint_private(obj) contains uninitialised byte(s)
+   ...
+
+Syscall param _umtx_op_wait_uint_private(op) contains uninitialised byte(s)
+   ...
+
+Syscall param _umtx_op_wait_uint_private(id) contains uninitialised byte(s)
+   ...
+
+Syscall param _umtx_op_wait_uint_private(timeout_size) contains uninitialised byte(s)
+   ...
+
+Syscall param _umtx_op_wait_uint_private(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param _umtx_op_wait_private(uint) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param _umtx_op_wait_private(umtx_time) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+456:            SYS_sigqueue 3s 0m
+---------------------------------------------------------
+Syscall param sigqueue(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param sigqueue(signo) contains uninitialised byte(s)
+   ...
+
+Syscall param sigqueue(value) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+457:            SYS_kmq_open 4s 2m
+---------------------------------------------------------
+Syscall param mq_open(name) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(oflag) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(attr) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param mq_open(attr) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+457:            SYS_kmq_open 3s 1m
+---------------------------------------------------------
+Syscall param mq_open(name) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(oflag) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+457:            SYS_kmq_open 3s 2m
+---------------------------------------------------------
+Syscall param mq_open(name) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(oflag) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_open(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param mq_open(attr) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param mq_open(attr->mq_maxmsg) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+---------------------------------------------------------
+458:         SYS_kmq_setattr 3s 2m
+---------------------------------------------------------
+Syscall param mq_setattr(mqdes) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_setattr(mqstat) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_setattr(omqstat) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_setattr(omqstat) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+459:    SYS_kmq_timedreceive 5s 2m
+---------------------------------------------------------
+Syscall param mq_timedreceive(mqdes) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedreceive(msg_ptr) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedreceive(msg_len) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedreceive(msg_prio) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedreceive(abs_timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedreceive(msg_prio) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param mq_timedreceive(abs_timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+460:       SYS_kmq_timedsend 5s 1m
+---------------------------------------------------------
+Syscall param mq_timedsend(mqdes) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedsend(msg_ptr) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedsend(msg_len) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedsend(msg_prio) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedsend(abs_timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_timedsend(abs_timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+461:          SYS_kmq_notify 2s 1m
+---------------------------------------------------------
+Syscall param mq_notify(mqdes) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_notify(notification) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_notify(notification) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+462:          SYS_kmq_unlink 1s 1m
+---------------------------------------------------------
+Syscall param mq_unlink(name) contains uninitialised byte(s)
+   ...
+
+Syscall param mq_unlink(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+463:              SYS_abort2 other
+---------------------------------------------------------
+---------------------------------------------------------
+465:           SYS_aio_fsync 2s 1m
+---------------------------------------------------------
+Syscall param aio_fsync(op) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_fsync(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_fsync(iocb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+466:       SYS_rtprio_thread 3s 1m
+---------------------------------------------------------
+Syscall param rtprio_thread(function) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio_thread(lwpid) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio_thread(rtp) contains uninitialised byte(s)
+   ...
+
+Syscall param rtprio_thread(rtp#set) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+472:SYS_sctp_generic_sendmsg 7s 1m
+---------------------------------------------------------
+Syscall param sctp_generic_sendmsg(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(msg) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(msglen) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(to) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(len) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(sinfo) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_sendmsg(sinfo) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+474:SYS_sctp_generic_recvmsg 7s 4m
+---------------------------------------------------------
+Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iovlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(fromlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iov) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(fromlen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+474:SYS_sctp_generic_recvmsg 6s 4m
+---------------------------------------------------------
+Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iovlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iov) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(from) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+474:SYS_sctp_generic_recvmsg 6s 6m
+---------------------------------------------------------
+Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(fromlen) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s)
+   ...
+
+Syscall param sctp_generic_recvmsg(iov) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param sctp_generic_recvmsg(iov.iov_base) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(fromlen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+475:               SYS_pread 4s 1m
+---------------------------------------------------------
+Syscall param pread(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param pread(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param pread(count) contains uninitialised byte(s)
+   ...
+
+Syscall param pread(off) contains uninitialised byte(s)
+   ...
+
+Syscall param pread(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+476:              SYS_pwrite 4s 1m
+---------------------------------------------------------
+Syscall param pwrite(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param pwrite(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param pwrite(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param pwrite(offset) contains uninitialised byte(s)
+   ...
+
+Syscall param pwrite(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+477:                SYS_mmap 6s 1m
+---------------------------------------------------------
+Syscall param mmap(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param mmap(len) contains uninitialised byte(s)
+   ...
+
+Syscall param mmap(prot) contains uninitialised byte(s)
+   ...
+
+Syscall param mmap(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param mmap(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param mmap(offset) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+478:               SYS_lseek 3s 0m
+---------------------------------------------------------
+Syscall param lseek(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param lseek(offset) contains uninitialised byte(s)
+   ...
+
+Syscall param lseek(whence) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+479:            SYS_truncate 2s 1m
+---------------------------------------------------------
+Syscall param truncate(path) contains uninitialised byte(s)
+   ...
+
+Syscall param truncate(length) contains uninitialised byte(s)
+   ...
+
+Syscall param truncate(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+480:           SYS_ftruncate 2s 0m
+---------------------------------------------------------
+Syscall param ftruncate(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param ftruncate(length) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+481:           SYS_thr_kill2 3s 0m
+---------------------------------------------------------
+Syscall param thr_kill2(pid) contains uninitialised byte(s)
+   ...
+
+Syscall param thr_kill2(tid) contains uninitialised byte(s)
+   ...
+
+Syscall param thr_kill2(sig) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+482:            SYS_shm_open (SHM_ANON) 3s 0m
+---------------------------------------------------------
+Syscall param shm_open(path) contains uninitialised byte(s)
+   ...
+
+Syscall param shm_open(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param shm_open(mode) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+483:          SYS_shm_unlink 1s 1m
+---------------------------------------------------------
+Syscall param shm_unlink(path) contains uninitialised byte(s)
+   ...
+
+Syscall param shm_unlink(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+484:              SYS_cpuset 1s 1m
+---------------------------------------------------------
+Syscall param cpuset(setid) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset(setid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+485:        SYS_cpuset_setid 3s 0m
+---------------------------------------------------------
+Syscall param cpuset_setid(which) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setid(id) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setid(setid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+486:        SYS_cpuset_getid 4s 1m
+---------------------------------------------------------
+Syscall param cpuset_getid(level) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getid(which) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getid(id) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getid(setid) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getid(setid) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+487:  SYS_cpuset_getaffinity 5s 1m
+---------------------------------------------------------
+Syscall param cpuset_getaffinity(level) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getaffinity(which) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getaffinity(id) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getaffinity(setsize) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getaffinity(mask) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getaffinity points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+488:  SYS_cpuset_setaffinity 5s 1m
+---------------------------------------------------------
+Syscall param cpuset_setaffinity(level) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setaffinity(which) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setaffinity(id) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setaffinity(setsize) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setaffinity(mask) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_setaffinity points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+489:           SYS_faccessat 3s 1m
+---------------------------------------------------------
+Syscall param faccessat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param faccessat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param faccessat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param faccessat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+490:            SYS_fchmodat 4s 1m
+---------------------------------------------------------
+Syscall param fchmodat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fchmodat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param fchmodat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param fchmodat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param fchmodat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+491:            SYS_fchownat 5s 1m
+---------------------------------------------------------
+Syscall param fchownat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fchownat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param fchownat(owner) contains uninitialised byte(s)
+   ...
+
+Syscall param fchownat(group) contains uninitialised byte(s)
+   ...
+
+Syscall param fchownat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param fchownat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+492:             SYS_fexecve 3s 2m
+---------------------------------------------------------
+Syscall param fexecve(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fexecve(argv) contains uninitialised byte(s)
+   ...
+
+Syscall param fexecve(envp) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+493:   SYS_freebsd11_fstatat 4s 2m
+---------------------------------------------------------
+Syscall param fstatat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fstatat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+494:           SYS_futimesat 3s 2m
+---------------------------------------------------------
+Syscall param futimesat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param futimesat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param futimesat(times) contains uninitialised byte(s)
+   ...
+
+Syscall param futimesat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param futimesat(times) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+495:              SYS_linkat 5s 2m
+---------------------------------------------------------
+Syscall param linkat(fd1) contains uninitialised byte(s)
+   ...
+
+Syscall param linkat(name1) contains uninitialised byte(s)
+   ...
+
+Syscall param linkat(fd2) contains uninitialised byte(s)
+   ...
+
+Syscall param linkat(name2) contains uninitialised byte(s)
+   ...
+
+Syscall param linkat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param linkat(name1) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param linkat(name2) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+496:             SYS_mkdirat 3s 1m
+---------------------------------------------------------
+Syscall param mkdirat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param mkdirat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param mkdirat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mkdirat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+497:            SYS_mkfifoat 3s 1m
+---------------------------------------------------------
+Syscall param mkfifoat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param mkfifoat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param mkfifoat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mkfifoat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+498:   SYS_freebsd11_mknodat 4s 1m
+---------------------------------------------------------
+Syscall param mknodat(dfd) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(pathname) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(dev) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+499:              SYS_openat 3s 1m
+---------------------------------------------------------
+Syscall param openat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+499:              SYS_openat 4s 1m
+---------------------------------------------------------
+Syscall param openat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param openat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+500:          SYS_readlinkat 4s 2m
+---------------------------------------------------------
+Syscall param readlinkat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param readlinkat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param readlinkat(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param readlinkat(bufsize) contains uninitialised byte(s)
+   ...
+
+Syscall param readlinkat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param readlinkat(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+501:            SYS_renameat 4s 2m
+---------------------------------------------------------
+Syscall param renameat(fromfd) contains uninitialised byte(s)
+   ...
+
+Syscall param renameat(from) contains uninitialised byte(s)
+   ...
+
+Syscall param renameat(tofd) contains uninitialised byte(s)
+   ...
+
+Syscall param renameat(to) contains uninitialised byte(s)
+   ...
+
+Syscall param renameat(oldpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param renameat(newpath) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+502:           SYS_symlinkat 3s 2m
+---------------------------------------------------------
+Syscall param symlinkat(name1) contains uninitialised byte(s)
+   ...
+
+Syscall param symlinkat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param symlinkat(name2) contains uninitialised byte(s)
+   ...
+
+Syscall param symlinkat(name1) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param symlinkat(name2) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+503:            SYS_unlinkat 3s 1m
+---------------------------------------------------------
+Syscall param unlinkat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param unlinkat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param unlinkat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param unlinkat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+504:        SYS_posix_openpt 1s 1m
+---------------------------------------------------------
+Syscall param posix_openpt(oflag) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+506:            SYS_jail_get 3s 1m
+---------------------------------------------------------
+Syscall param jail_get(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param jail_get(niov) contains uninitialised byte(s)
+   ...
+
+Syscall param jail_get(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param jail_get(iov) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+507:            SYS_jail_set 3s 1m
+---------------------------------------------------------
+Syscall param jail_set(iov) contains uninitialised byte(s)
+   ...
+
+Syscall param jail_set(niov) contains uninitialised byte(s)
+   ...
+
+Syscall param jail_set(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param jail_set(iovs) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+508:         SYS_jail_remove 1s 0m
+---------------------------------------------------------
+Syscall param jail_remove(jid) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+509:           SYS_closefrom 1s 0m
+---------------------------------------------------------
+Syscall param closefrom(lowfd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+510:            SYS___semctl (IPC_STAT) 4s 1m
+---------------------------------------------------------
+Syscall param semctl(semid) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(semnum) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(arg) contains uninitialised byte(s)
+   ...
+
+Syscall param sys___sysctl(arg) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+510:            SYS___semctl (other) 3s 0m
+---------------------------------------------------------
+Syscall param semctl(semid) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(semnum) contains uninitialised byte(s)
+   ...
+
+Syscall param semctl(cmd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+511:              SYS_msgctl 3s 1m
+---------------------------------------------------------
+Syscall param msgctl(msqid) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param msgctl(IPC_STAT, buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+512:              SYS_shmctl 3s 1m
+---------------------------------------------------------
+Syscall param shmctl(shmid) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param shmctl(IPC_STAT, buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+513:           SYS_lpathconf 2s 1m
+---------------------------------------------------------
+Syscall param lpathconf(path) contains uninitialised byte(s)
+   ...
+
+Syscall param lpathconf(name) contains uninitialised byte(s)
+   ...
+
+Syscall param lpathconf(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+515:    SYS___cap_rights_get 3s 1m
+---------------------------------------------------------
+Syscall param cap_rights_get(version) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_rights_get(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_rights_get(rights) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_rights_get(rights) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+516:           SYS_cap_enter other
+---------------------------------------------------------
+---------------------------------------------------------
+517:         SYS_cap_getmode 1s 1m
+---------------------------------------------------------
+Syscall param cap_getmode(modep) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_getmode(modep) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+518:              SYS_pdfork other
+---------------------------------------------------------
+---------------------------------------------------------
+519:              SYS_pdkill 2s 0m
+---------------------------------------------------------
+Syscall param pdkill(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param pdkill(signum) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+520:            SYS_pdgetpid 2s 1m
+---------------------------------------------------------
+Syscall param pdgetpid(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param pdgetpid(pidp) contains uninitialised byte(s)
+   ...
+
+Syscall param pdgetpid(pidp)) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+522:             SYS_pselect 6s 5m
+---------------------------------------------------------
+Syscall param pselect(nfds) contains uninitialised byte(s)
+   ...
+
+Syscall param pselect(readfds) contains uninitialised byte(s)
+   ...
+
+Syscall param pselect(writefds) contains uninitialised byte(s)
+   ...
+
+Syscall param pselect(exceptfds) contains uninitialised byte(s)
+   ...
+
+Syscall param pselect(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param pselect(newsigmask) contains uninitialised byte(s)
+   ...
+
+Syscall param pselect(readfds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param pselect(writefds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param pselect(exceptfds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param pselect(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param pselect(sig) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+523:       SYS_getloginclass 2s 1m
+---------------------------------------------------------
+Syscall param getloginclass(name) contains uninitialised byte(s)
+   ...
+
+Syscall param getloginclass(len) contains uninitialised byte(s)
+   ...
+
+Syscall param getloginclass(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+524:       SYS_setloginclass 1s 1m
+---------------------------------------------------------
+Syscall param setloginclass(name) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_setloginclass(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+525:      SYS_rctl_get_racct 4s 2m
+---------------------------------------------------------
+Syscall param rctl_get_racct(inbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_racct(inbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_racct(outbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_racct(outbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_racct(inbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param rctl_get_racct(outbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+526:      SYS_rctl_get_rules 4s 2m
+---------------------------------------------------------
+Syscall param rctl_get_rules(inbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_rules(inbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_rules(outbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_rules(outbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_rules(inbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param rctl_get_rules(outbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+527:     SYS_rctl_get_limits 4s 2m
+---------------------------------------------------------
+Syscall param rctl_get_limits(inbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_limits(inbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_limits(outbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_limits(outbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_get_limits(inbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param rctl_get_limits(outbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+528:       SYS_rctl_add_rule 2s 1m
+---------------------------------------------------------
+Syscall param rctl_add_rule(inbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_add_rule(inbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_add_rule(inbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+529:    SYS_rctl_remove_rule 2s 1m
+---------------------------------------------------------
+Syscall param rctl_remove_rule(inbufp) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_remove_rule(inbuflen) contains uninitialised byte(s)
+   ...
+
+Syscall param rctl_remove_rule(inbufp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+530:     SYS_posix_fallocate 3s 0m
+---------------------------------------------------------
+Syscall param posix_fallocate(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param posix_fallocate(offset) contains uninitialised byte(s)
+   ...
+
+Syscall param posix_fallocate(len) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+531:       SYS_posix_fadvise 4s 0m
+---------------------------------------------------------
+Syscall param posix_fadvise(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param posix_fadvise(offset) contains uninitialised byte(s)
+   ...
+
+Syscall param posix_fadvise(len) contains uninitialised byte(s)
+   ...
+
+Syscall param posix_fadvise(advice) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+532:               SYS_wait6 6s 3m
+---------------------------------------------------------
+Syscall param wait6(idtype) contains uninitialised byte(s)
+   ...
+
+Syscall param wait6(id) contains uninitialised byte(s)
+   ...
+
+Syscall param wait6(status) contains uninitialised byte(s)
+   ...
+
+Syscall param wait6(options) contains uninitialised byte(s)
+   ...
+
+Syscall param wait6(wrusage) contains uninitialised byte(s)
+   ...
+
+Syscall param wait6(infop) contains uninitialised byte(s)
+   ...
+
+Syscall param wait6(status) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param wait6(wrusage) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param wait6(infop) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+533:    SYS_cap_rights_limit 2s 1m
+---------------------------------------------------------
+Syscall param cap_rights_limit(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_rights_limit(rights) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_rights_limit(rights) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+534:    SYS_cap_ioctls_limit 3s 1m
+---------------------------------------------------------
+Syscall param cap_ioctls_limit(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_ioctls_limit(rights) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_ioctls_limit(ncmds) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_ioctls_limit(cmds)) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+535:      SYS_cap_ioctls_get 3s 1m
+---------------------------------------------------------
+Syscall param cap_ioctls_get(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_ioctls_get(cmds) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_ioctls_get(maxcmds) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_ioctls_get(cmds) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+536:    SYS_cap_fcntls_limit 2s 0m
+---------------------------------------------------------
+Syscall param cap_fcntls_limit(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_fcntls_limit(fcntlrights) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+537:      SYS_cap_fcntls_get 2s 1m
+---------------------------------------------------------
+Syscall param cap_fcntls_get(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_fcntls_get(fcntlrightsp) contains uninitialised byte(s)
+   ...
+
+Syscall param cap_fcntls_get(fcntlrightsp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+538:              SYS_bindat 4s 1m
+---------------------------------------------------------
+Syscall param bindat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param bindat(s) contains uninitialised byte(s)
+   ...
+
+Syscall param bindat(name) contains uninitialised byte(s)
+   ...
+
+Syscall param bindat(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param bindat(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+539:           SYS_connectat 4s 1m
+---------------------------------------------------------
+Syscall param connectat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param connectat(s) contains uninitialised byte(s)
+   ...
+
+Syscall param connectat(name) contains uninitialised byte(s)
+   ...
+
+Syscall param connectat(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param connectat(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+540:           SYS_chflagsat 4s 1m
+---------------------------------------------------------
+Syscall param chflagsat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param chflagsat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param chflagsat(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param chflagsat(atflag) contains uninitialised byte(s)
+   ...
+
+Syscall param chflagsat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+541:             SYS_accept4 4s 1m
+---------------------------------------------------------
+Syscall param accept4(s) contains uninitialised byte(s)
+   ...
+
+Syscall param accept4(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param accept4(*addrlen) contains uninitialised byte(s)
+   ...
+
+Syscall param accept4(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.accept(addrlen_in) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+541:             SYS_accept4 3s 1m
+---------------------------------------------------------
+Syscall param accept4(s) contains uninitialised byte(s)
+   ...
+
+Syscall param accept4(addr) contains uninitialised byte(s)
+   ...
+
+Syscall param accept4(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param socketcall.accept(addr) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+542:               SYS_pipe2 2s 1m
+---------------------------------------------------------
+Syscall param pipe2(fildes) contains uninitialised byte(s)
+   ...
+
+Syscall param pipe2(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param pipe2(fildes) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+543:           SYS_aio_mlock 1s 1m
+---------------------------------------------------------
+Syscall param aio_mlock(iocb) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_mlock(iocb points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+544:             SYS_procctl (PROC_REAP_RELEASE) 3s 0m
+---------------------------------------------------------
+Syscall param procctl(idtype) contains uninitialised byte(s)
+   ...
+
+Syscall param procctl(id) contains uninitialised byte(s)
+   ...
+
+Syscall param procctl(cmd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+544:             SYS_procctl (PROC_REAP_GETPIDS) 4s 1m
+---------------------------------------------------------
+Syscall param procctl(idtype) contains uninitialised byte(s)
+   ...
+
+Syscall param procctl(id) contains uninitialised byte(s)
+   ...
+
+Syscall param procctl(cmd) contains uninitialised byte(s)
+   ...
+
+Syscall param procctl(arg) contains uninitialised byte(s)
+   ...
+
+Syscall param procctl(arg) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+545:               SYS_ppoll 4s 2m
+---------------------------------------------------------
+Syscall param ppoll(fds) contains uninitialised byte(s)
+   ...
+
+Syscall param ppoll(nfds) contains uninitialised byte(s)
+   ...
+
+Syscall param ppoll(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param ppoll(newsigmask) contains uninitialised byte(s)
+   ...
+
+Syscall param ppoll(fds.fd) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ppoll(fds.revents) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ppoll(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ppoll(newsigmask) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+545:               SYS_ppoll 2s 2+2m
+---------------------------------------------------------
+Syscall param ppoll(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param ppoll(newsigmask) contains uninitialised byte(s)
+   ...
+
+Syscall param ppoll(fds.fd) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param ppoll(fds.events) points to uninitialised byte(s)
+   ...
+ Address 0x........ is on thread 1's stack
+
+Syscall param ppoll(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param ppoll(newsigmask) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+546:            SYS_futimens 2s 1m
+---------------------------------------------------------
+Syscall param futimens(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param futimens(times) contains uninitialised byte(s)
+   ...
+
+Syscall param futimens(times) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+547:           SYS_utimensat 4s 2m
+---------------------------------------------------------
+Syscall param utimensat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param utimensat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param utimensat(times) contains uninitialised byte(s)
+   ...
+
+Syscall param utimensat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param utimensat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param utimensat(times) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+550:           SYS_fdatasync 1s 0m
+---------------------------------------------------------
+Syscall param fdatasync(fd) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+551:               SYS_fstat 2s 1m
+---------------------------------------------------------
+Syscall param fstat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fstat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param fstat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+552:             SYS_fstatat 4s 2m
+---------------------------------------------------------
+Syscall param fstatat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fstatat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+553:              SYS_fhstat 2s 2m
+---------------------------------------------------------
+Syscall param fhstat(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstat(sb) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstat(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhstat(sb) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+554:       SYS_getdirentries 4s 2m
+---------------------------------------------------------
+Syscall param getdirentries(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(nbytes) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(basep) contains uninitialised byte(s)
+   ...
+
+Syscall param getdirentries(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getdirentries(basep) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+555:              SYS_statfs 2s 2m
+---------------------------------------------------------
+Syscall param statfs(path) contains uninitialised byte(s)
+   ...
+
+Syscall param statfs(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param statfs(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param statfs(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+556:             SYS_fstatfs 2s 1m
+---------------------------------------------------------
+Syscall param fstatfs(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatfs(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param fstatfs(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+557:           SYS_getfsstat 3s 1m
+---------------------------------------------------------
+Syscall param getfsstat(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param getfsstat(len) contains uninitialised byte(s)
+   ...
+
+Syscall param getfsstat(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param getfsstat(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+558:            SYS_fhstatfs 2s 2m
+---------------------------------------------------------
+Syscall param fhstatfs(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstatfs(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param fhstatfs(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhstatfs(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+559:             SYS_mknodat 4s 1m
+---------------------------------------------------------
+Syscall param mknodat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(mode) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(dev) contains uninitialised byte(s)
+   ...
+
+Syscall param mknodat(pathname) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+560:              SYS_kevent 6s 3m
+---------------------------------------------------------
+Syscall param kevent(kq) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(changelist) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(nchanges) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(eventlist) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(nevents) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param kevent(changelist) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param kevent(eventlist) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param kevent(timeout) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+561:    SYS_cpuset_getdomain 6s 2m
+---------------------------------------------------------
+Syscall param cpuset_getdomain(level) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(which) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(id) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(setsize) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(mask) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(policy) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(mask) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param cpuset_getdomain(policy) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+562:    SYS_cpuset_setdomain 6s 1m
+---------------------------------------------------------
+Syscall param cpuset_getdomain(level) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(which) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(id) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(setsize) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(mask) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(policy) contains uninitialised byte(s)
+   ...
+
+Syscall param cpuset_getdomain(mask) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+563:           SYS_getrandom 3s 1m
+---------------------------------------------------------
+Syscall param getrandom(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param getrandom(buflen) contains uninitialised byte(s)
+   ...
+
+Syscall param getrandom(flags) contains uninitialised byte(s)
+   ...
+
+Syscall param getrandom(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+564:             SYS_getfhat 4s 2m
+---------------------------------------------------------
+Syscall param getfhat(fd) contains uninitialised byte(s)
+   ...
+
+Syscall param getfhat(path) contains uninitialised byte(s)
+   ...
+
+Syscall param getfhat(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param getfhat(flag) contains uninitialised byte(s)
+   ...
+
+Syscall param getfhat(path) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param getfhat(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+565:              SYS_fhlink 2s 2m
+---------------------------------------------------------
+Syscall param fhlink(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhlink(to) contains uninitialised byte(s)
+   ...
+
+Syscall param fhlink(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhlink(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+566:            SYS_fhlinkat 3s 2m
+---------------------------------------------------------
+Syscall param fhlinkat(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhlinkat(tofd) contains uninitialised byte(s)
+   ...
+
+Syscall param fhlinkat(to) contains uninitialised byte(s)
+   ...
+
+Syscall param fhlinkat(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhreadlink(to) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+567:          SYS_fhreadlink 3s 2m
+---------------------------------------------------------
+Syscall param fhreadlink(fhp) contains uninitialised byte(s)
+   ...
+
+Syscall param fhreadlink(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param fhreadlink(bufsize) contains uninitialised byte(s)
+   ...
+
+Syscall param fhreadlink(fhp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param fhreadlink(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+570:      SYS___sysctlbyname (getoldlen) 3s 2m
+---------------------------------------------------------
+Syscall param __sysctlbyname(name) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(oldlenp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(newlen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __sysctlbyname(oldlenp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+570:      SYS___sysctlbyname (getold) 4s 2m
+---------------------------------------------------------
+Syscall param __sysctlbyname(name) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(oldp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(oldlenp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(newlen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __sysctlbyname(oldlenp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Warning: Bad oldlenp address 0x........ in sysctlbyname
+---------------------------------------------------------
+570:      SYS___sysctlbyname (putnew) 4s 2m
+---------------------------------------------------------
+Syscall param __sysctlbyname(name) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(namelen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(newp) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(newlen) contains uninitialised byte(s)
+   ...
+
+Syscall param __sysctlbyname(name) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param __sysctlbyname(newp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
+  1:                SYS_exit 1s 0m
+---------------------------------------------------------
+Syscall param exit(status) contains uninitialised byte(s)
+   ...
+
index 9e4b90a76df316332c312af4fd47a419b64d430e..30fe2a1a992f95a2eba035d3c2e920653f5ea4f1 100644 (file)
@@ -310,6 +310,36 @@ asm(
 ".previous\n"
 );
 
+#elif defined(VGP_arm64_freebsd)
+
+#define __NR_mprotect 74
+
+extern UWord do_syscall_WRK (
+          UWord syscall_no,
+          UWord a1, UWord a2, UWord a3,
+          UWord a4, UWord a5, UWord a6,
+          UWord a7, UWord a8,
+          UInt *flags,
+          UWord *rv2
+       );
+asm(
+   ".text\n"
+   ".globl do_syscall_WRK\n"
+   "do_syscall_WRK:\n"
+    "        ldr     x8, [sp, #8]     \n"  /* assume syscall success */
+    "        str     xzr, [x8]        \n"
+    "        ldr     x8, [sp, #0]     \n"  /* load syscall_no */
+    "        svc     0x0              \n"
+    "        bcc     1f               \n"  /* jump if success */
+    "        ldr     x9, [sp, #8]     \n"  /* syscall failed - set *errflag */
+    "        mov     x10, #1          \n"
+    "        str     x10, [x9]        \n"
+    "    1:  ldr     x9, [sp, #16]    \n"  /* save 2nd result word */
+    "        str     x1, [x9]         \n"
+    "        ret                      \n"  /* return 1st result word */
+   ".previous\n"
+   );
+
 #else
 // Ensure the file compiles even if the syscall nr is not defined.
 #ifndef __NR_mprotect
@@ -349,7 +379,7 @@ static void non_simd_mprotect (long tid, void* addr, long len)
    mprotect_result = do_syscall_WRK(__NR_mprotect,
                                     (UWord) addr, len, PROT_NONE,
                                     0, 0, 0, 0, 0, &flags);
-#elif defined(VGP_amd64_freebsd)
+#elif defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
 
    UInt flags = 0U;
    UWord rv2 = 0U;
index 9b9aad2ae5630655e77c00135450042cd4a84b20..147bdf8cdfd814d10feb1da7566220737f3597e3 100644 (file)
@@ -14,8 +14,8 @@ To see them, rerun with: --leak-check=full --show-leak-kinds=all
 expecting a leak
 1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:390)
-   by 0x........: main (leak-segv-jmp.c:465)
+   by 0x........: f (leak-segv-jmp.c:420)
+   by 0x........: main (leak-segv-jmp.c:495)
 
 LEAK SUMMARY:
    definitely lost: 1,000 bytes in 1 blocks
@@ -30,8 +30,8 @@ mprotect result 0
 expecting a leak again
 1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:390)
-   by 0x........: main (leak-segv-jmp.c:465)
+   by 0x........: f (leak-segv-jmp.c:420)
+   by 0x........: main (leak-segv-jmp.c:495)
 
 LEAK SUMMARY:
    definitely lost: 1,000 bytes in 1 blocks
@@ -46,8 +46,8 @@ full mprotect result 0
 expecting a leak again after full mprotect
 1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:390)
-   by 0x........: main (leak-segv-jmp.c:465)
+   by 0x........: f (leak-segv-jmp.c:420)
+   by 0x........: main (leak-segv-jmp.c:495)
 
 LEAK SUMMARY:
    definitely lost: 1,000 bytes in 1 blocks
@@ -62,13 +62,13 @@ mprotect result 0
 expecting heuristic not to crash after full mprotect
 1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:390)
-   by 0x........: main (leak-segv-jmp.c:465)
+   by 0x........: f (leak-segv-jmp.c:420)
+   by 0x........: main (leak-segv-jmp.c:495)
 
 200,000 bytes in 1 blocks are possibly lost in loss record ... of ...
    at 0x........: calloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:437)
-   by 0x........: main (leak-segv-jmp.c:465)
+   by 0x........: f (leak-segv-jmp.c:467)
+   by 0x........: main (leak-segv-jmp.c:495)
 
 LEAK SUMMARY:
    definitely lost: 1,000 bytes in 1 blocks
index 9e3cd2ad8fc33ba919f56e15c7fb7f0ff1ac71a8..bf78d5866f549feb0027b016e1a71b5189091703 100644 (file)
       __asm__ __volatile__ ("mov %r2, $0\n\t");                              \
       __asm__ __volatile__ ("mov %r3, $0\n\t");                              \
    } while (0)
+#elif defined(__aarch64__)
+/* 64bit arm */
+#define CLEAR_CALLER_SAVED_REGS                                              \
+   do {                                                                      \
+      __asm__ __volatile__ ("mov x0, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x1, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x2, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x3, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x4, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x5, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x6, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x7, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x8, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x9, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x10, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x11, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x12, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x13, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x14, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x15, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x16, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x17, 0\n\t");                              \
+      __asm__ __volatile__ ("mov x18, 0\n\t");                              \
+   } while (0)
 #else
 #define CLEAR_CALLER_SAVED_REGS  /*nothing*/
 #endif
diff --git a/memcheck/tests/overlap.stderr.exp-no_memcpy b/memcheck/tests/overlap.stderr.exp-no_memcpy
new file mode 100644 (file)
index 0000000..f97cf80
--- /dev/null
@@ -0,0 +1,20 @@
+Source and destination overlap in strncpy(0x........, 0x........, 21)
+   at 0x........: strncpy (vg_replace_strmem.c:...)
+   by 0x........: main (overlap.c:45)
+
+Source and destination overlap in strncpy(0x........, 0x........, 21)
+   at 0x........: strncpy (vg_replace_strmem.c:...)
+   by 0x........: main (overlap.c:47)
+
+Source and destination overlap in strcpy(0x........, 0x........)
+   at 0x........: strcpy (vg_replace_strmem.c:...)
+   by 0x........: main (overlap.c:54)
+
+Source and destination overlap in strncat(0x........, 0x........, 21)
+   at 0x........: strncat (vg_replace_strmem.c:...)
+   by 0x........: main (overlap.c:112)
+
+Source and destination overlap in strncat(0x........, 0x........, 21)
+   at 0x........: strncat (vg_replace_strmem.c:...)
+   by 0x........: main (overlap.c:113)
+
index 52665a7f05865b8f18fc2da398c6f5b60c35e2f7..4f2ee84f3da62ce3a9ccd28581aebc844a34459f 100644 (file)
@@ -1,7 +1,7 @@
 
 include $(top_srcdir)/Makefile.tool-tests.am
 
-dist_noinst_SCRIPTS = filter_stderr
+dist_noinst_SCRIPTS = filter_stderr filter_nan
 
 EXTRA_DIST = \
        bug484426.stdout.exp bug484426.stderr.exp bug484426.vgtest \
diff --git a/none/tests/arm64/filter_nan b/none/tests/arm64/filter_nan
new file mode 100755 (executable)
index 0000000..78663db
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+sed 's/special value 7 = nan/special value 7 = -nan/'
index dcab22d1bcd67a108e41037c1d1f7df8c9d831f1..bfab97570107b0b8c86691fe43d600927ed69af4 100644 (file)
@@ -34,9 +34,9 @@ print_double(const char *ident, double x)
 int
 main(int argc, char **argv)
 {
-  float x[] = { 55,                  0.98076171874999996, 0, 1, 0xFFFFFFFF } ;
-  float y[] = { 0.69314718055994529, 1.015625,            0, 1, 0xFFFFFFFF };
-  float z[] = { 38.123094930796988,  1,                   0, 1, 0xFFFFFFFF };
+  float x[] = { 55,                  0.98076171874999996, 0, 1, (float)0xFFFFFFFF } ;
+  float y[] = { 0.69314718055994529, 1.015625,            0, 1, (float)0xFFFFFFFF };
+  float z[] = { 38.123094930796988,  1,                   0, 1, (float)0xFFFFFFFF };
   float dst = -5;
 
   double dx[] = { 55,                  0.98076171874999996, 0, 1, 0xFFFFFFFF } ;
index b835f3aae036a448dbc945848c3074af72a8e9f6..85a1900ed48fdd314fe2c7d832a28ecd16419a10 100644 (file)
@@ -1,2 +1,3 @@
 prog: fp_and_simd
 vgopts: -q
+stdout_filter: filter_nan
index 92a8350ab228509282154fb9f38044652441c735..cdb1a80ba3287fb043553835f4557fbea9193ae2 100644 (file)
  */
 #if defined(__powerpc__) || defined(__aarch64__)
 #  define DIVISION_BY_ZERO_TRIGGERS_FPE 0
+#if defined(VGO_freebsd)
+#  define DIVISION_BY_ZERO_SI_CODE      SI_LWP
+#else
 #  define DIVISION_BY_ZERO_SI_CODE      SI_TKILL
+#endif
 #elif defined(__arm__)
 #  define DIVISION_BY_ZERO_TRIGGERS_FPE 1
 #  define DIVISION_BY_ZERO_SI_CODE      SI_TKILL
index 2025a54684e2abfc5b55ab213e0c638efbb1a41b..50c74496f810e2f35270786ba2bb19e7120cb92e 100644 (file)
@@ -10,6 +10,7 @@ EXTRA_DIST = \
        auxv.stderr.exp-freebsd13 \
        auxv.stderr.exp-freebsd131 \
        auxv.stderr.exp-freebsd14 \
+       auxv.stderr.exp-arm64 \
        cp.vgtest \
        cp.stderr.exp \
        osrel.vgtest \
diff --git a/none/tests/freebsd/auxv.stderr.exp-arm64 b/none/tests/freebsd/auxv.stderr.exp-arm64
new file mode 100644 (file)
index 0000000..949e740
--- /dev/null
@@ -0,0 +1,30 @@
+val: AT_PHDR int: 03 ptr: 0x........
+val: AT_PHENT int: 04 ptr: 0x........
+val: AT_PHNUM int: 05 ptr: 0x........
+val: AT_PAGESZ int: 06 ptr: 0x........
+val: AT_FLAGS int: 08 ptr: 0x........
+val: AT_ENTRY int: 09 ptr: 0x........
+val: AT_BASE int: 07 ptr: 0x........
+val: AT_EHDRFLAGS int: 24 ptr: 0x........
+val: AT_EXECPATH int: 15 ptr: 0x........
+EXECPATH: BASEDIR/valgrind/none/tests/freebsd/auxv
+val: AT_OSRELDATE int: 18 ptr: 0x........
+val: AT_CANARY int: 16 ptr: 0x........
+val: AT_CANARYLEN int: 17 ptr: 0x........
+val: AT_NCPUS int: 19 ptr: 0x........
+val: AT_PAGESIZES int: 20 ptr: 0x........
+val: AT_PAGESIZESLEN int: 21 ptr: 0x........
+val: AT_IGNORE int: 01 ptr: 0x........
+val: AT_STACKPROT int: 23 ptr: 0x........
+val: AT_IGNORE int: 01 ptr: 0x........
+val: AT_IGNORE int: 01 ptr: 0x........
+val: AT_IGNORE int: 01 ptr: 0x........
+val: AT_ARGC int: 28 ptr: 0x........
+val: AT_ARGV int: 29 ptr: 0x........
+ARGV: ./auxv
+val: AT_ENVC int: 30 ptr: 0x........
+val: AT_ENVV int: 31 ptr: 0x........
+val: AT_PS_STRINGS int: 32 ptr: 0x........
+PS_STRINGS ARGV: ./auxv
+val: AT_USRSTACKBASE int: 35 ptr: 0x........
+val: AT_USRSTACKLIM int: 36 ptr: 0x........
index 4ac7e330ac4e3b0c98dc74eff1bb136c21c24378..737abbf67898facd622eb7f14e865e74db670d51 100644 (file)
@@ -1134,7 +1134,7 @@ static inline void my_exit ( int x )
 
 /* See https://bugs.kde.org/show_bug.cgi?id=402833
    why we disable the overlap check on x86_64.  */
-#if defined(VGP_amd64_linux)
+#if defined(VGP_amd64_linux) || defined(VGP_arm64_freebsd)
  #define MEMCPY(soname, fnname) \
    MEMMOVE_OR_MEMCPY(20180, soname, fnname, 0)
 #else
index 37cc1bc76d62ad89ae467e066ba3651666881dde..4dbb8ca1091111fa13c75188f45735bf4f6c309a 100644 (file)
@@ -68,7 +68,7 @@ static Bool go(char* arch)
 #elif defined(VGP_arm_linux)
    if ( 0 == strcmp( arch, "arm" ) ) return True;
 
-#elif defined(VGP_arm64_linux)
+#elif defined(VGP_arm64_linux) || defined(VGP_arm64_freebsd)
    if ( 0 == strcmp( arch, "arm64" ) ) return True;
 
 #elif defined(VGP_mips32_linux)
index ebfc774187203739f0c9bf145817c50cf8d492b8..29f33796c656ea9124f99420722fc89b83b2f7a4 100644 (file)
@@ -5,6 +5,30 @@
 #include <sys/auxv.h>
 #endif
 
+#if defined(VGO_freebsd)
+#include <elf.h>
+#include <sys/exec.h>
+
+unsigned long getauxval(unsigned long type);
+
+unsigned long getauxval(unsigned long type)
+{
+   extern char** environ;
+   char** envp = environ;
+   Elf_Auxinfo *auxp;
+    while(*envp++ != NULL)
+        ;
+   for (auxp = (Elf_Auxinfo *)envp; auxp->a_type != AT_NULL; auxp++)
+   {
+      if (type == auxp->a_type)
+      {
+         return (unsigned long)auxp->a_un.a_val;
+      }
+   }
+}
+#endif
+
+
 // This file determines arm64 features a processor supports.
 // Arm processors do not have a x86-like cpuinfo instruction. Instead the
 // getauxval() syscall is used with capabilities parameters: getauxval(AT_HWCAP)
@@ -29,48 +53,132 @@ typedef int    Bool;
 
 // The processor's capabilities/features are returned by getauxval() as an
 // unsigned long with each bit representing a capability/feature.
+#ifndef HWCAP_FP
 #define HWCAP_FP            (1 << 0)
+#endif
+#ifndef HWCAP_ASIMD
 #define HWCAP_ASIMD         (1 << 1)
+#endif
+#ifndef HWCAP_EVTSTRM
 #define HWCAP_EVTSTRM       (1 << 2)
+#endif
+#ifndef HWCAP_AES
 #define HWCAP_AES           (1 << 3)
+#endif
+#ifndef HWCAP_PMULL
 #define HWCAP_PMULL         (1 << 4)
+#endif
+#ifndef HWCAP_SHA1
+#endif
+#ifndef HWCAP_SHA1
 #define HWCAP_SHA1          (1 << 5)
+#endif
+#ifndef HWCAP_SHA2
 #define HWCAP_SHA2          (1 << 6)
+#endif
+#ifndef HWCAP_CRC32
 #define HWCAP_CRC32         (1 << 7)
+#endif
+#ifndef HWCAP_ATOMICS
 #define HWCAP_ATOMICS       (1 << 8)
+#endif
+#ifndef HWCAP_FPHP
 #define HWCAP_FPHP          (1 << 9)
+#endif
+#ifndef HWCAP_ASIMDHP
 #define HWCAP_ASIMDHP       (1 << 10)
+#endif
+#ifndef HWCAP_CPUID
 #define HWCAP_CPUID         (1 << 11)
+#endif
+#ifndef HWCAP_ASIMDRDM
 #define HWCAP_ASIMDRDM      (1 << 12)
+#endif
+#ifndef HWCAP_JSCVT
 #define HWCAP_JSCVT         (1 << 13)
+#endif
+#ifndef HWCAP_FCMA
 #define HWCAP_FCMA          (1 << 14)
+#endif
+#ifndef HWCAP_LRCPC
 #define HWCAP_LRCPC         (1 << 15)
+#endif
+#ifndef HWCAP_DCPOP
 #define HWCAP_DCPOP         (1 << 16)
+#endif
+#ifndef HWCAP_SHA3
 #define HWCAP_SHA3          (1 << 17)
+#endif
+#ifndef HWCAP_SM3
 #define HWCAP_SM3           (1 << 18)
+#endif
+#ifndef HWCAP_SM4
 #define HWCAP_SM4           (1 << 19)
+#endif
+#ifndef HWCAP_ASIMDDP
 #define HWCAP_ASIMDDP       (1 << 20)
+#endif
+#ifndef HWCAP_SHA512
 #define HWCAP_SHA512        (1 << 21)
+#endif
+#ifndef HWCAP_SVE
 #define HWCAP_SVE           (1 << 22)
+#endif
+#ifndef HWCAP_ASIMDFHM
 #define HWCAP_ASIMDFHM      (1 << 23)
+#endif
+#ifndef HWCAP_DIT
 #define HWCAP_DIT           (1 << 24)
+#endif
+#ifndef HWCAP_USCAT
 #define HWCAP_USCAT         (1 << 25)
+#endif
+#ifndef HWCAP_ILRCPC
 #define HWCAP_ILRCPC        (1 << 26)
+#endif
+#ifndef HWCAP_FLAGM
 #define HWCAP_FLAGM         (1 << 27)
+#endif
+#ifndef HWCAP_SSBS
 #define HWCAP_SSBS          (1 << 28)
+#endif
+#ifndef HWCAP_SB
 #define HWCAP_SB            (1 << 29)
+#endif
+#ifndef HWCAP_PACA
 #define HWCAP_PACA          (1 << 30)
+#endif
+#ifndef HWCAP_PACG
 #define HWCAP_PACG          (1UL << 31)
+#endif
 
+#ifndef HWCAP2_DCPODP
 #define HWCAP2_DCPODP       (1 << 0)
+#endif
+#ifndef HWCAP2_SVE2
 #define HWCAP2_SVE2         (1 << 1)
+#endif
+#ifndef HWCAP2_SVEAES
 #define HWCAP2_SVEAES       (1 << 2)
+#endif
+#ifndef HWCAP2_SVEPMULL
 #define HWCAP2_SVEPMULL     (1 << 3)
+#endif
+#ifndef HWCAP2_SVEBITPERM
 #define HWCAP2_SVEBITPERM   (1 << 4)
+#endif
+#ifndef HWCAP2_SVESHA3
 #define HWCAP2_SVESHA3      (1 << 5)
+#endif
+#ifndef HWCAP2_SVESM4
 #define HWCAP2_SVESM4       (1 << 6)
+#endif
+#ifndef HWCAP2_FLAGM2
 #define HWCAP2_FLAGM2       (1 << 7)
+#endif
+#ifndef HWCAP2_FRINT
 #define HWCAP2_FRINT        (1 << 8)
+#endif
 
 unsigned long hwcaps[] = {
    HWCAP_FP,     HWCAP_ASIMD,  HWCAP_EVTSTRM, HWCAP_AES,     HWCAP_PMULL,