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:
41
src/core/sal/qemu/QEMUMemory.hpp
Normal file
41
src/core/sal/qemu/QEMUMemory.hpp
Normal 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__
|
||||
Reference in New Issue
Block a user