xref: /NextBSD/sys/sys/mach/notify.h (revision 33da5adc555b3bc29986eeadca03829e4ad06b1e)
1 /*
2  * Copyright 1991-1998 by Open Software Foundation, Inc.
3  *              All Rights Reserved
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both the copyright notice and this permission notice appear in
9  * supporting documentation.
10  *
11  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
12  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13  * FOR A PARTICULAR PURPOSE.
14  *
15  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
16  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
18  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
19  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  */
21 /*
22  * MkLinux
23  */
24 /* CMU_HIST */
25 /*
26  * Revision 2.4.2.1  92/03/03  16:22:23  jeffreyh
27  * 	Changes form TRUNK
28  * 	[92/02/26  12:12:10  jeffreyh]
29  *
30  * Revision 2.5  92/01/15  13:44:41  rpd
31  * 	Changed MACH_IPC_COMPAT conditionals to default to not present.
32  *
33  * Revision 2.4  91/05/14  16:58:21  mrt
34  * 	Correcting copyright
35  *
36  * Revision 2.3  91/02/05  17:35:18  mrt
37  * 	Changed to new Mach copyright
38  * 	[91/02/01  17:20:02  mrt]
39  *
40  * Revision 2.2  90/06/02  14:59:32  rpd
41  * 	Converted to new IPC.
42  * 	[90/03/26  22:38:14  rpd]
43  *
44  * Revision 2.7.7.1  90/02/20  22:24:32  rpd
45  * 	Revised for new IPC.
46  * 	[90/02/19  23:38:57  rpd]
47  *
48  *
49  * Condensed history:
50  *	Moved ownership rights under MACH_IPC_XXXHACK (rpd).
51  * 	Added NOTIFY_PORT_DESTROYED (rpd).
52  *	Added notification message structure definition (mwyoung).
53  *	Created, based on Accent values (mwyoung).
54  */
55 /* CMU_ENDHIST */
56 /*
57  * Mach Operating System
58  * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
59  * All Rights Reserved.
60  *
61  * Permission to use, copy, modify and distribute this software and its
62  * documentation is hereby granted, provided that both the copyright
63  * notice and this permission notice appear in all copies of the
64  * software, derivative works or modified versions, and any portions
65  * thereof, and that both notices appear in supporting documentation.
66  *
67  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
68  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
69  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
70  *
71  * Carnegie Mellon requests users of this software to return to
72  *
73  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
74  *  School of Computer Science
75  *  Carnegie Mellon University
76  *  Pittsburgh PA 15213-3890
77  *
78  * any improvements or extensions that they make and grant Carnegie Mellon
79  * the rights to redistribute these changes.
80  */
81 /*
82  */
83 /*
84  *	File:	mach/notify.h
85  *
86  *	Kernel notification message definitions.
87  */
88 
89 #ifndef	_MACH_NOTIFY_H_
90 #define _MACH_NOTIFY_H_
91 
92 #include <sys/types.h>
93 #include <vm/vm.h> /* boolean_t */
94 #include <sys/mach/port.h>
95 #include <sys/mach/message.h>
96 #include <sys/mach/ndr.h>
97 
98 /*
99  *  An alternative specification of the notification interface
100  *  may be found in mach/notify.defs.
101  */
102 
103 #define MACH_NOTIFY_FIRST		0100
104 #define MACH_NOTIFY_PORT_DELETED	(MACH_NOTIFY_FIRST + 001 )
105 			/* A send or send-once right was deleted. */
106 #define MACH_NOTIFY_PORT_DESTROYED	(MACH_NOTIFY_FIRST + 005)
107 			/* A receive right was (would have been) deallocated */
108 #define MACH_NOTIFY_NO_SENDERS		(MACH_NOTIFY_FIRST + 006)
109 			/* Receive right has no extant send rights */
110 #define MACH_NOTIFY_SEND_ONCE		(MACH_NOTIFY_FIRST + 007)
111 			/* An extant send-once right died */
112 #define MACH_NOTIFY_DEAD_NAME		(MACH_NOTIFY_FIRST + 010)
113 			/* Send or send-once right died, leaving a dead-name */
114 #define MACH_NOTIFY_LAST		(MACH_NOTIFY_FIRST + 015)
115 
116 typedef struct {
117     mach_msg_header_t	not_header;
118     NDR_record_t	NDR;
119     mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
120     mach_msg_format_0_trailer_t trailer;
121 } mach_port_deleted_notification_t;
122 
123 typedef struct {
124     mach_msg_header_t	not_header;
125     mach_msg_body_t	not_body;
126     mach_msg_port_descriptor_t not_port;/* MACH_MSG_TYPE_PORT_RECEIVE */
127     mach_msg_format_0_trailer_t trailer;
128 } mach_port_destroyed_notification_t;
129 
130 typedef struct {
131     mach_msg_header_t	not_header;
132     NDR_record_t	NDR;
133     mach_msg_type_number_t not_count;
134     mach_msg_format_0_trailer_t trailer;
135 } mach_no_senders_notification_t;
136 
137 typedef struct {
138     mach_msg_header_t	not_header;
139     mach_msg_format_0_trailer_t trailer;
140 } mach_send_once_notification_t;
141 
142 typedef struct {
143     mach_msg_header_t	not_header;
144     NDR_record_t	NDR;
145     mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
146     mach_msg_format_0_trailer_t trailer;
147 } mach_dead_name_notification_t;
148 
149 #endif	/* _MACH_NOTIFY_H_ */
150