Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ->*_handlers fields #1357

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Remove ->*_handlers fields #1357

wants to merge 7 commits into from

Conversation

ehem
Copy link
Contributor

@ehem ehem commented Aug 2, 2024

Both INTRNG and x86 have counters for the number of handlers attached to an interrupt. These may have been retrievable somewhere in the past, but now they're only being used as truth values for whether any handler is present. The CK_SLIST_EMPTY() can now fully substitute for this functionality, so reduce the space usage of interrupt structures.

One minor note, nominally a race could cause two threads to see startempty as false. The effect would simply be duplicate enabling of an interrupt which should be harmless.

INTRNG will call the enable/disable functions immediately after the
first handler is added, or the last is removed.  As a result there is no
need for setup/teardown functions to handle this task.

The teardown functions were doing nothing else.  Remove the PCIe
teardown function, the GPIO teardown function can be repurposed.  The
PCIe setup function might still have some value in a debugging kernel.
Create invalid value constants for intr_polarity and GPIO
pin/interrupts.  These are meant for internal use by drivers.
…nals

Using PIC-private variables is superior as it keeps the PIC
implementation better separated from INTRNG's internals.  In turn this
eases changes to INTRNG.
Add macros for future development.  Instead of always using `== 0`
everywhere, create a macro for testing for existance of handler(s).
We most certainly don't want the shared interrupt system to mask IPI
interrupts.  As such report them to `dmesg` and indicate they're being
handled.
The information is already available on the event, via a different
means.  Therefore retrieve it from there, rather than duplicating the
information.  Should be mild space savings, perhaps trivial speed due to
cache savings.  Should improve in future due to increasing numbers of
interrupts on recent systems.
Use of the macro CK_SLIST_EMPTY() on ->is_event->ie_handlers readily
substitues for the value ->is_handlers.  While only minor shrinkage of
struct intsrc, small reductions do accumulate.

Update the i8254 hack to work with this setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant