159b9b48bSIngo Weinhold /* 259b9b48bSIngo Weinhold * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved. 359b9b48bSIngo Weinhold * Distributed under the terms of the MIT License. 459b9b48bSIngo Weinhold */ 559b9b48bSIngo Weinhold 659b9b48bSIngo Weinhold // kernel-internal interface for the messaging service 759b9b48bSIngo Weinhold 859b9b48bSIngo Weinhold #ifndef MESSAGING_H 959b9b48bSIngo Weinhold #define MESSAGING_H 1059b9b48bSIngo Weinhold 1159b9b48bSIngo Weinhold #include <OS.h> 1259b9b48bSIngo Weinhold 1359b9b48bSIngo Weinhold #ifdef __cplusplus 1459b9b48bSIngo Weinhold extern "C" { 1559b9b48bSIngo Weinhold #endif 1659b9b48bSIngo Weinhold 1759b9b48bSIngo Weinhold typedef struct messaging_target { 1859b9b48bSIngo Weinhold port_id port; 1959b9b48bSIngo Weinhold int32 token; 2059b9b48bSIngo Weinhold } messaging_target; 2159b9b48bSIngo Weinhold 2259b9b48bSIngo Weinhold status_t init_messaging_service(); 2359b9b48bSIngo Weinhold 2459b9b48bSIngo Weinhold status_t send_message(const void *message, int32 messageSize, 2559b9b48bSIngo Weinhold const messaging_target *targets, int32 targetCount); 2659b9b48bSIngo Weinhold 27*244ddcf0SIngo Weinhold // syscalls 2859b9b48bSIngo Weinhold area_id _user_register_messaging_service(sem_id lockingSem, sem_id counterSem); 29*244ddcf0SIngo Weinhold status_t _user_unregister_messaging_service(); 3059b9b48bSIngo Weinhold 3159b9b48bSIngo Weinhold #ifdef __cplusplus 3259b9b48bSIngo Weinhold } 3359b9b48bSIngo Weinhold #endif 3459b9b48bSIngo Weinhold 3559b9b48bSIngo Weinhold 3659b9b48bSIngo Weinhold // C++ only 3759b9b48bSIngo Weinhold 3859b9b48bSIngo Weinhold #ifdef __cplusplus 3959b9b48bSIngo Weinhold 4059b9b48bSIngo Weinhold namespace BPrivate { 4159b9b48bSIngo Weinhold class KMessage; 4259b9b48bSIngo Weinhold } 4359b9b48bSIngo Weinhold 44*244ddcf0SIngo Weinhold status_t send_message(const BPrivate::KMessage *message, 4559b9b48bSIngo Weinhold const messaging_target *targets, 4659b9b48bSIngo Weinhold int32 targetCount); 4759b9b48bSIngo Weinhold 4859b9b48bSIngo Weinhold #endif // __cplusplus 4959b9b48bSIngo Weinhold 5059b9b48bSIngo Weinhold #endif // MESSAGING_H 51