Effectively the only way to recover from errors in the communication
with pcid is by restarting the driver from scratch possibly after
restarting pcid. As such moving the aborts from individual drivers to
pcid_interface simplifies drivers while at the same time allowing nicer
error messages.
This allows a single PCI daemon to run on the whole system, prevents
multiple drivers from claiming the same PCI device and makes it possible
for userspace to enumerate all available PCI devices. In the future this
will enable an lspci tool, possibly PCIe hot plugging and more.
Co-Authored-By: 4lDO2 <4lDO2@protonmail.com>
This will allow serializing/deserializing to be shared across programs.
For pcid-spawner will need to parse the config files and if we want to
embed config files into the driver executables at some point it may also
be useful.
This is the only part that actually modifies the PCI configuration. In
the future we will want to delay enabling a PCI device until it is
actually going to be used while still reading metadata about the PCI
device before that point.
This will make it easier to change the way logging is done for all
drivers. This also fixes the log category for a couple of drivers as
well as makes failing to set the logger a fatal error. Only when a
logger is already set is it impossible to set another logger.
Currently pcid exits the main thread once it is done spawning drivers
and expects all background threads handling driver communication to stay
around. This only works as exitting the main thread on redox os
currently doesn't cause the whole process to die. This will have to be
fixed at some point for compatibility with programs that expect that
exitting the main thread kills all other threads in the process, at
which point pcid would break without the changes in this commit.
This makes them harder to accidentally run them from the shell, which
would not work. In the future this may also allow embedding the driver
config in the driver executable itself without having to look at all
non-driver executables too.