mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
riscv: Use __riscv_flush_icache() on Linux.
This seems to perhaps clear icache on all harts. Otherwise crashing is seen. Not sure what to do on other platforms.
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
#include "ppsspp_config.h"
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#if PPSSPP_ARCH(RISCV64) && PPSSPP_PLATFORM(LINUX)
|
||||
#include <sys/cachectl.h>
|
||||
#endif
|
||||
#include "Common/BitScan.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/RiscVEmitter.h"
|
||||
@@ -1051,8 +1054,13 @@ void RiscVEmitter::FlushIcache() {
|
||||
|
||||
void RiscVEmitter::FlushIcacheSection(const u8 *start, const u8 *end) {
|
||||
#if PPSSPP_ARCH(RISCV64)
|
||||
#if PPSSPP_PLATFORM(LINUX)
|
||||
__riscv_flush_icache((char *)start, (char *)end, 0);
|
||||
#else
|
||||
// TODO: This might only correspond to a local hart icache clear, which is no good.
|
||||
__builtin___clear_cache((char *)start, (char *)end);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
FixupBranch::~FixupBranch() {
|
||||
|
||||
Reference in New Issue
Block a user