summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/pmap.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-03-04 18:50:15 +0000
committeralc <alc@FreeBSD.org>2008-03-04 18:50:15 +0000
commitd6dc62ac2dd54c2afece3f042641880b7b59c382 (patch)
tree0869c65a3444ea0d08785fa5bc51bf6107c2f96d /sys/amd64/include/pmap.h
parent3bb463bbf1b4a0167157bf82341abafc8767c974 (diff)
downloadFreeBSD-src-d6dc62ac2dd54c2afece3f042641880b7b59c382.zip
FreeBSD-src-d6dc62ac2dd54c2afece3f042641880b7b59c382.tar.gz
Add support for automatic promotion of 4KB page mappings to 2MB page
mappings. Automatic promotion can be enabled by setting the tunable "vm.pmap.pg_ps_enabled" to a non-zero value. By default, automatic promotion is disabled. (Expect this to change.) Reviewed by: ups Tested by: kris, Peter Holm
Diffstat (limited to 'sys/amd64/include/pmap.h')
-rw-r--r--sys/amd64/include/pmap.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 61c4db6..9844d76 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -57,7 +57,7 @@
#define PG_NC_PCD 0x010 /* PCD Cache disable */
#define PG_A 0x020 /* A Accessed */
#define PG_M 0x040 /* D Dirty */
-#define PG_PS 0x080 /* PS Page size (0=4k,1=4M) */
+#define PG_PS 0x080 /* PS Page size (0=4k,1=2M) */
#define PG_PTE_PAT 0x080 /* PAT PAT index */
#define PG_G 0x100 /* G Global */
#define PG_AVAIL1 0x200 /* / Available for system */
@@ -76,6 +76,13 @@
#define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */
/*
+ * Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB
+ * (PTE) page mappings have identical settings for the following fields:
+ */
+#define PG_PTE_PROMOTE (PG_NX | PG_MANAGED | PG_W | PG_G | PG_PTE_PAT | \
+ PG_M | PG_A | PG_NC_PCD | PG_NC_PWT | PG_U | PG_RW | PG_V)
+
+/*
* Page Protection Exception bits
*/
@@ -241,6 +248,7 @@ struct pmap {
u_int pm_active; /* active on cpus */
/* spare u_int here due to padding */
struct pmap_statistics pm_stats; /* pmap statistics */
+ vm_page_t pm_root; /* spare page table pages */
};
typedef struct pmap *pmap_t;
@@ -301,7 +309,6 @@ extern vm_paddr_t dump_avail[];
extern vm_offset_t virtual_avail;
extern vm_offset_t virtual_end;
-#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list))
#define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz))
void pmap_bootstrap(vm_paddr_t *);
@@ -315,6 +322,7 @@ void pmap_kremove(vm_offset_t);
void *pmap_mapbios(vm_paddr_t, vm_size_t);
void *pmap_mapdev(vm_paddr_t, vm_size_t);
void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
+boolean_t pmap_page_is_mapped(vm_page_t m);
void pmap_unmapdev(vm_offset_t, vm_size_t);
void pmap_invalidate_page(pmap_t, vm_offset_t);
void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t);
OpenPOWER on IntegriCloud