aboutsummaryrefslogtreecommitdiff
path: root/pci-arbiter/pcifs.c
Commit message (Collapse)AuthorAgeFilesLines
* pci-arbiter: restore code that allows it to run non-bootstrapSamuel Thibault2021-04-041-6/+12
| | | | | | | | | | * pci-arbiter/pcifs.h (init_root_node): Restore underlying_node parameter. * pci-arbiter/pcifs.c (underlying_stat): Drop global variable. (init_root_node): Restore getting the stat from the underlying node. * pci-arbiter/main.c (main): Restore calling netfs_startup in non-bootstrap case, and pass underlying node to init_root_node. Only call pcifs_startup in bootstrap case.
* pci-arbiter: Introduce machdev into this serverDamien Zammit2021-03-081-14/+15
| | | | | | | | | | | | | | | * pci-arbiter/Makefile Add machdev lib and simplify * pci-arbiter/main.c (pci_device_{open,close,shutdown}): New methods (netfs_server_func): Thread the demuxer loop (pcifs_startup): Custom startup method (main): Use machdev for server and detach worker threads * pci-arbiter/options.{c,h} Add disk-server-task and priv ports * pci-arbiter/startup-ops.c Delete file Message-Id: <20210308130457.693821-4-damien@zamaudio.com>
* pci-arbiter: Accept not having an underlying node.Damien Zammit2021-03-071-6/+12
| | | | | | * pci-arbiter/pcifs.c (underlying_stat): New variable. (init_file_system): When underlying_node is nul, use the underlying_stat content.
* pci-arbiter: Probe devices and map regionsJoan Lledó2020-09-131-5/+10
| | | | | | | | | | | This adapts the arbiter to a bug fixed in libpciaccess. We were relying on the library to probe devices and map regions but it's the arbiter who should do it. * pci-arbiter/pcifs.c: * create_fs_tree(): probe the device to find regions and rom * pci-arbiter/func_files.c: * io_region_file(): map region on the first access attempt
* Memset directory entries to zero during their creationJoan Lledó2020-05-021-1/+2
| | | | | | | * pci-arbiter/pcifs.c: * create_dir_entry: Add memset() * create_fs_tree: Remove memset() Message-Id: <20200502172713.18654-2-jlledom@mailfence.com>
* pci-arbiter: Fix memory bugsJoan Lledó2019-11-241-1/+6
| | | | | | | | * pci-arbiter/pcifs.c: * init_file_system: Remove unnecessary free() * create_fs_tree: Fix a boundary overrun where no devices are found. Message-Id: <20191124194721.4982-2-jlledom@mailfence.com>
* pci-arbiter: remove unneeded memset.Joan Lledó2019-11-091-4/+0
| | | | | * pci-arbiter/pcifs.c (create_fs_tree): Remove all memset() previous to snprintf() calls.
* pci-arbiter: Use libpciaccess instead of embedding itDamien Zammit2019-11-031-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes all embedded pciaccess code from the arbiter and instead uses the external pciaccess library. * pci-arbiter/Makefile: * Remove pci_access.c and x86_pci.c from the sources. * pci-arbiter/func_files.c: * io_config_file: Use a harcoded PCI config size. * read_rom_file: Grab the full rom first, then return the requested amount. * pci-arbiter/main.c: * main: Call create_fs_tree() w/o pci_sys. Since it's not part of the translator anymore. * pci-arbiter/netfs_impl.c: * netfs_attempt_read: Send pci_device_cfg_read() as the read op. * netfs_attempt_write: Send pci_device_cfg_write() as the write op. * pci-arbiter/pci-ops.c: * S_pci_conf_read: Call libpciaccess' pci_device_cfg_read(). * S_pci_conf_write: Call libpciaccess' pci_device_cfg_write(). * S_pci_get_dev_rom: Set rom.base_addr to zero for the moment, until libpciaccess esposes it properly. * pci-arbiter/pci_access.c: Deleted * pci-arbiter/pci_access.h: Deleted * pci-arbiter/pcifs.c: * create_fs_tree: Remove the pci_sys parameter. Use libpciaccess' iterator. Use a hardcoded config space size. * pci-arbiter/pcifs.h: Definitions for changes in pcifs.c. * pci-arbiter/x86_pci.c: Deleted. * pci-arbiter/x86_pci.h: Deleted.
* pci-arbiter Revert snprintf truncation changeSamuel Thibault2019-11-031-5/+5
| | | | | | snprintf guarantees to add a trailing \0, so there is no need to add one * pci-arbiter/pcifs.c (create_fs_tree): Give whole buffer to snprintf.
* pci-arbiter: Fix a -Wstringop-truncation warningJoan Lledó2019-11-031-8/+10
| | | | | | | | | | | | * pci-arbiter/pcifs.c: * create_dir_entry: Limit to NAME_SIZE-1 when calling strncpy(). Finish entry->name with '\0'. * create_fs_tree: memset() to 0 the directory entry. Limit to NAME_SIZE-1 all calls to snprintf() and strncpy(). Message-Id: <20191103093756.9672-4-jlledom@mailfence.com>
* PCI ArbiterJoan Lledó2018-10-301-0/+409