mailing list of musl libc
 help / color / mirror / code / Atom feed
0c5af2ec643bbde7e9a1015120c6de2f19b7fdcd blob 1341 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 
#include <errno.h>
#include "syscall.h"
#include "atomic.h"

#ifdef SYS_cacheflush
int _flush_cache(void *addr, int len, int op)
{
	return syscall(SYS_cacheflush, addr, len, op);
}
weak_alias(_flush_cache, cacheflush);
#endif

#ifdef SYS_cachectl
int __cachectl(void *addr, int len, int op)
{
	return syscall(SYS_cachectl, addr, len, op);
}
weak_alias(__cachectl, cachectl);
#endif

#ifdef SYS_riscv_flush_icache

#ifdef VDSO_FLUSH_ICACHE_SYM

static void *volatile vdso_func;

static int flush_icache_init(void *start, void *end, unsigned long int flags)
{
	void *p = __vdsosym(VDSO_FLUSH_ICACHE_VER, VDSO_FLUSH_ICACHE_SYM);
	int (*f)(void *, void *, unsigned long int) =
		(int (*)(void *, void *, unsigned long int))p;
	a_cas_p(&vdso_func, (void *)flush_icache_init, p);
	return f ? f(start, end, flags) : -ENOSYS;
}

static void *volatile vdso_func = (void *)flush_icache_init;

#endif

int __riscv_flush_icache(void *start, void *end, unsigned long int flags) 
{
#ifdef VDSO_FLUSH_ICACHE_SYM
	int (*f)(void *, void *, unsigned long int) =
		(int (*)(void *, void *, unsigned long int))vdso_func;
	if (f) {
		int r = f(start, end, flags);
		if (!r) return r;
		if (r != -ENOSYS) return __syscall_ret(r);
	}
#endif
	return syscall(SYS_riscv_flush_icache, start, end, flags);
}
weak_alias(__riscv_flush_icache, riscv_flush_icache);
#endif
debug log:

solving 0c5af2ec ...
found 0c5af2ec in https://inbox.vuxu.org/musl/20190524144608.5998-1-sir@cmpwn.com/
found 84a138a4 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 84a138a4158692d037b1c8aa56ea5d04b0d07ca6	src/linux/cache.c

applying [1/1] https://inbox.vuxu.org/musl/20190524144608.5998-1-sir@cmpwn.com/
diff --git a/src/linux/cache.c b/src/linux/cache.c
index 84a138a4..0c5af2ec 100644

1:36: trailing whitespace.
int __riscv_flush_icache(void *start, void *end, unsigned long int flags) 
Checking patch src/linux/cache.c...
Applied patch src/linux/cache.c cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 0c5af2ec643bbde7e9a1015120c6de2f19b7fdcd	src/linux/cache.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).