diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-04 19:36:51 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-04 19:36:51 +0200 |
commit | 651df2e03f3eb2fcca3446174625dda77b94bcc6 (patch) | |
tree | bbbfa0e6c13b13439bc2dea2ed303bd0f655d850 /pci-arbiter/pcifs.c | |
parent | bef0f49eff0eb113e551b7cf1f552364f8d805c7 (diff) | |
download | hurd-651df2e03f3eb2fcca3446174625dda77b94bcc6.tar.gz hurd-651df2e03f3eb2fcca3446174625dda77b94bcc6.tar.bz2 hurd-651df2e03f3eb2fcca3446174625dda77b94bcc6.zip |
pci-arbiter: restore code that allows it to run non-bootstrap
* 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.
Diffstat (limited to 'pci-arbiter/pcifs.c')
-rw-r--r-- | pci-arbiter/pcifs.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pci-arbiter/pcifs.c b/pci-arbiter/pcifs.c index 699d5942..3b13e437 100644 --- a/pci-arbiter/pcifs.c +++ b/pci-arbiter/pcifs.c @@ -31,9 +31,6 @@ #include "ncache.h" #include "func_files.h" -/* Empty status for root node when bootstrapping */ -static io_statbuf_t underlying_stat; - static error_t create_dir_entry (int32_t domain, int16_t bus, int16_t dev, int16_t func, int32_t device_class, char *name, @@ -92,15 +89,24 @@ alloc_file_system (struct pcifs ** fs) } error_t -init_root_node (void) +init_root_node (file_t underlying_node) { + error_t err; struct node *np; - io_statbuf_t *underlying_node_stat = &underlying_stat; + io_statbuf_t underlying_node_stat = { 0 }; + + if (underlying_node != MACH_PORT_NULL) + { + /* Initialize status from underlying node. */ + err = io_stat (underlying_node, &underlying_node_stat); + if (err) + return err; + } np = netfs_make_node_alloc (sizeof (struct netnode)); if (!np) return ENOMEM; - np->nn_stat = *underlying_node_stat; + np->nn_stat = underlying_node_stat; np->nn_stat.st_fsid = getpid (); np->nn_stat.st_mode = S_IFDIR | S_IROOT | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | |