[RFC] Cache control from user land (patch)

sson sson at FreeBSD.org
Wed Jan 14 05:57:09 UTC 2015


miod wrote
>> Hi all:
>> 
>> Below is a link to a patch that provides a sysarch() so that cache lines
>> may
>> be invalidated from userspace (via the sysarch() system call).   For
>> convenience mips_cacheflush() is provided in the machine/cachectl.h
>> header
>> file:
>> 
>>    int mips_cacheflush(void *addr, size_t nbytes, int whichcache);
> 
> Why not provide an IRIX-compatible cacheflush() and _flush_cache()
> aliases? Many 3rd-party software expects them if defined(__mips__).
> 
> Miod

Good idea.  I have updated the diff: 
https://people.freebsd.org/~sson/mips/cacheflush/mips_cacheflush.diff

i.e., added the following to cachectl.h:

+/* IRIX API compatible aliases. */
+#define	ICACHE	MIPS_CF_ICACHE
+#define	DCACHE	MIPS_CF_DCACHE
+#define	BCACHE	MIPS_CF_BCACHE
+
+static inline int
+cacheflush(void *addr, int nbytes, int whichcache)
+{
+
+	return (mips_cacheflush(addr, (size_t)nbytes, whichcache));
+}
+
+static inline int
+_flush_cache(char *addr, int nbytes, int whichcache)
+{
+
+	return (mips_cacheflush((void *)addr, (size_t)nbytes, whichcache));
+}

-stacey.



--
View this message in context: http://freebsd.1045724.n5.nabble.com/RFC-Cache-control-from-user-land-patch-tp5980362p5980519.html
Sent from the freebsd-mips mailing list archive at Nabble.com.


More information about the freebsd-mips mailing list