xref: /titanic_50/usr/src/uts/common/sys/winlockio.h (revision 0a1278f26ea4b7c8c0285d4f2d6c5b680904aa01)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_WINLOCKIO_H
28 #define	_SYS_WINLOCKIO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <sys/ioccom.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Structure for allocating lock contexts.
41  * The page number portion of sy_ident is the offset for mmap(2).
42  * The page offset portion of sy_ident is the byte-offset relative to
43  * the start of the page returned by mmap(2) and should added to it.
44  */
45 
46 struct	winlockalloc {
47 	uint_t	sy_key;		/* user-provided key, if any */
48 	uint_t	sy_ident;	/* system-provided identification */
49 };
50 
51 /*
52  * Structure for getting and setting lock timeouts or NOTIMEOUT flag
53  */
54 
55 struct	winlocktimeout {
56 	uint_t	sy_ident;	/* system-provided identification */
57 	uint_t	sy_timeout;	/* timeout value in seconds */
58 	int	sy_flags;	/* Flags for lock context - see defs below */
59 };
60 
61 #define	WIOC	('L'<<8)
62 
63 
64 #define	WINLOCKALLOC		(WIOC|0)
65 #define	WINLOCKFREE		(WIOC|1)
66 #define	WINLOCKSETTIMEOUT	(WIOC|2)
67 #define	WINLOCKGETTIMEOUT	(WIOC|3)
68 #define	WINLOCKDUMP		(WIOC|4)
69 
70 #ifndef GRABPAGEALLOC
71 #include <sys/fbio.h>		/* defines GRAB* ioctls */
72 #endif
73 
74 /* flag bits */
75 #define	SY_NOTIMEOUT	0x1	/* This client never times out */
76 
77 #ifdef	_KERNEL
78 
79 #define	UFLAGS		0x00ff	/* flags usable by users */
80 #define	KFLAGS		0xff00	/* flags used by driver implementation */
81 #define	TRASHPAGE	0x0400	/* process has unlock mapping to trashpage */
82 
83 #endif	/* _KERNEL */
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_WINLOCKIO_H */
90