2005-01-20 20:52:06 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2005, Haiku Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT license.
|
2002-07-09 16:24:59 +04:00
|
|
|
*/
|
|
|
|
#ifndef _KERNEL_PORT_H
|
|
|
|
#define _KERNEL_PORT_H
|
|
|
|
|
2005-07-14 03:55:15 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <thread.h>
|
2005-07-14 03:55:15 +04:00
|
|
|
#include <iovec.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2005-01-20 20:52:06 +03:00
|
|
|
struct kernel_args;
|
2007-10-02 23:47:31 +04:00
|
|
|
struct select_info;
|
2005-01-20 20:52:06 +03:00
|
|
|
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#define PORT_FLAG_USE_USER_MEMCPY 0x80000000
|
|
|
|
|
2005-01-20 20:52:06 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
status_t port_init(struct kernel_args *args);
|
2002-08-03 04:41:27 +04:00
|
|
|
int delete_owned_ports(team_id owner);
|
2004-04-22 02:46:35 +04:00
|
|
|
int32 port_max_ports(void);
|
|
|
|
int32 port_used_ports(void);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-10-02 23:47:31 +04:00
|
|
|
status_t select_port(int32 object, struct select_info *info, bool kernel);
|
|
|
|
status_t deselect_port(int32 object, struct select_info *info, bool kernel);
|
|
|
|
|
2005-07-14 03:55:15 +04:00
|
|
|
// currently private API
|
|
|
|
status_t writev_port_etc(port_id id, int32 msgCode, const iovec *msgVecs,
|
|
|
|
size_t vecCount, size_t bufferSize, uint32 flags, bigtime_t timeout);
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
// temp: test
|
|
|
|
void port_test(void);
|
|
|
|
|
2005-01-20 20:52:06 +03:00
|
|
|
// user syscalls
|
2005-07-14 03:55:15 +04:00
|
|
|
port_id _user_create_port(int32 queueLength, const char *name);
|
2004-08-29 00:45:00 +04:00
|
|
|
status_t _user_close_port(port_id id);
|
|
|
|
status_t _user_delete_port(port_id id);
|
2005-07-14 03:55:15 +04:00
|
|
|
port_id _user_find_port(const char *portName);
|
2004-08-29 00:45:00 +04:00
|
|
|
status_t _user_get_port_info(port_id id, struct port_info *info);
|
2005-01-20 20:52:06 +03:00
|
|
|
status_t _user_get_next_port_info(team_id team, int32 *cookie,
|
2002-07-09 16:24:59 +04:00
|
|
|
struct port_info *info);
|
2005-01-20 20:52:06 +03:00
|
|
|
ssize_t _user_port_buffer_size_etc(port_id port, uint32 flags,
|
2002-07-09 16:24:59 +04:00
|
|
|
bigtime_t timeout);
|
2004-08-29 00:45:00 +04:00
|
|
|
ssize_t _user_port_count(port_id port);
|
2005-07-14 03:55:15 +04:00
|
|
|
ssize_t _user_read_port_etc(port_id port, int32 *msgCode,
|
|
|
|
void *msgBuffer, size_t bufferSize, uint32 flags,
|
2002-07-09 16:24:59 +04:00
|
|
|
bigtime_t timeout);
|
2004-08-29 00:45:00 +04:00
|
|
|
status_t _user_set_port_owner(port_id port, team_id team);
|
2005-07-14 03:55:15 +04:00
|
|
|
status_t _user_write_port_etc(port_id port, int32 msgCode,
|
|
|
|
const void *msgBuffer, size_t bufferSize,
|
2005-01-20 20:52:06 +03:00
|
|
|
uint32 flags, bigtime_t timeout);
|
2005-07-14 03:55:15 +04:00
|
|
|
status_t _user_writev_port_etc(port_id id, int32 msgCode,
|
|
|
|
const iovec *msgVecs, size_t vecCount,
|
|
|
|
size_t bufferSize, uint32 flags, bigtime_t timeout);
|
2008-04-17 21:46:02 +04:00
|
|
|
status_t _user_get_port_message_info_etc(port_id port,
|
|
|
|
port_message_info *info, size_t infoSize, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
2005-01-20 20:52:06 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2003-09-13 00:48:07 +04:00
|
|
|
#endif /* _KERNEL_PORT_H */
|