From owner-freebsd-mips@FreeBSD.ORG Wed Jan 14 05:57:08 2015 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE6C0F73 for ; Wed, 14 Jan 2015 05:57:08 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1.freebsd.org (Postfix) with ESMTP id C864DAB8 for ; Wed, 14 Jan 2015 05:57:08 +0000 (UTC) Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 520D91076562 for ; Tue, 13 Jan 2015 21:48:17 -0800 (PST) Date: Tue, 13 Jan 2015 22:48:17 -0700 (MST) From: sson To: freebsd-mips@freebsd.org 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> Subject: Re: [RFC] Cache control from user land (patch) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2015 05:57:09 -0000 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.