summaryrefslogtreecommitdiff
path: root/src/arch/sparc/process.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-11-29 00:00:02 -0800
committerGabe Black <gblack@eecs.umich.edu>2007-11-29 00:00:02 -0800
commit16e99e4677c24147e09ff10d375751a7b114a8d7 (patch)
tree1a34802e53a58e475ba2faeb27c6e9778ffaa08c /src/arch/sparc/process.hh
parenta84d9716d63e16e01bdcef34b115c6dcd20e4146 (diff)
downloadgem5-16e99e4677c24147e09ff10d375751a7b114a8d7.tar.xz
SPARC: Combine the 64 and 32 bit process initialization code.
Alignment is done as it was for 32 bit processes. --HG-- extra : convert_revision : 9368ad40dcc7911f8fc7ec1468c6a28aa92d196f
Diffstat (limited to 'src/arch/sparc/process.hh')
-rw-r--r--src/arch/sparc/process.hh55
1 files changed, 24 insertions, 31 deletions
diff --git a/src/arch/sparc/process.hh b/src/arch/sparc/process.hh
index dd8eae316..a37760139 100644
--- a/src/arch/sparc/process.hh
+++ b/src/arch/sparc/process.hh
@@ -34,6 +34,7 @@
#include <string>
#include <vector>
+#include "sim/byteswap.hh"
#include "sim/process.hh"
class ObjectFile;
@@ -43,10 +44,18 @@ class SparcLiveProcess : public LiveProcess
{
protected:
+ const Addr StackBias;
+
//The locations of the fill and spill handlers
Addr fillStart, spillStart;
- SparcLiveProcess(LiveProcessParams * params, ObjectFile *objFile);
+ SparcLiveProcess(LiveProcessParams * params,
+ ObjectFile *objFile, Addr _StackBias);
+
+ void startup();
+
+ template<class IntType>
+ void argsInit(int pageSize);
public:
@@ -62,29 +71,32 @@ class SparcLiveProcess : public LiveProcess
virtual void flushWindows(ThreadContext *tc) = 0;
};
-struct M5_32_auxv_t
+template<class IntType>
+struct M5_auxv_t
{
- int32_t a_type;
+ IntType a_type;
union {
- int32_t a_val;
- int32_t a_ptr;
- int32_t a_fcn;
+ IntType a_val;
+ IntType a_ptr;
+ IntType a_fcn;
};
- M5_32_auxv_t()
+ M5_auxv_t()
{}
- M5_32_auxv_t(int32_t type, int32_t val);
+ M5_auxv_t(IntType type, IntType val)
+ {
+ a_type = SparcISA::htog(type);
+ a_val = SparcISA::htog(val);
+ }
};
class Sparc32LiveProcess : public SparcLiveProcess
{
protected:
- std::vector<M5_32_auxv_t> auxv;
-
Sparc32LiveProcess(LiveProcessParams * params, ObjectFile *objFile) :
- SparcLiveProcess(params, objFile)
+ SparcLiveProcess(params, objFile, 0)
{
// Set up stack. On SPARC Linux, stack goes from the top of memory
// downward, less the hole for the kernel address space.
@@ -103,31 +115,12 @@ class Sparc32LiveProcess : public SparcLiveProcess
void flushWindows(ThreadContext *tc);
};
-struct M5_64_auxv_t
-{
- int64_t a_type;
- union {
- int64_t a_val;
- int64_t a_ptr;
- int64_t a_fcn;
- };
-
- M5_64_auxv_t()
- {}
-
- M5_64_auxv_t(int64_t type, int64_t val);
-};
-
class Sparc64LiveProcess : public SparcLiveProcess
{
protected:
- static const Addr StackBias = 2047;
-
- std::vector<M5_64_auxv_t> auxv;
-
Sparc64LiveProcess(LiveProcessParams * params, ObjectFile *objFile) :
- SparcLiveProcess(params, objFile)
+ SparcLiveProcess(params, objFile, 2047)
{
// Set up stack. On SPARC Linux, stack goes from the top of memory
// downward, less the hole for the kernel address space.