Files
fail/core/SAL/ovp/OVPRegister.hpp
hsc b70b6fb43a another directory rename: failstar -> fail
"failstar" sounds like a name for a cruise liner from the 80s.  As "*" isn't a
desirable part of directory names, just name the whole thing "fail/", the core
parts being stored in "fail/core/".

Additionally fixing two build system dependency issues:
 - missing jobserver -> protomessages dependency
 - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain
   file dependencies ... cmake for the win)


git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
2012-03-08 19:43:02 +00:00

81 lines
1.8 KiB
C++

#ifndef __OVP_REGISTER_HPP__
#define __OVP_REGISTER_HPP__
#include "../Register.hpp"
#include "../../../ovp/OVPPlatform.hpp"
//#include "../../../ovp/OVPStatusRegister.hpp"
extern OVPPlatform ovpplatform;
namespace sal {
/**
* \class OVPRegister
* OVP-specific implementation of x86 registers.
*/
class OVPRegister : public Register
{
private:
void *reg;
public:
/**
* Constructs a new register object.
* @param id the unique id of this register (simulator specific)
* @param width width of the register (8, 16, 32 or 64 bit should suffice)
* @param link pointer to bochs internal register memory
* @param t type of the register
*/
OVPRegister(unsigned int id, regwidth_t width, void* link, RegisterType t)
: Register(id, t, width) {
reg = link;
}
/**
* Retrieves the data of the register.
* @return the current register data
*/
regdata_t getData() { return ovpplatform.getRegisterData(reg); }
/**
* Sets the content of the register.
* @param data the new register data to be written
*/
void setData(regdata_t data) { ovpplatform.setRegisterData(reg, data); }
};
/**
* \class OVPRegister
* OVP-specific implementation of the RegisterManager.
*/
class OVPRegisterManager : public RegisterManager
{
public:
/**
* Returns the current instruction pointer.
* @return the current eip
*/
virtual address_t getInstructionPointer()
{
return ovpplatform.getPC();
}
/**
* Retruns the top address of the stack.
* @return the starting address of the stack
*/
virtual address_t getStackPointer()
{
return ovpplatform.getSP();
}
/**
* Retrieves the base ptr (holding the address of the
* current stack frame).
* @return the base pointer
*/
virtual address_t getBasePointer()
{
return 0;
}
};
}
#endif