syscall_emul.hh (11593:ba45735a726a) syscall_emul.hh (11594:0d151793b2f3)
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

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

59#include <sys/fcntl.h> // for O_BINARY
60
61#endif
62#include <fcntl.h>
63#include <sys/mman.h>
64#include <sys/stat.h>
65#include <sys/time.h>
66#include <sys/uio.h>
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

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

59#include <sys/fcntl.h> // for O_BINARY
60
61#endif
62#include <fcntl.h>
63#include <sys/mman.h>
64#include <sys/stat.h>
65#include <sys/time.h>
66#include <sys/uio.h>
67#include <unistd.h>
67
68#include <cerrno>
69#include <string>
70
71#include "base/chunk_generator.hh"
72#include "base/intmath.hh" // for RoundUp
73#include "base/loader/object_file.hh"
74#include "base/misc.hh"

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

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
68
69#include <cerrno>
70#include <string>
71
72#include "base/chunk_generator.hh"
73#include "base/intmath.hh" // for RoundUp
74#include "base/loader/object_file.hh"
75#include "base/misc.hh"

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

1402
1403 int sim_fd = p->getSimFD(tgt_fd);
1404 if (sim_fd < 0)
1405 return -EBADF;
1406
1407 BufferArg bufArg(bufPtr, nbytes);
1408 bufArg.copyIn(tc->getMemProxy());
1409
1409 int bytes_written = pwrite64(sim_fd, bufArg.bufferPtr(), nbytes, offset);
1410 int bytes_written = pwrite(sim_fd, bufArg.bufferPtr(), nbytes, offset);
1410
1411 return (bytes_written == -1) ? -errno : bytes_written;
1412}
1413
1414/// Target mmap() handler.
1415template <class OS>
1416SyscallReturn
1417mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)

--- 239 unchanged lines hidden ---
1411
1412 return (bytes_written == -1) ? -errno : bytes_written;
1413}
1414
1415/// Target mmap() handler.
1416template <class OS>
1417SyscallReturn
1418mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)

--- 239 unchanged lines hidden ---