Deleted Added
sdiff udiff text old ( 10495:75d2f19fecce ) new ( 10496:0a5a8ecd0ec6 )
full compact
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

72#include "base/types.hh"
73#include "config/the_isa.hh"
74#include "cpu/base.hh"
75#include "cpu/thread_context.hh"
76#include "debug/SyscallVerbose.hh"
77#include "mem/page_table.hh"
78#include "mem/se_translating_port_proxy.hh"
79#include "sim/byteswap.hh"
80#include "sim/process.hh"
81#include "sim/syscallreturn.hh"
82#include "sim/system.hh"
83
84///
85/// System call descriptor.
86///
87class SyscallDesc {

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

599 ThreadContext *tc)
600{
601 int index = 0;
602 int fd = process->getSyscallArg(tc, index);
603 unsigned req = process->getSyscallArg(tc, index);
604
605 DPRINTF(SyscallVerbose, "ioctl(%d, 0x%x, ...)\n", fd, req);
606
607 if (fd < 0 || process->sim_fd(fd) < 0) {
608 // doesn't map to any simulator fd: not a valid target fd
609 return -EBADF;
610 }
611
612 if (OS::isTtyReq(req)) {
613 return -ENOTTY;
614 }
615
616 warn("Unsupported ioctl call: ioctl(%d, 0x%x, ...) @ \n",
617 fd, req, tc->pcState());
618 return -ENOTTY;
619}

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

624 ThreadContext *tc, int index)
625{
626 std::string path;
627
628 if (!tc->getMemProxy().tryReadString(path,
629 process->getSyscallArg(tc, index)))
630 return -EFAULT;
631
632 if (path == "/dev/sysdev0") {
633 // This is a memory-mapped high-resolution timer device on Alpha.
634 // We don't support it, so just punt.
635 warn("Ignoring open(%s, ...)\n", path);
636 return -ENOENT;
637 }
638
639 int tgtFlags = process->getSyscallArg(tc, index);
640 int mode = process->getSyscallArg(tc, index);
641 int hostFlags = 0;
642
643 // translate open flags
644 for (int i = 0; i < OS::NUM_OPEN_FLAGS; i++) {
645 if (tgtFlags & OS::openFlagTable[i].tgtFlag) {
646 tgtFlags &= ~OS::openFlagTable[i].tgtFlag;

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

656 hostFlags |= O_BINARY;
657#endif
658
659 // Adjust path for current working directory
660 path = process->fullPath(path);
661
662 DPRINTF(SyscallVerbose, "opening file %s\n", path.c_str());
663
664 int fd;
665 int local_errno;
666 if (startswith(path, "/proc/") || startswith(path, "/system/") ||
667 startswith(path, "/platform/") || startswith(path, "/sys/")) {
668 // It's a proc/sys entry and requires special handling
669 fd = OS::openSpecialFile(path, process, tc);
670 local_errno = ENOENT;
671 } else {

--- 801 unchanged lines hidden ---