POK
|
00001 /* 00002 * POK header 00003 * 00004 * The following file is a part of the POK project. Any modification should 00005 * made according to the POK licence. You CANNOT use this file or a part of 00006 * this file is this part of a file for your own project 00007 * 00008 * For more information on the POK licence, please see our LICENCE FILE 00009 * 00010 * Please follow the coding guidelines described in doc/CODING_GUIDELINES 00011 * 00012 * Copyright (c) 2007-2009 POK team 00013 * 00014 * Created by julien on Thu Jan 15 23:34:13 2009 00015 */ 00016 00017 00018 #ifdef POK_NEEDS_ARINC653_BUFFER 00019 00020 00021 /*----------------------------------------------------------------*/ 00022 /* */ 00023 /* BUFFER constant and type definitions and management services */ 00024 /* */ 00025 /*----------------------------------------------------------------*/ 00026 00027 #ifndef APEX_BUFFER 00028 #define APEX_BUFFER 00029 00030 #ifndef POK_NEEDS_ARINC653_PROCESS 00031 #define POK_NEEDS_ARINC653_PROCESS 00032 #endif 00033 00034 #include <arinc653/types.h> 00035 #include <arinc653/process.h> 00036 00037 #define MAX_NUMBER_OF_BUFFERS SYSTEM_LIMIT_NUMBER_OF_BUFFERS 00038 00039 typedef NAME_TYPE BUFFER_NAME_TYPE; 00040 00041 typedef APEX_INTEGER BUFFER_ID_TYPE; 00042 00043 typedef struct { 00044 MESSAGE_RANGE_TYPE NB_MESSAGE; 00045 MESSAGE_RANGE_TYPE MAX_NB_MESSAGE; 00046 MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE; 00047 WAITING_RANGE_TYPE WAITING_PROCESSES; 00048 } BUFFER_STATUS_TYPE; 00049 00050 00051 00052 extern void CREATE_BUFFER ( 00053 /*in */ BUFFER_NAME_TYPE BUFFER_NAME, 00054 /*in */ MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE, 00055 /*in */ MESSAGE_RANGE_TYPE MAX_NB_MESSAGE, 00056 /*in */ QUEUING_DISCIPLINE_TYPE QUEUING_DISCIPLINE, 00057 /*out*/ BUFFER_ID_TYPE *BUFFER_ID, 00058 /*out*/ RETURN_CODE_TYPE *RETURN_CODE ); 00059 00060 extern void SEND_BUFFER ( 00061 /*in */ BUFFER_ID_TYPE BUFFER_ID, 00062 /*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR, /* by reference */ 00063 /*in */ MESSAGE_SIZE_TYPE LENGTH, 00064 /*in */ SYSTEM_TIME_TYPE TIME_OUT, 00065 /*out*/ RETURN_CODE_TYPE *RETURN_CODE ); 00066 00067 extern void RECEIVE_BUFFER ( 00068 /*in */ BUFFER_ID_TYPE BUFFER_ID, 00069 /*in */ SYSTEM_TIME_TYPE TIME_OUT, 00070 /*out*/ MESSAGE_ADDR_TYPE MESSAGE_ADDR, 00071 /*out*/ MESSAGE_SIZE_TYPE *LENGTH, 00072 /*out*/ RETURN_CODE_TYPE *RETURN_CODE ); 00073 00074 extern void GET_BUFFER_ID ( 00075 /*in */ BUFFER_NAME_TYPE BUFFER_NAME, 00076 /*out*/ BUFFER_ID_TYPE *BUFFER_ID, 00077 /*out*/ RETURN_CODE_TYPE *RETURN_CODE ); 00078 00079 extern void GET_BUFFER_STATUS ( 00080 /*in */ BUFFER_ID_TYPE BUFFER_ID, 00081 /*out*/ BUFFER_STATUS_TYPE *BUFFER_STATUS, 00082 /*out*/ RETURN_CODE_TYPE *RETURN_CODE ); 00083 00084 #endif 00085 #endif