1 /* ports.h 2 * 3 * Definitions here are for kernel use only. For the actual 4 * definitions of port functions, please look at OS.h 5 */ 6 #ifndef _KERNEL_PORT_H 7 #define _KERNEL_PORT_H 8 9 #include <thread.h> 10 11 #define PORT_FLAG_USE_USER_MEMCPY 0x80000000 12 13 status_t port_init(kernel_args *ka); 14 int delete_owned_ports(team_id owner); 15 int32 port_max_ports(void); 16 int32 port_used_ports(void); 17 18 // temp: test 19 void port_test(void); 20 21 // user-level API 22 port_id user_create_port(int32 queue_length, const char *name); 23 status_t user_close_port(port_id id); 24 status_t user_delete_port(port_id id); 25 port_id user_find_port(const char *port_name); 26 status_t user_get_port_info(port_id id, struct port_info *info); 27 status_t user_get_next_port_info(team_id team, 28 int32 *cookie, 29 struct port_info *info); 30 ssize_t user_port_buffer_size_etc(port_id port, 31 uint32 flags, 32 bigtime_t timeout); 33 ssize_t user_port_count(port_id port); 34 status_t user_read_port_etc(port_id port, 35 int32 *msg_code, 36 void *msg_buffer, 37 size_t buffer_size, 38 uint32 flags, 39 bigtime_t timeout); 40 status_t user_set_port_owner(port_id port, team_id team); 41 status_t user_write_port_etc(port_id port, 42 int32 msg_code, 43 void *msg_buffer, 44 size_t buffer_size, 45 uint32 flags, 46 bigtime_t timeout); 47 48 #endif /* _KERNEL_PORT_H */ 49