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

Name:mp_irqdomain_alloc

Proto:int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq, unsigned int nr_irqs, void *arg)

Type:int

Parameter:

TypeParameterName
struct irq_domain *domain
unsigned intvirq
unsigned intnr_irqs
void *arg
2981  info = arg
2984  If Not info || nr_irqs > 1 Then Return -EINVAL
2986  irq_data = q_domain_get_irq_data - Get irq_data associated with @virq and @domain*@domain: domain to match*@virq: IRQ number to get irq_data
2987  If Not irq_data Then Return -EINVAL
2990  ioapic = mp_irqdomain_ioapic_idx(domain)
2991  pin = ioapic_pin
2992  If q_find_mapping() - Find a linux irq from a hw irq number.*@domain: domain owning this hardware interrupt*@hwirq: hardware irq number in that domain space > 0 Then Return -EEXIST
2995  data = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
2996  If Not data Then Return -ENOMEM
2999  ioapic_entry = entry
3000  ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, info)
3001  If ret < 0 Then
3002  free previously allocated memory
3003  Return ret
3006  Initialization list head
3007  hwirq = ioapic_pin
3008  chip = If parent == x86_vector_domain Then ioapic_chip Else ioapic_ir_chip
3010  chip_data = data
3011  mp_irqdomain_get_attr(mp_pin_to_gsi(ioapic, pin), data, info)
3013  cfg = irqd_cfg(irq_data)
3014  add_pin_to_irq_node(data, ioapic_alloc_attr_node(info), ioapic, pin)
3016  local_irq_save(flags)
3017  If ioapic_entry Then mp_setup_entry(cfg, data, ioapic_entry)
3019  mp_register_handler(virq, trigger)
3020  If virq < nr_legacy_irqs() Then mask(virq)
3022  local_irq_restore(flags)
3024  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(APIC_VERBOSE, debug-level messages "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n", ioapic, mpc_ioapic_id(ioapic), pin, vector, virq, trigger, polarity, dest_apicid)
3029  Return 0