template <int order>
struct paging_entry {
public:
- static_assert(order >= 0, "Error: negative order for paging entry.");
+ static_assert(order >= 0, "negative order for paging entry.");
paging_entry(bool is_page) {
os::assert(order != 0 || is_page, "4KiB defined as non-page.");
if (order != 0 && is_page) {
data = (data & ~(1ul << 63)) | (v ? (1ul << 63) : 0);
}
inline unsigned PK() {
- os::assert(is_page(), "Error: read protection key of non-page.");
+ os::assert(is_page(), "read protection key of non-page.");
return (data >> 52) & 0xF;
}
inline void PK(unsigned v) {
- os::assert(is_page(), "Error: write to protection key of non-page.");
- os::assert((v & 0xF) == v, "Error: incorrect protection key.");
+ os::assert(is_page(), "write to protection key of non-page.");
+ os::assert((v & 0xF) == v, "incorrect protection key.");
data = (data & ~(0xFul << 59)) | (std::uint64_t(v) << 59);
}
inline unsigned AVL_high() {
return (data >> 52) & (is_page() ? 0x7F : 0x7FF);
}
inline void AVL_high(unsigned v) {
- os::assert((v & (is_page() ? 0x7F : 0x7FF)) == v, "Error: incorrect AVL high bits.");
+ os::assert((v & (is_page() ? 0x7F : 0x7FF)) == v, "incorrect AVL high bits.");
data = (data & ~((is_page() ? 0x7Ful : 0x7FFul) << 52)) | (std::uint64_t(v) << 52);
}
inline phys_ptr<paging_table<order - 1>> base_address() {
}
inline void base_address(phys_ptr<paging_table<order - 1>> v) {
const std::uint64_t v_int = v.get_phys_addr();
- os::assert((v_int & 0x000FFFFFFFFFF000 & (0xFFFFFFFFFFFFF000 << (is_page() ? 9 * order : 0))) == v_int, "Error: incorrect base address.");
+ os::assert((v_int & 0x000FFFFFFFFFF000 & (0xFFFFFFFFFFFFF000 << (is_page() ? 9 * order : 0))) == v_int, "incorrect base address.");
data = (data & ~0x000FFFFFFFFFF000ul & ~(order != 0 && is_page() ? 1ul << 12 : 0ul)) | v_int;
}
inline unsigned AVL_low() {
return (data >> 9) & 0x7;
}
inline void AVL_low(unsigned v) {
- os::assert((v & 0x7) == v, "Error: incorrect AVL low bits");
+ os::assert((v & 0x7) == v, "incorrect AVL low bits");
data = (data & ~(0x7ul << 9)) | (v << 9);
}
inline bool G() {
- os::assert(is_page(), "Error: read global bit of non-page.");
+ os::assert(is_page(), "read global bit of non-page.");
return (data & (1 << 8)) != 0;
}
inline void G(bool v) {
- os::assert(is_page(), "Error: write to global bit of non-page.");
+ os::assert(is_page(), "write to global bit of non-page.");
data = (data & ~(1ul << 8)) | (v ? 1 << 8 : 0);
}
inline bool PAT() {
- os::assert(is_page(), "Error: read PAT bit of non-page.");
+ os::assert(is_page(), "read PAT bit of non-page.");
return (data & (1 << (order == 0 ? 7 : 12))) != 0;
}
inline void PAT(bool v) {
- os::assert(is_page(), "Error: write to PAT bit of non-page.");
+ os::assert(is_page(), "write to PAT bit of non-page.");
data = (data & ~(1ul << (order == 0 ? 7 : 12))) | (v ? 1 << (order == 0 ? 7 : 12) : 0);
}
inline bool D() {
- os::assert(is_page(), "Error: read dirty bit of non-page.");
+ os::assert(is_page(), "read dirty bit of non-page.");
return (data & (1 << 6)) != 0;
}
inline void D(bool v) {
- os::assert(is_page(), "Error: write to dirty bit of non-page.");
+ os::assert(is_page(), "write to dirty bit of non-page.");
data = (data & ~(1ul << 6)) | (v ? 1 << 6 : 0);
}
inline bool A() {