theseus-os/Theseus

Follow-up improvements to aarch64 FIQ support

kevinaboos opened this issue · 1 comments

  • InterruptDestination seems redundant with IpiTargetCpu...?

  • We can use type wrappers to ensure that the acknowledge_fast_interrupt and end_of_fast_interrupt functions are only invokable by current_elx_fiq. By that I mean create a new type ExceptionContextFiq that is a simple wrapper around ExceptionContext, and then require a reference to that type to be passed into both of the above fast interrupt functions. Then, we can make those functions safe on the outside, and just use unsafe on the inside.

    #[transparent]
    #[non_exhaustive]
    pub struct ExceptionContextFiq(ExceptionContext);

    This design is better imo since there's no real way to ensure that the fast interrupt functions are actually called safely.

  • It's a little bit odd to use the type *const InterruptHandler, since InterruptHandler is already a function pointer. We should be able to remove the leading *const part and just deal with the InterruptHandler directly. But do let me know if that is actually requried somewhere else.

Originally posted by @kevinaboos in #1039 (review)

Addressed in #1052.