From d7bc65df3f6f3026da2094143342e58cd6bdd321 Mon Sep 17 00:00:00 2001
From: Stefan O'Rear <sorear@fastmail.com>
Date: Thu, 3 Sep 2020 05:23:40 -0400
Subject: [PATCH 08/16] riscv: Fall back to syscall __riscv_flush_icache

Matches glibc behavior and fixes a case where we could fall off the
function without returning a value.
---
 src/linux/cache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/linux/cache.c b/src/linux/cache.c
index 0eb051c2..9cacac2b 100644
--- a/src/linux/cache.c
+++ b/src/linux/cache.c
@@ -45,6 +45,7 @@ int __riscv_flush_icache(void *start, void *end, unsigned long int flags)
 		if (!r) return r;
 		if (r != -ENOSYS) return __syscall_ret(r);
 	}
+	return syscall(SYS_riscv_flush_icache, start, end, flags);
 }
 weak_alias(__riscv_flush_icache, riscv_flush_icache);
 #endif
-- 
2.29.2

