syscall_emul.hh (11392:5967db4cff04) | syscall_emul.hh (11593:ba45735a726a) |
---|---|
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 --- 1375 unchanged lines hidden (view full) --- 1384 // Note that we do not zero out the remainder of the mapping. This 1385 // is done by a real system, but it probably will not affect 1386 // execution (hopefully). 1387 } 1388 1389 return start; 1390} 1391 | 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 --- 1375 unchanged lines hidden (view full) --- 1384 // Note that we do not zero out the remainder of the mapping. This 1385 // is done by a real system, but it probably will not affect 1386 // execution (hopefully). 1387 } 1388 1389 return start; 1390} 1391 |
1392template <class OS> 1393SyscallReturn 1394pwrite64Func(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 1395{ 1396 int index = 0; 1397 int tgt_fd = p->getSyscallArg(tc, index); 1398 Addr bufPtr = p->getSyscallArg(tc, index); 1399 int nbytes = p->getSyscallArg(tc, index); 1400 int offset = p->getSyscallArg(tc, index); 1401 1402 int sim_fd = p->getSimFD(tgt_fd); 1403 if (sim_fd < 0) 1404 return -EBADF; 1405 1406 BufferArg bufArg(bufPtr, nbytes); 1407 bufArg.copyIn(tc->getMemProxy()); 1408 1409 int bytes_written = pwrite64(sim_fd, bufArg.bufferPtr(), nbytes, offset); 1410 1411 return (bytes_written == -1) ? -errno : bytes_written; 1412} 1413 |
|
1392/// Target mmap() handler. 1393template <class OS> 1394SyscallReturn 1395mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 1396{ 1397 return mmapImpl<OS>(desc, num, p, tc, false); 1398} 1399 --- 235 unchanged lines hidden --- | 1414/// Target mmap() handler. 1415template <class OS> 1416SyscallReturn 1417mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) 1418{ 1419 return mmapImpl<OS>(desc, num, p, tc, false); 1420} 1421 --- 235 unchanged lines hidden --- |