xref: /haiku/headers/private/kernel/messaging.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-internal interface for the messaging service
7*59b9b48bSIngo Weinhold 
8*59b9b48bSIngo Weinhold #ifndef MESSAGING_H
9*59b9b48bSIngo Weinhold #define MESSAGING_H
10*59b9b48bSIngo Weinhold 
11*59b9b48bSIngo Weinhold #include <OS.h>
12*59b9b48bSIngo Weinhold 
13*59b9b48bSIngo Weinhold #ifdef __cplusplus
14*59b9b48bSIngo Weinhold extern "C" {
15*59b9b48bSIngo Weinhold #endif
16*59b9b48bSIngo Weinhold 
17*59b9b48bSIngo Weinhold typedef struct messaging_target {
18*59b9b48bSIngo Weinhold 	port_id	port;
19*59b9b48bSIngo Weinhold 	int32	token;
20*59b9b48bSIngo Weinhold } messaging_target;
21*59b9b48bSIngo Weinhold 
22*59b9b48bSIngo Weinhold status_t init_messaging_service();
23*59b9b48bSIngo Weinhold 
24*59b9b48bSIngo Weinhold status_t send_message(const void *message, int32 messageSize,
25*59b9b48bSIngo Weinhold 	const messaging_target *targets, int32 targetCount);
26*59b9b48bSIngo Weinhold 
27*59b9b48bSIngo Weinhold area_id _user_register_messaging_service(sem_id lockingSem, sem_id counterSem);
28*59b9b48bSIngo Weinhold 
29*59b9b48bSIngo Weinhold #ifdef __cplusplus
30*59b9b48bSIngo Weinhold }
31*59b9b48bSIngo Weinhold #endif
32*59b9b48bSIngo Weinhold 
33*59b9b48bSIngo Weinhold 
34*59b9b48bSIngo Weinhold // C++ only
35*59b9b48bSIngo Weinhold 
36*59b9b48bSIngo Weinhold #ifdef __cplusplus
37*59b9b48bSIngo Weinhold 
38*59b9b48bSIngo Weinhold namespace BPrivate {
39*59b9b48bSIngo Weinhold 	class KMessage;
40*59b9b48bSIngo Weinhold }
41*59b9b48bSIngo Weinhold 
42*59b9b48bSIngo Weinhold status_t send_message(const KMessage *message,
43*59b9b48bSIngo Weinhold 	const messaging_target *targets,
44*59b9b48bSIngo Weinhold 	int32 targetCount);
45*59b9b48bSIngo Weinhold 
46*59b9b48bSIngo Weinhold #endif	// __cplusplus
47*59b9b48bSIngo Weinhold 
48*59b9b48bSIngo Weinhold #endif	// MESSAGING_H
49