process.cc (12394:7c5a2e374998) | process.cc (12412:cc28ea62727b) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * Copyright (c) 2016 The University of Virginia 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 201 unchanged lines hidden (view full) --- 210 tc->pcState(getStartPC()); 211 212 memState->setStackMin(roundDown(memState->getStackMin(), pageSize)); 213} 214 215RiscvISA::IntReg 216RiscvProcess::getSyscallArg(ThreadContext *tc, int &i) 217{ | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * Copyright (c) 2016 The University of Virginia 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 201 unchanged lines hidden (view full) --- 210 tc->pcState(getStartPC()); 211 212 memState->setStackMin(roundDown(memState->getStackMin(), pageSize)); 213} 214 215RiscvISA::IntReg 216RiscvProcess::getSyscallArg(ThreadContext *tc, int &i) 217{ |
218 // RISC-V only has four system call argument registers by convention, so 219 // if a larger index is requested return 0 | 218 // If a larger index is requested than there are syscall argument 219 // registers, return 0 |
220 RiscvISA::IntReg retval = 0; | 220 RiscvISA::IntReg retval = 0; |
221 if (i < 4) | 221 if (i < SyscallArgumentRegs.size()) |
222 retval = tc->readIntReg(SyscallArgumentRegs[i]); 223 i++; 224 return retval; 225} 226 227void 228RiscvProcess::setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val) 229{ --- 14 unchanged lines hidden --- | 222 retval = tc->readIntReg(SyscallArgumentRegs[i]); 223 i++; 224 return retval; 225} 226 227void 228RiscvProcess::setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val) 229{ --- 14 unchanged lines hidden --- |