summaryrefslogtreecommitdiffstats
path: root/sys/arm/include
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
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')
-rw-r--r--sys/arm/include/pmap.h3
-rw-r--r--sys/arm/include/sf_buf.h27
-rw-r--r--sys/arm/include/vmparam.h7
3 files changed, 35 insertions, 2 deletions
diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h
index 0f97246..cb45c88 100644
--- a/sys/arm/include/pmap.h
+++ b/sys/arm/include/pmap.h
@@ -531,7 +531,8 @@ void pmap_postinit(void);
#ifdef ARM_USE_SMALL_ALLOC
void arm_add_smallalloc_pages(void *, void *, int, int);
-void arm_busy_pages(void);
+vm_offset_t arm_ptovirt(vm_paddr_t);
+void arm_init_smallalloc(void);
struct arm_small_page {
void *addr;
TAILQ_ENTRY(arm_small_page) pg_list;
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_ */
diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h
index d5725a4..c16df43 100644
--- a/sys/arm/include/vmparam.h
+++ b/sys/arm/include/vmparam.h
@@ -96,7 +96,14 @@
#define UPT_MIN_ADDRESS VADDR(UPTPTDI, 0)
#define VM_MIN_ADDRESS (0x00001000)
+#ifdef ARM_USE_SMALL_ALLOC
+#ifndef ARM_KERN_DIRECTMAP
+#define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */
+#endif
+#define VM_MAXUSER_ADDRESS KERNBASE - ARM_KERN_DIRECTMAP
+#else /* ARM_USE_SMALL_ALLOC */
#define VM_MAXUSER_ADDRESS KERNBASE
+#endif /* ARM_USE_SMALL_ALLOC */
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
#define USRSTACK VM_MAXUSER_ADDRESS
OpenPOWER on IntegriCloud