Try Different Cache API
minecraft-pi-docker/pipeline/head There was a failure building this commit Details

This commit is contained in:
TheBrokenRail 2020-10-16 22:41:13 -04:00
parent e501391142
commit 76cb02ef46
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,8 @@
#include <unistd.h>
#include <sys/mman.h>
#include <stdint.h>
#include <asm/cachectl.h>
#include <errno.h>
#include <libcore/libcore.h>
@ -70,7 +72,10 @@ void _patch(const char *file, int line, void *start, unsigned char patch[]) {
mprotect((void *) page_start, end - page_start, PROT_READ | PROT_EXEC);
__builtin___clear_cache(start, (void *) end);
if (cacheflush(start, 4, ICACHE) != 0) {
fprintf(stderr, "Error Flushing Cache: %s\n", strerror(errno));
exit(1);
}
}
void _patch_address(const char *file, int line, void *start, void *target) {