xref: /haiku/headers/private/kernel/messaging.h (revision 3cb015b1ee509d69c643506e8ff573808c86dcfc)
1 /*
2  * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 // kernel-internal interface for the messaging service
7 
8 #ifndef MESSAGING_H
9 #define MESSAGING_H
10 
11 #include <OS.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef struct messaging_target {
18 	port_id	port;
19 	int32	token;
20 } messaging_target;
21 
22 status_t init_messaging_service();
23 
24 status_t send_message(const void *message, int32 messageSize,
25 	const messaging_target *targets, int32 targetCount);
26 
27 // syscalls
28 area_id _user_register_messaging_service(sem_id lockingSem, sem_id counterSem);
29 status_t _user_unregister_messaging_service();
30 
31 #ifdef __cplusplus
32 }
33 #endif
34 
35 
36 // C++ only
37 
38 #ifdef __cplusplus
39 
40 namespace BPrivate {
41 	class KMessage;
42 }
43 
44 status_t send_message(const BPrivate::KMessage *message,
45 	const messaging_target *targets,
46 	int32 targetCount);
47 
48 #endif	// __cplusplus
49 
50 #endif	// MESSAGING_H
51