syscall_emul.hh (12206:dd72486d1dbc) syscall_emul.hh (12235:95ab7b9d1c57)
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

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

1682 return -EINVAL;
1683 break;
1684 }
1685
1686 rlp.copyOut(tc->getMemProxy());
1687 return 0;
1688}
1689
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

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

1682 return -EINVAL;
1683 break;
1684 }
1685
1686 rlp.copyOut(tc->getMemProxy());
1687 return 0;
1688}
1689
1690template <class OS>
1691SyscallReturn
1692prlimitFunc(SyscallDesc *desc, int callnum, Process *process,
1693 ThreadContext *tc)
1694{
1695 int index = 0;
1696 if (process->getSyscallArg(tc, index) != 0)
1697 {
1698 warn("prlimit: ignoring rlimits for nonzero pid");
1699 return -EPERM;
1700 }
1701 int resource = process->getSyscallArg(tc, index);
1702 Addr n = process->getSyscallArg(tc, index);
1703 if (n != 0)
1704 warn("prlimit: ignoring new rlimit");
1705 Addr o = process->getSyscallArg(tc, index);
1706 if (o != 0)
1707 {
1708 TypedBufferArg<typename OS::rlimit> rlp(
1709 process->getSyscallArg(tc, index));
1710 switch (resource) {
1711 case OS::TGT_RLIMIT_STACK:
1712 // max stack size in bytes: make up a number (8MB for now)
1713 rlp->rlim_cur = rlp->rlim_max = 8 * 1024 * 1024;
1714 rlp->rlim_cur = TheISA::htog(rlp->rlim_cur);
1715 rlp->rlim_max = TheISA::htog(rlp->rlim_max);
1716 break;
1717 case OS::TGT_RLIMIT_DATA:
1718 // max data segment size in bytes: make up a number
1719 rlp->rlim_cur = rlp->rlim_max = 256*1024*1024;
1720 rlp->rlim_cur = TheISA::htog(rlp->rlim_cur);
1721 rlp->rlim_max = TheISA::htog(rlp->rlim_max);
1722 default:
1723 warn("prlimit: unimplemented resource %d", resource);
1724 return -EINVAL;
1725 break;
1726 }
1727 rlp.copyOut(tc->getMemProxy());
1728 }
1729 return 0;
1730}
1731
1690/// Target clock_gettime() function.
1691template <class OS>
1692SyscallReturn
1693clock_gettimeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
1694{
1695 int index = 1;
1696 //int clk_id = p->getSyscallArg(tc, index);
1697 TypedBufferArg<typename OS::timespec> tp(p->getSyscallArg(tc, index));

--- 324 unchanged lines hidden ---
1732/// Target clock_gettime() function.
1733template <class OS>
1734SyscallReturn
1735clock_gettimeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
1736{
1737 int index = 1;
1738 //int clk_id = p->getSyscallArg(tc, index);
1739 TypedBufferArg<typename OS::timespec> tp(p->getSyscallArg(tc, index));

--- 324 unchanged lines hidden ---