twizzler-operating-system / twizzler

The Twizzler Operating System
BSD 3-Clause "New" or "Revised" License
66 stars 13 forks source link

Fix bugs and papercuts in basic device driver API, and implement remaining support for user-handling of interrupts. #95

Closed dbittman closed 1 year ago

dbittman commented 1 year ago

This PR contains a multitude of minor changes to device driver APIs that make them easier to use, and fixes bugs in the interrupt mechanism.

First, the PR contains a bunch of testing code as I am dog-fooding an NVMe driver. That is all in nvme_test.rs, and does not need reviewing.

The biggest changes are in interrupt handling, wherein the PCIe code is actually in-place to program MSI-x tables and allocate interrupts from the kernel. A lower level change is that now external device interrupts get enqueued for a higher soft interrupt handler to actually wake threads (since this could involve mem allocation and mutex locking).

Otherwise, there are a number of minor API changes / additions to make working with the device APIs smoother.

I plan to, in a separate PR, continue to dogfood and cleanup some of the code. I just wanted to get some of this in now since it includes API changes.