aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2002-06-01 16:59:30 +0000
committerAlan Cox <alc@FreeBSD.org>2002-06-01 16:59:30 +0000
commit794316a866e9407bbf161d29adf52a8d57d59740 (patch)
treeea3b5e6f302e123b8be6393c2daaa7d29356dc79 /sys
parentbc89a11710e59ed4f3174d2eda651fcd0f95481a (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_map.c27
-rw-r--r--sys/vm/vm_map.h11
2 files changed, 21 insertions, 17 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 2da4baafc3aba..853815c7c6d15 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -356,19 +356,6 @@ vmspace_swap_count(struct vmspace *vmspace)
return (count);
}
-u_char
-vm_map_entry_behavior(struct vm_map_entry *entry)
-{
- return entry->eflags & MAP_ENTRY_BEHAV_MASK;
-}
-
-void
-vm_map_entry_set_behavior(struct vm_map_entry *entry, u_char behavior)
-{
- entry->eflags = (entry->eflags & ~MAP_ENTRY_BEHAV_MASK) |
- (behavior & MAP_ENTRY_BEHAV_MASK);
-}
-
void
_vm_map_lock(vm_map_t map, const char *file, int line)
{
@@ -528,6 +515,19 @@ vm_map_entry_create(vm_map_t map)
}
/*
+ * vm_map_entry_set_behavior:
+ *
+ * Set the expected access behavior, either normal, random, or
+ * sequential.
+ */
+static __inline void
+vm_map_entry_set_behavior(vm_map_entry_t entry, u_char behavior)
+{
+ entry->eflags = (entry->eflags & ~MAP_ENTRY_BEHAV_MASK) |
+ (behavior & MAP_ENTRY_BEHAV_MASK);
+}
+
+/*
* vm_map_entry_splay:
*
* Implements Sleator and Tarjan's top-down splay algorithm. Returns
@@ -543,7 +543,6 @@ vm_map_entry_splay(vm_offset_t address, vm_map_entry_t root)
if (root == NULL)
return (root);
- dummy.left = dummy.right = NULL;
lefttreemax = righttreemin = &dummy;
for (;;) {
if (address < root->start) {
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index aff38338079f2..02d3b476f33aa 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -133,6 +133,14 @@ struct vm_map_entry {
#define MAP_ENTRY_NOCOREDUMP 0x0400 /* don't include in a core */
+#ifdef _KERNEL
+static __inline u_char
+vm_map_entry_behavior(vm_map_entry_t entry)
+{
+ return (entry->eflags & MAP_ENTRY_BEHAV_MASK);
+}
+#endif /* _KERNEL */
+
/*
* Maps are doubly-linked lists of map entries, kept sorted
* by address. A single hint is provided to start
@@ -210,9 +218,6 @@ struct vmspace {
};
#ifdef _KERNEL
-u_char vm_map_entry_behavior(struct vm_map_entry *entry);
-void vm_map_entry_set_behavior(struct vm_map_entry *entry, u_char behavior);
-
/*
* Macros: vm_map_lock, etc.
* Function: