xref: /haiku/headers/private/kernel/MessagingServiceDefs.h (revision 59b9b48bb3007001179fb35d63243b22fd8b47c2)
1*59b9b48bSIngo Weinhold /*
2*59b9b48bSIngo Weinhold  * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved.
3*59b9b48bSIngo Weinhold  * Distributed under the terms of the MIT License.
4*59b9b48bSIngo Weinhold  */
5*59b9b48bSIngo Weinhold 
6*59b9b48bSIngo Weinhold // kernel - userland interface definitions
7*59b9b48bSIngo Weinhold 
8*59b9b48bSIngo Weinhold #ifndef MESSAGING_SERVICE_DEFS_H
9*59b9b48bSIngo Weinhold #define MESSAGING_SERVICE_DEFS_H
10*59b9b48bSIngo Weinhold 
11*59b9b48bSIngo Weinhold #include <OS.h>
12*59b9b48bSIngo Weinhold 
13*59b9b48bSIngo Weinhold #include <messaging.h>
14*59b9b48bSIngo Weinhold 
15*59b9b48bSIngo Weinhold enum {
16*59b9b48bSIngo Weinhold 	MESSAGING_COMMAND_SEND_MESSAGE	= 0,
17*59b9b48bSIngo Weinhold };
18*59b9b48bSIngo Weinhold 
19*59b9b48bSIngo Weinhold struct messaging_area_header {
20*59b9b48bSIngo Weinhold 	vint32	lock_counter;
21*59b9b48bSIngo Weinhold 	int32	size;				// set to 0, when area is discarded
22*59b9b48bSIngo Weinhold 	area_id	kernel_area;
23*59b9b48bSIngo Weinhold 	area_id	next_kernel_area;
24*59b9b48bSIngo Weinhold 	int32	command_count;
25*59b9b48bSIngo Weinhold 	int32	first_command;
26*59b9b48bSIngo Weinhold 	int32	last_command;
27*59b9b48bSIngo Weinhold };
28*59b9b48bSIngo Weinhold 
29*59b9b48bSIngo Weinhold struct messaging_command {
30*59b9b48bSIngo Weinhold 	int32	next_command;
31*59b9b48bSIngo Weinhold 	uint32	command;
32*59b9b48bSIngo Weinhold 	int32	size;
33*59b9b48bSIngo Weinhold 	char	data[0];
34*59b9b48bSIngo Weinhold };
35*59b9b48bSIngo Weinhold 
36*59b9b48bSIngo Weinhold struct messaging_command_new_area {
37*59b9b48bSIngo Weinhold 	area_id	area;
38*59b9b48bSIngo Weinhold };
39*59b9b48bSIngo Weinhold 
40*59b9b48bSIngo Weinhold struct messaging_command_send_message {
41*59b9b48bSIngo Weinhold 	int32				message_size;
42*59b9b48bSIngo Weinhold 	int32				target_count;
43*59b9b48bSIngo Weinhold 	messaging_target	targets[0];	// [target_count]
44*59b9b48bSIngo Weinhold //	char				message[message_size];
45*59b9b48bSIngo Weinhold };
46*59b9b48bSIngo Weinhold 
47*59b9b48bSIngo Weinhold #endif	// MESSAGING_SERVICE_DEFS_H
48