syscall_emul.hh (6672:b636411c118e) syscall_emul.hh (6683:5e0fcc528fe5)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

1126 who);
1127 }
1128
1129 rup.copyOut(tc->getMemPort());
1130
1131 return 0;
1132}
1133
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

1126 who);
1127 }
1128
1129 rup.copyOut(tc->getMemPort());
1130
1131 return 0;
1132}
1133
1134/// Target times() function.
1135template <class OS>
1136SyscallReturn
1137timesFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
1138 ThreadContext *tc)
1139{
1140 TypedBufferArg<typename OS::tms> bufp(process->getSyscallArg(tc, 0));
1134
1141
1142 // Fill in the time structure (in clocks)
1143 int64_t clocks = curTick * OS::_SC_CLK_TCK / Clock::Int::s;
1144 bufp->tms_utime = clocks;
1145 bufp->tms_stime = 0;
1146 bufp->tms_cutime = 0;
1147 bufp->tms_cstime = 0;
1135
1148
1149 // Convert to host endianness
1150 bufp->tms_utime = htog(bufp->tms_utime);
1136
1151
1152 // Write back
1153 bufp.copyOut(tc->getMemPort());
1154
1155 // Return clock ticks since system boot
1156 return clocks;
1157}
1158
1159
1160
1137#endif // __SIM_SYSCALL_EMUL_HH__
1161#endif // __SIM_SYSCALL_EMUL_HH__