18 #ifdef POK_NEEDS_ARINC653_BUFFER
19 #include <arinc653/types.h>
20 #include <arinc653/buffer.h>
22 #include <middleware/port.h>
23 #include <middleware/buffer.h>
26 BUFFER_NAME_TYPE BUFFER_NAME,
27 MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
28 MESSAGE_RANGE_TYPE MAX_NB_MESSAGE,
29 QUEUING_DISCIPLINE_TYPE QUEUING_DISCIPLINE,
30 BUFFER_ID_TYPE *BUFFER_ID,
31 RETURN_CODE_TYPE *RETURN_CODE )
34 pok_buffer_id_t core_id;
35 pok_queueing_discipline_t core_discipline;
37 switch (QUEUING_DISCIPLINE)
40 core_discipline = POK_PORT_QUEUEING_DISCIPLINE_PRIORITY;
44 core_discipline = POK_PORT_QUEUEING_DISCIPLINE_FIFO;
48 *RETURN_CODE = INVALID_PARAM;
52 core_ret = pok_buffer_create (BUFFER_NAME, MAX_MESSAGE_SIZE * MAX_NB_MESSAGE, MAX_MESSAGE_SIZE, core_discipline, &core_id);
56 *RETURN_CODE = core_ret;
60 BUFFER_ID_TYPE BUFFER_ID,
61 MESSAGE_ADDR_TYPE MESSAGE_ADDR,
62 MESSAGE_SIZE_TYPE LENGTH,
63 SYSTEM_TIME_TYPE TIME_OUT,
64 RETURN_CODE_TYPE *RETURN_CODE )
67 core_ret = pok_buffer_send (BUFFER_ID, MESSAGE_ADDR, LENGTH, TIME_OUT);
68 *RETURN_CODE = core_ret;
72 BUFFER_ID_TYPE BUFFER_ID,
73 SYSTEM_TIME_TYPE TIME_OUT,
74 MESSAGE_ADDR_TYPE MESSAGE_ADDR,
75 MESSAGE_SIZE_TYPE *LENGTH,
76 RETURN_CODE_TYPE *RETURN_CODE )
79 pok_port_size_t core_size;
80 core_ret = pok_buffer_receive (BUFFER_ID, TIME_OUT, MESSAGE_ADDR, &core_size);
81 *LENGTH = (APEX_INTEGER) core_size;
82 *RETURN_CODE = core_ret;
86 BUFFER_NAME_TYPE BUFFER_NAME,
87 BUFFER_ID_TYPE *BUFFER_ID,
88 RETURN_CODE_TYPE *RETURN_CODE )
92 *RETURN_CODE = NOT_AVAILABLE;
95 void GET_BUFFER_STATUS (
96 BUFFER_ID_TYPE BUFFER_ID,
98 RETURN_CODE_TYPE *RETURN_CODE )
101 (void) BUFFER_STATUS;
102 *RETURN_CODE = NOT_AVAILABLE;