[PC-BSD Commits] r2498 - freebsd-projects/nvidia-work/split_large_pages/diff_on_HEAD
svn at pcbsd.org
svn at pcbsd.org
Wed Jul 30 21:00:24 PDT 2008
Author: magesh
Date: 2008-07-30 21:00:24 -0700 (Wed, 30 Jul 2008)
New Revision: 2498
Modified:
freebsd-projects/nvidia-work/split_large_pages/diff_on_HEAD/pmap.c_diff_on_v1.638.patch
Log:
Changed the name of one of the parameters to pmap_pte_attr() and pmap_pde_attr() to better reflect their purpose.
Modified: freebsd-projects/nvidia-work/split_large_pages/diff_on_HEAD/pmap.c_diff_on_v1.638.patch
===================================================================
--- freebsd-projects/nvidia-work/split_large_pages/diff_on_HEAD/pmap.c_diff_on_v1.638.patch 2008-07-31 03:43:16 UTC (rev 2497)
+++ freebsd-projects/nvidia-work/split_large_pages/diff_on_HEAD/pmap.c_diff_on_v1.638.patch 2008-07-31 04:00:24 UTC (rev 2498)
@@ -1,11 +1,11 @@
--- /sys/amd64/amd64/pmap.c.orig 2008-07-31 09:00:26.000000000 +0530
-+++ /sys/amd64/amd64/pmap.c 2008-07-31 09:00:41.000000000 +0530
++++ /sys/amd64/amd64/pmap.c 2008-07-31 09:21:52.000000000 +0530
@@ -4250,13 +4250,10 @@ pmap_clear_reference(vm_page_t m)
/* Adjust the cache mode for a 4KB page mapped via a PTE. */
static __inline void
-pmap_pte_attr(vm_offset_t va, int mode)
-+pmap_pte_attr(pt_entry_t *pte, int cbpte)
++pmap_pte_attr(pt_entry_t *pte, int cache_bits)
{
- pt_entry_t *pte;
u_int opte, npte;
@@ -20,14 +20,14 @@
opte = *(u_int *)pte;
npte = opte & ~(PG_PTE_PAT | PG_NC_PCD | PG_NC_PWT);
- npte |= pmap_cache_bits(mode, 0);
-+ npte |= cbpte;
++ npte |= cache_bits;
} while (npte != opte && !atomic_cmpset_int((u_int *)pte, opte, npte));
}
/* Adjust the cache mode for a 2MB page mapped via a PDE. */
static __inline void
-pmap_pde_attr(vm_offset_t va, int mode)
-+pmap_pde_attr(pd_entry_t *pde, int cbpde)
++pmap_pde_attr(pd_entry_t *pde, int cache_bits)
{
- pd_entry_t *pde;
u_int opde, npde;
@@ -42,7 +42,7 @@
opde = *(u_int *)pde;
npde = opde & ~(PG_PDE_PAT | PG_NC_PCD | PG_NC_PWT);
- npde |= pmap_cache_bits(mode, 1);
-+ npde |= cbpde;
++ npde |= cache_bits;
} while (npde != opde && !atomic_cmpset_int((u_int *)pde, opde, npde));
}
@@ -94,20 +94,16 @@
/*
* Pages that aren't mapped aren't supported. Also break down 2MB pages
* into 4KB pages if required.
-@@ -4390,6 +4402,21 @@ pmap_change_attr(vm_offset_t va, vm_size
+@@ -4390,6 +4402,17 @@ pmap_change_attr(vm_offset_t va, vm_size
}
if (*pde & PG_PS) {
/*
-+ * We find the cache mode bits for the required memory
-+ * type (only if we haven't found it already).
-+ */
-+ if (cbpde < 0)
-+ cbpde = pmap_cache_bits(mode, 1);
-+ /*
+ * If the current 2MB page already has the required
+ * memory type, then we need not demote this page. Just
+ * increment tmpva to the next 2MB page frame.
+ */
++ if (cbpde < 0)
++ cbpde = pmap_cache_bits(mode, 1);
+ if ((*pde & PG_PDE_CACHE_BITS) == cbpde) {
+ tmpva = (tmpva + NBPDR) & ~PDRMASK;
+ continue;
@@ -116,7 +112,7 @@
* If the current offset aligns with a 2MB page frame
* and there is at least 2MB left within the range, then
* we need not break down this page into 4KB pages.
-@@ -4415,27 +4442,40 @@ pmap_change_attr(vm_offset_t va, vm_size
+@@ -4415,27 +4438,40 @@ pmap_change_attr(vm_offset_t va, vm_size
/*
* Ok, all the pages exist, so run through them updating their
More information about the Commits
mailing list