Function report |
Source Code:arch\x86\kernel\hpet.c |
Create Date:2022-07-28 08:43:06 |
Last Modify:2020-03-16 21:38:50 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:hpet_enable - Try to setup the HPET timer. Returns 1 on success.
Proto:int __init hpet_enable(void)
Type:int
Parameter:Nothing
819 | If Not is_hpet_capable() Then Return 0 |
822 | hpet_set_mapping() |
823 | If Not hpet_virt_address Then Return 0 |
833 | hpet_period = hpet_readl(HPET_PERIOD) |
834 | If hpet_period < HPET_MIN_PERIOD || hpet_period > HPET_MAX_PERIOD Then Go to out_nohpet |
838 | freq = FSEC_PER_SEC |
846 | id = hpet_readl(HPET_ID) |
847 | hpet_print_config() |
850 | channels = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT) + 1 |
856 | If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HPET_EMULATE_RTC) && channels < 2 Then Go to out_nohpet |
859 | hc = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
860 | If Not hc Then |
861 | pr_warn("Disabling HPET.\n") |
862 | Go to out_nohpet |
865 | nr_channels = channels |
868 | cfg = hpet_readl(HPET_CFG) |
870 | cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY) |
871 | hpet_writel(cfg, HPET_CFG) |
879 | cfg = hpet_readl(HPET_Tn_CFG(i)) |
881 | irq = (cfg & Tn_INT_ROUTE_CNF_MASK) >> Tn_INT_ROUTE_CNF_SHIFT |
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) |
893 | hpet_print_config() |
900 | If Not hpet_counting() Then Go to out_nohpet |
903 | clocksource_register_hz( & clocksource_hpet, (u32)hpet_freq) |
905 | If id & HPET_ID_LEGSUP Then |
906 | hpet_legacy_clockevent_register( & channels[0]) |
907 | mode = HPET_MODE_LEGACY |
908 | If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HPET_EMULATE_RTC) Then mode = HPET_MODE_LEGACY |
910 | Return 1 |
912 | Return 0 |
914 | out_nohpet : |
916 | channels = NULL |
917 | nr_channels = 0 |
918 | hpet_clear_mapping() |
920 | Return 0 |
Name | Describe |
---|---|
hpet_late_init | The late initialization runs after the PCI quirks have been invoked* which might have detected a system on which the HPET can be enforced |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |