summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-08 00:32:04 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-08 00:32:04 -0500
commit746ceb93fdb13f74ea2e18f980d122f8bfb5cd0a (patch)
treed44643851ab29a287d14710b3bad6ade2d9cc8c4 /src
parent1a5d5d0b561591a5775d4b5a253360b7cea9076e (diff)
downloadgem5-746ceb93fdb13f74ea2e18f980d122f8bfb5cd0a.tar.xz
Replaced getArg with a SPARC implementation.
--HG-- extra : convert_revision : ba31171a81b6c46de2997de2701d35fcf8c614b7
Diffstat (limited to 'src')
-rw-r--r--src/arch/sparc/arguments.cc16
-rw-r--r--src/arch/sparc/arguments.hh4
2 files changed, 11 insertions, 9 deletions
diff --git a/src/arch/sparc/arguments.cc b/src/arch/sparc/arguments.cc
index a0a31567e..44adf4a15 100644
--- a/src/arch/sparc/arguments.cc
+++ b/src/arch/sparc/arguments.cc
@@ -54,16 +54,18 @@ Arguments::Data::alloc(size_t size)
uint64_t
Arguments::getArg(bool fp)
{
- //XXX This needs to be replaced with the sparc version
+ //The caller uses %o0-%05 for the first 6 arguments even if their floating
+ //point. Double precision floating point values take two registers/args.
+ //Quads, structs, and unions are passed as pointers. All arguments beyond
+ //the sixth are passed on the stack past the 16 word window save area,
+ //space for the struct/union return pointer, and space reserved for the
+ //first 6 arguments which the caller may use but doesn't have to.
if (number < 6) {
- if (fp)
- return tc->readFloatRegBits(16 + number);
- else
- return tc->readIntReg(16 + number);
+ return tc->readIntReg(8 + number);
} else {
- Addr sp = tc->readIntReg(30);
+ Addr sp = tc->readIntReg(14);
VirtualPort *vp = tc->getVirtPort(tc);
- uint64_t arg = vp->read<uint64_t>(sp + (number-6) * sizeof(uint64_t));
+ uint64_t arg = vp->read<uint64_t>(sp + 92 + (number-6) * sizeof(uint64_t));
tc->delVirtPort(vp);
return arg;
}
diff --git a/src/arch/sparc/arguments.hh b/src/arch/sparc/arguments.hh
index 0d059a564..8f925dd25 100644
--- a/src/arch/sparc/arguments.hh
+++ b/src/arch/sparc/arguments.hh
@@ -144,6 +144,6 @@ class Arguments
}
};
-}; // namespace AlphaISA
+}; // namespace SparcISA
-#endif // __ARCH_ALPHA_ARGUMENTS_HH__
+#endif // __ARCH_SPARC_ARGUMENTS_HH__