Deleted Added
sdiff udiff text old ( 11383:5ac090acd180 ) new ( 11385:dbbf54058f6f )
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

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

1218 delete [] (char *)hiov[i].iov_base;
1219
1220 if (result < 0)
1221 return -errno;
1222
1223 return result;
1224}
1225
1226
1227/// Target mmap() handler.
1228template <class OS>
1229SyscallReturn
1230mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
1231{
1232 int index = 0;
1233 Addr start = p->getSyscallArg(tc, index);
1234 uint64_t length = p->getSyscallArg(tc, index);
1235 int prot = p->getSyscallArg(tc, index);
1236 int tgt_flags = p->getSyscallArg(tc, index);
1237 int tgt_fd = p->getSyscallArg(tc, index);
1238 int offset = p->getSyscallArg(tc, index);
1239
1240 DPRINTF_SYSCALL(Verbose, "mmap(0x%x, len %d, prot %d, flags %d, fd %d, "
1241 "offs %d)\n", start, length, prot, tgt_flags, tgt_fd,
1242 offset);
1243
1244 if (start & (TheISA::PageBytes - 1) ||
1245 offset & (TheISA::PageBytes - 1) ||
1246 (tgt_flags & OS::TGT_MAP_PRIVATE &&
1247 tgt_flags & OS::TGT_MAP_SHARED) ||
1248 (!(tgt_flags & OS::TGT_MAP_PRIVATE) &&
1249 !(tgt_flags & OS::TGT_MAP_SHARED)) ||
1250 !length) {

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

1358 // Note that we do not zero out the remainder of the mapping. This
1359 // is done by a real system, but it probably will not affect
1360 // execution (hopefully).
1361 }
1362
1363 return start;
1364}
1365
1366/// Target getrlimit() handler.
1367template <class OS>
1368SyscallReturn
1369getrlimitFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
1370 ThreadContext *tc)
1371{
1372 int index = 0;
1373 unsigned resource = process->getSyscallArg(tc, index);

--- 219 unchanged lines hidden ---