]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for various aio_*() syscalls on Darwin. With them, Quicktime
authorNicholas Nethercote <njn@valgrind.org>
Wed, 24 Jun 2009 06:25:36 +0000 (06:25 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 24 Jun 2009 06:25:36 +0000 (06:25 +0000)
runs, albeit incredibly slowly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10371

coregrind/m_syswrap/priv_syswrap-darwin.h
coregrind/m_syswrap/syswrap-darwin.c
include/vki/vki-darwin.h
memcheck/tests/darwin/scalar.c
memcheck/tests/darwin/scalar.stderr.exp

index 840fd08193d1265c4755fd963611ff944523bd36..0803a43ca06eaba60e417fc9d522decf54b4f2bb 100644 (file)
@@ -369,12 +369,12 @@ DECL_TEMPLATE(darwin, settid);                  // 285
 // NYI settid_with_pid 311
 // NYI __pthread_cond_timedwait 312
 // NYI aio_fsync 313
-// NYI aio_return 314
-// NYI aio_suspend 315
+DECL_TEMPLATE(darwin, aio_return);             // 314
+DECL_TEMPLATE(darwin, aio_suspend);            // 315
 // NYI aio_cancel 316
-// NYI aio_error 317
-// NYI aio_read 318
-// NYI aio_write 319
+DECL_TEMPLATE(darwin, aio_error);              // 317
+DECL_TEMPLATE(darwin, aio_read);               // 318
+DECL_TEMPLATE(darwin, aio_write);              // 319
 // NYI lio_listio 320
 // NYI __pthread_cond_wait 321
 // NYI iopolicysys 322
index 3bdc01a676003e594e0b75733ce3e171d4ab0a88..147e34b7ad4c8f5c0d4498a4bcb9b76cf223d9b5 100644 (file)
@@ -3355,6 +3355,51 @@ PRE(sigsuspend)
 }
 
 
+PRE(aio_return)
+{
+   // This assumes that the kernel looks at the struct pointer, but not the
+   // contents of the struct.
+   PRINT( "aio_return ( %#lx )", ARG1 );
+   PRE_REG_READ1(long, "aio_return", struct vki_aiocb*, aiocbp);
+}
+
+PRE(aio_suspend)
+{
+   // This assumes that the kernel looks at the struct pointers in the list,
+   // but not the contents of the structs.
+   PRINT( "aio_suspend ( %#lx )", ARG1 );
+   PRE_REG_READ3(long, "aio_suspend",
+                 const struct vki_aiocb *, aiocbp, int, nent,
+                 const struct vki_timespec *, timeout);
+   if (ARG2 > 0)
+      PRE_MEM_READ("aio_suspend(list)", ARG1, ARG2 * sizeof(struct vki_aiocb *));
+   if (ARG3)
+      PRE_MEM_READ ("aio_suspend(timeout)", ARG3, sizeof(struct vki_timespec));
+}
+
+PRE(aio_error)
+{
+   // This assumes that the kernel looks at the struct pointer, but not the
+   // contents of the struct.
+   PRINT( "aio_error ( %#lx )", ARG1 );
+   PRE_REG_READ1(long, "aio_error", struct vki_aiocb*, aiocbp);
+}
+
+PRE(aio_read)
+{
+   PRINT( "aio_read ( %#lx )", ARG1 );
+   PRE_REG_READ1(long, "aio_read", struct vki_aiocb*, aiocbp);
+   PRE_MEM_READ( "aio_read(aiocbp)", ARG1, sizeof(struct vki_aiocb));
+}
+
+PRE(aio_write)
+{
+   PRINT( "aio_write ( %#lx )", ARG1 );
+   PRE_REG_READ1(long, "aio_write", struct vki_aiocb*, aiocbp);
+   PRE_MEM_READ( "aio_write(aiocbp)", ARG1, sizeof(struct vki_aiocb));
+}
+
+
 /* ---------------------------------------------------------------------
    mach_msg: formatted messages
    ------------------------------------------------------------------ */
@@ -7300,12 +7345,12 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 // _____(__NR_settid_with_pid), 
 // _____(__NR___pthread_cond_timedwait), 
 // _____(__NR_aio_fsync), 
-// _____(__NR_aio_return), 
-// _____(__NR_aio_suspend), 
+   MACX_(__NR_aio_return,     aio_return), 
+   MACX_(__NR_aio_suspend,    aio_suspend), 
 // _____(__NR_aio_cancel), 
-// _____(__NR_aio_error), 
-// _____(__NR_aio_read), 
-// _____(__NR_aio_write), 
+   MACX_(__NR_aio_error,      aio_error), 
+   MACX_(__NR_aio_read,       aio_read), 
+   MACX_(__NR_aio_write,      aio_write), 
 // _____(__NR_lio_listio),   // 320
 // _____(__NR___pthread_cond_wait), 
 // _____(__NR_iopolicysys), 
index cf5e5422b5bab285172f05906d99217a6fdce256..e65881d81ab13efa320d67b1e793bdf92206d06f 100644 (file)
@@ -1020,4 +1020,8 @@ struct ByteRangeLockPB2
 #define        VKI_A_SETKAUDIT A_SETKAUDIT     
 
 
+#include <sys/aio.h>
+
+#define vki_aiocb aiocb
+
 #endif
index 6c43caf9843df170e238739ede0227804b667f94..6015bbfd21a94ec0d59c06d3b5786a49a1719878 100644 (file)
@@ -537,12 +537,24 @@ int main(void)
    // __NR_settid_with_pid 311
    // __NR___pthread_cond_timedwait 312
    // __NR_aio_fsync 313
-   // __NR_aio_return 314
-   // __NR_aio_suspend 315
+
+   GO(__NR_aio_return, 314, "1s 0m");
+   SY(__NR_aio_return, x0); FAIL;
+
+   GO(__NR_aio_suspend, 315, "1s 0m");
+   SY(__NR_aio_suspend, x0, x0+1, x0); FAIL;
+
    // __NR_aio_cancel 316
-   // __NR_aio_error 317
-   // __NR_aio_read 318
-   // __NR_aio_write 319
+
+   GO(__NR_aio_error, 317, "1s 0m");
+   SY(__NR_aio_error, x0); FAIL;
+
+   GO(__NR_aio_read, 318, "1s 1m");
+   SY(__NR_aio_read, x0); FAIL;
+
+   GO(__NR_aio_write, 319, "1s 1m");
+   SY(__NR_aio_write, x0); FAIL;
+
    // __NR_lio_listio 320
    // __NR___pthread_cond_wait 321
    // __NR_iopolicysys 322
index 89f0580b8207564e5d3dca7da7145dedce07d2fe..904777f7e07611fea7ba548399335828e167b800 100644 (file)
@@ -688,6 +688,54 @@ Syscall param lstat_extended(fsacl) points to unaddressable byte(s)
 (300):           old shared_region_make_private_np
 -----------------------------------------------------
 -----------------------------------------------------
+x200013a(314):     __NR_aio_return 1s 0m
+-----------------------------------------------------
+
+Syscall param aio_return(aiocbp) contains uninitialised byte(s)
+   ...
+-----------------------------------------------------
+x200013b(315):    __NR_aio_suspend 1s 0m
+-----------------------------------------------------
+
+Syscall param aio_suspend(aiocbp) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_suspend(nent) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_suspend(timeout) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_suspend(list) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
+x200013d(317):      __NR_aio_error 1s 0m
+-----------------------------------------------------
+
+Syscall param aio_error(aiocbp) contains uninitialised byte(s)
+   ...
+-----------------------------------------------------
+x200013e(318):       __NR_aio_read 1s 1m
+-----------------------------------------------------
+
+Syscall param aio_read(aiocbp) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_read(aiocbp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
+x200013f(319):      __NR_aio_write 1s 1m
+-----------------------------------------------------
+
+Syscall param aio_write(aiocbp) contains uninitialised byte(s)
+   ...
+
+Syscall param aio_write(aiocbp) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
 (323):           unused
 -----------------------------------------------------
 -----------------------------------------------------