]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin: add syswrap for necp_open
authorPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 27 Mar 2024 20:01:20 +0000 (21:01 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 27 Mar 2024 20:01:20 +0000 (21:01 +0100)
From Louis Brunner. It's marked for 10.15 in his repo but I get
--50575-- WARNING: unhandled amd64-darwin syscall: unix:501
on 10.13

VEX/priv/guest_arm64_toIR.c
coregrind/m_syswrap/priv_syswrap-darwin.h
coregrind/m_syswrap/syswrap-darwin.c

index 9076a61a633f669a33410c95d6d486c4f87937c7..8a8743866b1667a99fc0a4d5bbed721b8ec8e01b 100644 (file)
@@ -15087,6 +15087,9 @@ Bool dis_AdvSIMD_fp_data_proc_1_source(/*MB_OUT*/DisResult* dres, UInt insn)
          case BITS3(1,0,0): ch = 'a'; irrmE = mkU32(Irrm_NEAREST); break;
          // I am unsure about the following, due to the "integral exact"
          // description in the manual.  What does it mean? (frintx, that is)
+         // PJF exact means that if the rounding can't be done without
+         // precision loss (dst numerically equal to src after the rounding)
+         // then an exception is raised / the IXC bit gets set in the FPSR
          case BITS3(1,1,0):
             ch = 'x'; irrmE = mkexpr(mk_get_IR_rounding_mode()); break;
          case BITS3(1,1,1):
index ae1c36761e9fa90e5e93a90cd6cf2f3c6418e6e2..e70960b8a373cc169e18114b16539c09bee5338a 100644 (file)
@@ -622,7 +622,7 @@ DECL_TEMPLATE(darwin, guarded_writev_np);           // 487
 #endif /* DARWIN_VERS >= DARWIN_10_11 */
 #if DARWIN_VERS >= DARWIN_10_12
 DECL_TEMPLATE(darwin, getentropy);                  // 500
-// NYI necp_open                                    // 501
+DECL_TEMPLATE(darwin, necp_open);                   // 501
 // NYI necp_client_action                           // 502
 // 503
 // 504
index cc54486bab5213a29ec5aedebc002b7c3fc2433d..74a7f1e52cf705f3e84682564c156407226eb182 100644 (file)
@@ -10100,12 +10100,19 @@ PRE(getentropy)
                   void*, buffer, size_t, size);
     PRE_MEM_WRITE( "getentropy(buffer)", ARG1, ARG2 );
 }
+
 POST(getentropy)
 {
     vg_assert(SUCCESS);
     POST_MEM_WRITE( ARG1, ARG2 );
 }
 
+PRE(necp_open)
+{
+   PRINT("necp_open(%#lx)", ARG1);
+   PRE_REG_READ1(int, "necp_open", int, flags);
+}
+
 static const HChar *ulop_name(int op)
 {
    switch (op) {
@@ -10985,7 +10992,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 // _____(__NR_clonefileat),                             // 462
 // _____(__NR_renameatx_np),                            // 488
    MACXY(__NR_getentropy, getentropy),                  // 500
-// _____(__NR_necp_open),                               // 501
+   MACX_(__NR_necp_open, necp_open),                    // 501
 // _____(__NR_necp_client_action),                      // 502
    _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(503)),        // ???
    _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(504)),        // ???