1 /* 2 * Copyright 2005, Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT license. 4 */ 5 #ifndef _KERNEL_PORT_H 6 #define _KERNEL_PORT_H 7 8 #include <thread.h> 9 10 struct kernel_args; 11 12 13 #define PORT_FLAG_USE_USER_MEMCPY 0x80000000 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 status_t port_init(struct kernel_args *args); 20 int delete_owned_ports(team_id owner); 21 int32 port_max_ports(void); 22 int32 port_used_ports(void); 23 24 // temp: test 25 void port_test(void); 26 27 // user syscalls 28 port_id _user_create_port(int32 queue_length, const char *name); 29 status_t _user_close_port(port_id id); 30 status_t _user_delete_port(port_id id); 31 port_id _user_find_port(const char *port_name); 32 status_t _user_get_port_info(port_id id, struct port_info *info); 33 status_t _user_get_next_port_info(team_id team, int32 *cookie, 34 struct port_info *info); 35 ssize_t _user_port_buffer_size_etc(port_id port, uint32 flags, 36 bigtime_t timeout); 37 ssize_t _user_port_count(port_id port); 38 ssize_t _user_read_port_etc(port_id port, int32 *msg_code, 39 void *msg_buffer, size_t buffer_size, uint32 flags, 40 bigtime_t timeout); 41 status_t _user_set_port_owner(port_id port, team_id team); 42 status_t _user_write_port_etc(port_id port, int32 msg_code, 43 const void *msg_buffer, size_t buffer_size, 44 uint32 flags, bigtime_t timeout); 45 46 #ifdef __cplusplus 47 } 48 #endif 49 50 #endif /* _KERNEL_PORT_H */ 51