syscall_emul.hh (11594:0d151793b2f3) syscall_emul.hh (11624:9796e43e751d)
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

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

1279 "will not be propagated to the host or shared mappings");
1280 }
1281
1282 length = roundUp(length, TheISA::PageBytes);
1283
1284 int sim_fd = -1;
1285 uint8_t *pmap = nullptr;
1286 if (!(tgt_flags & OS::TGT_MAP_ANONYMOUS)) {
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

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

1279 "will not be propagated to the host or shared mappings");
1280 }
1281
1282 length = roundUp(length, TheISA::PageBytes);
1283
1284 int sim_fd = -1;
1285 uint8_t *pmap = nullptr;
1286 if (!(tgt_flags & OS::TGT_MAP_ANONYMOUS)) {
1287 sim_fd = p->getSimFD(tgt_fd);
1287 // Check for EmulatedDriver mmap
1288 FDEntry *fde = p->getFDEntry(tgt_fd);
1289 if (fde == NULL)
1290 return -EBADF;
1291
1292 if (fde->driver != NULL) {
1293 return fde->driver->mmap(p, tc, start, length, prot,
1294 tgt_flags, tgt_fd, offset);
1295 }
1296 sim_fd = fde->fd;
1297
1288 if (sim_fd < 0)
1289 return -EBADF;
1290
1291 pmap = (decltype(pmap))mmap(NULL, length, PROT_READ, MAP_PRIVATE,
1292 sim_fd, offset);
1293
1294 if (pmap == (decltype(pmap))-1) {
1295 warn("mmap: failed to map file into host address space");

--- 362 unchanged lines hidden ---
1298 if (sim_fd < 0)
1299 return -EBADF;
1300
1301 pmap = (decltype(pmap))mmap(NULL, length, PROT_READ, MAP_PRIVATE,
1302 sim_fd, offset);
1303
1304 if (pmap == (decltype(pmap))-1) {
1305 warn("mmap: failed to map file into host address space");

--- 362 unchanged lines hidden ---