Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\apic\io_apic.c Create Date:2022-07-28 08:30:27
Last Modify:2020-03-16 21:24:45 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This code may look a bit paranoid, but it's supposed to cooperate with* a wide range of boards and BIOS bugs. Fortunately only the timer IRQ* is so screwy. Thanks to Brian Perkins for testing/hacking this beast* fanatically on his truly buggy board.

Proto:static inline void __init check_timer(void)

Type:void

Parameter:Nothing

2128  irq_data = irq_get_irq_data(0)
2129  data = chip_data
2130  cfg = irqd_cfg(irq_data)
2131  node = cpu_to_node(0)
2134  no_pin1 = 0
2136  If Not HPET replaces the PIT, when enabled. So we need to know, which of* the two timers is used Then Return
2139  local_irq_save(flags)
2144  mask(0)
2155  apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT)
2156  init(1)
2158  pin1 = Find the pin to which IRQ[irq] (ISA) is connected
2159  apic1 = find_isa_irq_apic(0, mp_INT)
2160  pin2 = pin
2161  apic2 = apic
2163  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", vector, apic1, pin1, apic2, pin2)
2174  If pin1 == -1 Then
2175  panic_if_irq_remap("BIOS bug: timer not connected to IO-APIC")
2176  pin1 = pin2
2177  apic1 = apic2
2178  no_pin1 = 1
2179  Else if pin2 == -1 Then
2180  pin2 = pin1
2181  apic2 = apic1
2184  If pin1 != -1 Then
2186  If no_pin1 Then
2188  Else
2196  If idx != -1 && irq_trigger(idx) Then unmask_ioapic_irq(irq_get_irq_data(0))
2199  irq_domain_deactivate_irq(irq_data)
2200  irq_domain_activate_irq(irq_data, false)
2202  If disable_timer_pin_1 > 0 Then clear_IO_APIC_pin(0, pin1)
2204  Go to out
2206  panic_if_irq_remap("timer doesn't work through Interrupt-remapped IO-APIC")
2207  local_irq_disable()
2208  clear_IO_APIC_pin(apic1, pin1)
2209  If Not no_pin1 Then Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, r conditions "..MP-BIOS bug: 8254 timer not connected to IO-APIC\n")
2213  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "...trying to set up timer (IRQ0) through the 8259A ...\n")
2215  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "..... (found apic %d pin %d) ...\n", apic2, pin2)
2220  Reroute an IRQ to a different pin.
2221  irq_domain_deactivate_irq(irq_data)
2222  irq_domain_activate_irq(irq_data, false)
2223  unmask(0)
2226  Go to out
2231  local_irq_disable()
2232  mask(0)
2233  clear_IO_APIC_pin(apic2, pin2)
2234  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "....... failed.\n")
2237  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "...trying to set up timer as Virtual Wire IRQ...\n")
2240  lapic_register_intr(0)
2241  apic_write(APIC_LVT0, APIC_DM_FIXED | vector)
2242  unmask(0)
2244  If There is a nasty bug in some older SMP boards, their mptable lies* about the timer IRQ Then
2245  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "..... works.\n")
2246  Go to out
2248  local_irq_disable()
2249  mask(0)
2250  apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector)
2251  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "..... failed.\n")
2253  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "...trying to set up timer as ExtINT IRQ...\n")
2256  init(0)
2257  make_irq(0)
2258  apic_write(APIC_LVT0, APIC_DM_EXTINT)
2260  This looks a bit hackish but it's about the only one way of sending* a few INTA cycles to 8259As and any associated glue logic
2262  If There is a nasty bug in some older SMP boards, their mptable lies* about the timer IRQ Then
2263  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "..... works.\n")
2264  Go to out
2266  local_irq_disable()
2267  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "..... failed :(.\n")
2268  If apic_is_x2apic_enabled() Then Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(Debugging macros, formational "Perhaps problem with the pre-enabled x2apic mode\nTry booting with x2apic and interrupt-remapping disabled in the bios.\n")
2272  panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
2274  out :
2275  local_irq_restore(flags)
Caller
NameDescribe
setup_IO_APIC