Skip to content

Commit

Permalink
- Disable MMU before reconfiguring the pagetables in the trampoline c…
Browse files Browse the repository at this point in the history
…ode.

  Otherwise we might end up overwriting the PTEs we're currently using
  for some reason.

Reviewed by:	cognet
  • Loading branch information
stass committed Apr 25, 2012
1 parent 912ab38 commit 943262f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sys/arm/arm/elf_trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,17 @@ __start(void)
(unsigned int)&func_end + 800 , 0);
if (altdst > dst)
dst = altdst;

/*
* Disable MMU. Otherwise, setup_pagetables call below
* might overwrite the L1 table we are currently using.
*/
cpu_idcache_wbinv_all();
cpu_l2cache_wbinv_all();
__asm __volatile("mrc p15, 0, %0, c1, c0, 0\n"
"bic %0, %0, #1\n" /* MMU_DISABLE */
"mcr p15, 0, %0, c1, c0, 0\n"
:"=r" (pt_addr));
} else
#endif
dst = 4 + load_kernel((unsigned int)&kernel_start,
Expand Down

0 comments on commit 943262f

Please sign in to comment.