diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2018-01-29 04:33:41 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2018-01-29 04:33:41 +0000 |
commit | eb1baf72ae55cd91b1ef7ef624b38d4fba7f2cf5 (patch) | |
tree | 4762e750f4328e0912276a2f7808e37bbf8167a7 /sys/powerpc/booke/pmap.c | |
parent | 156531d65ac7397ee1ae21a2e7d877647245cf0e (diff) | |
download | src-eb1baf72ae55cd91b1ef7ef624b38d4fba7f2cf5.tar.gz src-eb1baf72ae55cd91b1ef7ef624b38d4fba7f2cf5.zip |
Notes
Diffstat (limited to 'sys/powerpc/booke/pmap.c')
-rw-r--r-- | sys/powerpc/booke/pmap.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 69b24ad26139..e6c207ef4552 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -382,6 +382,8 @@ static int mmu_booke_change_attr(mmu_t mmu, vm_offset_t addr, vm_size_t sz, vm_memattr_t mode); static int mmu_booke_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); +static int mmu_booke_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, + int *is_user, vm_offset_t *decoded_addr); static mmu_method_t mmu_booke_methods[] = { @@ -436,6 +438,7 @@ static mmu_method_t mmu_booke_methods[] = { MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), MMUMETHOD(mmu_change_attr, mmu_booke_change_attr), MMUMETHOD(mmu_map_user_ptr, mmu_booke_map_user_ptr), + MMUMETHOD(mmu_decode_kernel_ptr, mmu_booke_decode_kernel_ptr), /* dumpsys() support */ MMUMETHOD(mmu_dumpsys_map, mmu_booke_dumpsys_map), @@ -2292,6 +2295,25 @@ mmu_booke_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, } /* + * Figure out where a given kernel pointer (usually in a fault) points + * to from the VM's perspective, potentially remapping into userland's + * address space. + */ +static int +mmu_booke_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, int *is_user, + vm_offset_t *decoded_addr) +{ + + if (addr < VM_MAXUSER_ADDRESS) + *is_user = 1; + else + *is_user = 0; + + *decoded_addr = addr; + return (0); +} + +/* * Initialize pmap associated with process 0. */ static void |