MMU: Properly clear flags

This commit is contained in:
apio 2022-11-15 19:10:19 +01:00
parent 3358454833
commit e16324887f

View File

@ -242,11 +242,11 @@ namespace MMU
if (l1.present) return err; // Please explicitly unmap the page before mapping it again.
l1.ignore0 = l1.ignore1 = false;
l1.present = true;
if (flags & Flags::ReadWrite) l1.read_write = true;
if (flags & Flags::User) l1.user = true;
if (flags & Flags::WriteThrough) l1.write_through = true;
if (flags & Flags::CacheDisable) l1.cache_disabled = true;
if (flags & Flags::NoExecute) l1.no_execute = true;
l1.read_write = (flags & Flags::ReadWrite);
l1.user = (flags & Flags::User);
l1.write_through = (flags & Flags::WriteThrough);
l1.cache_disabled = (flags & Flags::CacheDisable);
l1.no_execute = (flags & Flags::NoExecute);
l1.set_address(phys);
return {};
}
@ -257,11 +257,11 @@ namespace MMU
if (rc.has_error()) return rc.release_error();
auto& l1 = *rc.release_value();
if (!l1.present) return err;
if (flags & Flags::ReadWrite) l1.read_write = true;
if (flags & Flags::User) l1.user = true;
if (flags & Flags::WriteThrough) l1.write_through = true;
if (flags & Flags::CacheDisable) l1.cache_disabled = true;
if (flags & Flags::NoExecute) l1.no_execute = true;
l1.read_write = (flags & Flags::ReadWrite);
l1.user = (flags & Flags::User);
l1.write_through = (flags & Flags::WriteThrough);
l1.cache_disabled = (flags & Flags::CacheDisable);
l1.no_execute = (flags & Flags::NoExecute);
return {};
}