Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:q_sim_init - Initialize the interrupt simulator: allocate a range of* dummy interrupts.*@sim: The interrupt simulator object to initialize.*@num_irqs: Number of interrupts to allocate* On success: return the base of the allocated interrupt range.

Proto:int irq_sim_init(struct irq_sim *sim, unsigned int num_irqs)

Type:int

Parameter:

TypeParameterName
struct irq_sim *sim
unsigned intnum_irqs
79  irqs = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
80  If Not irqs Then Return -ENOMEM
83  irq_base = use macros to avoid needing export.h for THIS_MODULE ( - 1, 0, num_irqs, 0)
84  If irq_base < 0 Then
85  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
86  Return irq_base
89  pending = bitmap_zalloc(num_irqs, GFP_KERNEL)
90  If Not pending Then
91  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
92  q_free_descs - free irq descriptors*@from: Start of descriptor range*@cnt: Number of consecutive irqs to free
93  Return -ENOMEM
96  When i < num_irqs cycle
97  irqnum = irq_base + i
98  enabled = false
99  q_set_chip - set the irq chip for an irq*@irq: irq number*@chip: pointer to irq chip description structure
100  q_set_chip_data - set irq chip data for an irq*@irq: Interrupt number*@data: Pointer to chip specific data* Set the hardware irq chip data for an irq
101  irq_set_handler(irq_base + i, & handle_simple_irq - Simple and software-decoded IRQs.*@desc: the interrupt description structure for this irq* Simple interrupts are either sent from a demultiplexing interrupt* handler or come from hardware, where no interrupt hardware control)
102  irq_modify_status(irq_base + i, IRQ_NOREQUEST | IRQ_NOAUTOEN, IRQ_NOPROBE)
106  init_irq_work( & work, irq_sim_handle_irq)
107  irq_count = num_irqs
109  Return irq_base
Caller
NameDescribe
devm_irq_sim_initq_sim_init - Initialize the interrupt simulator for a managed device.*@dev: Device to initialize the simulator object for.*@sim: The interrupt simulator object to initialize.*@num_irqs: Number of interrupts to allocate