diff options
Diffstat (limited to 'hurd/hurd/port.h')
-rw-r--r-- | hurd/hurd/port.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/hurd/hurd/port.h b/hurd/hurd/port.h index 7dac1bfe3c..0779578d03 100644 --- a/hurd/hurd/port.h +++ b/hurd/hurd/port.h @@ -1,5 +1,5 @@ /* Lightweight user references for ports. - Copyright (C) 1993-2016 Free Software Foundation, Inc. + Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,7 +24,6 @@ #include <mach.h> #include <hurd/userlink.h> #include <spin-lock.h> -#include <hurd/signal.h> /* Structure describing a cell containing a port. With the lock held, a @@ -60,9 +59,10 @@ struct hurd_port /* Initialize *PORT to INIT. */ -void _hurd_port_init (struct hurd_port *port, mach_port_t init); +extern void _hurd_port_init (struct hurd_port *port, mach_port_t init); -#if defined __USE_EXTERN_INLINES && defined _LIBC && !defined NOT_IN_libc +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_PORT_H_EXTERN_INLINE void _hurd_port_init (struct hurd_port *port, mach_port_t init) { @@ -70,6 +70,7 @@ _hurd_port_init (struct hurd_port *port, mach_port_t init) port->users = NULL; port->port = init; } +# endif #endif @@ -79,11 +80,12 @@ extern void _hurd_port_cleanup (void *, jmp_buf, int); /* Get a reference to *PORT, which is locked. Pass return value and LINK to _hurd_port_free when done. */ -mach_port_t +extern mach_port_t _hurd_port_locked_get (struct hurd_port *port, struct hurd_userlink *link); -#if defined __USE_EXTERN_INLINES && defined _LIBC && !defined NOT_IN_libc +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_PORT_H_EXTERN_INLINE mach_port_t _hurd_port_locked_get (struct hurd_port *port, struct hurd_userlink *link) @@ -99,15 +101,17 @@ _hurd_port_locked_get (struct hurd_port *port, __spin_unlock (&port->lock); return result; } +# endif #endif /* Same, but locks PORT first. */ -mach_port_t +extern mach_port_t _hurd_port_get (struct hurd_port *port, struct hurd_userlink *link); -#if defined __USE_EXTERN_INLINES && defined _LIBC && !defined NOT_IN_libc +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_PORT_H_EXTERN_INLINE mach_port_t _hurd_port_get (struct hurd_port *port, struct hurd_userlink *link) @@ -119,17 +123,19 @@ _hurd_port_get (struct hurd_port *port, HURD_CRITICAL_END; return result; } +# endif #endif /* Free a reference gotten with `USED_PORT = _hurd_port_get (PORT, LINK);' */ -void +extern void _hurd_port_free (struct hurd_port *port, struct hurd_userlink *link, mach_port_t used_port); -#if defined __USE_EXTERN_INLINES && defined _LIBC && !defined NOT_IN_libc +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_PORT_H_EXTERN_INLINE void _hurd_port_free (struct hurd_port *port, struct hurd_userlink *link, @@ -149,15 +155,17 @@ _hurd_port_free (struct hurd_port *port, if (dealloc) __mach_port_deallocate (__mach_task_self (), used_port); } +# endif #endif /* Set *PORT's port to NEWPORT. NEWPORT's reference is consumed by PORT->port. PORT->lock is locked. */ -void _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport); +extern void _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport); -#if defined __USE_EXTERN_INLINES && defined _LIBC && !defined NOT_IN_libc +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_PORT_H_EXTERN_INLINE void _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport) { @@ -168,13 +176,15 @@ _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport) if (old != MACH_PORT_NULL) __mach_port_deallocate (__mach_task_self (), old); } +# endif #endif /* Same, but locks PORT first. */ -void _hurd_port_set (struct hurd_port *port, mach_port_t newport); +extern void _hurd_port_set (struct hurd_port *port, mach_port_t newport); -#if defined __USE_EXTERN_INLINES && defined _LIBC && !defined NOT_IN_libc +#if defined __USE_EXTERN_INLINES && defined _LIBC +# if IS_IN (libc) _HURD_PORT_H_EXTERN_INLINE void _hurd_port_set (struct hurd_port *port, mach_port_t newport) { @@ -183,6 +193,7 @@ _hurd_port_set (struct hurd_port *port, mach_port_t newport) _hurd_port_locked_set (port, newport); HURD_CRITICAL_END; } +# endif #endif |