函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\smpboot.c Create Date:2022-07-27 09:24:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:wakeup_secondary_cpu_via_init

函数原型:static int wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)

返回类型:int

参数:

类型参数名称
intphys_apicid
unsigned longstart_eip
782  send_status等于0, accept_status等于0
785  maxlvt等于lapic_get_maxlvt - get the maximum number of local vector table entries
790  如果APIC_INTEGRATED(boot_cpu_apic_version)则
791  如果maxlvt大于3则apic_write(APIC_ESR, 0)
793  apic_read(APIC_ESR)
796  pr_debug("Asserting INIT\n")
804  apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT, phys_apicid)
807  pr_debug("Waiting for send to finish...\n")
808  send_status等于safe_apic_wait_icr_idle()
810  0x10c7 is 2**32 / 1000000 (rounded up) (init_udelay)
812  pr_debug("Deasserting INIT\n")
816  apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid)
818  pr_debug("Waiting for send to finish...\n")
819  send_status等于safe_apic_wait_icr_idle()
821  Force strict CPU ordering.* And yes, this might be required on UP too when we're talking* to devices.()
829  如果APIC_INTEGRATED(boot_cpu_apic_version)则num_starts等于2
831  否则num_starts等于0
837  pr_debug("#startup loops: %d\n", num_starts)
839 j小于等于num_starts循环
840  pr_debug("Sending STARTUP #%d\n", j)
841  如果maxlvt大于3则apic_write(APIC_ESR, 0)
843  apic_read(APIC_ESR)
844  pr_debug("After apic_write\n")
853  apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12), phys_apicid)
859  如果init_udelay恒等于0则0x10c7 is 2**32 / 1000000 (rounded up) (10)
861  否则0x10c7 is 2**32 / 1000000 (rounded up) (300)
864  pr_debug("Startup point 1\n")
866  pr_debug("Waiting for send to finish...\n")
867  send_status等于safe_apic_wait_icr_idle()
872  如果init_udelay恒等于0则0x10c7 is 2**32 / 1000000 (rounded up) (10)
874  否则0x10c7 is 2**32 / 1000000 (rounded up) (200)
877  如果maxlvt大于3则apic_write(APIC_ESR, 0)
879  accept_status等于apic_read(APIC_ESR)按位与0xEF
880  如果send_statusaccept_status退出
883  pr_debug("After Startup\n")
885  如果send_status打印错误信息("APIC never delivered???\n")
887  如果accept_status打印错误信息("APIC delivery error (%lx)\n", accept_status)
890  返回:send_status按位或accept_status
调用者
名称描述
wakeup_cpu_via_init_nmiWake up AP by INIT, INIT, STARTUP sequence.* Instead of waiting for STARTUP after INITs, BSP will execute the BIOS* boot-strap code which is not a desired behavior for waking up BSP. To* void the boot-strap code, wake up CPU0 by NMI instead.