Skip to content

Commit 66e6609

Browse files
authored
Merge pull request #45 from OFFTKP/fenc
Flush icache on cpuinfo
2 parents 0ac545d + 3809db3 commit 66e6609

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/cpuinfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <utility>
1313
#include <asm/hwcap.h>
1414
#include <sys/auxv.h>
15+
#include <sys/cachectl.h>
1516
#include <sys/mman.h>
1617
#include <sys/prctl.h>
1718
#include <sys/syscall.h>
@@ -635,6 +636,8 @@ bool CheckExtensionSignal(biscuit::RISCVExtension extension) {
635636
result = mprotect(memory, 4096, PROT_READ | PROT_EXEC);
636637
BISCUIT_ASSERT(result == 0);
637638

639+
__riscv_flush_icache(reinterpret_cast<void*>(function), as.GetCursorPointer(), 0);
640+
638641
bool has_extension = function(&valid_memory);
639642

640643
result = munmap(memory, 4096);

0 commit comments

Comments
 (0)