41 #ifndef __ARCH_ARM_PAGETABLE_H__ 42 #define __ARCH_ARM_PAGETABLE_H__ 63 panic(
"Need to implement PTE serialization\n");
68 panic(
"Need to implement PTE serialization\n");
148 bool uncacheable,
bool read_only) :
150 attributes(0), lookupLevel(
L1), asid(_asn), vmid(0), N(0),
151 innerAttrs(0), outerAttrs(0), ap(read_only ? 0x3 : 0), hap(0x3),
153 longDescFormat(false), isHyp(false), global(false), valid(true),
154 ns(true), nstid(true), el(
EL0), nonCacheable(uncacheable),
155 shareable(false), outerShareable(false), xn(0), pxn(0)
161 warn(
"ARM TlbEntry does not support read-only mappings\n");
165 pfn(0), size(0), vpn(0), attributes(0), lookupLevel(
L1), asid(0),
166 vmid(0), N(0), innerAttrs(0), outerAttrs(0), ap(0), hap(0x3),
168 longDescFormat(false), isHyp(false), global(false), valid(false),
169 ns(true), nstid(true), el(
EL0), nonCacheable(false),
170 shareable(false), outerShareable(false), xn(0), pxn(0)
193 return match(va, 0, _vmid, hypLookUp, secure_lookup,
true, target_el);
198 bool secure_lookup,
bool ignore_asn,
ExceptionLevel target_el)
const 203 if (valid && va >= v && va <= v + size && (secure_lookup == !nstid) &&
204 (hypLookUp == isHyp))
206 match = checkELMatch(target_el);
208 if (match && !ignore_asn) {
209 match = global || (asn ==
asid);
211 if (match && nstid) {
212 match = isHyp || (_vmid == vmid);
221 if (target_el ==
EL2 || target_el ==
EL3) {
222 return (el == target_el);
224 return (el ==
EL0) || (el ==
EL1);
231 return (pfn << N) | (va & size);
241 if ( attributes & (1 << 11) ) {
242 newBits = ((outerShareable ? 0x2 :
243 shareable ? 0x3 : 0) << 7);
261 newBits = ((outerShareable ? 0:1) << 10) |
262 ((shareable ? 1:0) << 7) |
273 attributes |= newBits;
279 attributes = lpae ? (1 << 11) : 0;
286 return csprintf(
"%#x, asn %d vmn %d hyp %d ppn %#x size: %#x ap:%d " 287 "ns:%d nstid:%d g:%d el:%d", vpn << N, asid, vmid,
288 isHyp, pfn << N, size, ap, ns, nstid, global, el);
318 uint8_t domain_ =
static_cast<uint8_t
>(
domain);
349 paramIn(cp,
"domain", domain_);
358 #endif // __ARCH_ARM_PAGETABLE_H__
#define panic(...)
This implements a cprintf based panic() function.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void serialize(CheckpointOut &cp) const
std::string print() const
TlbEntry(Addr _asn, Addr _vaddr, Addr _paddr, bool uncacheable, bool read_only)
#define UNSERIALIZE_SCALAR(scalar)
void unserialize(CheckpointIn &cp)
std::string csprintf(const char *format, const Args &...args)
#define SERIALIZE_ENUM(scalar)
void updateVaddr(Addr new_vaddr)
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
bool checkELMatch(ExceptionLevel target_el) const
Addr pAddr(Addr va) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool match(Addr va, uint8_t _vmid, bool hypLookUp, bool secure_lookup, ExceptionLevel target_el) const
Basic support for object serialization.
#define SERIALIZE_SCALAR(scalar)
std::ostream CheckpointOut
#define UNSERIALIZE_ENUM(scalar)
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool match(Addr va, uint16_t asn, uint8_t _vmid, bool hypLookUp, bool secure_lookup, bool ignore_asn, ExceptionLevel target_el) const
void setAttributes(bool lpae)