cpu操作函數(shù)
cpu_ops函數(shù)由bringup_cpu調(diào)用,以觸發(fā)secondary cpu啟動(dòng)。它是根據(jù)設(shè)備樹中解析出的enable-method屬性確定的。
int __init init_cpu_ops(int cpu)
{
const char *enable_method = cpu_read_enable_method(cpu); (1)
…
cpu_ops[cpu] = cpu_get_ops(enable_method); (2)
…
}
(1)獲取該cpu enable-method屬性的值
(2)根據(jù)其enable-method獲取其對應(yīng)的cpu_ops回調(diào)
其中spin-table啟動(dòng)方式的回調(diào)如下:
const struct cpu_operations smp_spin_table_ops = {
.name = "spin-table",
.cpu_init = smp_spin_table_cpu_init,
.cpu_prepare = smp_spin_table_cpu_prepare,
.cpu_boot = smp_spin_table_cpu_boot,
}
觸發(fā)secondary cpu啟動(dòng)
以上流程都準(zhǔn)備完成后,觸發(fā)secondary cpu啟動(dòng)就非常簡單了。只需調(diào)用其cpu_ops回調(diào)函數(shù),向其對應(yīng)的spin_table_cpu_release_addr位置寫入secondary cpu入口地址即可。以下為其調(diào)用流程:
其中smp_spin_table_cpu_boot的實(shí)現(xiàn)如下:
static int smp_spin_table_cpu_boot(unsigned int cpu)
{
write_pen_release(cpu_logical_map(cpu)); (1)
sev(); (2)
return 0;
}
(1)向給定地址寫入內(nèi)核entry
(2)通過sev指令喚醒secondary cpu啟動(dòng)
此后,該線程將等待cpu啟動(dòng)完成,并在完成后將其設(shè)置為online狀態(tài)
-
cpu
+關(guān)注
關(guān)注
68文章
11031瀏覽量
215912 -
SMP
+關(guān)注
關(guān)注
0文章
78瀏覽量
20153 -
函數(shù)
+關(guān)注
關(guān)注
3文章
4367瀏覽量
64125 -
設(shè)備樹
+關(guān)注
關(guān)注
0文章
39瀏覽量
3300
發(fā)布評(píng)論請先 登錄
AliOS Things SMP系統(tǒng)及其在esp32上實(shí)現(xiàn)示例
記錄學(xué)習(xí)ARM Linux的多核啟動(dòng)過程
ARM64 SMP多核啟動(dòng)相關(guān)資料推薦(下)
介紹在ARM64架構(gòu)下啟動(dòng)多核的兩種方式
基于raspi 3b上的SMP設(shè)計(jì)實(shí)現(xiàn)
RT-Thread SMP和AMP初體驗(yàn)簡介
RT-Thread框架下的SMP支持
Linux在SMP系統(tǒng)上的移植研究

ARM64 SMP多核啟動(dòng)(上)—spin-table

ARM64 SMP多核啟動(dòng)(下)—PSCI

多核CPU的啟動(dòng)方式
SMP是什么?多核芯片(SMP)的啟動(dòng)方法

SMP是什么 啟動(dòng)方式介紹
SMP多核secondary cpu啟動(dòng)流程

評(píng)論