diff options
author | jchandra <jchandra@FreeBSD.org> | 2011-01-27 14:49:22 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2011-01-27 14:49:22 +0000 |
commit | e0953f64d353b5b62c4b32e89ba2914eb1fdec24 (patch) | |
tree | fdd6ab84b1bcf99f7de8e8cc0debd0f9efaceb4d /sys/mips/include/sf_buf.h | |
parent | cb008dd1afea31668df80b23122049573f039ea1 (diff) | |
download | FreeBSD-src-e0953f64d353b5b62c4b32e89ba2914eb1fdec24.zip FreeBSD-src-e0953f64d353b5b62c4b32e89ba2914eb1fdec24.tar.gz |
Implement sf_buf using direct map (XKPHYS) in MIPS n64.
- Provide trivial implementation of sf_buf_alloc(), sf_buf_free(),
sf_buf_kva() and sf_buf_page() using direct map for n64.
- uio_machdep.c - use macros so that the direct map will be used in
case of n64.
Reviewed by: imp (earlier version)
Obtained from: jmallett (user/jmallett/octeon)
Diffstat (limited to 'sys/mips/include/sf_buf.h')
-rw-r--r-- | sys/mips/include/sf_buf.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/mips/include/sf_buf.h b/sys/mips/include/sf_buf.h index b6ee1cc..b9efaf0 100644 --- a/sys/mips/include/sf_buf.h +++ b/sys/mips/include/sf_buf.h @@ -29,8 +29,35 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ +#ifdef __mips_n64 +#include <vm/vm.h> +#include <vm/vm_param.h> +#include <vm/vm_page.h> +#else #include <sys/queue.h> +#endif +#ifdef __mips_n64 +/* In 64 bit the whole memory is directly mapped */ +struct sf_buf; + +static __inline vm_offset_t +sf_buf_kva(struct sf_buf *sf) +{ + vm_page_t m; + + m = (vm_page_t)sf; + return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); +} + +static __inline struct vm_page * +sf_buf_page(struct sf_buf *sf) +{ + + return ((vm_page_t)sf); +} + +#else /* ! __mips_n64 */ struct vm_page; struct sf_buf { @@ -52,5 +79,6 @@ sf_buf_page(struct sf_buf *sf) return (sf->m); } +#endif /* __mips_n64 */ #endif /* !_MACHINE_SF_BUF_H_ */ |