summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-05-18 04:16:57 +0000
committeralc <alc@FreeBSD.org>2008-05-18 04:16:57 +0000
commita8f81206ad84b1ab64280e9138a55223f038fc54 (patch)
tree66daa86e54a43f6d578f868aa2c92f77693509f7 /sys
parentafc301919a8dbd312078ed5029c7efe8e76a2302 (diff)
downloadFreeBSD-src-a8f81206ad84b1ab64280e9138a55223f038fc54.zip
FreeBSD-src-a8f81206ad84b1ab64280e9138a55223f038fc54.tar.gz
Retire pmap_addr_hint(). It is no longer used.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c12
-rw-r--r--sys/arm/arm/pmap.c7
-rw-r--r--sys/i386/i386/pmap.c12
-rw-r--r--sys/ia64/ia64/pmap.c7
-rw-r--r--sys/mips/mips/pmap.c27
-rw-r--r--sys/powerpc/booke/pmap.c10
-rw-r--r--sys/powerpc/powerpc/mmu_if.m14
-rw-r--r--sys/powerpc/powerpc/pmap_dispatch.c8
-rw-r--r--sys/sparc64/sparc64/pmap.c7
-rw-r--r--sys/sun4v/sun4v/pmap.c6
-rw-r--r--sys/vm/pmap.h1
11 files changed, 24 insertions, 87 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 5af214f..28cf203 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -4458,18 +4458,6 @@ if (oldpmap) /* XXX FIXME */
critical_exit();
}
-vm_offset_t
-pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size)
-{
-
- if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) {
- return addr;
- }
-
- addr = (addr + (NBPDR - 1)) & ~(NBPDR - 1);
- return addr;
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index 992fb58..cec6703 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -4348,13 +4348,6 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr)
}
-vm_offset_t
-pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size)
-{
-
- return(addr);
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index a688810..e293286 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -4586,18 +4586,6 @@ pmap_activate(struct thread *td)
critical_exit();
}
-vm_offset_t
-pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size)
-{
-
- if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) {
- return addr;
- }
-
- addr = (addr + PDRMASK) & ~PDRMASK;
- return addr;
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index 68218f6..10726a5 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -2259,13 +2259,6 @@ out:
return (prevpm);
}
-vm_offset_t
-pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size)
-{
-
- return addr;
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c
index a55167c..2fe2559 100644
--- a/sys/mips/mips/pmap.c
+++ b/sys/mips/mips/pmap.c
@@ -2838,19 +2838,6 @@ pmap_activate(struct thread *td)
critical_exit();
}
-/* TBD */
-
-vm_offset_t
-pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size)
-{
-
- if ((obj == NULL) || (size < NBSEG) || (obj->type != OBJT_DEVICE)) {
- return addr;
- }
- addr = (addr + (NBSEG - 1)) & ~(NBSEG - 1);
- return addr;
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
@@ -2859,6 +2846,20 @@ void
pmap_align_superpage(vm_object_t object, vm_ooffset_t offset,
vm_offset_t *addr, vm_size_t size)
{
+ vm_offset_t superpage_offset;
+
+ if (size < NBSEG)
+ return;
+ if (object != NULL && (object->flags & OBJ_COLORED) != 0)
+ offset += ptoa(object->pg_color);
+ superpage_offset = offset & SEGOFSET;
+ if (size - ((NBSEG - superpage_offset) & SEGOFSET) < NBSEG ||
+ (*addr & SEGOFSET) == superpage_offset)
+ return;
+ if ((*addr & SEGOFSET) < superpage_offset)
+ *addr = (*addr & ~SEGOFSET) + superpage_offset;
+ else
+ *addr = ((*addr + SEGOFSET) & ~SEGOFSET) + superpage_offset;
}
int pmap_pid_dump(int pid);
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index e0c30bd..d0d2878 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -269,7 +269,6 @@ static struct ptbl_buf *ptbl_bufs;
/*
* Kernel MMU interface
*/
-static vm_offset_t mmu_booke_addr_hint(mmu_t, vm_object_t, vm_offset_t, vm_size_t);
static void mmu_booke_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t);
static void mmu_booke_clear_modify(mmu_t, vm_page_t);
static void mmu_booke_clear_reference(mmu_t, vm_page_t);
@@ -323,7 +322,6 @@ static boolean_t mmu_booke_page_executable(mmu_t, vm_page_t);
static mmu_method_t mmu_booke_methods[] = {
/* pmap dispatcher interface */
- MMUMETHOD(mmu_addr_hint, mmu_booke_addr_hint),
MMUMETHOD(mmu_change_wiring, mmu_booke_change_wiring),
MMUMETHOD(mmu_clear_modify, mmu_booke_clear_modify),
MMUMETHOD(mmu_clear_reference, mmu_booke_clear_reference),
@@ -2320,14 +2318,6 @@ mmu_booke_mincore(mmu_t mmu, pmap_t pmap, vm_offset_t addr)
return (0);
}
-static vm_offset_t
-mmu_booke_addr_hint(mmu_t mmu, vm_object_t object, vm_offset_t va,
- vm_size_t size)
-{
-
- return (va);
-}
-
/**************************************************************************/
/* TID handling */
/**************************************************************************/
diff --git a/sys/powerpc/powerpc/mmu_if.m b/sys/powerpc/powerpc/mmu_if.m
index 0903e3d..4a8ffa8 100644
--- a/sys/powerpc/powerpc/mmu_if.m
+++ b/sys/powerpc/powerpc/mmu_if.m
@@ -100,10 +100,10 @@ CODE {
return;
}
- static vm_offset_t mmu_null_addr_hint(mmu_t mmu, vm_object_t object,
- vm_offset_t va, vm_size_t size)
+ static void mmu_null_align_superpage(mmu_t mmu, vm_object_t object,
+ vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size)
{
- return (va);
+ return;
}
};
@@ -659,15 +659,17 @@ METHOD void deactivate {
* return the given tentative start address.
*
* @param _obj VM backing object
+ * @param _offset starting offset with the VM object
* @param _addr initial guess at virtual address
* @param _size size of virtual address range
*/
-METHOD vm_offset_t addr_hint {
+METHOD void align_superpage {
mmu_t _mmu;
vm_object_t _obj;
- vm_offset_t _addr;
+ vm_ooffset_t _offset;
+ vm_offset_t *_addr;
vm_size_t _size;
-} DEFAULT mmu_null_addr_hint;
+} DEFAULT mmu_null_align_superpage;
diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c
index 6b79622..7e0c4ff 100644
--- a/sys/powerpc/powerpc/pmap_dispatch.c
+++ b/sys/powerpc/powerpc/pmap_dispatch.c
@@ -297,12 +297,6 @@ pmap_deactivate(struct thread *td)
MMU_DEACTIVATE(mmu_obj, td);
}
-vm_offset_t
-pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size)
-{
- return (MMU_ADDR_HINT(mmu_obj, obj, addr, size));
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
@@ -311,6 +305,8 @@ void
pmap_align_superpage(vm_object_t object, vm_ooffset_t offset,
vm_offset_t *addr, vm_size_t size)
{
+
+ MMU_ALIGN_SUPERPAGE(mmu_obj, object, offset, addr, size);
}
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index a0a622d..7b9a8d4 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -1978,13 +1978,6 @@ pmap_activate(struct thread *td)
mtx_unlock_spin(&sched_lock);
}
-vm_offset_t
-pmap_addr_hint(vm_object_t object, vm_offset_t va, vm_size_t size)
-{
-
- return (va);
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
diff --git a/sys/sun4v/sun4v/pmap.c b/sys/sun4v/sun4v/pmap.c
index 3fe21dd..4a5b7d6 100644
--- a/sys/sun4v/sun4v/pmap.c
+++ b/sys/sun4v/sun4v/pmap.c
@@ -424,12 +424,6 @@ pmap_activate(struct thread *td)
critical_exit();
}
-vm_offset_t
-pmap_addr_hint(vm_object_t object, vm_offset_t va, vm_size_t size)
-{
- return (va);
-}
-
/*
* Increase the starting virtual address of the given mapping if a
* different alignment might result in more superpage mappings.
diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h
index 5490ba2..486855c 100644
--- a/sys/vm/pmap.h
+++ b/sys/vm/pmap.h
@@ -132,7 +132,6 @@ void pmap_zero_page_area(vm_page_t, int off, int size);
void pmap_zero_page_idle(vm_page_t);
int pmap_mincore(pmap_t pmap, vm_offset_t addr);
void pmap_activate(struct thread *td);
-vm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size);
#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count)
#define pmap_wired_count(pm) ((pm)->pm_stats.wired_count)
OpenPOWER on IntegriCloud