17 #include <core/dependencies.h>
19 #ifndef __POK_LIBPOK_PORTS_H__
20 #define __POK_LIBPOK_PORTS_H__
24 #include <core/syscall.h>
28 POK_PORT_QUEUEING_DISCIPLINE_FIFO = 1,
29 POK_PORT_QUEUEING_DISCIPLINE_PRIORITY = 2
30 } pok_port_queueing_disciplines_t;
34 POK_PORT_DIRECTION_IN = 1,
35 POK_PORT_DIRECTION_OUT = 2
36 } pok_port_directions_t;
38 typedef pok_queueing_discipline_t pok_port_queueing_discipline_t;
42 POK_PORT_KIND_QUEUEING = 1,
43 POK_PORT_KIND_SAMPLING = 2,
44 POK_PORT_KIND_VIRTUAL = 2,
45 POK_PORT_KIND_INVALID = 10
48 #ifdef POK_NEEDS_PORTS_VIRTUAL
49 pok_ret_t pok_port_virtual_create (
char* name, pok_port_id_t*
id);
51 pok_ret_t pok_port_virtual_destination (
const pok_port_id_t
id,
const uint32_t n, uint32_t* result);
53 pok_ret_t pok_port_virtual_nb_destinations (
const pok_port_id_t
id, uint32_t* result);
55 pok_ret_t pok_port_virtual_get_global (
const pok_port_id_t local, pok_port_id_t* global);
58 #ifdef POK_NEEDS_PORTS_QUEUEING
63 pok_port_direction_t direction;
65 uint8_t waiting_processes;
69 pok_ret_t pok_port_queueing_create (
char* name,
70 const pok_port_size_t size,
71 const pok_port_direction_t direction,
72 const pok_port_queueing_discipline_t discipline,
75 pok_ret_t pok_port_queueing_receive (
const pok_port_id_t
id,
76 const uint64_t timeout,
77 const pok_port_size_t maxlen,
79 pok_port_size_t* len);
81 pok_ret_t pok_port_queueing_send (
const pok_port_id_t
id,
83 const pok_port_size_t len,
84 const uint64_t timeout);
86 #define pok_port_queueing_status(id,status) \
87 pok_syscall2(POK_SYSCALL_MIDDLEWARE_QUEUEING_STATUS,(uint32_t)id,(uint32_t)status)
95 #define pok_port_queueing_id(name,id) \
96 pok_syscall2(POK_SYSCALL_MIDDLEWARE_QUEUEING_ID,(uint32_t)name,(uint32_t)id)
104 #ifdef POK_NEEDS_PORTS_SAMPLING
109 pok_port_size_t size;
110 pok_port_direction_t direction;
116 pok_ret_t pok_port_sampling_create (
char* name,
117 const pok_port_size_t size,
118 const pok_port_direction_t direction,
119 const uint64_t refresh,
122 pok_ret_t pok_port_sampling_write (
const pok_port_id_t
id,
124 const pok_port_size_t len);
126 pok_ret_t pok_port_sampling_read (
const pok_port_id_t
id,
128 pok_port_size_t* len,
131 #define pok_port_sampling_id(name,id) \
132 pok_syscall2(POK_SYSCALL_MIDDLEWARE_SAMPLING_ID,(uint32_t)name,(uint32_t)id)
139 #define pok_port_sampling_status(id,status) \
140 pok_syscall2(POK_SYSCALL_MIDDLEWARE_SAMPLING_STATUS,(uint32_t)id,(uint32_t)status)