summaryrefslogtreecommitdiff
path: root/pci-arbiter
diff options
context:
space:
mode:
Diffstat (limited to 'pci-arbiter')
-rw-r--r--pci-arbiter/Makefile2
-rw-r--r--pci-arbiter/main.c29
-rw-r--r--pci-arbiter/startup.c60
-rw-r--r--pci-arbiter/startup.h31
4 files changed, 9 insertions, 113 deletions
diff --git a/pci-arbiter/Makefile b/pci-arbiter/Makefile
index b32bc579..d3d205ec 100644
--- a/pci-arbiter/Makefile
+++ b/pci-arbiter/Makefile
@@ -21,7 +21,7 @@ makemode = server
PORTDIR = $(srcdir)/port
SRCS = main.c pci-ops.c netfs_impl.c \
- pcifs.c ncache.c options.c func_files.c startup.c \
+ pcifs.c ncache.c options.c func_files.c \
pciServer.c startup_notifyServer.c
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c
index efb9f65c..1815994a 100644
--- a/pci-arbiter/main.c
+++ b/pci-arbiter/main.c
@@ -43,7 +43,6 @@
#include <pciaccess.h>
#include <pthread.h>
#include "pcifs.h"
-#include "startup.h"
struct pcifs *fs;
volatile struct mapped_time_value *pcifs_maptime;
@@ -106,17 +105,9 @@ pci_device_close (void *d)
static void
pci_device_shutdown (mach_port_t dosync_handle)
{
- struct port_info *inpi = ports_lookup_port (netfs_port_bucket, dosync_handle,
- pci_shutdown_notify_class);
-
- if (!inpi)
- return;
-
// Free all libpciaccess resources
pci_system_cleanup ();
- ports_port_deref (inpi);
-
ports_destroy_right (&pci_control_port);
netfs_shutdown (FSYS_GOAWAY_FORCE);
@@ -192,15 +183,17 @@ pcifs_startup(mach_port_t bootstrap, int flags)
err = ports_create_port (netfs_control_class, netfs_port_bucket,
sizeof (struct port_info), &newpi);
- if (!err)
+ if (err)
+ error (11, err, "Translator startup failure: pcifs_startup");
+
+ pci_control_port = ports_get_send_right (newpi);
+
+ if (bootstrap != MACH_PORT_NULL)
{
- pci_control_port = ports_get_send_right (newpi);
err = fsys_startup (bootstrap, flags, pci_control_port, MACH_MSG_TYPE_COPY_SEND,
- &realnode);
+ &realnode);
assert_perror_backtrace (err);
}
- if (err)
- error (11, err, "Translator startup failure: fsys_startup");
return realnode;
}
@@ -221,8 +214,8 @@ main (int argc, char **argv)
if (disk_server_task != MACH_PORT_NULL)
{
machdev_register (&pci_arbiter_emulation_ops);
- machdev_device_init ();
machdev_trivfs_init (disk_server_task, "pci", "/servers/bus/pci", &bootstrap);
+ machdev_device_init ();
err = pthread_create (&t, NULL, machdev_server, NULL);
if (err)
error (1, err, "Creating machdev thread");
@@ -278,12 +271,6 @@ main (int argc, char **argv)
error (1, err, "Creating netfs loop thread");
pthread_detach (nt);
- /*
- * Ask init to tell us when the system is going down,
- * so we can try to be friendly to our correspondents on the network.
- */
- arrange_shutdown_notification ();
-
/* Let the other threads do their job */
pthread_exit(NULL);
/* Never reached */
diff --git a/pci-arbiter/startup.c b/pci-arbiter/startup.c
deleted file mode 100644
index 421c9e24..00000000
--- a/pci-arbiter/startup.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (C) 2017 Free Software Foundation, Inc.
- Written by Michael I. Bushnell, p/BSG.
-
- This file is part of the GNU Hurd.
-
- The GNU Hurd is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- The GNU Hurd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/* Startup and shutdown notifications management */
-
-#include "startup.h"
-
-#include <unistd.h>
-#include <hurd/paths.h>
-#include <hurd/startup.h>
-#include <hurd/netfs.h>
-
-struct port_class *pci_shutdown_notify_class;
-
-void
-arrange_shutdown_notification ()
-{
- error_t err;
- mach_port_t initport, notify;
- struct port_info *pi;
-
- pci_shutdown_notify_class = ports_create_class (0, 0);
-
- /* Arrange to get notified when the system goes down,
- but if we fail for some reason, just silently give up. No big deal. */
-
- err = ports_create_port (pci_shutdown_notify_class, netfs_port_bucket,
- sizeof (struct port_info), &pi);
- if (err)
- return;
-
- initport = file_name_lookup (_SERVERS_STARTUP, 0, 0);
- if (initport == MACH_PORT_NULL)
- return;
-
- notify = ports_get_send_right (pi);
- ports_port_deref (pi);
- startup_request_notification (initport, notify,
- MACH_MSG_TYPE_MAKE_SEND,
- program_invocation_short_name);
- mach_port_deallocate (mach_task_self (), notify);
- mach_port_deallocate (mach_task_self (), initport);
-}
diff --git a/pci-arbiter/startup.h b/pci-arbiter/startup.h
deleted file mode 100644
index 416b84d6..00000000
--- a/pci-arbiter/startup.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Copyright (C) 2017 Free Software Foundation, Inc.
- Written by Michael I. Bushnell, p/BSG.
-
- This file is part of the GNU Hurd.
-
- The GNU Hurd is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- The GNU Hurd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef STARTUP_H
-#define STARTUP_H
-
-/* Startup and shutdown notifications management */
-
-/* Port class for startup requests */
-extern struct port_class *pci_shutdown_notify_class;
-
-void arrange_shutdown_notification (void);
-
-#endif /* STARTUP_H */