Ticket #21525: patch-valgrind-global.diff

File patch-valgrind-global.diff, 39.0 KB (added by guillaume-jean@…, 15 years ago)

Global patch for the valgrind sourcefiles

  • Makefile.all.am

     
    8888        -Wpointer-arith \
    8989        -Wstrict-prototypes \
    9090        -Wmissing-declarations \
     91        -Wno-pointer-sign \
    9192        @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
    9293        -fno-strict-aliasing
    9394
  • mpi/Makefile.am

     
    5656
    5757
    5858if BUILD_MPIWRAP_PRI
    59 libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES  = libmpiwrap.c
    60 libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = -I../include
     59libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES  = $(srcdir)/libmpiwrap.c
     60libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = -I$(srcdir)/../include
    6161libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS   = \
    6262        $(CFLAGS_MPI) $(MPI_FLAG_M3264_PRI)
    6363libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS  = $(LDFLAGS_MPI)
    6464endif
    6565if BUILD_MPIWRAP_SEC
    66 libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES  = libmpiwrap.c
    67 libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = -I../include
     66libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES  = $(srcdir)/libmpiwrap.c
     67libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = -I$(srcdir)/../include
    6868libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS   = \
    6969        $(CFLAGS_MPI) $(MPI_FLAG_M3264_SEC)
    7070libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS  = $(LDFLAGS_MPI)
  • darwin10-drd.supp

     
     1
     2# DRD suppressions for Darwin 10.x / Mac OS X 10.6 Snow Leopard
  • include/vki/vki-darwin.h

     
    792792typedef struct eventreq vki_eventreq;
    793793
    794794
     795#include <sys/acl.h>
     796
     797#define vki_kauth_filesec kauth_filesec
     798
     799
    795800#include <sys/ptrace.h>
    796801
    797802#define VKI_PTRACE_TRACEME   PT_TRACE_ME
     
    10211026#define VKI_A_GETPINFO_ADDR     A_GETPINFO_ADDR
    10221027#define VKI_A_GETKAUDIT A_GETKAUDIT     
    10231028#define VKI_A_SETKAUDIT A_SETKAUDIT     
     1029#if DARWIN_VERS >= DARWIN_10_6
     1030#define VKI_A_SENDTRIGGER A_SENDTRIGGER
     1031#define VKI_A_GETSINFO_ADDR A_GETSINFO_ADDR
     1032#endif
    10241033
    10251034
    10261035#include <sys/aio.h>
  • include/vki/vki-scnums-darwin.h

     
    3232#define __VKI_SCNUMS_DARWIN_H
    3333
    3434
     35// need DARWIN_10_x definitions
     36#include "config.h"
     37
    3538// osfmk/mach/i386/syscall_sw.h
    3639
    3740// There are two syscall number encodings in Darwin.
     
    376379#define __NR_sigreturn      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(184)
    377380#define __NR_chud           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(185)
    378381                        /* 186  */
     382#if DARWIN_VERS >= DARWIN_10_6
     383#define __NR_fdatasync      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(187)
     384#else
    379385                        /* 187  */
     386#endif
    380387#define __NR_stat           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(188)
    381388#define __NR_fstat          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(189)
    382389#define __NR_lstat          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(190)
     
    403410#define __NR_ATPgetreq      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(211)
    404411#define __NR_ATPgetrsp      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(212)
    405412                        /* 213  Reserved for AppleTalk */
    406 #define __NR_kqueue_from_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214)
    407 #define __NR_kqueue_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215)
     413#if DARWIN_VERS >= DARWIN_10_6
     414                        /* 214  old kqueue_from_portset_np*/
     415                        /* 215  old kqueue_portset_np*/
     416#else
     417#define __NR_kqueue_from_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214)
     418#define __NR_kqueue_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215)
     419#endif
    408420#define __NR_mkcomplex      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(216)
    409421#define __NR_statv          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(217)
    410422#define __NR_lstatv         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(218)
     
    413425#define __NR_setattrlist    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(221)
    414426#define __NR_getdirentriesattr VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(222)
    415427#define __NR_exchangedata   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(223)
    416                         /* 224  checkuseraccess */
     428                        /* 224  old checkuseraccess */
    417429#define __NR_searchfs       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(225)
    418430#define __NR_delete         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(226)
    419431#define __NR_copyfile       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(227)
     432#if DARWIN_VERS >= DARWIN_10_6
     433#define __NR_fgetattrlist   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(228)
     434#define __NR_fsetattrlist   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(229)
     435#else
    420436                        /* 228  */
    421437                        /* 229  */
     438#endif
    422439#define __NR_poll           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(230)
    423440#define __NR_watchevent     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(231)
    424441#define __NR_waitevent      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(232)
     
    434451#define __NR_fsctl          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(242)
    435452#define __NR_initgroups     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(243)
    436453#define __NR_posix_spawn    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(244)
     454#if DARWIN_VERS >= DARWIN_10_6
     455#define __NR_ffsctl         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(245)
     456#else
    437457                        /* 245  */
     458#endif
    438459                        /* 246  */
    439460#define __NR_nfsclnt        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(247)
    440461#define __NR_fhopen         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(248)
     
    485506#define __NR_identitysvc    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(293)
    486507#define __NR_shared_region_check_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(294)
    487508#define __NR_shared_region_map_np   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(295)
     509#if DARWIN_VERS >= DARWIN_10_6
     510#define __NR_vm_pressure_monitor    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296)
     511#else
    488512                        /* 296  old load_shared_file */
     513#endif
    489514                        /* 297  old reset_shared_file */
    490515                        /* 298  old new_system_shared_regions */
    491516                        /* 299  old shared_region_map_file_np */
    492517                        /* 300  old shared_region_make_private_np */
    493 #define __NR___pthread_mutex_destroy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301)
    494 #define __NR___pthread_mutex_init VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302)
    495 #define __NR___pthread_mutex_lock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303)
    496 #define __NR___pthread_mutex_trylock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304)
    497 #define __NR___pthread_mutex_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305)
    498 #define __NR___pthread_cond_init VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306)
    499 #define __NR___pthread_cond_destroy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307)
    500 #define __NR___pthread_cond_broadcast VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308)
    501 #define __NR___pthread_cond_signal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309)
     518                        /* 301 */
     519                        /* 302 */
     520                        /* 303 */
     521                        /* 304 */
     522                        /* 305 */
     523                        /* 306 */
     524                        /* 307 */
     525                        /* 308 */
     526                        /* 309 */
    502527#define __NR_getsid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(310)
    503528#define __NR_settid_with_pid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(311)
    504 #define __NR___pthread_cond_timedwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312)
     529                        /* 312 */
    505530#define __NR_aio_fsync      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(313)
    506531#define __NR_aio_return     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(314)
    507532#define __NR_aio_suspend    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(315)
     
    510535#define __NR_aio_read       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(318)
    511536#define __NR_aio_write      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(319)
    512537#define __NR_lio_listio     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(320)
    513 #define __NR___pthread_cond_wait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(321)
     538                        /* 321 */
    514539#define __NR_iopolicysys    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(322)
    515540                        /* 323  */
    516541#define __NR_mlockall       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(324)
     
    559584#define __NR_bsdthread_register VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(366)
    560585#define __NR_workq_open     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(367)
    561586#define __NR_workq_ops      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(368)
     587#if DARWIN_VERS >= DARWIN_10_6
     588#define __NR_kevent64       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(369)
     589#else
    562590                        /* 369  */
     591#endif
    563592                        /* 370  */
    564593                        /* 371  */
     594#if DARWIN_VERS >= DARWIN_10_6
     595#define __NR___thread_selfid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(372)  // was UX64
     596#else
    565597                        /* 372  */
     598#endif
    566599                        /* 373  */
    567600                        /* 374  */
    568601                        /* 375  */
     
    617650#define __NR___mac_mount            VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(424)
    618651#define __NR___mac_get_mount        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(425)
    619652#define __NR___mac_getfsstat        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(426)
     653#if DARWIN_VERS >= DARWIN_10_6
     654#define __NR_fsgetpath              VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(427)
     655#define __NR_audit_session_self     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(428)
     656#define __NR_audit_session_join     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(429)
     657#endif
     658
     659#if DARWIN_VERS <= DARWIN_10_6
    620660#define __NR_MAXSYSCALL             VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(427)
     661#elif DARWIN_VERSION < DARWIN_10_7
     662#define __NR_MAXSYSCALL             VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(430)
     663#else
     664#error unknown darwin version
     665#endif
    621666
    622667#define __NR_DARWIN_FAKE_SIGRETURN (1 + __NR_MAXSYSCALL)
    623668
  • configure.in

     
    247247     *darwin*)
    248248        AC_MSG_RESULT([ok (${host_os})])
    249249        VGCONF_OS="darwin"
     250        AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
     251        AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
     252        AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
    250253
    251254        AC_MSG_CHECKING([for the kernel version])
    252255        kernel=`uname -r`
     
    254257        # Nb: for Darwin we set DEFAULT_SUPP here.  That's because Darwin
    255258        # has only one relevant version, the OS version. The `uname` check
    256259        # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
    257         # X 10.5.6, and "Darwin 10.x" would presumably be Mac OS X 10.6.x
    258         # Snow Leopard and darwin10.supp), and we don't know of an macros
    259         # similar to __GLIBC__ to get that info.
     260        # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard),
     261        # and we don't know of an macros similar to __GLIBC__ to get that info.
    260262        #
    261263        # XXX: `uname -r` won't do the right thing for cross-compiles, but
    262264        # that's not a problem yet.
    263265        case "${kernel}" in
    264266             9.*)
    265267                  AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
     268                  AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
    266269                  DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
    267270                  DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
    268271                  ;;
     272             10.*)
     273                  AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
     274                  AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
     275                  DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
     276                  DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
     277                  ;;
    269278     *)
    270279                  AC_MSG_RESULT([unsupported (${kernel})])
    271                   AC_MSG_ERROR([Valgrind works on Darwin 9.x (Mac OS X 10.5)])
     280                  AC_MSG_ERROR([Valgrind works on Darwin 9.x and 10.x (Mac OS X 10.5 and 10.6)])
    272281                  ;;
    273282        esac
    274283        ;;
     
    14711480
    14721481#----------------------------------------------------------------------------
    14731482# Check for /proc filesystem
     1483# This doesn't work when cross-compiling, including Darwin universal builds.
    14741484#----------------------------------------------------------------------------
     1485if test "x$cross_compiling" = "xno"; then
    14751486AC_CHECK_FILES(/proc/self/fd /proc/self/exe /proc/self/maps,
    14761487    [ AC_DEFINE([HAVE_PROC], 1, [can use /proc filesystem]) ],
    14771488    [])
     1489else
     1490     # assume /proc/self/* is available everywhere except Darwin
     1491     case "$VGCONF_OS" in
     1492        darwin)
     1493              ;;
     1494        *)
     1495           AC_DEFINE([HAVE_PROC], 1, [can use /proc filesystem])
     1496           ;;
     1497     esac
     1498fi
    14781499
    14791500
    14801501#----------------------------------------------------------------------------
  • configure

    old new  
    42964296                  DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
    42974297                  DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
    42984298                  ;;
     4299             10.*)
     4300                  echo "$as_me:$LINENO: result: Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard" >&5
     4301echo "${ECHO_T}Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard" >&6
     4302                  DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
     4303                  DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
     4304                  ;;
    42994305     *)
    43004306                  echo "$as_me:$LINENO: result: unsupported (${kernel})" >&5
    43014307echo "${ECHO_T}unsupported (${kernel})" >&6
  • auxprogs/Makefile.am

     
    2929valgrind_listener_CFLAGS    = $(AM_CFLAGS_PRI)
    3030valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
    3131valgrind_listener_LDFLAGS   = $(AM_CFLAGS_PRI)
    32 
  • Makefile.am

     
    2626
    2727# Put docs last because building the HTML is slow and we want to get
    2828# everything else working before we try it.
     29# GrP SnowLeopard:
     30#       mpi
    2931SUBDIRS = \
    3032        include \
    3133        VEX \
     
    3638        tests \
    3739        perf \
    3840        auxprogs \
    39         mpi \
    4041        docs
    4142DIST_SUBDIRS  = $(SUBDIRS)
    4243
     
    4849        glibc-2.2-LinuxThreads-helgrind.supp \
    4950        glibc-2.X-drd.supp \
    5051        exp-ptrcheck.supp \
    51         darwin9.supp darwin9-drd.supp
     52        darwin9.supp darwin9-drd.supp \
     53        darwin10.supp darwin10-drd.supp
    5254DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
    5355
    5456# We include all the base .supp files in the distribution, but not
     
    6365BUILT_SOURCES  = default.supp valgrind.pc
    6466CLEANFILES     = default.supp
    6567
    66 default.supp: $(DEFAULT_SUPP_FILES)
     68default.supp: $(addprefix $(srcdir)/,$(DEFAULT_SUPP_FILES))
    6769        echo "# This is a generated file, composed of the following suppression rules:" > default.supp
    6870        echo "# " $(DEFAULT_SUPP_FILES) >> default.supp
    69         cat $(DEFAULT_SUPP_FILES) >> default.supp
     71        cat $(addprefix $(srcdir)/,$(DEFAULT_SUPP_FILES)) >> default.supp
    7072
    7173## Preprend @PERL@ because tests/vg_regtest isn't executable
    7274regtest: check
  • darwin9-drd.supp

     
     1
     2# DRD suppressions for Darwin 9.x / Mac OS X 10.5 Leopard
     3
    14#
    25# Suppression patterns for dyld, the dynamic loader.
    36#
  • Makefile.vex.am

     
    5151# This is very uggerly.  Need to sed out both "xyzzyN" and
    5252# "xyzzy$N" since gcc on different targets emits the constants
    5353# differently -- with a leading $ on x86/amd64 but none on ppc32/64.
    54 pub/libvex_guest_offsets.h:
    55         rm -f auxprogs/genoffsets.s
    56         $(CC) $(LIBVEX_CFLAGS) -O -S -o auxprogs/genoffsets.s \
    57                                         auxprogs/genoffsets.c
    58         grep xyzzy auxprogs/genoffsets.s | grep define \
     54pub/libvex_guest_offsets.h: $(srcdir)/auxprogs/genoffsets.c
     55        $(CC) $(LIBVEX_CFLAGS) -O -S -o - $(srcdir)/auxprogs/genoffsets.c \
     56           | grep xyzzy | grep define \
    5957           | sed "s/xyzzy\\$$//g" | sed "s/xyzzy//g" \
    60            > pub/libvex_guest_offsets.h
    61         rm -f auxprogs/genoffsets.s
     58           > $(srcdir)/pub/libvex_guest_offsets.h
    6259
    6360#----------------------------------------------------------------------------
    6461# libvex-<platform>.a
  • darwin10.supp

     
     1
     2# Suppressions for Darwin 10.x / Mac OS X 10.6 Snow Leopard
  • coregrind/m_syswrap/priv_syswrap-darwin.h

     
    429429// 369
    430430// 370
    431431// 371
    432 // 372
     432DECL_TEMPLATE(darwin, __thread_selfid);         // 372
    433433// 373
    434434// 374
    435435// 375
     
    484484// NYI __mac_mount 424
    485485// NYI __mac_get_mount 425
    486486// NYI __mac_getfsstat 426
     487DECL_TEMPLATE(darwin, fsgetpath);           // 427
     488// NYI audit_session_self 428
     489// NYI audit_session_join 429
    487490
    488491// Mach message helpers
    489492DECL_TEMPLATE(darwin, host_info);
     
    498501DECL_TEMPLATE(darwin, mach_port_get_refs);
    499502DECL_TEMPLATE(darwin, mach_port_mod_refs);
    500503DECL_TEMPLATE(darwin, mach_port_get_set_status);
     504DECL_TEMPLATE(darwin, mach_port_move_member);
    501505DECL_TEMPLATE(darwin, mach_port_destroy);
    502506DECL_TEMPLATE(darwin, mach_port_request_notification);
    503507DECL_TEMPLATE(darwin, mach_port_insert_right);
     508DECL_TEMPLATE(darwin, mach_port_extract_right);
    504509DECL_TEMPLATE(darwin, mach_port_get_attributes);
    505510DECL_TEMPLATE(darwin, mach_port_set_attributes);
    506511DECL_TEMPLATE(darwin, mach_port_insert_member);
     
    537542DECL_TEMPLATE(darwin, thread_suspend);
    538543DECL_TEMPLATE(darwin, thread_get_state);
    539544DECL_TEMPLATE(darwin, thread_policy);
     545DECL_TEMPLATE(darwin, thread_policy_set);
    540546DECL_TEMPLATE(darwin, thread_info);
    541547DECL_TEMPLATE(darwin, bootstrap_register);
    542548DECL_TEMPLATE(darwin, bootstrap_look_up);
  • coregrind/m_syswrap/syswrap-amd64-darwin.c

     
    378378   VexGuestAMD64State *vex;
    379379   Addr stack;
    380380   SizeT stacksize;
     381   vki_sigset_t blockall;
    381382
     383   /* When we enter here we hold no lock (!), so we better acquire it
     384      pronto.  Why do we hold no lock?  Because (presumably) the only
     385      way to get here is as a result of a SfMayBlock syscall
     386      "workq_ops(WQOPS_THREAD_RETURN)", which will have dropped the
     387      lock.  At least that's clear for the 'reuse' case.  The
     388      non-reuse case?  Dunno, perhaps it's a new thread the kernel
     389      pulled out of a hat.  In any case we still need to take a
     390      lock. */
     391   VG_(acquire_BigLock_LL)("wqthread_hijack");
     392
     393   /* Start the thread with all signals blocked.  VG_(scheduler) will
     394      set the mask correctly when we finally get there. */
     395   VG_(sigfillset)(&blockall);
     396   VG_(sigprocmask)(VKI_SIG_SETMASK, &blockall, NULL);
     397
    382398   if (reuse) {
    383399       // This thread already exists; we're merely re-entering
    384400       // after leaving via workq_ops(WQOPS_THREAD_RETURN).
     
    418434   if (reuse) {
    419435      // Continue V's thread back in the scheduler.
    420436      // The client thread is of course in another location entirely.
     437
     438      /* Drop the lock before going into
     439         ML_(wqthread_continue_NORETURN).  The latter will immediately
     440         attempt to reacquire it in non-LL mode, which is a bit
     441         wasteful but I don't think is harmful.  A better solution
     442         would be to not drop the lock but instead "upgrade" it from a
     443         LL lock to a full lock, but that's too much like hard work
     444         right now. */
     445      VG_(release_BigLock_LL)("wqthread_hijack(1)");
    421446      ML_(wqthread_continue_NORETURN)(tst->tid);
    422447   }
    423448   else {
     
    450475      VG_(am_do_sync_check)("after", "wqthread_hijack", 0);
    451476
    452477      // Go!
     478      /* Same comments as the 'release' in the then-clause.
     479         start_thread_NORETURN calls run_thread_NORETURN calls
     480         thread_wrapper which acquires the lock before continuing.
     481         Let's hope nothing non-thread-local happens until that point.
     482
     483         DDD: I think this is plain wrong .. if we get to
     484         thread_wrapper not holding the lock, and someone has recycled
     485         this thread slot in the meantime, we're hosed.  Is that
     486         possible, though? */
     487      VG_(release_BigLock_LL)("wqthread_hijack(2)");
    453488      call_on_new_stack_0_1(tst->os_state.valgrind_stack_init_SP, 0,
    454489                            start_thread_NORETURN, (Word)tst);
    455490   }
  • coregrind/m_syswrap/priv_syswrap-generic.h

     
    200200DECL_TEMPLATE(generic, sys_getrlimit);             // * (?)
    201201DECL_TEMPLATE(generic, sys_truncate64);            // %% (P?)
    202202DECL_TEMPLATE(generic, sys_ftruncate64);           // %% (P?)
    203 DECL_TEMPLATE(generic, sys_lchown);                // * (L?)
     203DECL_TEMPLATE(generic, sys_lchown);                // * (L?) FreeBSD 3.0
    204204DECL_TEMPLATE(generic, sys_mincore);               // * L?
    205205DECL_TEMPLATE(generic, sys_getdents64);            // * (SVr4,SVID?)
    206206DECL_TEMPLATE(generic, sys_statfs64);              // * (?)
  • coregrind/m_syswrap/syswrap-main.c

     
    11551155#    error Unknown OS
    11561156#  endif
    11571157
    1158    return sys == NULL  ? &bad_sys  : sys;
     1158   return (sys && sys->before) ? sys : &bad_sys;
    11591159}
    11601160
    11611161
  • coregrind/m_syswrap/syswrap-darwin.c

     
    6666#include <mach/mach.h>
    6767#include <mach/mach_vm.h>
    6868#include <semaphore.h>
    69 #include <sys/acl.h>   /* struct kauth_filesec */
    7069/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
    7170
    7271#define msgh_request_port      msgh_remote_port
     
    12401239{
    12411240   PRINT("futimes ( %ld, %#lx )", ARG1,ARG2);
    12421241   PRE_REG_READ2(long, "futimes", int, fd, struct timeval *, tvp);
    1243    if (ARG2 != 0) {
     1242   if (!ML_(fd_allowed)(ARG1, "futimes", tid, False)) {
     1243      SET_STATUS_Failure( VKI_EBADF );
     1244   } else if (ARG2 != 0) {
    12441245      PRE_timeval_READ( "futimes(tvp[0])", ARG2 );
    12451246      PRE_timeval_READ( "futimes(tvp[1])", ARG2+sizeof(struct vki_timeval) );
    12461247   }
     
    16351636{
    16361637   PRINT("kdebug_trace(%ld, %ld, %ld, %ld, %ld, %ld)",
    16371638         ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
     1639   /*
     1640     Don't check anything - some clients pass fewer arguments.
    16381641   PRE_REG_READ6(long, "kdebug_trace",
    16391642                 int,"code", int,"arg1", int,"arg2",
    16401643                 int,"arg3", int,"arg4", int,"arg5");
    1641    // GrP fixme anything else?
     1644   */
    16421645}
    16431646
    16441647
     
    20182021      is just way wrong.  [The trouble is with the size, which depends on a
    20192022      non-trival kernel computation] */
    20202023   PRE_MEM_READ( "fchmod_extended(xsecurity)", ARG5,
    2021                  sizeof(struct kauth_filesec) );
     2024                 sizeof(struct vki_kauth_filesec) );
    20222025}
    20232026
    20242027PRE(chmod_extended)
     
    20382041      is just way wrong.  [The trouble is with the size, which depends on a
    20392042      non-trival kernel computation] */
    20402043   PRE_MEM_READ( "chmod_extended(xsecurity)", ARG5,
    2041                  sizeof(struct kauth_filesec) );
     2044                 sizeof(struct vki_kauth_filesec) );
    20422045}
    20432046
    20442047
     
    22412244   } attrspec;
    22422245   static const attrspec commonattr[] = {
    22432246      // This order is important.
     2247#if DARWIN_VERS >= DARWIN_10_6
     2248      { ATTR_CMN_RETURNED_ATTRS,  sizeof(attribute_set_t) },
     2249#endif
    22442250      { ATTR_CMN_NAME,            -1 },
    22452251      { ATTR_CMN_DEVID,           sizeof(dev_t) },
    22462252      { ATTR_CMN_FSID,            sizeof(fsid_t) },
     
    22632269      { ATTR_CMN_NAMEDATTRLIST,   -1 },
    22642270      { ATTR_CMN_FLAGS,           sizeof(uint32_t) },
    22652271      { ATTR_CMN_USERACCESS,      sizeof(uint32_t) },
     2272      { ATTR_CMN_EXTENDED_SECURITY, -1 },
     2273      { ATTR_CMN_UUID,            sizeof(guid_t) },
     2274      { ATTR_CMN_GRPUUID,         sizeof(guid_t) },
    22662275      { ATTR_CMN_FILEID,          sizeof(uint64_t) },
    22672276      { ATTR_CMN_PARENTID,        sizeof(uint64_t) },
     2277#if DARWIN_VERS >= DARWIN_10_6
     2278      { ATTR_CMN_FULLPATH,        -1 },
     2279#endif
    22682280      { 0,                        0 }
    22692281   };
    22702282   static const attrspec volattr[] = {
     
    22882300      { ATTR_VOL_MOUNTEDDEVICE,   -1 },
    22892301      { ATTR_VOL_ENCODINGSUSED,   sizeof(uint64_t) },
    22902302      { ATTR_VOL_CAPABILITIES,    sizeof(vol_capabilities_attr_t) },
     2303#if DARWIN_VERS >= DARWIN_10_6
     2304      { ATTR_VOL_UUID,            sizeof(uuid_t) },
     2305#endif
    22912306      { ATTR_VOL_ATTRIBUTES,      sizeof(vol_attributes_attr_t) },
    22922307      { 0,                        0 }
    22932308   };
     
    23362351   d = attrBuf;
    23372352   dend = d + attrBufSize;
    23382353
     2354#if DARWIN_VERS >= DARWIN_10_6
     2355   // ATTR_CMN_RETURNED_ATTRS tells us what's really here, if set
     2356   if (a[0] & ATTR_CMN_RETURNED_ATTRS) {
     2357       // fixme range check this?
     2358       a[0] &= ~ATTR_CMN_RETURNED_ATTRS;
     2359       fn(tid, d, sizeof(attribute_set_t));
     2360       VG_(memcpy)(a, d, sizeof(a));
     2361   }
     2362#endif
     2363
    23392364   for (g = 0; g < 5; g++) {
    23402365      for (i = 0; attrdefs[g][i].attrBit; i++) {
    23412366         uint32_t bit = attrdefs[g][i].attrBit;
     
    23982423POST(getattrlist)
    23992424{
    24002425   if (ARG4 > sizeof(vki_uint32_t)) {
    2401       // attrBuf is uint32_t bytes written followed by attr data
     2426      // attrBuf is uint32_t size followed by attr data
    24022427      vki_uint32_t *sizep = (vki_uint32_t *)ARG3;
    24032428      POST_MEM_WRITE(ARG3, sizeof(vki_uint32_t));
    2404       scan_attrlist(tid, (struct vki_attrlist *)ARG2, sizep+1, *sizep, &get1attr);
     2429      if (ARG5 & FSOPT_REPORT_FULLSIZE) {
     2430         // *sizep is bytes required for return value, including *sizep
     2431      } else {
     2432         // *sizep is actual bytes returned, including *sizep
     2433      }
     2434      scan_attrlist(tid, (struct vki_attrlist *)ARG2, sizep+1, MIN(*sizep, ARG4), &get1attr);
    24052435   }
    24062436}
    24072437
     
    24572487
    24582488   POST_MEM_WRITE(ARG3, p - (char *)ARG3);
    24592489
    2460    PRINT("got %d records, %d/%lu bytes\n", count, p-(char *)ARG3, ARG4);
     2490   PRINT("got %d records, %ld/%lu bytes\n", count, p-(char *)ARG3, ARG4);
    24612491}
    24622492
    24632493
     2494PRE(fsgetpath)
     2495{
     2496#if VG_WORDSIZE == 4
     2497   PRINT("fsgetpath(%#lx, %ld, %#lx {%lu,%lu}, %llu)",
     2498         ARG1, ARG2, ARG3, ((unsigned int *)ARG3)[0], ((unsigned int *)ARG3)[1], LOHI64(ARG4, ARG5));
     2499   PRE_REG_READ5(ssize_t, "fsgetpath",
     2500                 void*,"buf", size_t,"bufsize",
     2501                 fsid_t *,"fsid",
     2502                 vki_uint32_t, "objid_low32", vki_uint32_t, "objid_high32");
     2503#else
     2504   PRINT("fsgetpath(%#lx, %ld, %#lx {%u,%u}, %llu)",
     2505         ARG1, ARG2, ARG3, ((unsigned int *)ARG3)[0], ((unsigned int *)ARG3)[1], ARG4);
     2506   PRE_REG_READ4(ssize_t, "fsgetpath",
     2507                 void*,"buf", size_t,"bufsize",
     2508                 fsid_t *,"fsid", uint64_t,"objid");
     2509#endif
     2510   PRE_MEM_READ("fsgetpath(fsid)", ARG3, sizeof(fsid_t));
     2511   PRE_MEM_WRITE("fsgetpath(buf)", ARG1, ARG2);
     2512}
     2513
     2514POST(fsgetpath)
     2515{
     2516   POST_MEM_WRITE(ARG1, RES);
     2517}
     2518
     2519
    24642520PRE(exchangedata)
    24652521{
    24662522   PRINT("exchangedata(%#lx(%s), %#lx(%s), %lu)",
     
    32423298   case VKI_A_SETCLASS:
    32433299   case VKI_A_SETPMASK:
    32443300   case VKI_A_SETFSIZE:
     3301#if DARWIN_VERS >= DARWIN_10_6
     3302   case VKI_A_SENDTRIGGER:
     3303#endif
    32453304      // kernel reads data..data+length
    32463305      PRE_MEM_READ("auditon(data)", ARG2, ARG3);
    32473306      break;
     
    32603319   case VKI_A_GETCLASS:
    32613320   case VKI_A_GETPINFO:
    32623321   case VKI_A_GETPINFO_ADDR:
     3322#if DARWIN_VERS >= DARWIN_10_6
     3323   case VKI_A_GETSINFO_ADDR:
     3324#endif
    32633325      // kernel reads and writes data..data+length
    32643326      // GrP fixme be precise about what gets read and written
    32653327      PRE_MEM_READ("auditon(data)", ARG2, ARG3);
     
    32933355   case VKI_A_SETCLASS:
    32943356   case VKI_A_SETPMASK:
    32953357   case VKI_A_SETFSIZE:
     3358#if DARWIN_VERS >= DARWIN_10_6
     3359   case VKI_A_SENDTRIGGER:
     3360#endif
    32963361      // kernel reads data..data+length
    32973362      break;
    32983363
     
    33103375   case VKI_A_GETCLASS:
    33113376   case VKI_A_GETPINFO:
    33123377   case VKI_A_GETPINFO_ADDR:
     3378#if DARWIN_VERS >= DARWIN_10_6
     3379   case VKI_A_GETSINFO_ADDR:
     3380#endif
    33133381      // kernel reads and writes data..data+length
    33143382      // GrP fixme be precise about what gets read and written
    33153383      POST_MEM_WRITE(ARG2, ARG3);
     
    43784446}
    43794447
    43804448
     4449PRE(mach_port_move_member)
     4450{
     4451#pragma pack(4)
     4452    typedef struct {
     4453        mach_msg_header_t Head;
     4454        NDR_record_t NDR;
     4455        mach_port_name_t member;
     4456        mach_port_name_t after;
     4457    } Request;
     4458#pragma pack()
     4459
     4460    Request *req = (Request *)ARG1;
     4461
     4462    PRINT("mach_port_move_member(%s, %s, %s)",
     4463          name_for_port(MACH_REMOTE),
     4464          name_for_port(req->member),
     4465          name_for_port(req->after));
     4466    /*
     4467    MACH_ARG(mach_port_move_member.member) = req->member;
     4468    MACH_ARG(mach_port_move_member.after) = req->after;
     4469    */
     4470    AFTER = POST_FN(mach_port_move_member);
     4471}
     4472
     4473POST(mach_port_move_member)
     4474{
     4475#pragma pack(4)
     4476   typedef struct {
     4477      mach_msg_header_t Head;
     4478      NDR_record_t NDR;
     4479      kern_return_t RetCode;
     4480      mach_msg_trailer_t trailer;
     4481   } Reply;
     4482#pragma pack()
     4483
     4484   Reply *reply = (Reply *)ARG1;
     4485
     4486   if (!reply->RetCode) {
     4487      // fixme port set tracker?
     4488   } else {
     4489      PRINT("mig return %d", reply->RetCode);
     4490   }
     4491}
     4492
     4493
    43814494PRE(mach_port_destroy)
    43824495{
    43834496#pragma pack(4)
     
    44984611}
    44994612
    45004613
     4614PRE(mach_port_extract_right)
     4615{
     4616#pragma pack(4)
     4617   typedef struct {
     4618      mach_msg_header_t Head;
     4619      NDR_record_t NDR;
     4620      mach_port_name_t name;
     4621      mach_msg_type_name_t msgt_name;
     4622   } Request;
     4623#pragma pack()
     4624
     4625   Request *req = (Request *)ARG1;
     4626   
     4627   PRINT("mach_port_extract_right(%s, %s, %d)",
     4628         name_for_port(MACH_REMOTE),
     4629         name_for_port(req->name), req->msgt_name);
     4630   
     4631   AFTER = POST_FN(mach_port_extract_right);
     4632   
     4633   // fixme port tracker?
     4634}
     4635
     4636POST(mach_port_extract_right)
     4637{
     4638   // fixme import_complex_message handles the returned result, right?
     4639}
     4640
     4641
    45014642PRE(mach_port_get_attributes)
    45024643{
    45034644#pragma pack(4)
     
    60866227
    60876228   // GrP fixme semaphore destroy needed when thread creation fails
    60886229   // GrP fixme probably other cleanup too
     6230   // GrP fixme spinlocks might be good enough?
    60896231
    60906232   // DDD: I'm not at all sure this is the right spot for this.  It probably
    60916233   // should be in pthread_hijack instead, just before the call to
     
    62046346}
    62056347
    62066348
    6207 POST(thread_policy)
    6208 {
    6209 }
    6210 
    62116349PRE(thread_policy)
    62126350{
    62136351   mach_msg_header_t *mh = (mach_msg_header_t *)ARG1;
     
    62226360   AFTER = POST_FN(thread_policy);
    62236361}
    62246362
     6363POST(thread_policy)
     6364{
     6365}
    62256366
     6367
     6368PRE(thread_policy_set)
     6369{
     6370   mach_msg_header_t *mh = (mach_msg_header_t *)ARG1;
     6371
     6372   PRINT("thread_policy_set(%s, ...)", name_for_port(mh->msgh_request_port));
     6373
     6374   AFTER = POST_FN(thread_policy_set);
     6375}
     6376
     6377POST(thread_policy_set)
     6378{
     6379}
     6380
     6381
    62266382PRE(thread_info)
    62276383{
    62286384   mach_msg_header_t *mh = (mach_msg_header_t *)ARG1;
     
    64496605   case 3211:
    64506606      CALL_PRE(mach_port_get_set_status);
    64516607      return;
     6608   case 3212:
     6609      CALL_PRE(mach_port_move_member);
     6610      return;
    64526611   case 3213:
    64536612      CALL_PRE(mach_port_request_notification);
    64546613      return;
    64556614   case 3214:
    64566615      CALL_PRE(mach_port_insert_right);
    64576616      return;
     6617   case 3215:
     6618      CALL_PRE(mach_port_extract_right);
     6619      return;
    64586620   case 3217:
    64596621      CALL_PRE(mach_port_get_attributes);
    64606622      return;
     
    65966758   case 3616:
    65976759      CALL_PRE(thread_policy);
    65986760      return;
     6761   case 3617:
     6762      CALL_PRE(thread_policy_set);
     6763      return;
    65996764   default:
    66006765      // unknown message to a thread
    66016766      VG_(printf)("UNKNOWN thread message [id %d, to %s, reply 0x%x]\n",
     
    67606925
    67616926POST(mach_msg_unhandled)
    67626927{
    6763    ML_(sync_mappings)("after", "mach_msg_unhandled", 0);
     6928   ML_(sync_mappings)("after", "mach_msg_receive (unhandled)", 0);
    67646929}
    67656930
    67666931
     
    69007065}
    69017066
    69027067
     7068#if DARWIN_VERS <= DARWIN_10_5
    69037069PRE(__semwait_signal)
    69047070{
    6905    /* args: int cond_sem, int mutex_sem,
    6906             int timeout, int relative,
    6907             time_t tv_sec, time_t tv_nsec */
     7071   /* 10.5 args: int cond_sem, int mutex_sem,
     7072                 int timeout, int relative,
     7073                 time_t tv_sec, time_t tv_nsec */
    69087074   PRINT("__semwait_signal(wait %s, signal %s, %ld, %ld, %lds:%ldns)",
    69097075         name_for_port(ARG1), name_for_port(ARG2), ARG3, ARG4, ARG5, ARG6);
    69107076   PRE_REG_READ6(long, "__semwait_signal",
     
    69147080
    69157081   *flags |= SfMayBlock;
    69167082}
     7083#else
     7084PRE(__semwait_signal)
     7085{
     7086   /* 10.5 args: int cond_sem, int mutex_sem,
     7087                 int timeout, int relative,
     7088                 const timespec *ts */
     7089   PRINT("__semwait_signal(wait %s, signal %s, %ld, %ld, %#lx)",
     7090         name_for_port(ARG1), name_for_port(ARG2), ARG3, ARG4, ARG5);
     7091   PRE_REG_READ5(int, "__semwait_signal",
     7092                 int,cond_sem, int,mutex_sem,
     7093                 int,timeout, int,relative,
     7094                 const struct vki_timespec *,ts);
     7095   
     7096   if (ARG5) PRE_MEM_READ ("__semwait_signal(ts)",
     7097                           ARG5, sizeof(struct vki_timespec));
     7098   
     7099   *flags |= SfMayBlock;
     7100}
     7101#endif
    69177102
    69187103
     7104PRE(__thread_selfid)
     7105{
     7106   PRINT("__thread_selfid ()");
     7107   PRE_REG_READ0(vki_uint64_t, "__thread_selfid");
     7108}
     7109
    69197110PRE(task_for_pid)
    69207111{
    69217112   PRINT("task_for_pid(%s, %ld, %#lx)", name_for_port(ARG1), ARG2, ARG3);
     
    74687659   MACX_(__NR_sigreturn,   sigreturn),
    74697660// _____(__NR_chud),
    74707661   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(186)),   // ???
     7662#if DARWIN_VERS >= DARWIN_10_6
     7663// _____(__NR_fdatasync),
     7664#else
    74717665   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(187)),   // ???
     7666#endif
    74727667   GENXY(__NR_stat,        sys_newstat),
    74737668   GENXY(__NR_fstat,       sys_newfstat),
    74747669   GENXY(__NR_lstat,       sys_newlstat),
     
    74957690// _____(__NR_ATPgetreq),
    74967691// _____(__NR_ATPgetrsp),
    74977692   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(213)),   // Reserved for AppleTalk
     7693#if DARWIN_VERS >= DARWIN_10_6
     7694   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214)),   // old kqueue_from_portset_np
     7695   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215)),   // old kqueue_portset_np
     7696#else
    74987697// _____(__NR_kqueue_from_portset_np),
    74997698// _____(__NR_kqueue_portset_np),
     7699#endif
    75007700// _____(__NR_mkcomplex),
    75017701// _____(__NR_statv),
    75027702// _____(__NR_lstatv),
     
    75097709// _____(__NR_searchfs),
    75107710   GENX_(__NR_delete,      sys_unlink),
    75117711// _____(__NR_copyfile),
     7712#if DARWIN_VERS >= DARWIN_10_6
     7713// _____(__NR_fgetattrlist),
     7714// _____(__NR_fsetattrlist),
     7715#else
    75127716   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(228)),   // ??
    75137717   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(229)),   // ??
     7718#endif
    75147719   GENXY(__NR_poll,        sys_poll),
    75157720   MACX_(__NR_watchevent,  watchevent),
    75167721   MACXY(__NR_waitevent,   waitevent),
     
    75267731   MACXY(__NR_fsctl,       fsctl),
    75277732   MACX_(__NR_initgroups,  initgroups),
    75287733   MACXY(__NR_posix_spawn, posix_spawn),
     7734#if DARWIN_VERS >= DARWIN_10_6
     7735// _____(__NR_ffsctl),
     7736#else
    75297737   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(245)),   // ???
     7738#endif
    75307739   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(246)),   // ???
    75317740// _____(__NR_nfsclnt),
    75327741// _____(__NR_fhopen),
     
    75777786// _____(__NR_identitysvc),
    75787787// _____(__NR_shared_region_check_np),
    75797788// _____(__NR_shared_region_map_np),
     7789#if DARWIN_VERS >= DARWIN_10_6
     7790// _____(__NR_vm_pressure_monitor),
     7791#else
    75807792   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296)),   // old load_shared_file
     7793#endif
    75817794   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(297)),   // old reset_shared_file
    75827795   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(298)),   // old new_system_shared_regions
    75837796   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(299)),   // old shared_region_map_file_np
    75847797   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(300)),   // old shared_region_make_private_np
    7585 // _____(__NR___pthread_mutex_destroy),
    7586 // _____(__NR___pthread_mutex_init),
    7587 // _____(__NR___pthread_mutex_lock),
    7588 // _____(__NR___pthread_mutex_trylock),
    7589 // _____(__NR___pthread_mutex_unlock),
    7590 // _____(__NR___pthread_cond_init),
    7591 // _____(__NR___pthread_cond_destroy),
    7592 // _____(__NR___pthread_cond_broadcast),
    7593 // _____(__NR___pthread_cond_signal),
     7798   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301)),   // ???
     7799   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302)),   // ???
     7800   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303)),   // ???
     7801   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304)),   // ???
     7802   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305)),   // ???
     7803   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306)),   // ???
     7804   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307)),   // ???
     7805   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308)),   // ???
     7806   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309)),   // ???
    75947807// _____(__NR_getsid),
    75957808// _____(__NR_settid_with_pid),
    7596 // _____(__NR___pthread_cond_timedwait),
     7809   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312)),   // ???
    75977810// _____(__NR_aio_fsync),
    75987811   MACXY(__NR_aio_return,     aio_return),
    75997812   MACX_(__NR_aio_suspend,    aio_suspend),
     
    76027815   MACXY(__NR_aio_read,       aio_read),
    76037816   MACX_(__NR_aio_write,      aio_write),
    76047817// _____(__NR_lio_listio),   // 320
    7605 // _____(__NR___pthread_cond_wait),
     7818   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(321)),   // ???
    76067819// _____(__NR_iopolicysys),
    76077820   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(323)),   // ???
    76087821// _____(__NR_mlockall),
     
    76457858   MACX_(__NR_bsdthread_terminate,  bsdthread_terminate),
    76467859   MACXY(__NR_kqueue,      kqueue),
    76477860   MACXY(__NR_kevent,      kevent),
    7648 // _____(__NR_lchown),
     7861   GENX_(__NR_lchown,      sys_lchown),
    76497862// _____(__NR_stack_snapshot),
    76507863   MACX_(__NR_bsdthread_register, bsdthread_register),
    76517864   MACX_(__NR_workq_open,  workq_open),
    76527865   MACXY(__NR_workq_ops,   workq_ops),
     7866#if DARWIN_VERS >= DARWIN_10_6
     7867// _____(__NR_kevent64),
     7868#else
    76537869   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(369)),   // ???
     7870#endif
    76547871   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(370)),   // ???
    76557872   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(371)),   // ???
     7873#if DARWIN_VERS >= DARWIN_10_6
     7874   MACX_(__NR___thread_selfid, __thread_selfid),
     7875#else
    76567876   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(372)),   // ???
     7877#endif
    76577878   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(373)),   // ???
    76587879   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(374)),   // ???
    76597880   _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(375)),   // ???
     
    77097930// _____(__NR___mac_mount),
    77107931// _____(__NR___mac_get_mount),
    77117932// _____(__NR___mac_getfsstat),
     7933#if DARWIN_VERS >= DARWIN_10_6
     7934   MACXY(__NR_fsgetpath, fsgetpath),
     7935// _____(__NR_audit_session_self),
     7936// _____(__NR_audit_session_join),
     7937#endif
     7938
    77127939// _____(__NR_MAXSYSCALL)
    77137940   MACX_(__NR_DARWIN_FAKE_SIGRETURN, FAKE_SIGRETURN)
    77147941};
  • coregrind/m_main.c

     
    15101510   VG_(do_syscall2)(__NR_munmap, 0x00000000, 0xf0000000);
    15111511# else
    15121512   // open up client space
    1513    VG_(do_syscall2)(__NR_munmap, 0x100000000, 0x700000000000-0x100000000);
     1513   VG_(do_syscall2)(__NR_munmap, 0x100000000, 0x7fff50000000-0x100000000);
    15141514   // open up client stack and dyld
    15151515   VG_(do_syscall2)(__NR_munmap, 0x7fff5c000000, 0x4000000);
    15161516# endif
  • coregrind/Makefile.am

     
    111111
    112112# Be careful w.r.t. parellel builds.  See section 27.9 of the automake info
    113113# page, "Handling Tools that Produce many Outputs".
    114 $(mach_user_srcs): $(mach_defs)
     114$(abs_builddir)/m_mach:
     115        mkdir -p $@
     116$(mach_user_srcs): $(mach_defs) $(abs_builddir)/m_mach
    115117        (cd m_mach && mig $(mach_defs))
    116 $(mach_hdrs): $(mach_defs) $(mach_user_srcs)
     118$(mach_hdrs): $(mach_defs) $(mach_user_srcs) $(abs_builddir)/m_mach
    117119        (cd m_mach && mig $(mach_defs))
    118120
    119121#----------------------------------------------------------------------------