process.cc (13388:6a07d5867a26) process.cc (13615:5cc9363f5ab7)
1/*
2 * Copyright (c) 2004-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;

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

196 setSyscallArg(tc, 0, argc);
197 setSyscallArg(tc, 1, argv_array_base);
198 tc->setIntReg(StackPointerReg, memState->getStackMin());
199
200 tc->pcState(getStartPC());
201}
202
203
1/*
2 * Copyright (c) 2004-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;

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

196 setSyscallArg(tc, 0, argc);
197 setSyscallArg(tc, 1, argv_array_base);
198 tc->setIntReg(StackPointerReg, memState->getStackMin());
199
200 tc->pcState(getStartPC());
201}
202
203
204MipsISA::IntReg
204RegVal
205MipsProcess::getSyscallArg(ThreadContext *tc, int &i)
206{
207 assert(i < 6);
208 return tc->readIntReg(FirstArgumentReg + i++);
209}
210
211void
205MipsProcess::getSyscallArg(ThreadContext *tc, int &i)
206{
207 assert(i < 6);
208 return tc->readIntReg(FirstArgumentReg + i++);
209}
210
211void
212MipsProcess::setSyscallArg(ThreadContext *tc, int i, MipsISA::IntReg val)
212MipsProcess::setSyscallArg(ThreadContext *tc, int i, RegVal val)
213{
214 assert(i < 6);
215 tc->setIntReg(FirstArgumentReg + i, val);
216}
217
218void
219MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
220{
221 if (sysret.successful()) {
222 // no error
223 tc->setIntReg(SyscallSuccessReg, 0);
224 tc->setIntReg(ReturnValueReg, sysret.returnValue());
225 } else {
226 // got an error, return details
227 tc->setIntReg(SyscallSuccessReg, (uint32_t)(-1));
228 tc->setIntReg(ReturnValueReg, sysret.errnoValue());
229 }
230}
213{
214 assert(i < 6);
215 tc->setIntReg(FirstArgumentReg + i, val);
216}
217
218void
219MipsProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret)
220{
221 if (sysret.successful()) {
222 // no error
223 tc->setIntReg(SyscallSuccessReg, 0);
224 tc->setIntReg(ReturnValueReg, sysret.returnValue());
225 } else {
226 // got an error, return details
227 tc->setIntReg(SyscallSuccessReg, (uint32_t)(-1));
228 tc->setIntReg(ReturnValueReg, sysret.errnoValue());
229 }
230}