2020-05-29 19:26:01 +02:00
|
|
|
#include <coreinit/cache.h>
|
|
|
|
#include <coreinit/memorymap.h>
|
|
|
|
#include "kernel/kernel.h"
|
|
|
|
|
|
|
|
void KernelReadPTE(uint32_t outputAddr, int32_t length) {
|
2021-09-24 16:44:51 +02:00
|
|
|
auto dst = (uint32_t) OSEffectiveToPhysical(outputAddr);
|
2020-05-29 19:26:01 +02:00
|
|
|
uint32_t src = 0xFFE20000;
|
|
|
|
ICInvalidateRange(&dst, 4);
|
|
|
|
DCFlushRange(&dst, 4);
|
|
|
|
DCFlushRange(&src, 4);
|
|
|
|
KernelCopyData(dst, src, length);
|
2021-09-24 16:44:51 +02:00
|
|
|
DCFlushRange((void *) outputAddr, length);
|
|
|
|
ICInvalidateRange((void *) outputAddr, length);
|
2020-05-29 19:26:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KernelWritePTE(uint32_t inputAddr, int32_t length) {
|
|
|
|
uint32_t dst = 0xFFE20000;
|
2021-09-24 16:44:51 +02:00
|
|
|
auto src = (uint32_t) OSEffectiveToPhysical(inputAddr);
|
2020-05-29 19:26:01 +02:00
|
|
|
ICInvalidateRange(&src, 4);
|
|
|
|
DCFlushRange(&src, 4);
|
|
|
|
KernelCopyData(dst, src, length);
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernelNOPAtPhysicalAddress(uint32_t addr) {
|
|
|
|
uint32_t dst = 0x60000000;
|
|
|
|
ICInvalidateRange(&dst, 4);
|
|
|
|
DCFlushRange(&dst, 4);
|
2021-09-24 16:44:51 +02:00
|
|
|
KernelCopyData(addr, (uint32_t) OSEffectiveToPhysical((uint32_t) &dst), 4);
|
2020-05-29 19:26:01 +02:00
|
|
|
}
|
|
|
|
|