diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-21 19:57:40 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-21 19:57:40 +0000 |
commit | 729533413f4e97bb65852c22fb914805e2759b5a (patch) | |
tree | cd4dfa8859a5f57124d315ff395b524d7587e1ea /sys/arm/cavium/cns11xx | |
parent | 0d55061d05ce55d28aff0c06bad831448d172425 (diff) | |
download | FreeBSD-src-729533413f4e97bb65852c22fb914805e2759b5a.zip FreeBSD-src-729533413f4e97bb65852c22fb914805e2759b5a.tar.gz |
sys: use our roundup2/rounddown2() macros when param.h is available.
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.
This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
Diffstat (limited to 'sys/arm/cavium/cns11xx')
-rw-r--r-- | sys/arm/cavium/cns11xx/econa_machdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arm/cavium/cns11xx/econa_machdep.c b/sys/arm/cavium/cns11xx/econa_machdep.c index 0ccc15e..aa5ec11 100644 --- a/sys/arm/cavium/cns11xx/econa_machdep.c +++ b/sys/arm/cavium/cns11xx/econa_machdep.c @@ -229,9 +229,9 @@ initarm(struct arm_boot_params *abp) pmap_link_l2pt(l1pagetable, KERNBASE + i * L1_S_SIZE, &kernel_pt_table[KERNEL_PT_KERN + i]); pmap_map_chunk(l1pagetable, KERNBASE, PHYSADDR, - (((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - 1)); + rounddown2(((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE, PAGE_SIZE), + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + afterkern = round_page(rounddown2(lastaddr + L1_S_SIZE, L1_S_SIZE)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * L1_S_SIZE, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); |