Date: Thu, 23 Oct 2008 06:25:37 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 151783 for review Message-ID: <200810230625.m9N6PbAI058276@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=151783 Change 151783 by peter@peter_cheese on 2008/10/23 06:25:33 Checkpoint catchup to 3.3.2 Affected files ... .. //depot/projects/valgrind/coregrind/m_debugger.c#3 edit .. //depot/projects/valgrind/coregrind/m_libcfile.c#4 edit .. //depot/projects/valgrind/coregrind/m_libcproc.c#4 edit .. //depot/projects/valgrind/coregrind/m_libcsignal.c#4 edit .. //depot/projects/valgrind/coregrind/pub_core_machine.h#3 edit .. //depot/projects/valgrind/include/pub_tool_machine.h#3 edit .. //depot/projects/valgrind/include/vki/vki-freebsd.h#3 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_debugger.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ - + /*--------------------------------------------------------------------*/ /*--- Attaching a debugger. m_debugger.c ---*/ /*--------------------------------------------------------------------*/ @@ -211,6 +211,9 @@ #elif defined(VGP_ppc64_aix5) I_die_here; +#elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) + I_die_here; + #else # error Unknown arch #endif ==== //depot/projects/valgrind/coregrind/m_libcfile.c#4 (text+ko) ==== @@ -227,6 +227,13 @@ TRANSLATE_TO_vg_stat(vgbuf, &buf); return res; } +# elif defined(VGO_freebsd) + { struct vki_stat buf; + res = VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)&buf); + if (!res.isError) + TRANSLATE_TO_vg_stat(vgbuf, &buf); + return res; + } # elif defined(VGO_aix5) { struct vki_stat buf; res = VG_(do_syscall4)(__NR_AIX5_statx, @@ -272,6 +279,13 @@ TRANSLATE_TO_vg_stat(vgbuf, &buf); return res.isError ? (-1) : 0; } +# elif defined(VGO_freebsd) + { struct vki_stat buf; + res = VG_(do_syscall2)(__NR_fstat, (UWord)fd, (UWord)&buf); + if (!res.isError) + TRANSLATE_TO_vg_stat(vgbuf, &buf); + return res.isError ? (-1) : 0; + } # elif defined(VGO_aix5) I_die_here; # else @@ -306,6 +320,8 @@ { # if defined(VGO_linux) return VG_(do_syscall2)(__NR_dup2, oldfd, newfd); +# elif defined(VGO_freebsd) + return VG_(do_syscall2)(__NR_dup2, oldfd, newfd); # elif defined(VGO_aix5) I_die_here; # else @@ -383,11 +399,20 @@ return True; } # elif defined(VGO_freebsd) - res = VG_(do_syscall2)(__NR___getcwd, (UWord)buf, size); + /* Simple: just ask the kernel */ + { SysRes res + = VG_(do_syscall2)(__NR___getcwd, (UWord)startup_wd, szB-1); + vg_assert(startup_wd[szB-1] == 0); + if (res.isError) { + return False; + } else { + startup_wd_acquired = True; + return True; + } + } # else # error Unknown OS # endif -#endif } /* Copy the previously acquired startup_wd into buf[0 .. size-1], ==== //depot/projects/valgrind/coregrind/m_libcproc.c#4 (text+ko) ==== @@ -228,7 +228,7 @@ Int VG_(waitpid)(Int pid, Int *status, Int options) { -# if defined(VGO_linux) +# if defined(VGO_linux) || defined(VGO_freebsd) SysRes res = VG_(do_syscall4)(__NR_wait4, pid, (UWord)status, options, 0); return res.isError ? -1 : res.res; # elif defined(VGO_aix5) @@ -372,7 +372,7 @@ Int VG_(gettid)(void) { // VG_(printf)("valgrind: gettid() faked\n"); - return VG_(do_syscall0)(__NR_getpid) . val; + return VG_(do_syscall0)(__NR_getpid).res; } #else Int VG_(gettid)(void) @@ -653,7 +653,7 @@ res = VG_(do_syscall6)(__NR___sysctl, (UWord)name, namelen, (UWord)oldp, (UWord)oldlenp, (UWord)newp, newlen); if (res.isError) return -1; - return res.val; + return res.res; } Int VG_(sysctlbyname)(const Char *name, void *oldp, vki_size_t *oldlenp, void *newp, vki_size_t newlen) @@ -681,7 +681,7 @@ res = VG_(do_syscall1)(__NR_modfind, (UWord)modname); if (res.isError) return -1; - return res.val; + return res.res; } #endif ==== //depot/projects/valgrind/coregrind/m_libcsignal.c#4 (text+ko) ==== @@ -234,7 +234,7 @@ static const struct vki_timespec zero = { 0, 0 }; /* only on freebsd6.x and higher */ SysRes res = VG_(do_syscall3)(__NR_sigtimedwait, (UWord)set, (UWord)info, - (UWord)timeout); + (UWord)&zero); return res.isError ? -1 : res.res; } #elif defined(VGO_aix5) || (defined(VGO_freebsd) && __FreeBSD__ < 6) ==== //depot/projects/valgrind/coregrind/pub_core_machine.h#3 (text+ko) ==== @@ -39,12 +39,12 @@ #include "pub_tool_machine.h" -#if defined(VGP_x86_linux) +#if defined(VGP_x86_linux) || defined(VGP_x86_freebsd) # define VG_ELF_DATA2XXX ELFDATA2LSB # define VG_ELF_MACHINE EM_386 # define VG_ELF_CLASS ELFCLASS32 # undef VG_PLAT_USES_PPCTOC -#elif defined(VGP_amd64_linux) +#elif defined(VGP_amd64_linux) || defined(VGP_amd64_freebsd) # define VG_ELF_DATA2XXX ELFDATA2LSB # define VG_ELF_MACHINE EM_X86_64 # define VG_ELF_CLASS ELFCLASS64 ==== //depot/projects/valgrind/include/pub_tool_machine.h#3 (text+ko) ==== @@ -31,13 +31,13 @@ #ifndef __PUB_TOOL_MACHINE_H #define __PUB_TOOL_MACHINE_H -#if defined(VGP_x86_linux) +#if defined(VGP_x86_linux) || defined(VGP_x86_freebsd) # define VG_MIN_INSTR_SZB 1 // min length of native instruction # define VG_MAX_INSTR_SZB 16 // max length of native instruction # define VG_CLREQ_SZB 14 // length of a client request, may // be larger than VG_MAX_INSTR_SZB # define VG_STACK_REDZONE_SZB 0 // number of addressable bytes below %RSP -#elif defined(VGP_amd64_linux) +#elif defined(VGP_amd64_linux) || defined(VGP_amd64_freebsd) # define VG_MIN_INSTR_SZB 1 # define VG_MAX_INSTR_SZB 16 # define VG_CLREQ_SZB 19 ==== //depot/projects/valgrind/include/vki/vki-freebsd.h#3 (text+ko) ==== @@ -255,6 +255,11 @@ // From sys/time.h //---------------------------------------------------------------------- +#define VKI_CLOCK_REALTIME 0 +#define VKI_CLOCK_MONOTONIC 1 +#define VKI_CLOCK_PROCESS_CPUTIME_ID 2 +#define VKI_CLOCK_THREAD_CPUTIME_ID 3 + struct vki_timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ @@ -336,9 +341,18 @@ vki_uid_t st_uid; vki_gid_t st_gid; vki_dev_t st_rdev; +#if 0 struct vki_timespec st_atimespec; struct vki_timespec st_mtimespec; struct vki_timespec st_ctimespec; +#else + vki_time_t st_atime; + long st_atime_nsec; + vki_time_t st_mtime; + long st_mtime_nsec; + vki_time_t st_ctime; + long st_ctime_nsec; +#endif vki_off_t st_size; vki_blkcnt_t st_blocks; vki_blksize_t st_blksize;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810230625.m9N6PbAI058276>