Add support to mincore for detecting whether a page is part of a
"super" page or not. Reviewed by: alc, ups
This commit is contained in:
parent
7b3fa39a40
commit
6e7534b8c8
@ -72,6 +72,8 @@ Page has been modified by us.
|
||||
Page has been referenced.
|
||||
.It Dv MINCORE_MODIFIED_OTHER
|
||||
Page has been modified.
|
||||
.It Dv MINCORE_SUPER
|
||||
Page is part of a "super" page. (only i386 & amd64)
|
||||
.El
|
||||
.Pp
|
||||
The information returned by
|
||||
|
@ -4371,6 +4371,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr)
|
||||
if (pdep != NULL && (*pdep & PG_V)) {
|
||||
if (*pdep & PG_PS) {
|
||||
pte = *pdep;
|
||||
val = MINCORE_SUPER;
|
||||
/* Compute the physical address of the 4KB page. */
|
||||
pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) &
|
||||
PG_FRAME;
|
||||
@ -4385,7 +4386,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr)
|
||||
PMAP_UNLOCK(pmap);
|
||||
|
||||
if (pte != 0) {
|
||||
val = MINCORE_INCORE;
|
||||
val |= MINCORE_INCORE;
|
||||
if ((pte & PG_MANAGED) == 0)
|
||||
return val;
|
||||
|
||||
|
@ -4481,6 +4481,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr)
|
||||
if (*pdep != 0) {
|
||||
if (*pdep & PG_PS) {
|
||||
pte = *pdep;
|
||||
val = MINCORE_SUPER:
|
||||
/* Compute the physical address of the 4KB page. */
|
||||
pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) &
|
||||
PG_FRAME;
|
||||
@ -4497,7 +4498,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr)
|
||||
PMAP_UNLOCK(pmap);
|
||||
|
||||
if (pte != 0) {
|
||||
val = MINCORE_INCORE;
|
||||
val |= MINCORE_INCORE;
|
||||
if ((pte & PG_MANAGED) == 0)
|
||||
return val;
|
||||
|
||||
|
@ -139,6 +139,7 @@
|
||||
#define MINCORE_MODIFIED 0x4 /* Page has been modified by us */
|
||||
#define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */
|
||||
#define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */
|
||||
#define MINCORE_SUPER 0x20 /* Page is a "super" page */
|
||||
|
||||
/*
|
||||
* Anonymous object constant for shm_open().
|
||||
|
Loading…
x
Reference in New Issue
Block a user