xref: /titanic_52/usr/src/uts/common/sys/ctfs.h (revision 6185db853e024a486ff8837e6784dd290d866112)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_CTFS_H
28 #define	_SYS_CTFS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/contract.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Location of the contract filesystem.
40  */
41 #define	CTFS_ROOT	"/system/contract"
42 
43 /*
44  * CTFS ioctl constants
45  */
46 #define	CTFS_PREFIX	('c' << 24 | 't' << 16)
47 #define	CTFS_IOC(x, y)	(CTFS_PREFIX | (x) << 8 | (y))
48 
49 /*
50  * Control codes for messages written to template files.
51  */
52 #define	CTFS_TMPL(x)	CTFS_IOC('t', x)
53 #define	CT_TACTIVATE	CTFS_TMPL(0)	/* Activate template */
54 #define	CT_TCLEAR	CTFS_TMPL(1)	/* Clear active template */
55 #define	CT_TCREATE	CTFS_TMPL(2)	/* Create contract from template */
56 #define	CT_TSET		CTFS_TMPL(3)	/* Set parameter */
57 #define	CT_TGET		CTFS_TMPL(4)	/* Get parameter */
58 
59 /*
60  * Control codes for messages written to ctl files.
61  */
62 #define	CTFS_CTL(x)	CTFS_IOC('c', x)
63 #define	CT_CABANDON	CTFS_CTL(0)	/* Abandon contract */
64 #define	CT_CACK		CTFS_CTL(1)	/* Ack a message */
65 #define	CT_CQREQ	CTFS_CTL(2)	/* Request an additional quantum */
66 #define	CT_CADOPT	CTFS_CTL(3)	/* Adopt a contract */
67 #define	CT_CNEWCT	CTFS_CTL(4)	/* Define new contract */
68 
69 /*
70  * Control codes for messages written to status files.
71  */
72 #define	CTFS_STAT(x)	CTFS_IOC('s', x)
73 #define	CT_SSTATUS	CTFS_STAT(0)	/* Obtain contract status */
74 
75 /*
76  * Control codes for messages written to event endpoints.
77  */
78 #define	CTFS_EVT(x)	CTFS_IOC('e', x)
79 #define	CT_ERESET	CTFS_EVT(0)	/* Reset event queue pointer */
80 #define	CT_ERECV	CTFS_EVT(1)	/* Read next event */
81 #define	CT_ECRECV	CTFS_EVT(2)	/* Read next critical event */
82 #define	CT_ENEXT	CTFS_EVT(3)	/* Skip current event */
83 #define	CT_ERELIABLE	CTFS_EVT(4)	/* Request reliable event receipt */
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_CTFS_H */
90