From: Julian Seward Date: Sat, 18 May 2002 13:24:24 +0000 (+0000) Subject: Add getpmsg/putpmsg (Rick Watson) X-Git-Tag: svn/VALGRIND_1_0_3~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12f3df8548ab950016deb6e5c167e79c23244b14;p=thirdparty%2Fvalgrind.git Add getpmsg/putpmsg (Rick Watson) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@292 --- diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c index ac681c08e8..04ec13fd91 100644 --- a/vg_syscall_mem.c +++ b/vg_syscall_mem.c @@ -422,6 +422,77 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) /* !!!!!!!!!! New, untested syscalls !!!!!!!!!!!!!!!!!!!!! */ +# if defined(__NR_getpmsg) /* syscall 188 */ + case __NR_getpmsg: + { + /* LiS getpmsg from http://www.gcom.com/home/linux/lis/ */ + /* int getpmsg(int fd, struct strbuf *ctrl, struct strbuf *data, + int *bandp, int *flagsp); */ + struct strbuf { + int maxlen; /* no. of bytes in buffer */ + int len; /* no. of bytes returned */ + caddr_t buf; /* pointer to data */ + }; + struct strbuf *ctrl; + struct strbuf *data; + if (VG_(clo_trace_syscalls)) + VG_(printf)("getpmsg ( %d, %p, %p, %p, %p )\n", + arg1,arg2,arg3,arg4,arg5); + ctrl = (struct strbuf *)arg2; + data = (struct strbuf *)arg3; + if (ctrl && ctrl->maxlen > 0) + must_be_writable(tst, "getpmsg(ctrl)", + (UInt)ctrl->buf, ctrl->maxlen); + if (data && data->maxlen > 0) + must_be_writable(tst, "getpmsg(data)", + (UInt)data->buf, data->maxlen); + if (arg4) + must_be_writable(tst, "getpmsg(bandp)", + (UInt)arg4, sizeof(int)); + if (arg5) + must_be_writable(tst, "getpmsg(flagsp)", + (UInt)arg5, sizeof(int)); + KERNEL_DO_SYSCALL(tid,res); + if (!VG_(is_kerror)(res) && res == 0 && ctrl && ctrl->len > 0) { + make_readable( (UInt)ctrl->buf, ctrl->len); + } + if (!VG_(is_kerror)(res) && res == 0 && data && data->len > 0) { + make_readable( (UInt)data->buf, data->len); + } + } + break; +# endif + + +# if defined(__NR_putpmsg) /* syscall 189 */ + case __NR_putpmsg: + { + /* LiS putpmsg from http://www.gcom.com/home/linux/lis/ */ + /* int putpmsg(int fd, struct strbuf *ctrl, struct strbuf *data, + int band, int flags); */ + struct strbuf { + int maxlen; /* no. of bytes in buffer */ + int len; /* no. of bytes returned */ + caddr_t buf; /* pointer to data */ + }; + struct strbuf *ctrl; + struct strbuf *data; + if (VG_(clo_trace_syscalls)) + VG_(printf)("putpmsg ( %d, %p, %p, %d, %d )\n", + arg1,arg2,arg3,arg4,arg5); + ctrl = (struct strbuf *)arg2; + data = (struct strbuf *)arg3; + if (ctrl && ctrl->len > 0) + must_be_readable(tst, "putpmsg(ctrl)", + (UInt)ctrl->buf, ctrl->len); + if (data && data->len > 0) + must_be_readable(tst, "putpmsg(data)", + (UInt)data->buf, data->len); + KERNEL_DO_SYSCALL(tid,res); + } + break; +# endif + case __NR_getitimer: /* syscall 105 */ /* int getitimer(int which, struct itimerval *value); */ if (VG_(clo_trace_syscalls))