Deleted Added
sdiff udiff text old ( 13569:47a2291177a7 ) new ( 13570:b6484720c6a9 )
full compact
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

--- 64 unchanged lines hidden (view full) ---

73/// This file defines objects used to emulate syscalls from the target
74/// application on the host machine.
75
76#ifdef __CYGWIN32__
77#include <sys/fcntl.h>
78
79#endif
80#include <fcntl.h>
81#include <sys/mman.h>
82#include <sys/socket.h>
83#include <sys/stat.h>
84#if (NO_STATFS == 0)
85#include <sys/statfs.h>
86#else
87#include <sys/mount.h>
88#endif
89#include <sys/time.h>
90#include <sys/uio.h>
91#include <unistd.h>
92
93#include <cerrno>
94#include <memory>
95#include <string>
96
97#include "arch/generic/tlb.hh"

--- 59 unchanged lines hidden (view full) ---

157/// Target brk() handler: set brk address.
158SyscallReturn brkFunc(SyscallDesc *desc, int num,
159 Process *p, ThreadContext *tc);
160
161/// Target close() handler.
162SyscallReturn closeFunc(SyscallDesc *desc, int num,
163 Process *p, ThreadContext *tc);
164
165// Target read() handler.
166SyscallReturn readFunc(SyscallDesc *desc, int num,
167 Process *p, ThreadContext *tc);
168
169/// Target write() handler.
170SyscallReturn writeFunc(SyscallDesc *desc, int num,
171 Process *p, ThreadContext *tc);
172
173/// Target lseek() handler.
174SyscallReturn lseekFunc(SyscallDesc *desc, int num,
175 Process *p, ThreadContext *tc);
176
177/// Target _llseek() handler.
178SyscallReturn _llseekFunc(SyscallDesc *desc, int num,
179 Process *p, ThreadContext *tc);
180

--- 760 unchanged lines hidden (view full) ---

941 // do the chmod
942 int result = chmod(path.c_str(), hostMode);
943 if (result < 0)
944 return -errno;
945
946 return 0;
947}
948
949
950/// Target fchmod() handler.
951template <class OS>
952SyscallReturn
953fchmodFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
954{
955 int index = 0;
956 int tgt_fd = p->getSyscallArg(tc, index);
957 uint32_t mode = p->getSyscallArg(tc, index);

--- 306 unchanged lines hidden (view full) ---

1264 if (result < 0)
1265 return -errno;
1266
1267 copyOutStatBuf<OS>(tc->getMemProxy(), bufPtr, &hostBuf, (sim_fd == 1));
1268
1269 return 0;
1270}
1271
1272
1273/// Target statfs() handler.
1274template <class OS>
1275SyscallReturn
1276statfsFunc(SyscallDesc *desc, int callnum, Process *process,
1277 ThreadContext *tc)
1278{
1279#if NO_STATFS
1280 warn("Host OS cannot support calls to statfs. Ignoring syscall");

--- 872 unchanged lines hidden (view full) ---

2153 fds[0] = p->fds->allocFD(sfdp1);
2154 auto sfdp2 = std::make_shared<SocketFDEntry>(fds[1], domain, type, prot);
2155 fds[1] = p->fds->allocFD(sfdp2);
2156 svBuf.copyOut(tc->getMemProxy());
2157
2158 return status;
2159}
2160
2161#endif // __SIM_SYSCALL_EMUL_HH__