MMU: Properly clear flags
This commit is contained in:
parent
3358454833
commit
e16324887f
@ -242,11 +242,11 @@ namespace MMU
|
|||||||
if (l1.present) return err; // Please explicitly unmap the page before mapping it again.
|
if (l1.present) return err; // Please explicitly unmap the page before mapping it again.
|
||||||
l1.ignore0 = l1.ignore1 = false;
|
l1.ignore0 = l1.ignore1 = false;
|
||||||
l1.present = true;
|
l1.present = true;
|
||||||
if (flags & Flags::ReadWrite) l1.read_write = true;
|
l1.read_write = (flags & Flags::ReadWrite);
|
||||||
if (flags & Flags::User) l1.user = true;
|
l1.user = (flags & Flags::User);
|
||||||
if (flags & Flags::WriteThrough) l1.write_through = true;
|
l1.write_through = (flags & Flags::WriteThrough);
|
||||||
if (flags & Flags::CacheDisable) l1.cache_disabled = true;
|
l1.cache_disabled = (flags & Flags::CacheDisable);
|
||||||
if (flags & Flags::NoExecute) l1.no_execute = true;
|
l1.no_execute = (flags & Flags::NoExecute);
|
||||||
l1.set_address(phys);
|
l1.set_address(phys);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -257,11 +257,11 @@ namespace MMU
|
|||||||
if (rc.has_error()) return rc.release_error();
|
if (rc.has_error()) return rc.release_error();
|
||||||
auto& l1 = *rc.release_value();
|
auto& l1 = *rc.release_value();
|
||||||
if (!l1.present) return err;
|
if (!l1.present) return err;
|
||||||
if (flags & Flags::ReadWrite) l1.read_write = true;
|
l1.read_write = (flags & Flags::ReadWrite);
|
||||||
if (flags & Flags::User) l1.user = true;
|
l1.user = (flags & Flags::User);
|
||||||
if (flags & Flags::WriteThrough) l1.write_through = true;
|
l1.write_through = (flags & Flags::WriteThrough);
|
||||||
if (flags & Flags::CacheDisable) l1.cache_disabled = true;
|
l1.cache_disabled = (flags & Flags::CacheDisable);
|
||||||
if (flags & Flags::NoExecute) l1.no_execute = true;
|
l1.no_execute = (flags & Flags::NoExecute);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user