Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\irq\generic-chip.c Create Date:2022-07-28 10:12:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__irq_alloc_domain_generic_chip - Allocate generic chips for an irq domain*@d: irq domain for which to allocate chips*@irqs_per_chip: Number of interrupts each chip handles (max 32)*@num_ct: Number of irq_chip_type instances associated with this*@name:

Proto:int __irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip, int num_ct, const char *name, irq_flow_handler_t handler, unsigned int clr, unsigned int set, enum irq_gc_flags gcflags)

Type:int

Parameter:

TypeParameterName
struct irq_domain *d
intirqs_per_chip
intnum_ct
const char *name
irq_flow_handler_thandler
unsigned intclr
unsigned intset
enum irq_gc_flagsgcflags
294  If Pointer to a list of generic chips Then Return -EBUSY
297  numchips = DIV_ROUND_UP(revmap_size, irqs_per_chip)
298  If Not numchips Then Return -EINVAL
302  sz = size of dgc + numchips * size of gc
303  sz += numchips * ( size of gc + num_ct * sizeof(structirq_chip_type) )
305  tmp = dgc = 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).
306  If Not dgc Then Return -ENOMEM
308  irqs_per_chip = irqs_per_chip
309  num_chips = numchips
310  irq_flags_to_set = set
311  irq_flags_to_clear = clr
312  gc_flags = gcflags
313  Pointer to a list of generic chips = dgc
316  tmp += size of dgc + numchips * size of gc
317  When i < numchips cycle
319  gc[i] = gc = tmp
320  irq_init_generic_chip(gc, name, num_ct, i * irqs_per_chip, NULL, handler)
323  domain = d
324  If gcflags & IRQ_GC_BE_IO Then
329  raw_spin_lock_irqsave( & gc_lock, flags)
330  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
331  raw_spin_unlock_irqrestore( & gc_lock, flags)
333  tmp += size of gc + num_ct * sizeof(structirq_chip_type)
335  Return 0