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
Unknown Object (File)
Sat, Mar 2, 2:10 PM
Unknown Object (File)
Dec 30 2023, 10:37 AM
Unknown Object (File)
Dec 20 2023, 4:27 AM
Unknown Object (File)
Dec 11 2023, 10:52 PM
Unknown Object (File)
Dec 10 2023, 2:02 PM
Unknown Object (File)
Dec 2 2023, 10:57 PM
Unknown Object (File)
Sep 6 2023, 7:16 AM
Unknown Object (File)
Aug 15 2023, 9:23 PM

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.