From 89a4f450d725936ff9d23f44e1f6f20568fdcadb Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sat, 6 Sep 2014 22:38:32 +0000 Subject: [PATCH] Implement local sfbuf_map and sfbuf_unmap for MIPS32. The pre-rework behaviour was not to keep the cached mappings around after the sfbuf was used but instead to recycle said mappings. PR: kern/193400 --- sys/mips/include/sf_buf.h | 19 +++++++++++++++++++ sys/mips/include/vmparam.h | 1 + 2 files changed, 20 insertions(+) diff --git a/sys/mips/include/sf_buf.h b/sys/mips/include/sf_buf.h index 76fb993da87..01ecd236fd5 100644 --- a/sys/mips/include/sf_buf.h +++ b/sys/mips/include/sf_buf.h @@ -48,4 +48,23 @@ sf_buf_page(struct sf_buf *sf) } #endif /* __mips_n64 */ + +#ifndef __mips_n64 /* in 32 bit mode we manage our own mappings */ + +static inline void +sf_buf_map(struct sf_buf *sf, int flags) +{ + + pmap_qenter(sf->kva, &sf->m, 1); +} + +static inline int +sf_buf_unmap(struct sf_buf *sf) +{ + pmap_qremove(sf->kva, 1); + return (1); +} + +#endif /* ! __mips_n64 */ + #endif /* !_MACHINE_SF_BUF_H_ */ diff --git a/sys/mips/include/vmparam.h b/sys/mips/include/vmparam.h index d3b833ebd4a..756a8a60a3f 100644 --- a/sys/mips/include/vmparam.h +++ b/sys/mips/include/vmparam.h @@ -189,6 +189,7 @@ #ifndef __mips_n64 #define SFBUF +#define SFBUF_MAP #endif #endif /* !_MACHINE_VMPARAM_H_ */ -- 2.45.2