Kernel: Map DMA and PCI MMIO as uncached

This commit is contained in:
2024-07-30 11:10:08 +03:00
parent bb1738db8c
commit 9bc02c81f8
5 changed files with 11 additions and 9 deletions

View File

@@ -369,13 +369,12 @@ namespace Kernel
if (flags & Flags::Reserved)
extra_flags |= Flags::Reserved;
if (s_has_pat)
{
if (memory_type == MemoryType::WriteCombining)
extra_flags |= (1ull << 7);
if (memory_type == MemoryType::WriteThrough)
extra_flags |= (1ull << 7) | (1ull << 3);
}
if (memory_type == MemoryType::Uncached)
extra_flags |= (1ull << 4);
if (s_has_pat && memory_type == MemoryType::WriteCombining)
extra_flags |= (1ull << 7);
if (s_has_pat && memory_type == MemoryType::WriteThrough)
extra_flags |= (1ull << 7) | (1ull << 3);
// NOTE: we add present here, since it has to be available in higher level structures
flags_t uwr_flags = (flags & (Flags::UserSupervisor | Flags::ReadWrite)) | Flags::Present;

View File

@@ -417,6 +417,8 @@ namespace Kernel
if (flags & Flags::Reserved)
extra_flags |= Flags::Reserved;
if (memory_type == MemoryType::Uncached)
extra_flags |= (1ull << 4);
if (memory_type == MemoryType::WriteCombining)
extra_flags |= (1ull << 7);
if (memory_type == MemoryType::WriteThrough)