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

Use interrupt_controller in interrupts::aarch64 #972

Merged
merged 11 commits into from
Aug 1, 2023

Conversation

NathanRoyer
Copy link
Member

@NathanRoyer NathanRoyer commented Jun 13, 2023

Changes:

  • BOARD_CONFIG becomes const so that I can reference it in other consts
  • BOARD_CONFIG now contains board-specific interrupt numbers
  • interrupt_controller's initializer is called from captain
  • interrupt_controller::InterruptDestination no longer contains a local_number on aarch64
  • interrupt_controller::send_ipi allows sending to AllButMe
  • new interrupt_controller::InterruptNumber type, wrapping a u8 on all platforms
  • aarch64-specific interrupt_controller::init_secondary_cpu_interface; panics on x86_64 (documented)
  • don't enable timer/shootdown/pl011 interrupts from interrupts::init as they're enabled later

@NathanRoyer

This comment was marked as outdated.

@NathanRoyer

This comment was marked as resolved.

@NathanRoyer

This comment was marked as outdated.

Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks decent, i left a few small comments. Also there is a conflict that needs to be resolved.

kernel/interrupt_controller/src/lib.rs Show resolved Hide resolved
kernel/interrupt_controller/src/aarch64.rs Outdated Show resolved Hide resolved
kernel/interrupt_controller/src/x86_64.rs Outdated Show resolved Hide resolved
@NathanRoyer NathanRoyer requested a review from kevinaboos August 1, 2023 16:33
@kevinaboos kevinaboos merged commit 5c351a2 into theseus-os:theseus_main Aug 1, 2023
@kevinaboos kevinaboos mentioned this pull request Aug 1, 2023
github-actions bot pushed a commit that referenced this pull request Aug 1, 2023
* Implements the basic set of two interrupt controller abstractions for aarch64:
  1. `LocalInterruptController`: an interrupt controller local to each CPU.
  2. `SystemWideInterruptController`: the system-wide interrupt controller
      that is responsible for redirecting interrupts to local CPUs.
  * These are not yet used, since they haven't been implemented for x86_64.

* Make `BOARD_CONFIG` const so that it can be used in other const contexts.
* Add board-specific fixed interrupt numbers to `BOARD_CONFIG`.

* Temporarily remove the aarch64-specific distinction between
  various types of interrupt numbers, e.g., local, IPI, shared peripheral, etc.
  * `InterruptDestination` correspondingly no longer uses a local number.
  * Once we determine an appropriate abstraction for this that is also
    compatible with x86, we will restore the `InterruptNumber` type
    with its constructor-checked correctness conditions.

* Device specific: for the PL011 UART device, we no longer enable timer interrupts
  in `interrupts::init()` because they are better off enabled later.

* Remove the `get_int_ctlr` macro in favor of regular accessor code.
  This will be updated again once we redesign the interrupt controller structs
  to contain actual owned MMIO objects that offer access to the interrupt chip device. 5c351a2
github-actions bot pushed a commit to tsoutsman/Theseus that referenced this pull request Aug 1, 2023
)

* Implements the basic set of two interrupt controller abstractions for aarch64:
  1. `LocalInterruptController`: an interrupt controller local to each CPU.
  2. `SystemWideInterruptController`: the system-wide interrupt controller
      that is responsible for redirecting interrupts to local CPUs.
  * These are not yet used, since they haven't been implemented for x86_64.

* Make `BOARD_CONFIG` const so that it can be used in other const contexts.
* Add board-specific fixed interrupt numbers to `BOARD_CONFIG`.

* Temporarily remove the aarch64-specific distinction between
  various types of interrupt numbers, e.g., local, IPI, shared peripheral, etc.
  * `InterruptDestination` correspondingly no longer uses a local number.
  * Once we determine an appropriate abstraction for this that is also
    compatible with x86, we will restore the `InterruptNumber` type
    with its constructor-checked correctness conditions.

* Device specific: for the PL011 UART device, we no longer enable timer interrupts
  in `interrupts::init()` because they are better off enabled later.

* Remove the `get_int_ctlr` macro in favor of regular accessor code.
  This will be updated again once we redesign the interrupt controller structs
  to contain actual owned MMIO objects that offer access to the interrupt chip device. 5c351a2
tsoutsman pushed a commit to tsoutsman/Theseus that referenced this pull request Sep 6, 2023
)

* Implements the basic set of two interrupt controller abstractions for aarch64:
  1. `LocalInterruptController`: an interrupt controller local to each CPU.
  2. `SystemWideInterruptController`: the system-wide interrupt controller
      that is responsible for redirecting interrupts to local CPUs.
  * These are not yet used, since they haven't been implemented for x86_64.

* Make `BOARD_CONFIG` const so that it can be used in other const contexts.
* Add board-specific fixed interrupt numbers to `BOARD_CONFIG`.

* Temporarily remove the aarch64-specific distinction between
  various types of interrupt numbers, e.g., local, IPI, shared peripheral, etc.
  * `InterruptDestination` correspondingly no longer uses a local number.
  * Once we determine an appropriate abstraction for this that is also
    compatible with x86, we will restore the `InterruptNumber` type
    with its constructor-checked correctness conditions.

* Device specific: for the PL011 UART device, we no longer enable timer interrupts
  in `interrupts::init()` because they are better off enabled later.

* Remove the `get_int_ctlr` macro in favor of regular accessor code.
  This will be updated again once we redesign the interrupt controller structs
  to contain actual owned MMIO objects that offer access to the interrupt chip device.
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.

2 participants