43 #ifndef __ARCH_ARM_PAGETABLE_H__ 44 #define __ARCH_ARM_PAGETABLE_H__ 66 panic(
"Need to implement PTE serialization\n");
71 panic(
"Need to implement PTE serialization\n");
151 bool uncacheable,
bool read_only) :
153 attributes(0), lookupLevel(
L1), asid(_asn), vmid(0), N(0),
154 innerAttrs(0), outerAttrs(0), ap(read_only ? 0x3 : 0), hap(0x3),
156 longDescFormat(false), isHyp(false), global(false), valid(true),
157 ns(true), nstid(true), el(
EL0), nonCacheable(uncacheable),
158 shareable(false), outerShareable(false), xn(0), pxn(0)
164 warn(
"ARM TlbEntry does not support read-only mappings\n");
168 pfn(0), size(0), vpn(0), attributes(0), lookupLevel(
L1), asid(0),
169 vmid(0), N(0), innerAttrs(0), outerAttrs(0), ap(0), hap(0x3),
171 longDescFormat(false), isHyp(false), global(false), valid(false),
172 ns(true), nstid(true), el(
EL0), nonCacheable(false),
173 shareable(false), outerShareable(false), xn(0), pxn(0)
196 return match(va, 0, _vmid, hypLookUp, secure_lookup,
true, target_el);
201 bool secure_lookup,
bool ignore_asn,
ExceptionLevel target_el)
const 206 if (valid && va >= v && va <= v + size && (secure_lookup == !nstid) &&
207 (hypLookUp == isHyp))
209 match = checkELMatch(target_el);
211 if (match && !ignore_asn) {
212 match = global || (asn ==
asid);
214 if (match && nstid) {
215 match = isHyp || (_vmid == vmid);
224 if (target_el ==
EL2 || target_el ==
EL3) {
225 return (el == target_el);
227 return (el ==
EL0) || (el ==
EL1);
234 return (pfn << N) | (va & size);
244 if ( attributes & (1 << 11) ) {
245 newBits = ((outerShareable ? 0x2 :
246 shareable ? 0x3 : 0) << 7);
264 newBits = ((outerShareable ? 0:1) << 10) |
265 ((shareable ? 1:0) << 7) |
276 attributes |= newBits;
282 attributes = lpae ? (1 << 11) : 0;
289 return csprintf(
"%#x, asn %d vmn %d hyp %d ppn %#x size: %#x ap:%d " 290 "ns:%d nstid:%d g:%d el:%d", vpn << N, asid, vmid,
291 isHyp, pfn << N, size, ap, ns, nstid, global, el);
321 uint8_t domain_ =
static_cast<uint8_t
>(
domain);
352 paramIn(cp,
"domain", domain_);
361 #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)
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)
#define UNSERIALIZE_ENUM(scalar)
std::ostream CheckpointOut
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
#define SERIALIZE_ENUM(scalar)
void setAttributes(bool lpae)