summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/arm/machdep.c9
-rw-r--r--sys/arm/at91/at91_machdep.c34
2 files changed, 23 insertions, 20 deletions
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 07f6f78..17a60c2 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -1264,10 +1264,10 @@ initarm(struct arm_boot_params *abp)
dpcpu_init((void *)dpcpu.pv_va, 0);
/* Allocate stacks for all modes */
- valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU));
- valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU));
- valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU));
- valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU));
+ valloc_pages(irqstack, IRQ_STACK_SIZE * MAXCPU);
+ valloc_pages(abtstack, ABT_STACK_SIZE * MAXCPU);
+ valloc_pages(undstack, UND_STACK_SIZE * MAXCPU);
+ valloc_pages(kernelstack, KSTACK_PAGES * MAXCPU);
valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
/*
@@ -1408,4 +1408,3 @@ initarm(struct arm_boot_params *abp)
sizeof(struct pcb)));
}
#endif
-
diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c
index d16ce19..f2b63cbd 100644
--- a/sys/arm/at91/at91_machdep.c
+++ b/sys/arm/at91/at91_machdep.c
@@ -96,6 +96,10 @@ __FBSDID("$FreeBSD$");
#include <arm/at91/at91sam9g20reg.h>
#include <arm/at91/at91sam9g45reg.h>
+#ifndef MAXCPU
+#define MAXCPU 1
+#endif
+
/* Page table for mapping proc0 zero page */
#define KERNEL_PT_SYS 0
#define KERNEL_PT_KERN 1
@@ -454,7 +458,7 @@ initarm(struct arm_boot_params *abp)
{
struct pv_addr kernel_l1pt;
struct pv_addr dpcpu;
- int loop, i;
+ int i;
u_int l1pagetable;
vm_offset_t freemempos;
vm_offset_t afterkern;
@@ -482,16 +486,16 @@ initarm(struct arm_boot_params *abp)
while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0)
freemempos += PAGE_SIZE;
valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);
- for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) {
- if (!(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) {
- valloc_pages(kernel_pt_table[loop],
+ for (i = 0; i < NUM_KERNEL_PTS; ++i) {
+ if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) {
+ valloc_pages(kernel_pt_table[i],
L2_TABLE_SIZE / PAGE_SIZE);
} else {
- kernel_pt_table[loop].pv_va = freemempos -
- (loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) *
+ kernel_pt_table[i].pv_va = freemempos -
+ (i % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) *
L2_TABLE_SIZE_REAL;
- kernel_pt_table[loop].pv_pa =
- kernel_pt_table[loop].pv_va - KERNVIRTADDR +
+ kernel_pt_table[i].pv_pa =
+ kernel_pt_table[i].pv_va - KERNVIRTADDR +
KERNPHYSADDR;
}
}
@@ -507,10 +511,10 @@ initarm(struct arm_boot_params *abp)
dpcpu_init((void *)dpcpu.pv_va, 0);
/* Allocate stacks for all modes */
- valloc_pages(irqstack, IRQ_STACK_SIZE);
- valloc_pages(abtstack, ABT_STACK_SIZE);
- valloc_pages(undstack, UND_STACK_SIZE);
- valloc_pages(kernelstack, KSTACK_PAGES);
+ valloc_pages(irqstack, IRQ_STACK_SIZE * MAXCPU);
+ valloc_pages(abtstack, ABT_STACK_SIZE * MAXCPU);
+ valloc_pages(undstack, UND_STACK_SIZE * MAXCPU);
+ valloc_pages(kernelstack, KSTACK_PAGES * MAXCPU);
valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
/*
@@ -558,9 +562,9 @@ initarm(struct arm_boot_params *abp)
pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa,
msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) {
- pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va,
- kernel_pt_table[loop].pv_pa, L2_TABLE_SIZE,
+ for (i = 0; i < NUM_KERNEL_PTS; ++i) {
+ pmap_map_chunk(l1pagetable, kernel_pt_table[i].pv_va,
+ kernel_pt_table[i].pv_pa, L2_TABLE_SIZE,
VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
}
OpenPOWER on IntegriCloud