1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

lib/ip: generalize getting mapped addresses

This commit is contained in:
daniel-k 2018-01-09 16:29:33 +01:00
parent 4035aab49f
commit c710a95352
2 changed files with 8 additions and 3 deletions

View file

@ -114,7 +114,11 @@ public:
protected:
uintptr_t
getBaseaddr() const;
getBaseaddr() const
{ return getAddrMapped(this->baseaddr); }
uintptr_t
getAddrMapped(uintptr_t address) const;
struct IrqPort {
int num;

View file

@ -143,9 +143,10 @@ IpCoreFactory* IpCoreFactory::lookup(const Vlnv &vlnv)
}
uintptr_t
IpCore::getBaseaddr() const {
IpCore::getAddrMapped(uintptr_t address) const
{
assert(card != nullptr);
return reinterpret_cast<uintptr_t>(card->map) + this->baseaddr;
return reinterpret_cast<uintptr_t>(card->map) + address;
}