aboutsummaryrefslogtreecommitdiff
path: root/pci-arbiter/netfs_impl.c
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2019-11-03 21:35:57 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-11-03 21:37:57 +0100
commitb160d6f3b3cdcd6a293c33cd89dcc46ab54c3264 (patch)
treebabcc0b5db069672277131e914beef6d6b4dddc5 /pci-arbiter/netfs_impl.c
parent084e5a86e5eca77cec49e08e0d83fe8266eca91b (diff)
downloadhurd-b160d6f3b3cdcd6a293c33cd89dcc46ab54c3264.tar.gz
hurd-b160d6f3b3cdcd6a293c33cd89dcc46ab54c3264.tar.bz2
hurd-b160d6f3b3cdcd6a293c33cd89dcc46ab54c3264.zip
pci-arbiter: Use libpciaccess instead of embedding it
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.
Diffstat (limited to 'pci-arbiter/netfs_impl.c')
-rw-r--r--pci-arbiter/netfs_impl.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/pci-arbiter/netfs_impl.c b/pci-arbiter/netfs_impl.c
index b96c7d8d..0be8c370 100644
--- a/pci-arbiter/netfs_impl.c
+++ b/pci-arbiter/netfs_impl.c
@@ -32,7 +32,7 @@
#include "pcifs.h"
#include "ncache.h"
-#include "pci_access.h"
+#include <pciaccess.h>
#include "func_files.h"
#define DIRENTS_CHUNK_SIZE (8*1024)
@@ -499,11 +499,11 @@ netfs_attempt_read (struct iouser * cred, struct node * node,
if (!strncmp (node->nn->ln->name, FILE_CONFIG_NAME, NAME_SIZE))
{
err =
- io_config_file (node->nn->ln->device, offset, len, data,
- pci_sys->read);
+ io_config_file (node->nn->ln->device, offset, len, data,
+ pci_device_cfg_read);
if (!err)
- /* Update atime */
- UPDATE_TIMES (node->nn->ln, TOUCH_ATIME);
+ /* Update atime */
+ UPDATE_TIMES (node->nn->ln, TOUCH_ATIME);
}
else if (!strncmp (node->nn->ln->name, FILE_ROM_NAME, NAME_SIZE))
{
@@ -538,13 +538,13 @@ netfs_attempt_write (struct iouser * cred, struct node * node,
if (!strncmp (node->nn->ln->name, FILE_CONFIG_NAME, NAME_SIZE))
{
err =
- io_config_file (node->nn->ln->device, offset, len, data,
- pci_sys->write);
+ io_config_file (node->nn->ln->device, offset, len, data,
+ pci_device_cfg_write);
if (!err)
- {
- /* Update mtime and ctime */
- UPDATE_TIMES (node->nn->ln, TOUCH_MTIME | TOUCH_CTIME);
- }
+ {
+ /* Update mtime and ctime */
+ UPDATE_TIMES (node->nn->ln, TOUCH_MTIME | TOUCH_CTIME);
+ }
}
else if (!strncmp
(node->nn->ln->name, FILE_REGION_NAME, strlen (FILE_REGION_NAME)))