|
Packit Service |
82fcde |
/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library; if not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <mach.h>
|
|
Packit Service |
82fcde |
#include <mach/mig_support.h>
|
|
Packit Service |
82fcde |
#include <hurd/threadvar.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* These functions are called by MiG-generated code. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
mach_port_t __hurd_reply_port0;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Called by MiG to get a reply port. */
|
|
Packit Service |
82fcde |
mach_port_t
|
|
Packit Service |
82fcde |
__mig_get_reply_port (void)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
if (__hurd_local_reply_port == MACH_PORT_NULL ||
|
|
Packit Service |
82fcde |
(&__hurd_local_reply_port != &__hurd_reply_port0
|
|
Packit Service |
82fcde |
&& __hurd_local_reply_port == __hurd_reply_port0))
|
|
Packit Service |
82fcde |
__hurd_local_reply_port = __mach_reply_port ();
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return __hurd_local_reply_port;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
weak_alias (__mig_get_reply_port, mig_get_reply_port)
|
|
Packit Service |
82fcde |
libc_hidden_def (__mig_get_reply_port)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Called by MiG to deallocate the reply port. */
|
|
Packit Service |
82fcde |
void
|
|
Packit Service |
82fcde |
__mig_dealloc_reply_port (mach_port_t arg)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
mach_port_t port = __hurd_local_reply_port;
|
|
Packit Service |
82fcde |
__hurd_local_reply_port = MACH_PORT_NULL; /* So the mod_refs RPC won't use it. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (MACH_PORT_VALID (port))
|
|
Packit Service |
82fcde |
__mach_port_mod_refs (__mach_task_self (), port,
|
|
Packit Service |
82fcde |
MACH_PORT_RIGHT_RECEIVE, -1);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
weak_alias (__mig_dealloc_reply_port, mig_dealloc_reply_port)
|
|
Packit Service |
82fcde |
libc_hidden_def (__mig_dealloc_reply_port)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Called by mig interfaces when done with a port. Used to provide the
|
|
Packit Service |
82fcde |
same interface as needed when a custom allocator is used. */
|
|
Packit Service |
82fcde |
void
|
|
Packit Service |
82fcde |
__mig_put_reply_port(mach_port_t port)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
/* Do nothing. */
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
weak_alias (__mig_put_reply_port, mig_put_reply_port)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Called at startup with STACK == NULL. When per-thread variables are set
|
|
Packit Service |
82fcde |
up, this is called again with STACK set to the new stack being switched
|
|
Packit Service |
82fcde |
to, where per-thread variables should be set up. */
|
|
Packit Service |
82fcde |
void
|
|
Packit Service |
82fcde |
__mig_init (void *stack)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
/* Do nothing. */
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
weak_alias (__mig_init, mig_init)
|
|
Packit Service |
82fcde |
libc_hidden_def (__mig_init)
|