Commit Graph

46 Commits

Author SHA1 Message Date
bjorn3 04ae0158c9 Update most crates to redox-scheme 0.6
A couple of crates need to stay on redox-scheme 0.4 as they need
cancellation for async schemes.
2025-07-04 22:13:24 +02:00
bjorn3 e7fe3183b0 Make all pcid_interface methods abort the process on errors
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.
2025-03-02 12:36:35 +01:00
bjorn3 8f1549e284 Introduce a pci scheme and move driver spawning to pcid-spawner
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>
2025-03-01 17:18:15 +01:00
bjorn3 cffa5308a1 Use pico-args instead of structopt for pcid
It is much lighter weight.

Co-Authored-By: 4lDO2 <4lDO2@protonmail.com>
2025-02-27 20:07:12 +01:00
bjorn3 898f8dc72b pcid: Remove usage of paw 2024-12-30 11:41:34 +01:00
bjorn3 e6139319e8 pcid: Remove a couple of unused dependencies 2024-12-30 11:40:02 +01:00
Andrey Turkin 18b688a49c Partial risc-v support 2024-10-17 20:07:17 +03:00
bjorn3 7935ed0248 Deduplicate setup_logging between all drivers
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.
2024-07-24 22:00:40 +02:00
bjorn3 15d2078a13 Handle daemonization of pcid in a better way
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.
2024-07-20 15:11:34 +02:00
bjorn3 2ab2fe7b5e Update to pci_types 0.10.0 2024-06-15 13:41:51 +02:00
bjorn3 f6a709ee5a pcid: Simplify PciFunc::read_range
This also avoids UB caused by creating a slice of uninitialized u8.
2024-06-11 21:05:25 +02:00
bjorn3 4b384066f2 Use pci_types for setting the interrupt line 2024-06-09 15:05:47 +02:00
bjorn3 020a3ef631 pcid: Update to pci_types 0.9.0 2024-06-09 14:03:10 +02:00
4lDO2 4c35e88997 Use latest event queue interface everywhere. 2024-03-31 14:30:04 +02:00
Jacob Lorentzon ff956fd3bb Switch to libredox where applicable (fixed) 2024-03-18 22:09:25 +00:00
Jeremy Soller 98078650f8 Revert "Switch to libredox where applicable."
This reverts commit 2e7dbf1cc1.
2024-03-18 15:00:52 -06:00
4lDO2 2e7dbf1cc1 Switch to libredox where applicable. 2024-03-18 19:23:05 +01:00
bjorn3 15c8ab2331 Search for PCI ECAM in the device tree on ARM 2024-03-17 17:15:34 +01:00
bjorn3 ad23ad5d93 Introduce irq_handle helper for legacy interrupts 2024-01-22 19:35:18 +01:00
bjorn3 0b611dca04 Start using the pci_types crate 2024-01-22 11:25:43 +01:00
bjorn3 ae7e2dac9f Only parse a single MCFG ACPI table
There should only be one and Linux only parses the first one too.
2024-01-19 18:41:28 +01:00
bjorn3 a7c5391c6c Introduce PciAddress type copied from the pci_types crate 2024-01-19 12:14:00 +01:00
Jeremy Soller 61e9512468 Update redox_syscall to 0.4 2023-09-07 20:49:37 -06:00
4lDO2 e0a0e2a532 Remove physmap in pcid. 2023-07-18 11:01:16 +02:00
4lDO2 af873f7626 Update redox_syscall dependency. 2022-07-27 17:55:39 +02:00
4lDO2 07f10fb4d1 Update redox_syscall to v0.2.12 2022-03-24 16:06:00 +01:00
4lDO2 7a2b3d7656 Update dependencies. 2021-06-17 18:18:27 +02:00
Wren Turkal 65982d5e02 Add more structure cli to pcid.
This change adds a structopt commandline interface to the pcid tool.
This add some help for the arguments that pcid takes.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-08-01 18:16:31 +00:00
4lDO2 fe95c942ac Add pcid logging. 2020-04-22 18:27:43 +02:00
4lDO2 31d5a95cf9 Add MCFG parsing for PCIe. 2020-04-19 17:32:45 +02:00
4lDO2 cb5a72fbc1 Successfully recognize (only one) MSI-X IRQ.
Somehow it only happens once though.
2020-04-19 14:45:46 +02:00
4lDO2 735c55f656 Rebase. 2020-04-19 14:45:46 +02:00
4lDO2 7536048ceb Parse some of the PCI capabilities, and setup IPC. 2020-04-19 14:45:46 +02:00
Roland Ruckerbauer b50437af8a Fixed deprecated syntax in vesad
2018 edition upgrade & fixes for a bunch of 'future error warnings'

Actually upgrading all crates to 2018 edition
2019-06-29 21:47:52 +02:00
Dan Robertson 4d349192da Allow PCI Config space parsing to handle types
- Update the PCI config space parsing to be able to handle multiple
   types.
 - Use a trait to abstract out reading from the config space in order to
   allow testing/fuzzing of the parser.
2018-02-27 22:46:30 +00:00
Karl Hobley 520c140da8 Migrate to serde. Fixes #9 2017-04-23 15:29:48 +01:00
Jeremy Soller 4bb229959e Specify crates.io versions 2017-01-13 15:10:16 -07:00
Jeremy Soller 608403765d Refactor to move io into syscall, and use git for crate references 2017-01-09 20:36:36 -07:00
Jeremy Soller 03abcd0e0e Update for new rustc-serialize 2016-11-10 11:28:43 -07:00
Jeremy Soller 08557a7c13 Fix build, remove cfg(redox) 2016-11-09 17:00:48 -07:00
Jeremy Soller db37769a8b Update to use upstream libc and rand 2016-11-09 10:43:05 -07:00
Jeremy Soller 9064550f6a Fix rustc-serialize 2016-11-03 15:47:54 -06:00
Jeremy Soller 0fdebfd4a1 Update syscall lib, update submodules and dependencies 2016-11-03 15:10:32 -06:00
Jeremy Soller 621e557174 Remove resource_sceme, Fix syscall crate name, add fmap 2016-11-02 19:48:25 -06:00
Jeremy Soller f79f80e595 Launch commands for each device found if specified 2016-09-25 16:59:25 -06:00
Jeremy Soller 4b3bc6ac11 PCI driver WIP 2016-09-11 15:56:48 -06:00