summaryrefslogtreecommitdiff
path: root/bsp/qemu-virt64-aarch64/drivers/secondary_cpu.c
blob: 844f73ce8d4ee0dd85ede7bc6e6076aeb5b52d74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 */
#include <rthw.h>
#include <rtthread.h>
#include <cpu.h>
#include "gic.h"
#include "interrupt.h"
#include "mmu.h"

#ifdef RT_USING_SMP

extern unsigned long MMUTable[];

void rt_hw_secondary_cpu_bsp_start(void)
{
    rt_hw_spin_lock(&_cpus_lock);

    rt_hw_mmu_ktbl_set((unsigned long)MMUTable);

    // interrupt init
    rt_hw_vector_init();

    arm_gic_cpu_init(0, 0);

    // local timer init

    rt_system_scheduler_start();
}

#endif // SMP