From 1ad178fd00b675d686c2560829e9a10c5cb44f6f Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 7 Jan 2015 16:05:48 +0100 Subject: proc: call `startup_essential_task' earlier Previously, the proc server did not call `startup_essential_task' until it got the message port of the startup server using `proc_setmsgport'. Now that we have `/servers/startup', we can do this in main, before we start our message service loop. A complication arises because the traditional startup server is single-threaded. Handle this by tweaking startup not to bind itself to `/servers/startup' before it is ready. * proc/main.c (main): Try to lookup `/servers/startup' and send the message here, or... * proc/msg.c (S_proc_setmsgport): ... fall back to the old way here. * proc/proc.h (startup_fallback): New variable. * startup/startup.c (main): Move code installing ourself on `/servers/startup' (install_as_translator): ... here. (launch_core_servers): And use it here, just before we reply to `/hurd/auth'. --- proc/proc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'proc/proc.h') diff --git a/proc/proc.h b/proc/proc.h index a056d18c..4be1de4e 100644 --- a/proc/proc.h +++ b/proc/proc.h @@ -151,6 +151,8 @@ mach_port_t generic_port; /* messages not related to a specific proc */ pthread_mutex_t global_lock; +extern int startup_fallback; /* (ab)use /hurd/startup's message port */ + /* Forward declarations */ void complete_wait (struct proc *, int); int check_uid (struct proc *, uid_t); -- cgit v1.2.3