Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:q_reserve_ipi() - Setup an IPI to destination cpumask*@domain: IPI domain*@dest: cpumask of cpus which can receive the IPI* Allocate a virq that can be used to send IPI to any CPU in dest mask

Proto:int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask *dest)

Type:int

Parameter:

TypeParameterName
struct irq_domain *domain
const struct cpumask *dest
30  If Not domain || Not irq_domain_is_ipi(domain) Then
31  pr_warn("Reservation on a non IPI domain\n")
32  Return -EINVAL
35  If Not pumask_subset - (*src1p & ~*src2p) == 0*@src1p: the first input*@src2p: the second input* Returns 1 if *@src1p is a subset of *@src2p, else returns 0 Then
36  pr_warn("Reservation is not in possible_cpu_mask\n")
37  Return -EINVAL
40  nr_irqs = pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in.
41  If Not nr_irqs Then
42  pr_warn("Reservation for empty destination mask\n")
43  Return -EINVAL
46  If irq_domain_is_ipi_single(domain) Then
53  nr_irqs = 1
54  offset = 0
55  Else
64  offset = Uniprocessor. Assume all masks are "1".
69  next = cpumask_next_zero(offset, dest)
70  If next < nr_cpu_ids Then next = pumask_next - get the next cpu in a cpumask*@n: the cpu prior to the place to search (ie. return will be > @n)*@srcp: the cpumask pointer* Returns >= nr_cpu_ids if no further cpus set.
72  If next < nr_cpu_ids Then
73  pr_warn("Destination mask has holes\n")
74  Return -EINVAL
78  virq = irq_domain_alloc_descs( - 1, nr_irqs, 0, NUMA_NO_NODE, NULL)
79  If virq <= 0 Then
80  pr_warn("Can't reserve IPI, failed to alloc descs\n")
81  Return -ENOMEM
84  virq = __irq_domain_alloc_irqs(domain, virq, nr_irqs, NUMA_NO_NODE, (void * )dest, true, NULL)
87  If virq <= 0 Then
88  pr_warn("Can't reserve IPI, failed to alloc hw irqs\n")
89  Go to free_descs
92  When i < nr_irqs cycle
93  data = irq_get_irq_data(virq + i)
94  pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
95  ipi_offset = offset
96  irq_set_status_flags(virq + i, IRQ_NO_BALANCING)
98  Return virq
100  free_descs :
101  q_free_descs - free irq descriptors*@from: Start of descriptor range*@cnt: Number of consecutive irqs to free
102  Return -EBUSY