summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2009-07-01 20:07:44 +0000
committerraj <raj@FreeBSD.org>2009-07-01 20:07:44 +0000
commit5f05e95e54899adfe2362a39f82a4d2e2bba1db6 (patch)
treea7696be83dc2729f368d170dd019d6bb053285eb /sys/arm
parentcd692bb0b91a97bec422a64640da5df4c60f41c0 (diff)
downloadFreeBSD-src-5f05e95e54899adfe2362a39f82a4d2e2bba1db6.zip
FreeBSD-src-5f05e95e54899adfe2362a39f82a4d2e2bba1db6.tar.gz
Map DPCPU pages into ARM kernel VA space.
DPCPU area was not properly mapped into kernel VA space, which caused page fault on the first DPCPU access. This patch fixes the problem by mapping DPCPU area into kernel VA space. Submitted by: Michal Hajduk, Piotr Ziecik Reviewed by: cognet, stas Approved by: re (kib) Obtained from: Semihalf
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/at91/at91_machdep.c5
-rw-r--r--sys/arm/mv/mv_machdep.c6
-rw-r--r--sys/arm/sa11x0/assabet_machdep.c3
3 files changed, 11 insertions, 3 deletions
diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c
index 90bf495..8235000 100644
--- a/sys/arm/at91/at91_machdep.c
+++ b/sys/arm/at91/at91_machdep.c
@@ -301,6 +301,11 @@ initarm(void *arg, void *arg2)
/* Map the vector page. */
pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+
+ /* Map the DPCPU pages */
+ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, DPCPU_SIZE,
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+
/* Map the stack pages */
pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
diff --git a/sys/arm/mv/mv_machdep.c b/sys/arm/mv/mv_machdep.c
index 8e1d5fd..59836fc 100644
--- a/sys/arm/mv/mv_machdep.c
+++ b/sys/arm/mv/mv_machdep.c
@@ -528,9 +528,9 @@ initarm(void *mdp, void *unused __unused)
L2_TABLE_SIZE_REAL * l2size,
VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
- /* Map allocated stacks and msgbuf */
- pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
- freemempos - irqstack.pv_va,
+ /* Map allocated DPCPU, stacks and msgbuf */
+ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa,
+ freemempos - dpcpu.pv_va,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
/* Link and map the vector page */
diff --git a/sys/arm/sa11x0/assabet_machdep.c b/sys/arm/sa11x0/assabet_machdep.c
index 4fa6656..521f3c3 100644
--- a/sys/arm/sa11x0/assabet_machdep.c
+++ b/sys/arm/sa11x0/assabet_machdep.c
@@ -313,6 +313,9 @@ initarm(void *arg, void *arg2)
pmap_map_chunk(l1pagetable, KERNBASE, KERNBASE,
((uint32_t)lastaddr - KERNBASE), VM_PROT_READ|VM_PROT_WRITE,
PTE_CACHE);
+ /* Map the DPCPU pages */
+ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, DPCPU_SIZE,
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
/* Map the stack pages */
pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
OpenPOWER on IntegriCloud