summaryrefslogtreecommitdiffstats
path: root/sys/arm/include/sf_buf.h
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2006-08-08 20:59:38 +0000
committercognet <cognet@FreeBSD.org>2006-08-08 20:59:38 +0000
commit2d628bb4d98b991fc187a29462ce204e463b7166 (patch)
tree04b496f0b265f6f59af71e0fdad414f440d96983 /sys/arm/include/sf_buf.h
parente813d81ecb6ebb4e3e75ac0c94d25e4e4c92bdad (diff)
downloadFreeBSD-src-2d628bb4d98b991fc187a29462ce204e463b7166.zip
FreeBSD-src-2d628bb4d98b991fc187a29462ce204e463b7166.tar.gz
Rewrite ARM_USE_SMALL_ALLOC so that instead of the current behavior, it maps
whole the physical memory, cached, using 1MB section mappings. This reduces the address space available for user processes a bit, but given the amount of memory a typical arm machine has, it is not (yet) a big issue. It then provides a uma_small_alloc() that works as it does for architectures which have a direct mapping.
Diffstat (limited to 'sys/arm/include/sf_buf.h')
-rw-r--r--sys/arm/include/sf_buf.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/arm/include/sf_buf.h b/sys/arm/include/sf_buf.h
index 7d438f0..2225d58 100644
--- a/sys/arm/include/sf_buf.h
+++ b/sys/arm/include/sf_buf.h
@@ -29,10 +29,34 @@
#ifndef _MACHINE_SF_BUF_H_
#define _MACHINE_SF_BUF_H_
-#include <sys/queue.h>
struct vm_page;
+#ifdef ARM_USE_SMALL_ALLOC
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/vm_page.h>
+
+struct sf_buf;
+
+
+static __inline vm_offset_t
+sf_buf_kva(struct sf_buf *sf)
+{
+ return arm_ptovirt(VM_PAGE_TO_PHYS((vm_page_t)sf));
+}
+
+static __inline vm_page_t
+sf_buf_page(struct sf_buf *sf)
+{
+ return ((vm_page_t)sf);
+}
+
+#else
+
+#include <sys/queue.h>
+
struct sf_buf {
LIST_ENTRY(sf_buf) list_entry; /* list of buffers */
TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */
@@ -55,4 +79,5 @@ sf_buf_page(struct sf_buf *sf)
return (sf->m);
}
+#endif
#endif /* !_MACHINE_SF_BUF_H_ */
OpenPOWER on IntegriCloud