Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F96164860
D29310.id86854.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29310.id86854.diff
View Options
Index: sys/kern/subr_intr.c
===================================================================
--- sys/kern/subr_intr.c
+++ sys/kern/subr_intr.c
@@ -401,33 +401,25 @@
static inline int
isrc_alloc_irq(struct intr_irqsrc *isrc)
{
- u_int maxirqs, irq;
+ u_int maxirqs;
mtx_assert(&isrc_table_lock, MA_OWNED);
maxirqs = intr_nirq;
- if (irq_next_free >= maxirqs)
- return (ENOSPC);
- for (irq = irq_next_free; irq < maxirqs; irq++) {
- if (irq_sources[irq] == NULL)
- goto found;
- }
- for (irq = 0; irq < irq_next_free; irq++) {
- if (irq_sources[irq] == NULL)
+ while (irq_next_free < maxirqs) {
+ if (irq_sources[irq_next_free] == NULL)
goto found;
+ ++irq_next_free;
}
- irq_next_free = maxirqs;
return (ENOSPC);
found:
- isrc->isrc_irq = irq;
- irq_sources[irq] = isrc;
+ isrc->isrc_irq = irq_next_free;
+ irq_sources[irq_next_free] = isrc;
- irq_next_free = irq + 1;
- if (irq_next_free >= maxirqs)
- irq_next_free = 0;
+ ++irq_next_free;
return (0);
}
@@ -445,6 +437,10 @@
if (irq_sources[isrc->isrc_irq] != isrc)
return (EINVAL);
+ /* Signal availability to isrc_alloc_irq(). */
+ if (isrc->isrc_irq < irq_next_free)
+ irq_next_free = isrc->isrc_irq;
+
irq_sources[isrc->isrc_irq] = NULL;
isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 24, 10:36 PM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12704233
Default Alt Text
D29310.id86854.diff (1 KB)
Attached To
Mode
D29310: kern/intr: switch to allocating handles forward
Attached
Detach File
Event Timeline
Log In to Comment