Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Sep 2014 09:46:56 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Adrian Chadd <adrian@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r271213 - head/sys/mips/include
Message-ID:  <20140907054656.GJ17059@FreeBSD.org>
In-Reply-To: <201409062238.s86McXJE068463@svn.freebsd.org>
References:  <201409062238.s86McXJE068463@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  Thanks, Adrian.

  I noticed that some arches that use SFBUF_MAP actually override
only the sf_buf_unmap() routine, and sf_buf_map() matches the
default one.

  Might be a good idea to add SFBUF_UNMAP macro, and override
sf_buf_map()/sf_buf_unmap() separately, to reduce copy-n-paste
a little bit.

On Sat, Sep 06, 2014 at 10:38:33PM +0000, Adrian Chadd wrote:
A> Author: adrian
A> Date: Sat Sep  6 22:38:32 2014
A> New Revision: 271213
A> URL: http://svnweb.freebsd.org/changeset/base/271213
A> 
A> Log:
A>   Implement local sfbuf_map and sfbuf_unmap for MIPS32.
A>   
A>   The pre-rework behaviour was not to keep the cached mappings around after
A>   the sfbuf was used but instead to recycle said mappings.
A>   
A>   PR:		kern/193400
A> 
A> Modified:
A>   head/sys/mips/include/sf_buf.h
A>   head/sys/mips/include/vmparam.h
A> 
A> Modified: head/sys/mips/include/sf_buf.h
A> ==============================================================================
A> --- head/sys/mips/include/sf_buf.h	Sat Sep  6 22:37:47 2014	(r271212)
A> +++ head/sys/mips/include/sf_buf.h	Sat Sep  6 22:38:32 2014	(r271213)
A> @@ -48,4 +48,23 @@ sf_buf_page(struct sf_buf *sf)
A>  }
A>  
A>  #endif /* __mips_n64 */
A> +
A> +#ifndef	__mips_n64	/* in 32 bit mode we manage our own mappings */
A> +
A> +static inline void
A> +sf_buf_map(struct sf_buf *sf, int flags)
A> +{
A> +
A> +	pmap_qenter(sf->kva, &sf->m, 1);
A> +}
A> +
A> +static inline int
A> +sf_buf_unmap(struct sf_buf *sf)
A> +{
A> +	pmap_qremove(sf->kva, 1);
A> +	return (1);
A> +}
A> +
A> +#endif	/* ! __mips_n64 */
A> +
A>  #endif /* !_MACHINE_SF_BUF_H_ */
A> 
A> Modified: head/sys/mips/include/vmparam.h
A> ==============================================================================
A> --- head/sys/mips/include/vmparam.h	Sat Sep  6 22:37:47 2014	(r271212)
A> +++ head/sys/mips/include/vmparam.h	Sat Sep  6 22:38:32 2014	(r271213)
A> @@ -189,6 +189,7 @@
A>  
A>  #ifndef __mips_n64
A>  #define	SFBUF
A> +#define	SFBUF_MAP
A>  #endif
A>  
A>  #endif /* !_MACHINE_VMPARAM_H_ */
A> 

-- 
Totus tuus, Glebius.



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