1/* 2 * Copyright (c) 2012-2013, 2015 ARM Limited 3 * Copyright (c) 2015 Advanced Micro Devices, Inc. 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 45 unchanged lines hidden (view full) --- 54#endif 55 56/// 57/// @file syscall_emul.hh 58/// 59/// This file defines objects used to emulate syscalls from the target 60/// application on the host machine. 61 |
62#if defined(__linux__) |
63#include <sys/eventfd.h> 64#include <sys/statfs.h> 65 |
66#else 67#include <sys/mount.h> 68 |
69#endif 70 71#ifdef __CYGWIN32__ 72#include <sys/fcntl.h> 73 74#endif 75#include <fcntl.h> 76#include <net/if.h> --- 699 unchanged lines hidden (view full) --- 776 conf->ifc_buf = (char*)ifc_buf_addr; 777 ifc_buf_arg.copyOut(tc->getMemProxy()); 778 conf_arg.copyOut(tc->getMemProxy()); 779 } 780 781 return status; 782 } 783 case SIOCGIFFLAGS: |
784#if defined(__linux__) |
785 case SIOCGIFINDEX: 786#endif 787 case SIOCGIFNETMASK: 788 case SIOCGIFADDR: |
789#if defined(__linux__) |
790 case SIOCGIFHWADDR: 791#endif 792 case SIOCGIFMTU: { 793 Addr req_addr = p->getSyscallArg(tc, index); 794 BufferArg req_arg(req_addr, sizeof(ifreq)); 795 req_arg.copyIn(tc->getMemProxy()); 796 797 status = ioctl(sfdp->getSimFD(), req, req_arg.bufferPtr()); --- 715 unchanged lines hidden (view full) --- 1513} 1514 1515/// Target statfs() handler. 1516template <class OS> 1517SyscallReturn 1518statfsFunc(SyscallDesc *desc, int callnum, Process *process, 1519 ThreadContext *tc) 1520{ |
1521#if defined(__linux__) |
1522 std::string path; 1523 1524 int index = 0; 1525 if (!tc->getMemProxy().tryReadString(path, 1526 process->getSyscallArg(tc, index))) { 1527 return -EFAULT; 1528 } 1529 Addr bufPtr = process->getSyscallArg(tc, index); --- 1319 unchanged lines hidden (view full) --- 2849 return p->fds->allocFD(afdp); 2850} 2851 2852/// Target eventfd() function. 2853template <class OS> 2854SyscallReturn 2855eventfdFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) 2856{ |
2857#if defined(__linux__) |
2858 int index = 0; 2859 unsigned initval = p->getSyscallArg(tc, index); 2860 int in_flags = p->getSyscallArg(tc, index); 2861 2862 int sim_fd = eventfd(initval, in_flags); 2863 if (sim_fd == -1) 2864 return -errno; 2865 --- 15 unchanged lines hidden --- |