Page MenuHomeFreeBSD

sys/x86: make irqs unsigned

Authored by on Sep 23 2021, 12:48 AM.
Referenced Files
Unknown Object (File)
Sun, May 14, 1:24 AM
Unknown Object (File)
May 6 2023, 10:58 AM
Unknown Object (File)
Mar 22 2023, 6:11 PM
Unknown Object (File)
Mar 5 2023, 7:44 AM
Unknown Object (File)
Jan 28 2023, 8:48 PM
Unknown Object (File)
Dec 20 2022, 2:23 AM



Most of the core already treated interrupts as unsigned. Adjust the x86
core to match this. This also fixes a few bugs.

Diff Detail

rS FreeBSD src repository - subversion
Lint Passed
No Test Coverage
Build Status
Buildable 42507
Build 39395: arc lint + arc unit

Event Timeline

Bit of overlap with D31957 here.

There is an interaction with D30648 in it was planned to make the vectors used by the Xen code unsigned anyway. Depending on which gets in first, either could potentially do this.

I think I made all the needed adjustments to sys/x86/x86/io_apic.c. I'm rather worried there could be additional similar changes needed elsewhere that I missed. Given what some of this is like, I would be rather tempted to enable -Wsign-compare and see how much gets flagged.


This one needs to stay signed. The cookie values IRQ_DISABLED, etc. are all -ve values.


Instead, just cast the value here for this file.

The next phase would be to convert ioapic_get_vector() to return u_int and push unsigned integers into that area.


I noticed, that is why all the comparisons for io_irq >= 0 were converted to io_irq < num_io_irqs and similar for io_irq < 0 => io_irq >= num_io_irqs.

I guess I should ask: @jhb is your view making io_irq unsigned should simply be a separate Phabricator diff?

I'm fine doing that.

Splitting io_apic portion off into separate diff.

With no guidance, simply do what I suspect was actually desired. Breaking the portion off into a separate diff. So now D32070 is purely making irq variables unsigned, while D32795 is making io_irq unsigned.

Looks like this is heading towards accomplishment in a different fashion. With no action simply dumping the Phabricator revision.