From: Paul Floyd Date: Wed, 27 Mar 2024 20:01:20 +0000 (+0100) Subject: Darwin: add syswrap for necp_open X-Git-Tag: VALGRIND_3_23_0~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3e96c80230b7fe9f9d90bd30f1d91e70c0bd7e3;p=thirdparty%2Fvalgrind.git Darwin: add syswrap for necp_open 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 --- diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c index 9076a61a6..8a8743866 100644 --- a/VEX/priv/guest_arm64_toIR.c +++ b/VEX/priv/guest_arm64_toIR.c @@ -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): diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h index ae1c36761..e70960b8a 100644 --- a/coregrind/m_syswrap/priv_syswrap-darwin.h +++ b/coregrind/m_syswrap/priv_syswrap-darwin.h @@ -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 diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index cc54486ba..74a7f1e52 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -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)), // ???