summaryrefslogtreecommitdiff
path: root/sys/arm/xscale/i8134x/crb_machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arm/xscale/i8134x/crb_machdep.c')
-rw-r--r--sys/arm/xscale/i8134x/crb_machdep.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/arm/xscale/i8134x/crb_machdep.c b/sys/arm/xscale/i8134x/crb_machdep.c
index eb3d08cc48069..3ee31b51a79ce 100644
--- a/sys/arm/xscale/i8134x/crb_machdep.c
+++ b/sys/arm/xscale/i8134x/crb_machdep.c
@@ -131,8 +131,8 @@ static const struct arm_devmap_entry iq81342_devmap[] = {
* Cheat and map a whole section, this will bring
* both PCI-X and PCI-E outbound I/O
*/
- IOP34X_PCIX_OIOBAR_VADDR &~ (0x100000 - 1),
- IOP34X_PCIX_OIOBAR &~ (0x100000 - 1),
+ rounddown2(IOP34X_PCIX_OIOBAR_VADDR, 0x100000),
+ rounddown2(IOP34X_PCIX_OIOBAR, 0x100000),
0x100000,
},
{
@@ -227,8 +227,8 @@ initarm(struct arm_boot_params *abp)
l1pagetable = kernel_l1pt.pv_va;
/* Map the L2 pages tables in the L1 page table */
- pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1),
- &kernel_pt_table[KERNEL_PT_SYS]);
+ pmap_link_l2pt(l1pagetable, rounddown2(ARM_VECTORS_HIGH, 0x00100000),
+ &kernel_pt_table[KERNEL_PT_SYS]);
pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START, 0x100000,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
@@ -236,11 +236,10 @@ initarm(struct arm_boot_params *abp)
0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000,
- (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1),
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- freemem_after = ((int)lastaddr + PAGE_SIZE) & ~(PAGE_SIZE - 1);
- afterkern = round_page(((vm_offset_t)lastaddr + L1_S_SIZE) & ~(L1_S_SIZE
- - 1));
+ rounddown2(((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE, L1_S_SIZE),
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+ freemem_after = rounddown2((int)lastaddr + PAGE_SIZE, PAGE_SIZE);
+ afterkern = round_page(rounddown2((vm_offset_t)lastaddr + L1_S_SIZE, L1_S_SIZE));
for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) {
pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000,
&kernel_pt_table[KERNEL_PT_AFKERNEL + i]);