svn commit: r271213 - head/sys/mips/include

Gleb Smirnoff glebius at FreeBSD.org
Sun Sep 7 05:47:00 UTC 2014


  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.


More information about the svn-src-head mailing list