Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2015 22:48:17 -0700 (MST)
From:      sson <sson@FreeBSD.org>
To:        freebsd-mips@freebsd.org
Subject:   Re: [RFC] Cache control from user land (patch)
Message-ID:  <1421214497093-5980519.post@n5.nabble.com>
In-Reply-To: <20150113191536.GA29344@tazenat.gentiane.org>
References:  <1421175994697-5980362.post@n5.nabble.com> <20150113191536.GA29344@tazenat.gentiane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1421214497093-5980519.post>