diff options
author | ps <ps@FreeBSD.org> | 2008-03-28 04:29:27 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2008-03-28 04:29:27 +0000 |
commit | 41d5b26ff8d7a88a81316dcf6014be2acd0553f9 (patch) | |
tree | dcda557febb2bec52abdb8d813e2359ca7ad5d8d /sys | |
parent | f6c880cb2d8e78a05b3c20e3ef96698dc74842ce (diff) | |
download | FreeBSD-src-41d5b26ff8d7a88a81316dcf6014be2acd0553f9.zip FreeBSD-src-41d5b26ff8d7a88a81316dcf6014be2acd0553f9.tar.gz |
Add support to mincore for detecting whether a page is part of a
"super" page or not.
Reviewed by: alc, ups
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 3 | ||||
-rw-r--r-- | sys/sys/mman.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 025a141..dd5c87d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -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; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 98a2fdf..c103ca6 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -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; diff --git a/sys/sys/mman.h b/sys/sys/mman.h index c6b8d42..6a963c9 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -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(). |