kern: Add special-case for InvalidateProcessDataCache on current process

This commit is contained in:
Michael Scire 2023-10-11 09:37:45 -07:00 committed by SciresM
parent 2a4d68f916
commit 3737151a2f
4 changed files with 27 additions and 1 deletions

View file

@ -102,7 +102,11 @@ namespace ams::kern::svc {
R_UNLESS(process.IsNotNull(), svc::ResultInvalidHandle());
/* Invalidate the cache. */
R_TRY(process->GetPageTable().InvalidateProcessDataCache(address, size));
if (process.GetPointerUnsafe() == GetCurrentProcessPointer()) {
R_TRY(process->GetPageTable().InvalidateCurrentProcessDataCache(address, size));
} else {
R_TRY(process->GetPageTable().InvalidateProcessDataCache(address, size));
}
R_SUCCEED();
}