summaryrefslogtreecommitdiff
path: root/src/arch/arm/process.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:00 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:00 -0500
commit4ddeceba96c5e066d79138709091a6dffec17372 (patch)
tree347a920e1d9216a02955c6833a0d69cee429e0b3 /src/arch/arm/process.cc
parent3951afd2fa6140f85a94c9636ac2d9e9d3a1c764 (diff)
downloadgem5-4ddeceba96c5e066d79138709091a6dffec17372.tar.xz
ARM: Allow ARM processes to start in Thumb mode.
Diffstat (limited to 'src/arch/arm/process.cc')
-rw-r--r--src/arch/arm/process.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc
index 702922a43..3c51c80a7 100644
--- a/src/arch/arm/process.cc
+++ b/src/arch/arm/process.cc
@@ -43,8 +43,9 @@
using namespace std;
using namespace ArmISA;
-ArmLiveProcess::ArmLiveProcess(LiveProcessParams *params, ObjectFile *objFile)
- : LiveProcess(params, objFile)
+ArmLiveProcess::ArmLiveProcess(LiveProcessParams *params, ObjectFile *objFile,
+ ObjectFile::Arch _arch)
+ : LiveProcess(params, objFile), arch(_arch)
{
stack_base = 0xbf000000L;
@@ -316,6 +317,8 @@ ArmLiveProcess::argsInit(int intSize, int pageSize)
}
Addr prog_entry = objFile->entryPoint();
+ if (arch == ObjectFile::Thumb)
+ prog_entry = (prog_entry & ~mask(1)) | (ULL(1) << PcTBitShift);
tc->setPC(prog_entry);
tc->setNextPC(prog_entry + sizeof(MachInst));