函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\hpet.c Create Date:2022-07-27 09:42:14
Last Modify:2020-03-16 21:38:50 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:hpet_enable - Try to setup the HPET timer. Returns 1 on success.

函数原型:int __init hpet_enable(void)

返回类型:int

参数:

819  如果非is_hpet_capable()则返回:0
822  hpet_set_mapping()
823  如果非hpet_virt_address则返回:0
827  如果非AMD SB700 based systems with spread spectrum enabled use a SMM based* HPET emulation to provide proper frequency setting.* On such systems the SMM code is initialized with the first HPET register* access and takes some time to complete则转到:out_nohpet
833  hpet_period等于hpet_readl(HPET_PERIOD)
834  如果hpet_period小于HPET_MIN_PERIODhpet_period大于HPET_MAX_PERIOD则转到:out_nohpet
838  freq等于FSEC_PER_SEC
839  do_div() is NOT a C function(freq, hpet_period)
840  hpet_freq等于freq
846  id等于hpet_readl(HPET_ID)
847  hpet_print_config()
850  channels等于id按位与HPET_ID_NUMBER的值右移HPET_ID_NUMBER_SHIFT位的值加1
856  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HPET_EMULATE_RTC)且channels小于2则转到:out_nohpet
859  hc等于分配数组内存并置零
860  如果非hc
861  打印警告信息("Disabling HPET.\n")
862  转到:out_nohpet
864  channels等于hc
865  nr_channels等于channels
868  cfg等于hpet_readl(HPET_CFG)
869  boot_cfg等于cfg
870  cfg与等于HPET_CFG_ENABLE按位或HPET_CFG_LEGACY的值的反
871  hpet_writel(cfg, HPET_CFG)
872  如果cfg打印警告信息("Global config: Unknown bits %#x\n", cfg)
876 i小于channels循环
877  num等于i
879  cfg等于hpet_readl(HPET_Tn_CFG(i))
880  boot_cfg等于cfg
881  irq等于cfg按位与Tn_INT_ROUTE_CNF_MASK的值右移Tn_INT_ROUTE_CNF_SHIFT
882  irq等于irq
884  cfg与等于HPET_TN_ENABLE按位或HPET_TN_LEVEL按位或HPET_TN_FSB的值的反
885  hpet_writel(cfg, HPET_Tn_CFG(i))
887  cfg与等于HPET_TN_PERIODIC按位或HPET_TN_PERIODIC_CAP按位或HPET_TN_64BIT_CAP按位或HPET_TN_32BIT按位或HPET_TN_ROUTE按位或HPET_TN_FSB按位或HPET_TN_FSB_CAP的值的反
890  如果cfg打印警告信息("Channel #%u config: Unknown bits %#x\n", i, cfg)
893  hpet_print_config()
900  如果非hpet_counting()则转到:out_nohpet
903  clocksource_register_hz( & clocksource_hpet, (u32)hpet_freq)
905  如果id按位与HPET_ID_LEGSUP
906  hpet_legacy_clockevent_register( & channels[0])
907  mode等于HPET_MODE_LEGACY
908  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HPET_EMULATE_RTC)则mode等于HPET_MODE_LEGACY
910  返回:1
912  返回:0
914  out_nohpet :
915  释放内存
916  channels = NULL
917  nr_channels等于0
918  hpet_clear_mapping()
919  HPET address is set in acpi/boot.c, when an ACPI entry exists等于0
920  返回:0
调用者
名称描述
hpet_late_initThe late initialization runs after the PCI quirks have been invoked* which might have detected a system on which the HPET can be enforced