[GSoC] [ARM] Patch by Johannes Wischert.

Turn off interrupts at loader entryn and make sure the mmu is disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32405 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2009-08-15 02:11:07 +00:00
parent 639b8a4905
commit bb7479a182

View File

@ -36,7 +36,31 @@ SYMBOL_END(_start_netbsd)
SYMBOL(_start_common):
strb r4,gUBootOS
str r8,gUBootGlobalData
/* ... */
/*
* Turn off interrupts and make sure we are in SVC mode
*/
mrs r4, cpsr
bic r4, r4, #0x1f
orr r4, r4, #0xd3
msr cpsr, r4
/*
* Turn off MMU and data cache if necessary.
* WARNING: assumes we are running with a 1-1 mapping if MMU is enabled.
*/
mrc p15, 0, r4, c1, c0, 0
bic r4, r4, #0x0000000f // WCAM bits
bic r4, r4, #0x00000300 // RS bits
mcr p15, 0, r4, c1, c0, 0
mov r4, #0
mov r4, r4
mov r4, r4
ldrb r4,gUBootOS
cmp r4,#0
beq start_raw