1 /* 2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU) 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #include "boot.h" 13 #include <machine.h> 14 #include <common/macro.h> 15 #include <common/types.h> 16 #include <common/vars.h> 17 18 char boot_stacks[PLAT_CPU_NUM][BOOT_STACK_SIZE] ALIGN(STACK_ALIGNMENT); 19 clear_bss(void)20static void clear_bss(void) 21 { 22 u64 *ptr; 23 24 for (ptr = &_bss_start; ptr < &_bss_end; ptr++) { 25 *ptr = 0; 26 } 27 } 28 start_c(paddr_t start_pa)29void start_c(paddr_t start_pa) 30 { 31 clear_bss(); 32 33 init_boot_page_table(); 34 35 el1_mmu_activate(); 36 37 start_kernel(start_pa); 38 } 39