mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
Make clear_bss work regardless of load address
This commit is contained in:
parent
1d621f3bf4
commit
4025781f1c
1 changed files with 6 additions and 2 deletions
|
@ -136,8 +136,9 @@ FAR_REACHING static void invalidate_icache_all_inner_shareable_tzram_pa(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FAR_REACHING static void clear_bss(void) {
|
FAR_REACHING static void clear_bss(void) {
|
||||||
memset((void *)__pk2ldr_bss_start__, 0, __pk2ldr_end__ - __pk2ldr_bss_start__);
|
volatile uintptr_t v = (uintptr_t)memset;
|
||||||
memset((void *)__main_bss_start__, 0, __main_end__ - __main_bss_start__);
|
((void (*)(void *, int, size_t))v)((void *)__pk2ldr_bss_start__, 0, __pk2ldr_end__ - __pk2ldr_bss_start__);
|
||||||
|
((void (*)(void *, int, size_t))v)((void *)__main_bss_start__, 0, __main_end__ - __main_bss_start__);
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t get_coldboot_crt0_stack_address(void) {
|
uintptr_t get_coldboot_crt0_stack_address(void) {
|
||||||
|
@ -153,8 +154,11 @@ void coldboot_init(void) {
|
||||||
/* TODO: initialize DMA controllers, etc. */
|
/* TODO: initialize DMA controllers, etc. */
|
||||||
configure_ttbls();
|
configure_ttbls();
|
||||||
set_memory_registers_enable_mmu_tzram_pa();
|
set_memory_registers_enable_mmu_tzram_pa();
|
||||||
|
|
||||||
|
|
||||||
copy_other_sections();
|
copy_other_sections();
|
||||||
|
|
||||||
|
|
||||||
flush_dcache_all_tzram_pa();
|
flush_dcache_all_tzram_pa();
|
||||||
invalidate_icache_all_inner_shareable_tzram_pa();
|
invalidate_icache_all_inner_shareable_tzram_pa();
|
||||||
/* At this point we can access all the mapped segments (all other functions, data...) normally */
|
/* At this point we can access all the mapped segments (all other functions, data...) normally */
|
||||||
|
|
Loading…
Reference in a new issue