}
static void
-exitFutexWake(ThreadContext *tc, Addr addr, uint64_t tgid)
+exitFutexWake(ThreadContext *tc, VPtr<> addr, uint64_t tgid)
{
// Clear value at address pointed to by thread's childClearTID field.
BufferArg ctidBuf(addr, sizeof(long));
SyscallReturn
-brkFunc(SyscallDesc *desc, ThreadContext *tc, Addr new_brk)
+brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
{
// change brk addr to first arg
auto p = tc->getProcessPtr();
SyscallReturn
_llseekFunc(SyscallDesc *desc, ThreadContext *tc,
int tgt_fd, uint64_t offset_high, uint32_t offset_low,
- Addr result_ptr, int whence)
+ VPtr<> result_ptr, int whence)
{
auto p = tc->getProcessPtr();
SyscallReturn
-munmapFunc(SyscallDesc *desc, ThreadContext *tc, Addr start, size_t length)
+munmapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start, size_t length)
{
// Even if the system is currently not capable of recycling physical
// pages, there is no reason we can't unmap them so that we trigger
SyscallReturn
gethostnameFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr buf_ptr, int name_len)
+ VPtr<> buf_ptr, int name_len)
{
BufferArg name(buf_ptr, name_len);
strncpy((char *)name.bufferPtr(), hostname, name_len);
SyscallReturn
getcwdFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr buf_ptr, unsigned long size)
+ VPtr<> buf_ptr, unsigned long size)
{
int result = 0;
auto p = tc->getProcessPtr();
SyscallReturn
readlinkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr buf_ptr, size_t bufsiz)
+ VPtr<> pathname, VPtr<> buf_ptr, size_t bufsiz)
{
std::string path;
auto p = tc->getProcessPtr();
}
SyscallReturn
-unlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname)
+unlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
{
std::string path;
auto p = tc->getProcessPtr();
SyscallReturn
linkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr new_pathname)
+ VPtr<> pathname, VPtr<> new_pathname)
{
std::string path;
std::string new_path;
SyscallReturn
symlinkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr new_pathname)
+ VPtr<> pathname, VPtr<> new_pathname)
{
std::string path;
std::string new_path;
}
SyscallReturn
-mkdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, mode_t mode)
+mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
{
auto p = tc->getProcessPtr();
std::string path;
}
SyscallReturn
-renameFunc(SyscallDesc *desc, ThreadContext *tc, Addr oldpath, Addr newpath)
+renameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> oldpath,
+ VPtr<> newpath)
{
auto p = tc->getProcessPtr();
}
SyscallReturn
-truncateFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, off_t length)
+truncateFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname,
+ off_t length)
{
std::string path;
auto p = tc->getProcessPtr();
SyscallReturn
truncate64Func(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, int64_t length)
+ VPtr<> pathname, int64_t length)
{
auto process = tc->getProcessPtr();
std::string path;
SyscallReturn
chownFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, uint32_t owner, uint32_t group)
+ VPtr<> pathname, uint32_t owner, uint32_t group)
{
std::string path;
auto p = tc->getProcessPtr();
}
SyscallReturn
-pipeFunc(SyscallDesc *desc, ThreadContext *tc, Addr tgt_addr)
+pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
{
return pipe2Func(desc, tc, tgt_addr, 0);
}
SyscallReturn
-pipe2Func(SyscallDesc *desc, ThreadContext *tc, Addr tgt_addr, int flags)
+pipe2Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr, int flags)
{
auto p = tc->getProcessPtr();
SyscallReturn
accessFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, mode_t mode)
+ VPtr<> pathname, mode_t mode)
{
std::string path;
auto p = tc->getProcessPtr();
SyscallReturn
mknodFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, mode_t mode, dev_t dev)
+ VPtr<> pathname, mode_t mode, dev_t dev)
{
auto p = tc->getProcessPtr();
std::string path;
}
SyscallReturn
-chdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname)
+chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
{
auto p = tc->getProcessPtr();
std::string path;
}
SyscallReturn
-rmdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname)
+rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
{
auto p = tc->getProcessPtr();
std::string path;
template<typename DE, int SYS_NUM>
static SyscallReturn
getdentsImpl(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, unsigned count)
+ int tgt_fd, VPtr<> buf_ptr, unsigned count)
{
auto p = tc->getProcessPtr();
#if defined(SYS_getdents)
SyscallReturn
getdentsFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, unsigned count)
+ int tgt_fd, VPtr<> buf_ptr, unsigned count)
{
typedef struct linux_dirent {
unsigned long d_ino;
#if defined(SYS_getdents64)
SyscallReturn
getdents64Func(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, unsigned count)
+ int tgt_fd, VPtr<> buf_ptr, unsigned count)
{
typedef struct linux_dirent64 {
ino64_t d_ino;
SyscallReturn
bindFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, int addrlen)
+ int tgt_fd, VPtr<> buf_ptr, int addrlen)
{
auto p = tc->getProcessPtr();
SyscallReturn
connectFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, int addrlen)
+ int tgt_fd, VPtr<> buf_ptr, int addrlen)
{
auto p = tc->getProcessPtr();
SyscallReturn
recvfromFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr bufrPtr, size_t bufrLen, int flags,
- Addr addrPtr, Addr addrlenPtr)
+ int tgt_fd, VPtr<> bufrPtr, size_t bufrLen, int flags,
+ VPtr<> addrPtr, VPtr<> addrlenPtr)
{
auto p = tc->getProcessPtr();
SyscallReturn
sendtoFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr bufrPtr, size_t bufrLen, int flags,
- Addr addrPtr, socklen_t addrLen)
+ int tgt_fd, VPtr<> bufrPtr, size_t bufrLen, int flags,
+ VPtr<> addrPtr, socklen_t addrLen)
{
auto p = tc->getProcessPtr();
SyscallReturn
recvmsgFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr msgPtr, int flags)
+ int tgt_fd, VPtr<> msgPtr, int flags)
{
auto p = tc->getProcessPtr();
SyscallReturn
sendmsgFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr msgPtr, int flags)
+ int tgt_fd, VPtr<> msgPtr, int flags)
{
auto p = tc->getProcessPtr();
SyscallReturn
getsockoptFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, int level, int optname, Addr valPtr, Addr lenPtr)
+ int tgt_fd, int level, int optname, VPtr<> valPtr,
+ VPtr<> lenPtr)
{
// union of all possible return value types from getsockopt
union val {
SyscallReturn
getsocknameFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr addrPtr, Addr lenPtr)
+ int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
{
auto p = tc->getProcessPtr();
SyscallReturn
getpeernameFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr sockAddrPtr, Addr addrlenPtr)
+ int tgt_fd, VPtr<> sockAddrPtr, VPtr<> addrlenPtr)
{
auto p = tc->getProcessPtr();
SyscallReturn
setsockoptFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, int level, int optname, Addr valPtr, socklen_t len)
+ int tgt_fd, int level, int optname, VPtr<> valPtr,
+ socklen_t len)
{
auto p = tc->getProcessPtr();
SyscallReturn getpagesizeFunc(SyscallDesc *desc, ThreadContext *tc);
/// Target brk() handler: set brk address.
-SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, Addr new_brk);
+SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk);
/// Target close() handler.
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd);
/// Target _llseek() handler.
SyscallReturn _llseekFunc(SyscallDesc *desc, ThreadContext *tc,
int tgt_fd, uint64_t offset_high,
- uint32_t offset_low, Addr result_ptr, int whence);
+ uint32_t offset_low, VPtr<> result_ptr, int whence);
/// Target munmap() handler.
-SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, Addr start,
+SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start,
size_t length);
/// Target shutdown() handler.
/// Target gethostname() handler.
SyscallReturn gethostnameFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr buf_ptr, int name_len);
+ VPtr<> buf_ptr, int name_len);
/// Target getcwd() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr buf_ptr, unsigned long size);
+ VPtr<> buf_ptr, unsigned long size);
/// Target readlink() handler.
SyscallReturn readlinkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr buf, size_t bufsiz);
+ VPtr<> pathname, VPtr<> buf, size_t bufsiz);
/// Target unlink() handler.
-SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname);
+SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc,
+ VPtr<> pathname);
/// Target link() handler
SyscallReturn linkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr new_pathname);
+ VPtr<> pathname, VPtr<> new_pathname);
/// Target symlink() handler.
SyscallReturn symlinkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr new_pathname);
+ VPtr<> pathname, VPtr<> new_pathname);
/// Target mkdir() handler.
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, mode_t mode);
+ VPtr<> pathname, mode_t mode);
/// Target mknod() handler.
SyscallReturn mknodFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, mode_t mode, dev_t dev);
+ VPtr<> pathname, mode_t mode, dev_t dev);
/// Target chdir() handler.
-SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname);
+SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname);
// Target rmdir() handler.
-SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname);
+SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname);
/// Target rename() handler.
SyscallReturn renameFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr oldpath, Addr newpath);
+ VPtr<> oldpath, VPtr<> newpath);
/// Target truncate() handler.
SyscallReturn truncateFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, off_t length);
+ VPtr<> pathname, off_t length);
/// Target ftruncate() handler.
/// Target truncate64() handler.
SyscallReturn truncate64Func(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, int64_t length);
+ VPtr<> pathname, int64_t length);
/// Target ftruncate64() handler.
SyscallReturn ftruncate64Func(SyscallDesc *desc, ThreadContext *tc,
/// Target chown() handler.
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, uint32_t owner, uint32_t group);
+ VPtr<> pathname, uint32_t owner, uint32_t group);
/// Target getpgrpFunc() handler.
SyscallReturn getpgrpFunc(SyscallDesc *desc, ThreadContext *tc);
int tgt_fd, int cmd);
/// Target pipe() handler.
-SyscallReturn pipeFunc(SyscallDesc *desc, ThreadContext *tc, Addr tgt_addr);
+SyscallReturn pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr);
/// Target pipe() handler.
SyscallReturn pipe2Func(SyscallDesc *desc, ThreadContext *tc,
- Addr tgt_addr, int flags);
+ VPtr<> tgt_addr, int flags);
/// Target getpid() handler.
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc);
// Target getpeername() handler.
SyscallReturn getpeernameFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr sockAddrPtr, Addr addrlenPtr);
+ int tgt_fd, VPtr<> sockAddrPtr,
+ VPtr<> addrlenPtr);
// Target bind() handler.
SyscallReturn bindFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, int addrlen);
+ int tgt_fd, VPtr<> buf_ptr, int addrlen);
// Target listen() handler.
SyscallReturn listenFunc(SyscallDesc *desc, ThreadContext *tc,
// Target connect() handler.
SyscallReturn connectFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, int addrlen);
+ int tgt_fd, VPtr<> buf_ptr, int addrlen);
#if defined(SYS_getdents)
// Target getdents() handler.
SyscallReturn getdentsFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, unsigned count);
+ int tgt_fd, VPtr<> buf_ptr, unsigned count);
#endif
#if defined(SYS_getdents64)
// Target getdents() handler.
SyscallReturn getdents64Func(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, unsigned count);
+ int tgt_fd, VPtr<> buf_ptr, unsigned count);
#endif
// Target sendto() handler.
SyscallReturn sendtoFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr bufrPtr, size_t bufrLen, int flags,
- Addr addrPtr, socklen_t addrLen);
+ int tgt_fd, VPtr<> bufrPtr, size_t bufrLen, int flags,
+ VPtr<> addrPtr, socklen_t addrLen);
// Target recvfrom() handler.
SyscallReturn recvfromFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr bufrPtr, size_t bufrLen,
- int flags, Addr addrPtr, Addr addrlenPtr);
+ int tgt_fd, VPtr<> bufrPtr, size_t bufrLen,
+ int flags, VPtr<> addrPtr, VPtr<> addrlenPtr);
// Target recvmsg() handler.
SyscallReturn recvmsgFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr msgPtr, int flags);
+ int tgt_fd, VPtr<> msgPtr, int flags);
// Target sendmsg() handler.
SyscallReturn sendmsgFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr msgPtr, int flags);
+ int tgt_fd, VPtr<> msgPtr, int flags);
// Target getuid() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc);
/// Target access() handler
SyscallReturn accessFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, mode_t mode);
+ VPtr<> pathname, mode_t mode);
// Target getsockopt() handler.
SyscallReturn getsockoptFunc(SyscallDesc *desc, ThreadContext *tc,
int tgt_fd, int level, int optname,
- Addr valPtr, Addr lenPtr);
+ VPtr<> valPtr, VPtr<> lenPtr);
// Target setsockopt() handler.
SyscallReturn setsockoptFunc(SyscallDesc *desc, ThreadContext *tc,
int tgt_fd, int level, int optname,
- Addr valPtr, socklen_t len);
+ VPtr<> valPtr, socklen_t len);
SyscallReturn getcpuFunc(SyscallDesc *desc, ThreadContext *tc,
VPtr<uint32_t> cpu, VPtr<uint32_t> node,
// Target getsockname() handler.
SyscallReturn getsocknameFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr addrPtr, Addr lenPtr);
+ int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr);
/// Futex system call
/// Implemented by Daniel Sanchez
template <class OS>
SyscallReturn
futexFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr uaddr, int op, int val, int timeout, Addr uaddr2, int val3)
+ VPtr<> uaddr, int op, int val, int timeout, VPtr<> uaddr2, int val3)
{
auto process = tc->getProcessPtr();
template <class OS>
SyscallReturn
ioctlFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, unsigned req, Addr addr)
+ int tgt_fd, unsigned req, VPtr<> addr)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
openatFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_dirfd, Addr pathname, int tgt_flags, int mode)
+ int tgt_dirfd, VPtr<> pathname, int tgt_flags, int mode)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
openFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, int tgt_flags, int mode)
+ VPtr<> pathname, int tgt_flags, int mode)
{
return openatFunc<OS>(
desc, tc, OS::TGT_AT_FDCWD, pathname, tgt_flags, mode);
/// Target unlinkat() handler.
template <class OS>
SyscallReturn
-unlinkatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, Addr pathname)
+unlinkatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname)
{
if (dirfd != OS::TGT_AT_FDCWD)
warn("unlinkat: first argument not AT_FDCWD; unlikely to work");
template <class OS>
SyscallReturn
faccessatFunc(SyscallDesc *desc, ThreadContext *tc,
- int dirfd, Addr pathname, int mode)
+ int dirfd, VPtr<> pathname, int mode)
{
if (dirfd != OS::TGT_AT_FDCWD)
warn("faccessat: first argument not AT_FDCWD; unlikely to work");
template <class OS>
SyscallReturn
readlinkatFunc(SyscallDesc *desc, ThreadContext *tc,
- int dirfd, Addr pathname, Addr buf, size_t bufsiz)
+ int dirfd, VPtr<> pathname, VPtr<> buf, size_t bufsiz)
{
if (dirfd != OS::TGT_AT_FDCWD)
warn("openat: first argument not AT_FDCWD; unlikely to work");
template <class OS>
SyscallReturn
renameatFunc(SyscallDesc *desc, ThreadContext *tc,
- int olddirfd, Addr oldpath, int newdirfd, Addr newpath)
+ int olddirfd, VPtr<> oldpath, int newdirfd, VPtr<> newpath)
{
if (olddirfd != OS::TGT_AT_FDCWD)
warn("renameat: first argument not AT_FDCWD; unlikely to work");
/// Target chmod() handler.
template <class OS>
SyscallReturn
-chmodFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, mode_t mode)
+chmodFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
{
std::string path;
auto process = tc->getProcessPtr();
template <class OS>
SyscallReturn
pollFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr fdsPtr, int nfds, int tmout)
+ VPtr<> fdsPtr, int nfds, int tmout)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
mremapFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr start, uint64_t old_length, uint64_t new_length, uint64_t flags,
+ VPtr<> start, uint64_t old_length, uint64_t new_length, uint64_t flags,
GuestABI::VarArgs<uint64_t> varargs)
{
auto p = tc->getProcessPtr();
uint64_t diff = new_length - old_length;
p->memState->mapRegion(mmap_end, diff, "remapped");
p->memState->setMmapEnd(mmap_end + diff);
- return start;
+ return (Addr)start;
} else {
if (!use_provided_address && !(flags & OS::TGT_MREMAP_MAYMOVE)) {
warn("can't remap here and MREMAP_MAYMOVE flag not set\n");
if (new_length != old_length)
p->memState->unmapRegion(start + new_length,
old_length - new_length);
- return use_provided_address ? provided_address : start;
+ return use_provided_address ? provided_address : (Addr)start;
}
}
template <class OS>
SyscallReturn
statFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, VPtr<typename OS::tgt_stat> tgt_stat)
+ VPtr<> pathname, VPtr<typename OS::tgt_stat> tgt_stat)
{
std::string path;
auto process = tc->getProcessPtr();
template <class OS>
SyscallReturn
stat64Func(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, VPtr<typename OS::tgt_stat64> tgt_stat)
+ VPtr<> pathname, VPtr<typename OS::tgt_stat64> tgt_stat)
{
std::string path;
auto process = tc->getProcessPtr();
template <class OS>
SyscallReturn
fstatat64Func(SyscallDesc *desc, ThreadContext *tc,
- int dirfd, Addr pathname, VPtr<typename OS::tgt_stat64> tgt_stat)
+ int dirfd, VPtr<> pathname,
+ VPtr<typename OS::tgt_stat64> tgt_stat)
{
auto process = tc->getProcessPtr();
if (dirfd != OS::TGT_AT_FDCWD)
template <class OS>
SyscallReturn
lstatFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, VPtr<typename OS::tgt_stat> tgt_stat)
+ VPtr<> pathname, VPtr<typename OS::tgt_stat> tgt_stat)
{
std::string path;
auto process = tc->getProcessPtr();
template <class OS>
SyscallReturn
lstat64Func(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, VPtr<typename OS::tgt_stat64> tgt_stat)
+ VPtr<> pathname, VPtr<typename OS::tgt_stat64> tgt_stat)
{
std::string path;
auto process = tc->getProcessPtr();
template <class OS>
SyscallReturn
statfsFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, VPtr<typename OS::tgt_statfs> tgt_stat)
+ VPtr<> pathname, VPtr<typename OS::tgt_statfs> tgt_stat)
{
#if defined(__linux__)
std::string path;
template <class OS>
SyscallReturn
cloneFunc(SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack,
- Addr ptidPtr, Addr ctidPtr, Addr tlsPtr)
+ VPtr<> ptidPtr, VPtr<> ctidPtr, VPtr<> tlsPtr)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
cloneBackwardsFunc(SyscallDesc *desc, ThreadContext *tc, RegVal flags,
- RegVal newStack, Addr ptidPtr, Addr tlsPtr, Addr ctidPtr)
+ RegVal newStack, VPtr<> ptidPtr, VPtr<> tlsPtr,
+ VPtr<> ctidPtr)
{
return cloneFunc<OS>(desc, tc, flags, newStack, ptidPtr, ctidPtr, tlsPtr);
}
template <class OS>
SyscallReturn
mmapFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr start, typename OS::size_t length, int prot,
+ VPtr<> start, typename OS::size_t length, int prot,
int tgt_flags, int tgt_fd, typename OS::off_t offset)
{
auto p = tc->getProcessPtr();
*/
p->memState->mapRegion(start, length, region_name, sim_fd, offset);
- return start;
+ return (Addr)start;
}
template <class OS>
SyscallReturn
pread64Func(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr bufPtr, int nbytes, int offset)
+ int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
pwrite64Func(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr bufPtr, int nbytes, int offset)
+ int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
mmap2Func(SyscallDesc *desc, ThreadContext *tc,
- Addr start, typename OS::size_t length, int prot,
+ VPtr<> start, typename OS::size_t length, int prot,
int tgt_flags, int tgt_fd, typename OS::off_t offset)
{
auto page_size = tc->getProcessPtr()->pTable->pageSize();
template <class OS>
SyscallReturn
prlimitFunc(SyscallDesc *desc, ThreadContext *tc,
- int pid, int resource, Addr n, VPtr<typename OS::rlimit> rlp)
+ int pid, int resource, VPtr<> n, VPtr<typename OS::rlimit> rlp)
{
if (pid != 0) {
warn("prlimit: ignoring rlimits for nonzero pid");
template <class OS>
SyscallReturn
gettimeofdayFunc(SyscallDesc *desc, ThreadContext *tc,
- VPtr<typename OS::timeval> tp, Addr tz_ptr)
+ VPtr<typename OS::timeval> tp, VPtr<> tz_ptr)
{
getElapsedTimeMicro(tp->tv_sec, tp->tv_usec);
tp->tv_sec += seconds_since_epoch;
/// Target utimes() handler.
template <class OS>
SyscallReturn
-utimesFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname,
+utimesFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname,
VPtr<typename OS::timeval [2]> tp)
{
std::string path;
template <class OS>
SyscallReturn
execveFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr argv_mem_loc, Addr envp_mem_loc)
+ VPtr<> pathname, VPtr<> argv_mem_loc, VPtr<> envp_mem_loc)
{
auto p = tc->getProcessPtr();
return -EACCES;
auto read_in = [](std::vector<std::string> &vect,
- PortProxy &mem_proxy, Addr mem_loc)
+ PortProxy &mem_proxy, VPtr<> mem_loc)
{
for (int inc = 0; ; inc++) {
BufferArg b((mem_loc + sizeof(Addr) * inc), sizeof(Addr));
/// Target time() function.
template <class OS>
SyscallReturn
-timeFunc(SyscallDesc *desc, ThreadContext *tc, Addr taddr)
+timeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> taddr)
{
typename OS::time_t sec, usec;
getElapsedTimeMicro(sec, usec);
template <class OS>
SyscallReturn
socketpairFunc(SyscallDesc *desc, ThreadContext *tc,
- int domain, int type, int prot, Addr svPtr)
+ int domain, int type, int prot, VPtr<> svPtr)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
readFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, int nbytes)
+ int tgt_fd, VPtr<> buf_ptr, int nbytes)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
writeFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr buf_ptr, int nbytes)
+ int tgt_fd, VPtr<> buf_ptr, int nbytes)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
wait4Func(SyscallDesc *desc, ThreadContext *tc,
- pid_t pid, Addr statPtr, int options, Addr rusagePtr)
+ pid_t pid, VPtr<> statPtr, int options, VPtr<> rusagePtr)
{
auto p = tc->getProcessPtr();
template <class OS>
SyscallReturn
acceptFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, Addr addrPtr, Addr lenPtr)
+ int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
{
struct sockaddr sa;
socklen_t addrLen;