first steps towards a QEMU target backend

- This commit only enables linking against QEMU.  The abstraction layer is
  completely dysfunctional at this time.
- QEMU's build system needs to be patched in order to create a static
  library.  This patch is currently not included in the Fail* repository.
- QEMU's JIT compilation may complicate or even preclude the implementation
  of some of Fail*'s backend abstractions.  Only a minimal subset (serial
  I/O, memory, memory writes, save/restore) is planned for the first phase.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1615 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-09-12 14:07:03 +00:00
parent f9c96ddf2d
commit e715149033
16 changed files with 395 additions and 22 deletions

View File

@ -0,0 +1,41 @@
#ifndef __QEMU_MEMORY_HPP__
#define __QEMU_MEMORY_HPP__
#include "../Memory.hpp"
namespace fail {
/**
* \class QEMUMemoryManager
* Represents a concrete implemenation of the abstract
* MemoryManager to provide access to QEMU's memory pool.
*/
class QEMUMemoryManager : public MemoryManager {
public:
size_t getPoolSize() const { return 0; /* TODO */ }
host_address_t getStartAddr() const { return 0; }
byte_t getByte(guest_address_t addr)
{
return static_cast<byte_t>(0); /* TODO */
}
void getBytes(guest_address_t addr, size_t cnt, void *dest)
{
char *d = static_cast<char *>(dest);
for (size_t i = 0; i < cnt; ++i)
d[i] = getByte(addr + i);
}
void setByte(guest_address_t addr, byte_t data)
{
/* TODO */
}
void setBytes(guest_address_t addr, size_t cnt, void const *src)
{
char const *s = static_cast<char const *>(src);
for (size_t i = 0; i < cnt; ++i)
setByte(addr + i, s[i]);
}
};
} // end-of-namespace: fail
#endif // __QEMU_MEMORY_HPP__