1、std_svc_setup (主要关注设置psci操作集)--有服务std_svc_setup //services/std_svc/std_svc_setup.c- >psci_setup //lib/psci/psci_setup.c - >plat_setup_psci_ops //设置平台的psci操作 调用平台的plat_setup_psci_ops函数去设置psci操作 eg:qemu平台 - >*psci_ops = &plat_qemu_psci_pm_ops; 208 static const plat_psci_ops_t plat_qemu_psci_pm_ops = { 209 .cpu_standby = qemu_cpu_standby, 210 .pwr_domain_on = qemu_pwr_domain_on, 211 .pwr_domain_off = qemu_pwr_domain_off, 212 .pwr_domain_suspend = qemu_pwr_domain_suspend, 213 .pwr_domain_on_finish = qemu_pwr_domain_on_finish, 214 .pwr_domain_suspend_finish = qemu_pwr_domain_suspend_finish, 215 .system_off = qemu_system_off, 216 .system_reset = qemu_system_reset, 217 .validate_power_state = qemu_validate_power_state, 218 .validate_ns_entrypoint = qemu_validate_ns_entrypoint 219 };在遍历每一个注册的运行时服务的时候,会导致std_svc_setup调用,其中会做psci操作集的设置,操作集中我们可以看到对核电源的管理的接口如:核上电,下电,挂起等,我们主要关注上电 .pwr_domain_on = qemu_pwr_domain_on,这个接口当我们主处理器boot从处理器的时候会用到。
2、运行时服务触发和处理--来请求smc指令触发进入el3异常向量表:
runtime_exceptions //el3的异常向量表- >sync_exception_aarch64- >handle_sync_exception- >smc_handler64- > ¦* populate the parameters for the smc handler. ¦* we already have x0-x4 in place. x5 will point to a cookie (not used ¦* now). x6 will point to the context structure (sp_el3) and x7 will ¦* contain flags we need to pass to the handler hence save x5-x7. ¦* ¦* note: x4 only needs to be preserved for aarch32 callers but we do it ¦* for aarch64 callers as well for convenience ¦*/ stp x4, x5, [sp, #ctx_gpregs_offset + ctx_gpreg_x4] //保存x4-x7到栈 stp x6, x7, [sp, #ctx_gpregs_offset + ctx_gpreg_x6] /* save rest of the gpregs and sp_el0*/ save_x18_to_x29_sp_el0 mov x5, xzr //x5清零 mov x6, sp //sp保存在x6 /* get the unique owning entity number */ //获得唯一的入口编号 ubfx x16, x0, #funcid_oen_shift, #funcid_oen_width ubfx x15, x0, #funcid_type_shift, #funcid_type_width orr x16, x16, x15, lsl #funcid_oen_width adr x11, (__rt_svc_descs_start__ + rt_svc_desc_handle) /* load descriptor index from array of indices */ adr x14, rt_svc_descs_indices //获得服务描述 标识数组 ldrb w15, [x14, x16] //根据唯一的入口编号 找到处理函数的 地址 /* ¦* restore the saved c runtime stack value which will become the new ¦* sp_el0 i.e. el3 runtime stack. it was saved in the 'cpu_context' ¦* structure prior to the last eret from el3. ¦*/ ldr x12, [x6, #ctx_el3state_offset + ctx_runtime_sp] /* ¦* any index greater than 127 is invalid. check bit 7 for ¦* a valid index ¦*/ tbnz w15, 7, smc_unknown /* switch to sp_el0 */ msr spsel, #0 /* ¦* get the descriptor using the index ¦* x11 = (base + off), x15 = index ¦* ¦* handler = (base + off) + (index < ret = psci_smc_handler(smc_fid, x1, x2, x3, x4, ¦ cookie, handle, flags) ... 480 } else {481 /* 64-bit psci function */ 482 483 switch (smc_fid) { 484 case psci_cpu_suspend_aarch64: 485 ret = (u_register_t) 486 psci_cpu_suspend((unsigned int)x1, x2, x3); 487 break; 488 489 case psci_cpu_on_aarch64: 490 ret = (u_register_t)psci_cpu_on(x1, x2, x3); 491 break; 492 ...}
2024 年“十大突破性技术”榜单
最强中端5G芯片诞生,超越高通骁龙765G
26支全球顶尖战队嘉兴上演网络最强“矛盾之争”
来了!第三批机型全面开放升级EMUI9.0
火爆的微信小说分销系统微信小说分销平台开发有哪些
SMP多核启动PSCI代码示例
华为智慧屏65英寸版本预售上线,具有三大智慧卖点
关于摄像机镜头的介绍和分类
东芝新开发的混合电路技术实现远距离测量
工业机器人短期内整体市场呈稳健增长态势
凌力尔特推出8通道微型模块ADC系列-LTM9011-14
中国联通以5G为基础打造全新时代的超级物联网
安全光幕传感器常见的故障
低通滤波器与匹配滤波器的区别
江波龙入选国家级专精特新“小巨人”企业
如何快速区别光端机和光纤收发器
奔驰EQC德国量产 搭载80KWh三元电池系统
肝胆疾病数据库填补医疗人工智能在肝胆疾病领域的标准空白
如何用5美元树莓派攻破一台有密码锁的计算机
一个和快完全不沾边的网站