Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2015 12:06:34 -0700 (MST)
From:      sson <sson@FreeBSD.org>
To:        freebsd-mips@freebsd.org
Subject:   [RFC] Cache control from user land (patch)
Message-ID:  <1421175994697-5980362.post@n5.nabble.com>

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

mips_cacheflush() flushes the content of the selected cache for the user
addresses in the range from addr to (addr+nbytes-1).  whichcache may be:

MIPS_CF_ICACHE:   Flush the instruction cache lines for a given user address
range.
MIPS_CF_DCACHE:  Write back to memory and invalidate the cache lines for a
given user address range.
MIPS_CF_BCACHE:  Write back and invalidate both types of caches for a given
user address range.
MIPS_CF_ICACHE_ALL, MIPS_CF_DCACHE, or MIPS_CF_BCACHE: Full the entire given
cache(s).

mips_cacheflush() may return the errno EFAULT or EINVAL (whichcache is not
valid).  In short, it is similar to the cacheflush() that netbsd provides
for mips.

The diff: 
https://people.freebsd.org/~sson/mips/cacheflush/mips_cacheflush.diff

Comments, concerns, questions, suggestions, etc. are welcome.

Regards,

-stacey.





--
View this message in context: http://freebsd.1045724.n5.nabble.com/RFC-Cache-control-from-user-land-patch-tp5980362.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?1421175994697-5980362.post>