48 : originalRanges(original_ranges),
49 remappedRanges(remapped_ranges),
50 backdoorLists(original_ranges.size())
59 if (reverted_backdoor ==
nullptr) {
62 return reverted_backdoor;
69 std::unique_ptr<MemBackdoor> reverted_backdoor = std::make_unique<MemBackdoor>();
70 reverted_backdoor->flags(backdoor->
flags());
71 reverted_backdoor->ptr(backdoor->
ptr());
86 Addr backdoor_offset =
88 Addr backdoor_size = shrinked_backdoor_range.
size();
99 Addr shrinked_offset =
101 reverted_backdoor->ptr(backdoor->
ptr() + shrinked_offset);
108 MemBackdoorPtr reverted_backdoor_raw_ptr = reverted_backdoor.get();
110 std::move(reverted_backdoor));
116 return reverted_backdoor_raw_ptr;
120 panic(
"Target does not provide valid backdoor.");
138 if (backdoor->range().contains(
addr) &&
139 backdoor->range().contains(
addr + size - 1)) {
140 return backdoor.get();
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
MemBackdoorPtr createRevertedBackdoor(MemBackdoorPtr backdoor, const AddrRange &pkt_range)
This function creates a new backdoor, whose address range contains the original request address.
BackdoorManager(const std::vector< AddrRange > &original_ranges, const std::vector< AddrRange > &remapped_ranges)
const std::vector< AddrRange > & originalRanges
MemBackdoorPtr findBackdoor(const AddrRange &pkt_range) const
This function returns a created backdoor that fulfills the request, or returns nullptr if there's no.
std::vector< std::list< std::unique_ptr< MemBackdoor > > > backdoorLists
In this vector, each entry contains a list of backdoors that in the range in original address view.
const std::vector< AddrRange > & remappedRanges
MemBackdoorPtr getRevertedBackdoor(MemBackdoorPtr backdoor, const AddrRange &pkt_range)
const AddrRange & range() const
void addInvalidationCallback(CbFunction func)
Addr start() const
Get the start address of the range.
Addr size() const
Get the size of the address range.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.