[*] Refactor cache

This commit is contained in:
Reece Wilson 2022-03-30 15:18:20 +01:00
parent cf73ccad37
commit e0b19c075d

View File

@ -23,7 +23,6 @@
void sys_icache_invalidate(void *start, size_t len);
#endif
namespace Aurora::Memory::Cache
{
AUKN_SYM void OptimizeAddressRangeOnCore(const AuList<AuPair<AuUInt, AuUInt>> &addressRanges)
@ -58,7 +57,7 @@ namespace Aurora::Memory::Cache
if (madvise(AuReinterpretCast<void *>(base), length, MADV_WILLNEED) != 0)
{
SysPushErrorHAL("Couldn't advice memory range 0x{:x} {}", base, length);
SysPushErrorHAL("Couldn't advise memory range 0x{:x} {}", base, length);
}
#endif
}
@ -66,7 +65,7 @@ namespace Aurora::Memory::Cache
#if defined(AURORA_IS_MODERNNT_DERIVED)
if (!PrefetchVirtualMemory(GetCurrentProcess(), arry.size(), arry.data(), 0))
{
SysPushErrorHAL("Couldn't pin memory range into cache");
SysPushErrorHAL("Couldn't poke memory physical memory into virtual address space (array)");
}
#endif
}
@ -89,9 +88,9 @@ namespace Aurora::Memory::Cache
const size_t cacheLine = 64; // TODO: pull from Aurora::HWInfo
asm volatile("sfence\n\t"
:
:
: "memory");
:
:
: "memory");
for (AuUInt i = 0; i < length; i += cacheLine)
{