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

PCI framework refactor: part 2 #1213

Merged
merged 4 commits into from
Apr 7, 2024
Merged

Conversation

AnErrupTion
Copy link
Collaborator

@AnErrupTion AnErrupTion commented Apr 6, 2024

This PR is the second part of #1212 and focuses on more changes within the PCI subsystem. The following changes were done:

  • The ISABus device driver was removed in favor of an ISADeviceService
  • Added PCIField.All to include all fields in the enum at once
  • Added a BusType property in Device, which is set to the DeviceDriverRegistryEntry's BusType by default
  • In PCIDevice:
    • The PCI controller field was made public
    • Properties like VendorID and DeviceID are now retrieved once
  • DeviceDriverRegistryEntry.Factory is now checked for nullability, and same for the BaseDeviceDriver instantiated by it
  • Added the DeviceService.GetAllDevices(DeviceBusType) method as a way to get all devices by a specific bus type, e.g. ISA or PCI. This unifies the process, instead of having to check for ISABus or PCIDevice respectively
  • In PCIDeviceService:
    • The service no longer relies on events to initialize PCI devices. Instead, the code was moved in the Initialize() method, where it finds for the first initialized IPCIController
    • In case no matched driver entry is found, a fallback bus type is set in the Device. This allows for retrieving unknown PCI devices using the newly added DeviceService.GetAllDevices(DeviceBusType) method, instead of getting all devices that inherit from PCIDevice

@AnErrupTion AnErrupTion self-assigned this Apr 6, 2024
@tgiphil
Copy link
Member

tgiphil commented Apr 7, 2024

Note: There are lots of other types of busses.

Copy link
Member

@charsleysa charsleysa left a comment

Choose a reason for hiding this comment

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

LGTM

@tgiphil tgiphil merged commit dfbf309 into mosa:master Apr 7, 2024
66 checks passed
@AnErrupTion AnErrupTion deleted the pci-refactor-2 branch April 7, 2024 08:20
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.

3 participants