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:48
Last Modify:2020-03-16 21:24:45 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:mp_register_ioapic - Register an IOAPIC device*@id: hardware IOAPIC ID*@address: physical address of IOAPIC register area*@gsi_base: base of GSI associated with the IOAPIC*@cfg: configuration information for the IOAPIC

Proto:int mp_register_ioapic(int id, unsigned int address, unsigned int gsi_base, struct ioapic_domain_cfg *cfg)

Type:int

Parameter:

TypeParameterName
intid
unsigned intaddress
unsigned intgsi_base
struct ioapic_domain_cfg *cfg
2796  hotplug = Not Not ioapic_initialized
2801  If Not address Then
2802  pr_warn("Bogus (zero) I/O APIC address found, skipping!\n")
2803  Return -EINVAL
2805  for_each_ioapic(ioapic)
2806  If apicaddr == address Then
2807  pr_warn("address 0x%x conflicts with IOAPIC%d\n", address, ioapic)
2809  Return -EEXIST
2812  idx = find_free_ioapic_entry()
2813  If idx >= MAX_IO_APICS Then
2814  pr_warn("Max # of I/O APICs (%d) exceeded (found %d), skipping\n", MAX_IO_APICS, idx)
2816  Return -ENOSPC
2819  type = MP_IOAPIC
2820  flags = MPC_APIC_USABLE
2821  apicaddr = address
2823  Some hardware wants to get fixmapped without caching.(FIX_IO_APIC_BASE_0 + idx, address)
2824  If bad_ioapic_register(idx) Then
2825  clear_fixmap(FIX_IO_APIC_BASE_0 + idx)
2826  Return -ENODEV
2829  apicid = io_apic_unique_id(idx, id)
2830  apicver = io_apic_get_version(idx)
2836  entries = io_apic_get_redir_entries(idx)
2837  gsi_end = gsi_base + entries - 1
2839  gsi_cfg = mp_ioapic_gsi_routing(ioapic)
2840  If gsi_base >= gsi_base && gsi_base <= gsi_end || gsi_end >= gsi_base && gsi_end <= gsi_end Then
2844  pr_warn("GSI range [%u-%u] for new IOAPIC conflicts with GSI[%u-%u]\n", gsi_base, gsi_end, gsi_base, gsi_end)
2847  clear_fixmap(FIX_IO_APIC_BASE_0 + idx)
2848  Return -ENOSPC
2851  gsi_cfg = mp_ioapic_gsi_routing(idx)
2852  gsi_base = gsi_base
2853  gsi_end = gsi_end
2855  irqdomain = NULL
2856  irqdomain_cfg = cfg
2863  If hotplug Then
2864  If mp_irqdomain_create(idx) Then
2866  Return -ENOMEM
2868  alloc_ioapic_saved_registers(idx)
2871  If gsi_end >= The one past the highest gsi number used Then The one past the highest gsi number used = gsi_end + 1
2873  If nr_ioapics <= idx Then nr_ioapics = idx + 1
2877  * # of IRQ routing registers = entries
2879  pr_info("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, GSI %d-%d\n", idx, mpc_ioapic_id(idx), mpc_ioapic_ver(idx), mpc_ioapic_addr(idx), gsi_base, gsi_end)
2884  Return 0
Caller
NameDescribe
jailhouse_get_smp_config