Merge pull request #3487 from wwylele/no-cached-io
Memory: remove RasterizerCachedSpecial page type
This commit is contained in:
commit
2085c9d7df
|
@ -165,10 +165,6 @@ T Read(const VAddr vaddr) {
|
||||||
}
|
}
|
||||||
case PageType::Special:
|
case PageType::Special:
|
||||||
return ReadMMIO<T>(GetMMIOHandler(vaddr), vaddr);
|
return ReadMMIO<T>(GetMMIOHandler(vaddr), vaddr);
|
||||||
case PageType::RasterizerCachedSpecial: {
|
|
||||||
RasterizerFlushVirtualRegion(vaddr, sizeof(T), FlushMode::Flush);
|
|
||||||
return ReadMMIO<T>(GetMMIOHandler(vaddr), vaddr);
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -206,11 +202,6 @@ void Write(const VAddr vaddr, const T data) {
|
||||||
case PageType::Special:
|
case PageType::Special:
|
||||||
WriteMMIO<T>(GetMMIOHandler(vaddr), vaddr, data);
|
WriteMMIO<T>(GetMMIOHandler(vaddr), vaddr, data);
|
||||||
break;
|
break;
|
||||||
case PageType::RasterizerCachedSpecial: {
|
|
||||||
RasterizerFlushVirtualRegion(vaddr, sizeof(T), FlushMode::Invalidate);
|
|
||||||
WriteMMIO<T>(GetMMIOHandler(vaddr), vaddr, data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -367,9 +358,6 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached) {
|
||||||
page_type = PageType::RasterizerCachedMemory;
|
page_type = PageType::RasterizerCachedMemory;
|
||||||
current_page_table->pointers[vaddr >> PAGE_BITS] = nullptr;
|
current_page_table->pointers[vaddr >> PAGE_BITS] = nullptr;
|
||||||
break;
|
break;
|
||||||
case PageType::Special:
|
|
||||||
page_type = PageType::RasterizerCachedSpecial;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -393,9 +381,6 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PageType::RasterizerCachedSpecial:
|
|
||||||
page_type = PageType::Special;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -523,14 +508,6 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_
|
||||||
std::memcpy(dest_buffer, GetPointerFromVMA(process, current_vaddr), copy_amount);
|
std::memcpy(dest_buffer, GetPointerFromVMA(process, current_vaddr), copy_amount);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PageType::RasterizerCachedSpecial: {
|
|
||||||
MMIORegionPointer handler = GetMMIOHandler(page_table, current_vaddr);
|
|
||||||
DEBUG_ASSERT(handler);
|
|
||||||
RasterizerFlushVirtualRegion(current_vaddr, static_cast<u32>(copy_amount),
|
|
||||||
FlushMode::Flush);
|
|
||||||
handler->ReadBlock(current_vaddr, dest_buffer, copy_amount);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -599,14 +576,6 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi
|
||||||
std::memcpy(GetPointerFromVMA(process, current_vaddr), src_buffer, copy_amount);
|
std::memcpy(GetPointerFromVMA(process, current_vaddr), src_buffer, copy_amount);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PageType::RasterizerCachedSpecial: {
|
|
||||||
MMIORegionPointer handler = GetMMIOHandler(page_table, current_vaddr);
|
|
||||||
DEBUG_ASSERT(handler);
|
|
||||||
RasterizerFlushVirtualRegion(current_vaddr, static_cast<u32>(copy_amount),
|
|
||||||
FlushMode::Invalidate);
|
|
||||||
handler->WriteBlock(current_vaddr, src_buffer, copy_amount);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -659,14 +628,6 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size
|
||||||
std::memset(GetPointerFromVMA(process, current_vaddr), 0, copy_amount);
|
std::memset(GetPointerFromVMA(process, current_vaddr), 0, copy_amount);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PageType::RasterizerCachedSpecial: {
|
|
||||||
MMIORegionPointer handler = GetMMIOHandler(page_table, current_vaddr);
|
|
||||||
DEBUG_ASSERT(handler);
|
|
||||||
RasterizerFlushVirtualRegion(current_vaddr, static_cast<u32>(copy_amount),
|
|
||||||
FlushMode::Invalidate);
|
|
||||||
handler->WriteBlock(current_vaddr, zeros.data(), copy_amount);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -718,17 +679,6 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
|
||||||
WriteBlock(process, dest_addr, GetPointerFromVMA(process, current_vaddr), copy_amount);
|
WriteBlock(process, dest_addr, GetPointerFromVMA(process, current_vaddr), copy_amount);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PageType::RasterizerCachedSpecial: {
|
|
||||||
MMIORegionPointer handler = GetMMIOHandler(page_table, current_vaddr);
|
|
||||||
DEBUG_ASSERT(handler);
|
|
||||||
RasterizerFlushVirtualRegion(current_vaddr, static_cast<u32>(copy_amount),
|
|
||||||
FlushMode::Flush);
|
|
||||||
|
|
||||||
std::vector<u8> buffer(copy_amount);
|
|
||||||
handler->ReadBlock(current_vaddr, buffer.data(), buffer.size());
|
|
||||||
WriteBlock(process, dest_addr, buffer.data(), buffer.size());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,6 @@ enum class PageType {
|
||||||
RasterizerCachedMemory,
|
RasterizerCachedMemory,
|
||||||
/// Page is mapped to a I/O region. Writing and reading to this page is handled by functions.
|
/// Page is mapped to a I/O region. Writing and reading to this page is handled by functions.
|
||||||
Special,
|
Special,
|
||||||
/// Page is mapped to a I/O region, but also needs to check for rasterizer cache flushing and
|
|
||||||
/// invalidation
|
|
||||||
RasterizerCachedSpecial,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpecialRegion {
|
struct SpecialRegion {
|
||||||
|
|
Reference in New Issue