Page MenuHomeFreeBSD

sys/x86: make irqs unsigned
AbandonedPublic

Authored by ehem_freebsd_m5p.com on Sep 23 2021, 12:48 AM.
Tags
None
Referenced Files
F106130136: D32070.diff
Wed, Dec 25, 9:51 PM
Unknown Object (File)
Oct 30 2024, 1:48 PM
Unknown Object (File)
Oct 29 2024, 8:19 PM
Unknown Object (File)
Oct 23 2024, 7:11 AM
Unknown Object (File)
Oct 23 2024, 7:11 AM
Unknown Object (File)
Oct 23 2024, 7:11 AM
Unknown Object (File)
Oct 23 2024, 7:00 AM
Unknown Object (File)
Sep 29 2024, 11:08 AM

Details

Reviewers
jhb
kib
Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
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.

sys/x86/x86/io_apic.c
83

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

539

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.

sys/x86/x86/io_apic.c
83

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.