xref: /illumos-gate/usr/src/uts/common/sys/door.h (revision 49b225e1)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5024b0a25Sseb  * Common Development and Distribution License (the "License").
6024b0a25Sseb  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*49b225e1SGavin Maltby  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  * The door lightweight RPC I/F.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef	_SYS_DOOR_H
317c478bd9Sstevel@tonic-gate #define	_SYS_DOOR_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
37*49b225e1SGavin Maltby /*
38*49b225e1SGavin Maltby  * Attributes associated with doors.
39*49b225e1SGavin Maltby  */
40*49b225e1SGavin Maltby 
41*49b225e1SGavin Maltby /* Attributes originally obtained from door_create operation */
42*49b225e1SGavin Maltby #define	DOOR_UNREF	0x01	/* Deliver an unref notification with door */
43*49b225e1SGavin Maltby #define	DOOR_PRIVATE	0x02	/* Use a private pool of server threads */
44*49b225e1SGavin Maltby #define	DOOR_UNREF_MULTI 0x10	/* Deliver unref notification more than once */
45*49b225e1SGavin Maltby #define	DOOR_REFUSE_DESC 0x40	/* Do not accept descriptors from callers */
46*49b225e1SGavin Maltby #define	DOOR_NO_CANCEL	0x80	/* No server thread cancel on client abort */
47*49b225e1SGavin Maltby #define	DOOR_NO_DEPLETION_CB 0x100 /* No thread create callbacks on depletion */
48*49b225e1SGavin Maltby 
49*49b225e1SGavin Maltby /* Attributes (additional) returned with door_info and door_desc_t data */
50*49b225e1SGavin Maltby #define	DOOR_LOCAL	0x04	/* Descriptor is local to current process */
51*49b225e1SGavin Maltby #define	DOOR_REVOKED	0x08	/* Door has been revoked */
52*49b225e1SGavin Maltby #define	DOOR_IS_UNREF	0x20	/* Door is currently unreferenced */
53*49b225e1SGavin Maltby #define	DOOR_PRIVCREATE	0x200	/* Door has a private thread creation func */
54*49b225e1SGavin Maltby #define	DOOR_DEPLETION_CB 0x400	/* Set only during depletion callbacks */
55*49b225e1SGavin Maltby 
567c478bd9Sstevel@tonic-gate #if !defined(_ASM)
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate #include <sys/types.h>
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
617c478bd9Sstevel@tonic-gate #include <sys/mutex.h>
627c478bd9Sstevel@tonic-gate #include <sys/vnode.h>
637c478bd9Sstevel@tonic-gate #include <sys/door_impl.h>
647c478bd9Sstevel@tonic-gate #endif /* defined(_KERNEL) */
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate /* Basic door type information */
677c478bd9Sstevel@tonic-gate typedef unsigned long long door_ptr_t;	/* Handle 64 bit pointers */
687c478bd9Sstevel@tonic-gate typedef unsigned long long door_id_t;	/* Unique door identifier */
697c478bd9Sstevel@tonic-gate typedef	unsigned int	   door_attr_t;	/* Door attributes */
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #ifdef _KERNEL
727c478bd9Sstevel@tonic-gate struct __door_handle;
737c478bd9Sstevel@tonic-gate typedef struct __door_handle *door_handle_t;	/* opaque kernel door handle */
747c478bd9Sstevel@tonic-gate #endif
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate #define	DOOR_INVAL -1			/* An invalid door descriptor */
777c478bd9Sstevel@tonic-gate #define	DOOR_UNREF_DATA ((void *)1)	/* Unreferenced invocation address */
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /* Door descriptor passed to door_info to get current thread's binding */
807c478bd9Sstevel@tonic-gate #define	DOOR_QUERY -2
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate /* Masks of applicable flags */
837c478bd9Sstevel@tonic-gate #define	DOOR_CREATE_MASK	(DOOR_UNREF | DOOR_PRIVATE | \
84*49b225e1SGavin Maltby 	    DOOR_UNREF_MULTI | DOOR_REFUSE_DESC | DOOR_NO_CANCEL | \
85*49b225e1SGavin Maltby 	    DOOR_NO_DEPLETION_CB | DOOR_PRIVCREATE)
867c478bd9Sstevel@tonic-gate #define	DOOR_KI_CREATE_MASK	(DOOR_UNREF | DOOR_UNREF_MULTI)
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate /* Mask of above attributes */
897c478bd9Sstevel@tonic-gate #define	DOOR_ATTR_MASK	(DOOR_CREATE_MASK | \
907c478bd9Sstevel@tonic-gate 	    DOOR_LOCAL | DOOR_REVOKED | DOOR_IS_UNREF)
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate /* Attributes used to describe door_desc_t data */
937c478bd9Sstevel@tonic-gate #define	DOOR_DESCRIPTOR	0x10000	/* A file descriptor is being passed */
947c478bd9Sstevel@tonic-gate #ifdef _KERNEL
957c478bd9Sstevel@tonic-gate #define	DOOR_HANDLE	0x20000 /* A kernel door handle is being passed */
967c478bd9Sstevel@tonic-gate #endif
977c478bd9Sstevel@tonic-gate #define	DOOR_RELEASE	0x40000	/* Passed references are also released */
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate /* Misc attributes used internally */
1007c478bd9Sstevel@tonic-gate #define	DOOR_DELAY	0x80000	/* Delayed unref delivery */
1017c478bd9Sstevel@tonic-gate #define	DOOR_UNREF_ACTIVE 0x100000	/* Unreferenced call is active */
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate /* door parameters */
1047c478bd9Sstevel@tonic-gate #define	DOOR_PARAM_DESC_MAX	1	/* max number of request descriptors */
1057c478bd9Sstevel@tonic-gate #define	DOOR_PARAM_DATA_MAX	2	/* max bytes of request data */
1067c478bd9Sstevel@tonic-gate #define	DOOR_PARAM_DATA_MIN	3	/* min bytes of request data */
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate /*
1097c478bd9Sstevel@tonic-gate  * On AMD64, 32-bit pack door_desc and door_info to avoid needing special
1107c478bd9Sstevel@tonic-gate  * copyin/copyout conversions due to differing alignment rules between
1117c478bd9Sstevel@tonic-gate  * 32-bit x86 and 64-bit amd64.
1127c478bd9Sstevel@tonic-gate  */
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1157c478bd9Sstevel@tonic-gate #pragma pack(4)
1167c478bd9Sstevel@tonic-gate #endif
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /*
1197c478bd9Sstevel@tonic-gate  * Structure used to pass descriptors/objects in door invocations
1207c478bd9Sstevel@tonic-gate  */
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate typedef struct door_desc {
1237c478bd9Sstevel@tonic-gate 	door_attr_t	d_attributes;	/* Tag for union */
1247c478bd9Sstevel@tonic-gate 	union {
1257c478bd9Sstevel@tonic-gate 		/* File descriptor is passed */
1267c478bd9Sstevel@tonic-gate 		struct {
1277c478bd9Sstevel@tonic-gate 			int		d_descriptor;
1287c478bd9Sstevel@tonic-gate 			door_id_t	d_id;		/* unique id */
1297c478bd9Sstevel@tonic-gate 		} d_desc;
1307c478bd9Sstevel@tonic-gate #ifdef _KERNEL
1317c478bd9Sstevel@tonic-gate 		/* Kernel passes handles referring to doors */
1327c478bd9Sstevel@tonic-gate 		door_handle_t d_handle;
1337c478bd9Sstevel@tonic-gate #endif
1347c478bd9Sstevel@tonic-gate 		/* Reserved space */
1357c478bd9Sstevel@tonic-gate 		int		d_resv[5];
1367c478bd9Sstevel@tonic-gate 	} d_data;
1377c478bd9Sstevel@tonic-gate } door_desc_t;
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate /*
1407c478bd9Sstevel@tonic-gate  * Structure used to return info from door_info
1417c478bd9Sstevel@tonic-gate  */
1427c478bd9Sstevel@tonic-gate typedef struct door_info {
1437c478bd9Sstevel@tonic-gate 	pid_t		di_target;	/* Server process */
1447c478bd9Sstevel@tonic-gate 	door_ptr_t	di_proc;	/* Server procedure */
1457c478bd9Sstevel@tonic-gate 	door_ptr_t	di_data;	/* Data cookie */
1467c478bd9Sstevel@tonic-gate 	door_attr_t	di_attributes;	/* Attributes associated with door */
1477c478bd9Sstevel@tonic-gate 	door_id_t	di_uniquifier;	/* Unique number */
1487c478bd9Sstevel@tonic-gate 	int		di_resv[4];	/* Future use */
1497c478bd9Sstevel@tonic-gate } door_info_t;
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1527c478bd9Sstevel@tonic-gate #pragma pack()
1537c478bd9Sstevel@tonic-gate #endif
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate /*
1567c478bd9Sstevel@tonic-gate  * Structure used to return info from door_cred
1577c478bd9Sstevel@tonic-gate  */
1587c478bd9Sstevel@tonic-gate typedef struct door_cred {
1597c478bd9Sstevel@tonic-gate 	uid_t	dc_euid;	/* Effective uid of client */
1607c478bd9Sstevel@tonic-gate 	gid_t	dc_egid;	/* Effective gid of client */
1617c478bd9Sstevel@tonic-gate 	uid_t	dc_ruid;	/* Real uid of client */
1627c478bd9Sstevel@tonic-gate 	gid_t	dc_rgid;	/* Real gid of client */
1637c478bd9Sstevel@tonic-gate 	pid_t	dc_pid;		/* pid of client */
1647c478bd9Sstevel@tonic-gate 	int	dc_resv[4];	/* Future use */
1657c478bd9Sstevel@tonic-gate } door_cred_t;
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate /*
1687c478bd9Sstevel@tonic-gate  * Structure used to pass/return data from door_call
1697c478bd9Sstevel@tonic-gate  *
1707c478bd9Sstevel@tonic-gate  * All fields are in/out paramters. Upon return these fields
1717c478bd9Sstevel@tonic-gate  * are updated to reflect the true location and size of the results.
1727c478bd9Sstevel@tonic-gate  */
1737c478bd9Sstevel@tonic-gate typedef struct door_arg {
1747c478bd9Sstevel@tonic-gate 	char		*data_ptr;	/* Argument/result data */
1757c478bd9Sstevel@tonic-gate 	size_t		data_size;	/* Argument/result data size */
1767c478bd9Sstevel@tonic-gate 	door_desc_t	*desc_ptr;	/* Argument/result descriptors */
1777c478bd9Sstevel@tonic-gate 	uint_t		desc_num;	/* Argument/result num discriptors */
1787c478bd9Sstevel@tonic-gate 	char		*rbuf;		/* Result area */
1797c478bd9Sstevel@tonic-gate 	size_t		rsize;		/* Result size */
1807c478bd9Sstevel@tonic-gate } door_arg_t;
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1837c478bd9Sstevel@tonic-gate /*
1847c478bd9Sstevel@tonic-gate  * Structure to pass/return data from 32-bit program's door_call.
1857c478bd9Sstevel@tonic-gate  */
1867c478bd9Sstevel@tonic-gate typedef struct door_arg32 {
1877c478bd9Sstevel@tonic-gate 	caddr32_t	data_ptr;	/* Argument/result data */
1887c478bd9Sstevel@tonic-gate 	size32_t	data_size;	/* Argument/result data size */
1897c478bd9Sstevel@tonic-gate 	caddr32_t	desc_ptr;	/* Argument/result descriptors */
1907c478bd9Sstevel@tonic-gate 	uint32_t	desc_num;	/* Argument/result num descriptors */
1917c478bd9Sstevel@tonic-gate 	caddr32_t	rbuf;		/* Result area */
1927c478bd9Sstevel@tonic-gate 	size32_t	rsize;		/* Result size */
1937c478bd9Sstevel@tonic-gate } door_arg32_t;
1947c478bd9Sstevel@tonic-gate #endif
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate /*
1977c478bd9Sstevel@tonic-gate  * Structure used to pass door invocation information.
1987c478bd9Sstevel@tonic-gate  */
1997c478bd9Sstevel@tonic-gate struct door_results {
2007c478bd9Sstevel@tonic-gate 	void		*cookie;
2017c478bd9Sstevel@tonic-gate 	char		*data_ptr;
2027c478bd9Sstevel@tonic-gate 	size_t		data_size;
2037c478bd9Sstevel@tonic-gate 	door_desc_t	*desc_ptr;
2047c478bd9Sstevel@tonic-gate 	size_t		desc_num;
2057c478bd9Sstevel@tonic-gate 	void		(*pc)();
2067c478bd9Sstevel@tonic-gate 	int		nservers;	/* zero if thread pool is empty */
2077c478bd9Sstevel@tonic-gate 	door_info_t	*door_info;
2087c478bd9Sstevel@tonic-gate };
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2117c478bd9Sstevel@tonic-gate /*
2127c478bd9Sstevel@tonic-gate  * Structure used to pass door invocation information to 32-bit processes.
2137c478bd9Sstevel@tonic-gate  */
2147c478bd9Sstevel@tonic-gate struct door_results32 {
2157c478bd9Sstevel@tonic-gate 	caddr32_t	cookie;
2167c478bd9Sstevel@tonic-gate 	caddr32_t	data_ptr;
2177c478bd9Sstevel@tonic-gate 	size32_t	data_size;
2187c478bd9Sstevel@tonic-gate 	caddr32_t	desc_ptr;
2197c478bd9Sstevel@tonic-gate 	size32_t	desc_num;
2207c478bd9Sstevel@tonic-gate 	caddr32_t	pc;
2217c478bd9Sstevel@tonic-gate 	int		nservers;
2227c478bd9Sstevel@tonic-gate 	caddr32_t	door_info;
2237c478bd9Sstevel@tonic-gate };
2247c478bd9Sstevel@tonic-gate #endif
2257c478bd9Sstevel@tonic-gate 
2267c478bd9Sstevel@tonic-gate /*
2277c478bd9Sstevel@tonic-gate  * Structure used to pass a descriptor list to door_return.
2287c478bd9Sstevel@tonic-gate  */
2297c478bd9Sstevel@tonic-gate typedef struct door_return_desc {
2307c478bd9Sstevel@tonic-gate 	door_desc_t	*desc_ptr;
2317c478bd9Sstevel@tonic-gate 	uint_t		desc_num;
2327c478bd9Sstevel@tonic-gate } door_return_desc_t;
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2357c478bd9Sstevel@tonic-gate typedef struct door_return_desc32 {
2367c478bd9Sstevel@tonic-gate 	caddr32_t	desc_ptr;
2377c478bd9Sstevel@tonic-gate 	uint_t		desc_num;
2387c478bd9Sstevel@tonic-gate } door_return_desc32_t;
2397c478bd9Sstevel@tonic-gate #endif
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate /*
2447c478bd9Sstevel@tonic-gate  * Errors used for doors. Negative numbers to avoid conflicts with errnos
2457c478bd9Sstevel@tonic-gate  */
2467c478bd9Sstevel@tonic-gate #define	DOOR_WAIT	-1	/* Waiting for response */
2477c478bd9Sstevel@tonic-gate #define	DOOR_EXIT	-2	/* Server thread has exited */
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate #define	VTOD(v)	((struct door_node *)(v->v_data))
2507c478bd9Sstevel@tonic-gate #define	DTOV(d) ((d)->door_vnode)
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate /*
2537c478bd9Sstevel@tonic-gate  * Underlying 'filesystem' object definition
2547c478bd9Sstevel@tonic-gate  */
2557c478bd9Sstevel@tonic-gate typedef struct door_node {
2567c478bd9Sstevel@tonic-gate 	vnode_t		*door_vnode;
2577c478bd9Sstevel@tonic-gate 	struct proc 	*door_target;	/* Proc handling this doors invoc's. */
2587c478bd9Sstevel@tonic-gate 	struct door_node *door_list;	/* List of active doors in proc */
2597c478bd9Sstevel@tonic-gate 	struct door_node *door_ulist;	/* Unref list */
2607c478bd9Sstevel@tonic-gate 	void		(*door_pc)();	/* Door server entry point */
2617c478bd9Sstevel@tonic-gate 	void		*door_data;	/* Cookie passed during invocations */
2627c478bd9Sstevel@tonic-gate 	door_id_t	door_index;	/* Used as a uniquifier */
2637c478bd9Sstevel@tonic-gate 	door_attr_t	door_flags;	/* State associated with door */
2647c478bd9Sstevel@tonic-gate 	uint_t		door_active;	/* Number of active invocations */
2657c478bd9Sstevel@tonic-gate 	door_pool_t	door_servers;	/* Private pool of server threads */
2667c478bd9Sstevel@tonic-gate 	size_t		door_data_max;	/* param: max request data size */
2677c478bd9Sstevel@tonic-gate 	size_t		door_data_min;	/* param: min request data size */
2687c478bd9Sstevel@tonic-gate 	uint_t		door_desc_max;	/* param: max request descriptors */
2697c478bd9Sstevel@tonic-gate 	uint_t		door_bound_threads; /* number of bound threads */
2707c478bd9Sstevel@tonic-gate } door_node_t;
2717c478bd9Sstevel@tonic-gate 
2727c478bd9Sstevel@tonic-gate /* Test if a door has been revoked */
2737c478bd9Sstevel@tonic-gate #define	DOOR_INVALID(dp)	((dp)->door_flags & DOOR_REVOKED)
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate struct file;
2767c478bd9Sstevel@tonic-gate int	door_insert(struct file *, door_desc_t *);
2777c478bd9Sstevel@tonic-gate int	door_finish_dispatch(caddr_t);
2787c478bd9Sstevel@tonic-gate uintptr_t door_final_sp(uintptr_t, size_t, int);
279323a81d9Sjwadams int	door_upcall(vnode_t *, door_arg_t *, struct cred *, size_t, uint_t);
2807c478bd9Sstevel@tonic-gate void	door_slam(void);
2817c478bd9Sstevel@tonic-gate void	door_exit(void);
2827c478bd9Sstevel@tonic-gate void	door_revoke_all(void);
2837c478bd9Sstevel@tonic-gate void	door_deliver_unref(door_node_t *);
2847c478bd9Sstevel@tonic-gate void	door_list_delete(door_node_t *);
2857c478bd9Sstevel@tonic-gate void	door_fork(kthread_t *, kthread_t *);
2867c478bd9Sstevel@tonic-gate void	door_bind_thread(door_node_t *);
2877c478bd9Sstevel@tonic-gate void	door_unbind_thread(door_node_t *);
2887c478bd9Sstevel@tonic-gate 
2897c478bd9Sstevel@tonic-gate extern kmutex_t door_knob;
2907c478bd9Sstevel@tonic-gate extern kcondvar_t door_cv;
2917c478bd9Sstevel@tonic-gate extern size_t door_max_arg;
2927c478bd9Sstevel@tonic-gate 
2937c478bd9Sstevel@tonic-gate /*
2947c478bd9Sstevel@tonic-gate  * In-kernel doors interface.  These functions are considered Sun Private
2957c478bd9Sstevel@tonic-gate  * and may change incompatibly in a minor release of Solaris.
2967c478bd9Sstevel@tonic-gate  */
2977c478bd9Sstevel@tonic-gate int	door_ki_upcall(door_handle_t, door_arg_t *);
298323a81d9Sjwadams int	door_ki_upcall_limited(door_handle_t, door_arg_t *, struct cred *,
299323a81d9Sjwadams     size_t, uint_t);
3007c478bd9Sstevel@tonic-gate int	door_ki_create(void (*)(void *, door_arg_t *,
3017c478bd9Sstevel@tonic-gate     void (**)(void *, void *), void **, int *), void *, door_attr_t,
3027c478bd9Sstevel@tonic-gate     door_handle_t *);
3037c478bd9Sstevel@tonic-gate void	door_ki_hold(door_handle_t);
3047c478bd9Sstevel@tonic-gate void	door_ki_rele(door_handle_t);
3057c478bd9Sstevel@tonic-gate int	door_ki_open(char *, door_handle_t *);
3067c478bd9Sstevel@tonic-gate int	door_ki_info(door_handle_t, door_info_t *);
3077c478bd9Sstevel@tonic-gate int	door_ki_getparam(door_handle_t, int, size_t *);
3087c478bd9Sstevel@tonic-gate int	door_ki_setparam(door_handle_t, int, size_t);
3097c478bd9Sstevel@tonic-gate door_handle_t door_ki_lookup(int did);
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate #endif	/* defined(_KERNEL) */
3127c478bd9Sstevel@tonic-gate #endif	/* !defined(_ASM) */
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate /*
3157c478bd9Sstevel@tonic-gate  * System call subcodes
3167c478bd9Sstevel@tonic-gate  */
3177c478bd9Sstevel@tonic-gate #define	DOOR_CREATE	0
3187c478bd9Sstevel@tonic-gate #define	DOOR_REVOKE	1
3197c478bd9Sstevel@tonic-gate #define	DOOR_INFO	2
3207c478bd9Sstevel@tonic-gate #define	DOOR_CALL	3
3217c478bd9Sstevel@tonic-gate #define	DOOR_BIND	6
3227c478bd9Sstevel@tonic-gate #define	DOOR_UNBIND	7
3237c478bd9Sstevel@tonic-gate #define	DOOR_UNREFSYS	8
3247c478bd9Sstevel@tonic-gate #define	DOOR_UCRED	9
3257c478bd9Sstevel@tonic-gate #define	DOOR_RETURN	10
3267c478bd9Sstevel@tonic-gate #define	DOOR_GETPARAM	11
3277c478bd9Sstevel@tonic-gate #define	DOOR_SETPARAM	12
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3307c478bd9Sstevel@tonic-gate }
3317c478bd9Sstevel@tonic-gate #endif
3327c478bd9Sstevel@tonic-gate 
3337c478bd9Sstevel@tonic-gate #endif	/* _SYS_DOOR_H */
334