mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
Implement __set_memory_registers
This commit is contained in:
parent
924d469344
commit
93634d08e3
2 changed files with 27 additions and 0 deletions
|
@ -27,6 +27,7 @@ SECTIONS
|
||||||
.cold_crt0 :
|
.cold_crt0 :
|
||||||
{
|
{
|
||||||
. = ALIGN(64);
|
. = ALIGN(64);
|
||||||
|
KEEP (*(.cold_crt0.text.start)) /* MUST be first */
|
||||||
KEEP (*(.cold_crt0.text*))
|
KEEP (*(.cold_crt0.text*))
|
||||||
KEEP (build/coldboot_init.o(.text*))
|
KEEP (build/coldboot_init.o(.text*))
|
||||||
*(.cold_crt0.rodata*)
|
*(.cold_crt0.rodata*)
|
||||||
|
@ -44,6 +45,7 @@ SECTIONS
|
||||||
. = ALIGN(64);
|
. = ALIGN(64);
|
||||||
__warmboot_crt0_lma__ = LOADADDR(.warm_crt0);
|
__warmboot_crt0_lma__ = LOADADDR(.warm_crt0);
|
||||||
__warmboot_crt0_start__ = ABSOLUTE(.);
|
__warmboot_crt0_start__ = ABSOLUTE(.);
|
||||||
|
KEEP (*(.warm_crt0.text.start)) /* Should be first */
|
||||||
KEEP (*(.warm_crt0.text*))
|
KEEP (*(.warm_crt0.text*))
|
||||||
KEEP (build/warmboot_init.o(.text*))
|
KEEP (build/warmboot_init.o(.text*))
|
||||||
*(.warm_crt0.rodata*)
|
*(.warm_crt0.rodata*)
|
||||||
|
|
|
@ -97,6 +97,31 @@ __start_warm:
|
||||||
ldr x16, =__jump_to_main_warm
|
ldr x16, =__jump_to_main_warm
|
||||||
br x16
|
br x16
|
||||||
|
|
||||||
|
/* Used by coldboot as well */
|
||||||
|
.section .warm_crt0.text.__set_memory_registers, "ax", %progbits
|
||||||
|
.global __set_memory_registers
|
||||||
|
.type __set_memory_registers, %function
|
||||||
|
__set_memory_registers:
|
||||||
|
msr cpuactlr_el1, x2
|
||||||
|
isb
|
||||||
|
msr scr_el3, x3
|
||||||
|
msr ttbr0_el3, x0
|
||||||
|
msr tcr_el3, x4
|
||||||
|
msr cptr_el3, x5
|
||||||
|
msr mair_el3, x6
|
||||||
|
msr vbar_el3, x1
|
||||||
|
|
||||||
|
/* Invalidate the entire TLB on the Inner Shareable domain */
|
||||||
|
isb
|
||||||
|
dsb ish
|
||||||
|
tlbi alle3is
|
||||||
|
dsb ish
|
||||||
|
isb
|
||||||
|
|
||||||
|
msr sctlr_el3, x7
|
||||||
|
isb
|
||||||
|
ret
|
||||||
|
|
||||||
.align 4
|
.align 4
|
||||||
.section .text.__jump_to_main_cold, "ax", %progbits
|
.section .text.__jump_to_main_cold, "ax", %progbits
|
||||||
__jump_to_main_cold:
|
__jump_to_main_cold:
|
||||||
|
|
Loading…
Reference in a new issue