diff options
author | ian <ian@FreeBSD.org> | 2014-05-18 17:46:48 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-05-18 17:46:48 +0000 |
commit | 369b19b027098bf40d0834da8f6387ef1de87c0b (patch) | |
tree | ef1855ccece4b5d9b8d6562418041e9882a691b6 | |
parent | de1f6cfd9077bc92ca5aaab07e0f76923bfae57b (diff) | |
download | FreeBSD-src-369b19b027098bf40d0834da8f6387ef1de87c0b.zip FreeBSD-src-369b19b027098bf40d0834da8f6387ef1de87c0b.tar.gz |
MFC 258287: Implement pmap_align_superpage().
-rw-r--r-- | sys/arm/arm/pmap-v6.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 1d9ad14..139f6c4 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -5089,6 +5089,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 < NBPDR) + return; + if (object != NULL && (object->flags & OBJ_COLORED) != 0) + offset += ptoa(object->pg_color); + superpage_offset = offset & PDRMASK; + if (size - ((NBPDR - superpage_offset) & PDRMASK) < NBPDR || + (*addr & PDRMASK) == superpage_offset) + return; + if ((*addr & PDRMASK) < superpage_offset) + *addr = (*addr & ~PDRMASK) + superpage_offset; + else + *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } /* |