T32: Integrated Register read/write calls

* Tested without connected Lauterbach.
  T32_* functions are mocked via aspect.

* New target t32cli, for sending T32 command cia cli. (for testing)

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2103 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hoffmann
2013-02-15 18:06:02 +00:00
parent a7e5d2373f
commit 39a6415001
30 changed files with 439 additions and 201 deletions

View File

@ -0,0 +1,53 @@
#include "T32ArmCPU.hpp"
#include <t32.h>
#include <iostream>
namespace fail {
regdata_t T32ArmCPU::getRegisterContent(Register* reg) const
{
// T32_ReadRegister wants a mask of bits representig the registers to read:
// e.g., reading R1 and R4 and R63
// mask1
// 0000 0000 0000 0000 0001 0010 -> R1/R4
// mask2
// 1000 0000 0000 0000 0001 0010 -> R63
uint64_t mask = (1 << reg->getIndex());
if(mask){
if( T32_ReadRegister(static_cast<dword>(mask & 0xffffffff), static_cast<dword>(mask >> 32), m_regbuffer) == 0 ){
// No error, return value.
return m_regbuffer[reg->getIndex()];
} else {
/// TODO Error handling!
}
}
return 0; // we should not come here.
}
void T32ArmCPU::setRegisterContent(Register* reg, regdata_t value)
{
uint64_t mask = (1 << reg->getIndex());
if(mask){
if( T32_WriteRegister(static_cast<dword>(mask & 0xffffffff), static_cast<dword>(mask >> 32), m_regbuffer) == 0 ){
// No error, return value.
return;
} else {
/// TODO Error handling!
}
}
}
address_t T32ArmCPU::getInstructionPointer() const
{
// TODO: programpointer is only valid when Emulation is stopped! -> T32_GetState)
address_t programpointer;
T32_ReadPP( &programpointer );
return programpointer;
}
} // end-of-namespace: fail