Int i;
vg_assert(set != NULL);
for (i = 0; i < _VKI_NSIG_WORDS; i++)
- if (set->sig[i] != (UInt)(~0x0)) return False;
+ if (set->sig[i] != (UWord)(~0x0)) return False;
return True;
}
/* The functions sigaction, sigprocmask, sigpending and sigsuspend
return 0 on success and -1 on error.
*/
-Int VG_(sigprocmask)( Int how,
- const vki_sigset_t* set,
- vki_sigset_t* oldset)
+Int VG_(sigprocmask)( Int how, const vki_sigset_t* set, vki_sigset_t* oldset)
{
Int res
= VG_(do_syscall)(__NR_rt_sigprocmask,
- how, (UInt)set, (UInt)oldset,
+ how, (UWord)set, (UWord)oldset,
_VKI_NSIG_WORDS * sizeof(UWord));
return VG_(is_kerror)(res) ? -1 : 0;
}
-Int VG_(sigaction) ( Int signum,
- const struct vki_sigaction* act,
- struct vki_sigaction* oldact)
+Int VG_(sigaction) ( Int signum, const struct vki_sigaction* act,
+ struct vki_sigaction* oldact)
{
Int res
= VG_(do_syscall)(__NR_rt_sigaction,
- signum, (UInt)act, (UInt)oldact,
+ signum, (UWord)act, (UWord)oldact,
_VKI_NSIG_WORDS * sizeof(UWord));
/* VG_(printf)("res = %d\n",res); */
return VG_(is_kerror)(res) ? -1 : 0;
res = VG_(sigemptyset)( &sa.sa_mask );
vg_assert(res == 0);
res = VG_(do_syscall)(__NR_rt_sigaction,
- signum, (UInt)(&sa), (UInt)NULL,
+ signum, (UWord)&sa, (UWord)NULL,
_VKI_NSIG_WORDS * sizeof(UWord));
return VG_(is_kerror)(res) ? -1 : 0;
}
send('0');
send('x');
ret += myvprintf_int64(send, flags, 16, width,
- (ULong)((UInt)va_arg (vargs, void *)));
+ (ULong)((UWord)va_arg (vargs, void *)));
break;
case 'x': /* %x */
if (is_long)
argv[3] = 0;
(void)VG_(do_syscall)(__NR_execve,
- (UInt)"/bin/sh", (UInt)argv, (UInt)envp);
+ (UWord)"/bin/sh", (UWord)argv, (UWord)envp);
/* If we're still alive here, execve failed. */
VG_(exit)(1);
if (p != ((void*)(-1))) {
vg_assert((void*)VG_(valgrind_base) <= p && p <= (void*)VG_(valgrind_last));
- tot_alloc += (UInt)nBytes;
+ tot_alloc += nBytes;
if (0)
VG_(printf)(
"get_memory_from_mmap: %llu tot, %llu req = %p .. %p, caller %s\n",
/* int sched_setscheduler(pid_t pid, int policy,
const struct sched_param *p); */
MAYBE_PRINTF("sched_setscheduler ( %d, %d, %p )\n",arg1,arg2,arg3);
- if (arg3 != (UInt)NULL)
+ if (arg3 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid,
"sched_setscheduler(struct sched_param *p)",
arg3, sizeof(struct vki_sched_param));
/* ssize_t sendfile(int out_fd, int in_fd, off_t *offset,
size_t count) */
MAYBE_PRINTF("sendfile ( %d, %d, %p, %llu )\n",arg1,arg2,arg3,(ULong)arg4);
- if (arg3 != (UInt)NULL)
+ if (arg3 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_write, tid, "sendfile(offset)",
arg3, sizeof(vki_off_t) );
}
/* ssize_t sendfile64(int out_df, int in_fd, loff_t *offset,
size_t count); */
MAYBE_PRINTF("sendfile64 ( %d, %d, %p, %llu )\n",arg1,arg2,arg3,(ULong)arg4);
- if (arg3 != (UInt)NULL)
+ if (arg3 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_write, tid, "sendfile64(offset)",
arg3, sizeof(vki_loff_t) );
}
POST(sendfile64)
{
- if (arg3 != (UInt)NULL ) {
+ if (arg3 != (UWord)NULL ) {
VG_TRACK( post_mem_write, arg3, sizeof(vki_loff_t) );
}
}
MAYBE_PRINTF("execve ( %p(%s), %p, %p )\n", arg1, arg1, arg2, arg3);
SYSCALL_TRACK( pre_mem_read_asciiz, tid, "execve(filename)", arg1 );
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
pre_argv_envp( arg2, tid, "execve(argv)", "execve(argv[i])" );
- if (arg3 != (UInt)NULL)
+ if (arg3 != (UWord)NULL)
pre_argv_envp( arg3, tid, "execve(envp)", "execve(envp[i])" );
/* Erk. If the exec fails, then the following will have made a
case 4: /* IPCOP_semtimedop */
SYSCALL_TRACK( pre_mem_read, tid, "semtimedop(sops)", arg5,
arg3 * sizeof(struct vki_sembuf) );
- if (arg6 != (UInt)NULL)
+ if (arg6 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "semtimedop(timeout)", arg6,
sizeof(struct vki_timespec) );
tst->sys_flags |= MayBlock;
// buf pointer only needs to be readable
struct vki_ifconf *ifc = (struct vki_ifconf *) arg3;
SYSCALL_TRACK( pre_mem_write,tid, "ioctl(SIOCGIFCONF).ifc_buf",
- (Addr)(ifc->vki_ifc_buf), (UInt)(ifc->ifc_len) );
+ (Addr)(ifc->vki_ifc_buf), ifc->ifc_len );
}
break;
case VKI_SIOCGSTAMP:
/* ToDo: don't do any of the following if the structure is invalid */
struct vki_cdrom_read_audio *cra = (struct vki_cdrom_read_audio *) arg3;
SYSCALL_TRACK( pre_mem_write, tid, "ioctl(CDROMREADAUDIO).buf",
- (Addr)(cra->buf),
- (UInt)(cra->nframes * VKI_CD_FRAMESIZE_RAW));
+ (Addr)cra->buf, cra->nframes * VKI_CD_FRAMESIZE_RAW);
}
break;
case VKI_CDROMPLAYMSF:
if (res == 0 && arg3 ) {
struct vki_ifconf *ifc = (struct vki_ifconf *) arg3;
if (ifc->vki_ifc_buf != NULL)
- VG_TRACK( post_mem_write, (Addr)(ifc->vki_ifc_buf),
- (UInt)(ifc->ifc_len) );
+ VG_TRACK( post_mem_write, (Addr)(ifc->vki_ifc_buf), ifc->ifc_len );
}
break;
case VKI_SIOCGSTAMP:
{
struct vki_cdrom_read_audio *cra = (struct vki_cdrom_read_audio *) arg3;
VG_TRACK( post_mem_write, (Addr)(cra->buf),
- (UInt)(cra->nframes * VKI_CD_FRAMESIZE_RAW));
+ cra->nframes * VKI_CD_FRAMESIZE_RAW);
break;
}
MAYBE_PRINTF("nanosleep ( %p, %p )\n", arg1,arg2);
SYSCALL_TRACK( pre_mem_read, tid, "nanosleep(req)", arg1,
sizeof(struct vki_timespec) );
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_write, tid, "nanosleep(rem)", arg2,
sizeof(struct vki_timespec) );
}
POST(nanosleep)
{
- if (arg2 != (UInt)NULL && res == -VKI_EINTR)
+ if (arg2 != (UWord)NULL && res == -VKI_EINTR)
VG_TRACK( post_mem_write, arg2, sizeof(struct vki_timespec) );
}
case VKI_SYS_RECV:
if (res >= 0
- && ((UInt*)arg2)[1] != (UInt)NULL) {
+ && ((UInt*)arg2)[1] != (UWord)NULL) {
VG_TRACK( post_mem_write, ((UInt*)arg2)[1], /* buf */
((UInt*)arg2)[2] /* len */ );
}
{
/* time_t time(time_t *t); */
MAYBE_PRINTF("time ( %p )\n",arg1);
- if (arg1 != (UInt)NULL) {
+ if (arg1 != (UWord)NULL) {
SYSCALL_TRACK( pre_mem_write, tid, "time", arg1, sizeof(vki_time_t) );
}
}
POST(time)
{
- if (arg1 != (UInt)NULL) {
+ if (arg1 != (UWord)NULL) {
VG_TRACK( post_mem_write, arg1, sizeof(vki_time_t) );
}
}
POST(times)
{
- if (arg1 != (UInt)NULL) {
+ if (arg1 != (UWord)NULL) {
VG_TRACK( post_mem_write, arg1, sizeof(struct vki_tms) );
}
}
POST(uname)
{
- if (arg1 != (UInt)NULL) {
+ if (arg1 != (UWord)NULL) {
VG_TRACK( post_mem_write, arg1, sizeof(struct vki_new_utsname) );
}
}
/* int utime(const char *filename, struct utimbuf *buf); */
MAYBE_PRINTF("utime ( %p, %p )\n", arg1,arg2);
SYSCALL_TRACK( pre_mem_read_asciiz, tid, "utime(filename)", arg1 );
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "utime(buf)", arg2,
sizeof(struct vki_utimbuf) );
}
/* int utimes(const char *filename, struct timeval *tvp); */
MAYBE_PRINTF("utimes ( %p, %p )\n", arg1,arg2);
SYSCALL_TRACK( pre_mem_read_asciiz, tid, "utimes(filename)", arg1 );
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "utimes(tvp)", arg2,
sizeof(struct vki_timeval) );
}
/* int futex(void *futex, int op, int val, const struct timespec *timeout); */
MAYBE_PRINTF("futex ( %p, %d, %d, %p, %p )\n", arg1,arg2,arg3,arg4,arg5);
SYSCALL_TRACK( pre_mem_read, tid, "futex(futex)", arg1, sizeof(int) );
- if (arg2 == VKI_FUTEX_WAIT && arg4 != (UInt)NULL)
+ if (arg2 == VKI_FUTEX_WAIT && arg4 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "futex(timeout)", arg4,
sizeof(struct vki_timespec) );
if (arg2 == VKI_FUTEX_REQUEUE)
/* int sigtimedwait(const sigset_t *set, siginfo_t *info,
const struct timespec timeout); */
MAYBE_PRINTF("sigtimedwait ( %p, %p, timeout )\n", arg1, arg2);
- if (arg1 != (UInt)NULL)
+ if (arg1 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "sigtimedwait(set)", arg1,
sizeof(vki_sigset_t));
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_write, tid, "sigtimedwait(info)", arg2,
sizeof(vki_siginfo_t) );
}
POST(rt_sigtimedwait)
{
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
VG_TRACK( post_mem_write, arg2, sizeof(vki_siginfo_t) );
}
{
/* long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo) */
MAYBE_PRINTF("rt_sigqueueinfo(%d, %d, %p)\n", arg1, arg2, arg3);
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "sigqueueinfo(uinfo)", arg3,
sizeof(vki_siginfo_t) );
}
{
/* int sigaltstack(const stack_t *ss, stack_t *oss); */
MAYBE_PRINTF("sigaltstack ( %p, %p )\n",arg1,arg2);
- if (arg1 != (UInt)NULL) {
+ if (arg1 != (UWord)NULL) {
SYSCALL_TRACK( pre_mem_read, tid, "sigaltstack(ss)",
arg1, sizeof(vki_stack_t) );
}
- if (arg2 != (UInt)NULL) {
+ if (arg2 != (UWord)NULL) {
SYSCALL_TRACK( pre_mem_write, tid, "sigaltstack(oss)",
arg2, sizeof(vki_stack_t) );
}
POST(sigaltstack)
{
- if (res == 0 && arg2 != (UInt)NULL)
+ if (res == 0 && arg2 != (UWord)NULL)
VG_TRACK( post_mem_write, arg2, sizeof(vki_stack_t));
}
/* int sigaction(int signum, struct k_sigaction *act,
struct k_sigaction *oldact); */
MAYBE_PRINTF("sigaction ( %d, %p, %p )\n",arg1,arg2,arg3);
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "sigaction(act)",
arg2, sizeof(struct vki_sigaction));
- if (arg3 != (UInt)NULL)
+ if (arg3 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_write, tid, "sigaction(oldact)",
arg3, sizeof(struct vki_sigaction));
POST(sigaction)
{
- if (res == 0 && arg3 != (UInt)NULL)
+ if (res == 0 && arg3 != (UWord)NULL)
VG_TRACK( post_mem_write, arg3, sizeof(struct vki_sigaction));
}
/* int sigprocmask(int how, k_sigset_t *set,
k_sigset_t *oldset); */
MAYBE_PRINTF("sigprocmask ( %d, %p, %p )\n",arg1,arg2,arg3);
- if (arg2 != (UInt)NULL)
+ if (arg2 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "sigprocmask(set)",
arg2, sizeof(vki_sigset_t));
- if (arg3 != (UInt)NULL)
+ if (arg3 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_write, tid, "sigprocmask(oldset)",
arg3, sizeof(vki_sigset_t));
POST(sigprocmask)
{
- if (res == 0 && arg3 != (UInt)NULL)
+ if (res == 0 && arg3 != (UWord)NULL)
VG_TRACK( post_mem_write, arg3, sizeof(vki_sigset_t));
}
if (arg3 > 0)
SYSCALL_TRACK( pre_mem_write, tid, "io_getevents(events)",
arg4, sizeof(struct vki_io_event)*arg3 );
- if (arg5 != (UInt)NULL)
+ if (arg5 != (UWord)NULL)
SYSCALL_TRACK( pre_mem_read, tid, "io_getevents(timeout)",
arg5, sizeof(struct vki_timespec));
}
VG_TRACK( post_mem_write, arg4, sizeof(struct vki_io_event)*res );
for (i = 0; i < res; i++) {
const struct vki_io_event *vev = ((struct vki_io_event *)arg4) + i;
- const struct vki_iocb *cb = (struct vki_iocb *)(UInt)vev->obj;
+ const struct vki_iocb *cb = (struct vki_iocb *)(Addr)vev->obj;
switch (cb->aio_lio_opcode) {
case VKI_IOCB_CMD_PREAD: