From owner-p4-projects@FreeBSD.ORG Tue Aug 14 18:19:25 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4745516A41A; Tue, 14 Aug 2007 18:19:25 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0B4A16A418 for ; Tue, 14 Aug 2007 18:19:24 +0000 (UTC) (envelope-from phk@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E7D6013C461 for ; Tue, 14 Aug 2007 18:19:24 +0000 (UTC) (envelope-from phk@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l7EIJOg1074416 for ; Tue, 14 Aug 2007 18:19:24 GMT (envelope-from phk@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l7EIJO6S074413 for perforce@freebsd.org; Tue, 14 Aug 2007 18:19:24 GMT (envelope-from phk@freebsd.org) Date: Tue, 14 Aug 2007 18:19:24 GMT Message-Id: <200708141819.l7EIJO6S074413@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to phk@freebsd.org using -f From: Poul-Henning Kamp To: Perforce Change Reviews Cc: Subject: PERFORCE change 125147 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2007 18:19:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=125147 Change 125147 by phk@phk_critter on 2007/08/14 18:19:05 add three more syscalls: sys_thr_self sys_thr_set_name sys_rtprio_thread Affected files ... .. //depot/projects/valgrind/coregrind/m_syswrap/priv_syswrap-freebsd.h#3 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#4 edit .. //depot/projects/valgrind/include/vki-freebsd.h#2 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_syswrap/priv_syswrap-freebsd.h#3 (text+ko) ==== @@ -197,6 +197,9 @@ DECL_TEMPLATE(freebsd, sys_statfs6); DECL_TEMPLATE(freebsd, sys_fstatfs6); DECL_TEMPLATE(freebsd, sys_fhstatfs6); +DECL_TEMPLATE(freebsd, sys_thr_self); +DECL_TEMPLATE(freebsd, sys_thr_set_name); +DECL_TEMPLATE(freebsd, sys_rtprio_thread); DECL_TEMPLATE(freebsd, sys_fork); DECL_TEMPLATE(freebsd, sys_vfork); DECL_TEMPLATE(freebsd, sys_modfind); ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#4 (text+ko) ==== @@ -1724,6 +1724,47 @@ #endif /* --------------------------------------------------------------------- + thr* wrappers + ------------------------------------------------------------------ */ + +PRE(sys_thr_self) +{ + PRINT( "sys_thr_self ( %p )", ARG1 ); + PRE_REG_READ1(long, "thr_self", long *, "id"); + PRE_MEM_WRITE( "thr_self()", ARG1, sizeof(long)); +} +POST(sys_thr_self) +{ + POST_MEM_WRITE( ARG1, sizeof(long)); +} + +PRE(sys_thr_set_name) +{ + PRINT( "sys_thr_set_name ( %d, %p )", ARG1, ARG2 ); + PRE_REG_READ2(long, "thr_set_name", long, "id", const char *, "name"); + PRE_MEM_RASCIIZ( "sys_thr_set_name(threadname)", ARG2); +} + +PRE(sys_rtprio_thread) +{ + PRINT( "sys_rtprio_thread ( %d, %d, %p )", ARG1, ARG2, ARG3 ); + PRE_REG_READ3(long, "rtprio_thread", + int, "function", __vki_lwpid_t, "lwpid", struct vki_rtprio *, "rtp"); + if (ARG1 == VKI_RTP_SET) { + PRE_MEM_READ( "rtprio_thread(set)", ARG3, sizeof(struct vki_rtprio)); + } else if (ARG1 == VKI_RTP_LOOKUP) { + PRE_MEM_WRITE( "rtprio_thread(lookup)", ARG3, sizeof(struct vki_rtprio)); + } else { + /* PHK ?? */ + } +} +POST(sys_rtprio_thread) +{ + if (ARG1 == VKI_RTP_LOOKUP && RES == 0) + POST_MEM_WRITE( ARG3, sizeof(struct vki_rtprio)); +} + +/* --------------------------------------------------------------------- sig* wrappers ------------------------------------------------------------------ */ @@ -2628,7 +2669,7 @@ // thr_create 430 // thr_exit 431 - // thr_self 432 + BSDXY(__NR_thr_self, sys_thr_self), // 432 // thr_kill 433 // _umtx_lock 434 // _umtx_unlock 435 @@ -2668,9 +2709,9 @@ // kmq_unlink 462 // abort2 463 - // thr_set_name 464 + BSDX_(__NR_thr_set_name, sys_thr_set_name), // 464 // aio_fsync 465 - // rtprio_thread 466 + BSDXY(__NR_rtprio_thread, sys_rtprio_thread), // 466 // nosys 467 // nosys 468 ==== //depot/projects/valgrind/include/vki-freebsd.h#2 (text+ko) ==== @@ -1658,6 +1658,18 @@ vki_modspecific_t data; }; +//---------------------------------------------------------------------- +// From sys/rtprio.h +//---------------------------------------------------------------------- + +struct vki_rtprio { + vki_uint16_t type; + vki_uint16_t prio; +}; + +#define VKI_RTP_LOOKUP 0 +#define VKI_RTP_SET 1 + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/