Commit e8d733f0 authored by jdelange's avatar jdelange
Browse files

* include/po_hi_transport.h

   src/po_hi_transport.c
   - Include comments that might be used by doxygen
   - Introduce new functions to handle user-defined
     protocols:
       x __po_hi_transport_get_protocol
       x __po_hi_transport_get_protocol_configuration


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@2974 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 12427891
......@@ -39,41 +39,150 @@ __po_hi_entity_t __po_hi_get_entity_from_global_port (const __po_hi_port_t port
* Return the entity identifier that own the port in parameters.
*/
int __po_hi_transport_send_default (__po_hi_task_id id, __po_hi_port_t port);
/*
* Default transport layer
* \fn __po_hi_transport_send_default
* \brief Default transport layer function.
*/
int __po_hi_transport_send_default (__po_hi_task_id id, __po_hi_port_t port);
/*
* \fn __po_hi_get_port_name
* \brief Return the name of the port similar to the name within the AADL model.
*/
char* __po_hi_get_port_model_name (const __po_hi_port_t port);
/*
* \fn __po_hi_get_port_name
* \brief Return the name of the port according to mapping rules.
*/
char* __po_hi_get_port_name (const __po_hi_port_t port);
/*
* \fn __po_hi_get_local_port_from_local_port
* \brief Return the local port identifier of the given global port to handle data on the node.
*/
__po_hi_local_port_t __po_hi_get_local_port_from_global_port (const __po_hi_port_t global_port);
/*
* \fn __po_hi_get_endianness
* \brief Return the endianness of the node given in parameter.
*
* The resulting value is either __PO_HI_BIGENDIAN or __PO_HI_LITTLEENDIAN.
*/
__po_hi_uint8_t __po_hi_get_endianness (const __po_hi_node_t node);
/*
* \fn __po_hi_get_device_from_port
* \brief Return the device associated with a given port.
*
* The resulting value is a device identifier generated in deployment.h.
* If no device is associated with the port, it returns the constant
* value invalid_device_id.
*/
__po_hi_device_id __po_hi_get_device_from_port (const __po_hi_port_t port);
char* __po_hi_get_device_naming (const __po_hi_device_id dev);
/*
* \fn __po_hi_get_device_configuration
* \brief Returns a pointer to the configuration data of the device.
*
* The configuration data can be either a string of a more complex
* data structure, such as an instance of an ASN1 type.
*/
__po_hi_uint32_t* __po_hi_get_device_configuration (const __po_hi_device_id);
/*
* \fn __po_hi_transport_get_data_size
* \brief Returns the size of the data stored in the port given as parameter.
*/
__po_hi_uint32_t __po_hi_transport_get_data_size (const __po_hi_port_t portno);
/*
* \fn __po_hi_transport_get_queue_size
* \brief Return the size of the queue associated with the port.
*
* The size if specified as the number of request the port can store,
* this is NOT the number of bytes that can be stored.
*/
__po_hi_uint32_t __po_hi_transport_get_queue_size (const __po_hi_port_t portno);
/*
* \fn __po_hi_transport_get_port_kind
* \brief Indicate the kind of the port given in parameter or __PO_HI_INVALID_PORT_KIND when not appropriate.
*
* The values that are returned indicate if the port is a pure event
* port, if it has a data associated and if it is an inter-process
* port or not.
*
* Potential return values are:
*
* __PO_HI_IN_DATA_INTER_PROCESS
* __PO_HI_OUT_DATA_INTER_PROCESS
* __PO_HI_IN_DATA_INTRA_PROCESS
* __PO_HI_OUT_DATA_INTRA_PROCESS
* __PO_HI_IN_EVENT_DATA_INTER_PROCESS
* __PO_HI_OUT_EVENT_DATA_INTER_PROCESS
* __PO_HI_IN_EVENT_DATA_INTRA_PROCESS
* __PO_HI_OUT_EVENT_DATA_INTRA_PROCESS
* __PO_HI_IN_EVENT_INTER_PROCESS
* __PO_HI_OUT_EVENT_INTER_PROCESS
* __PO_HI_IN_EVENT_INTRA_PROCESS
* __PO_HI_OUT_EVENT_INTRA_PROCESS
* __PO_HI_INVALID_PORT_KIND
*/
__po_hi_port_kind_t __po_hi_transport_get_port_kind (const __po_hi_port_t portno);
char* __po_hi_transport_get_model_name (const __po_hi_port_t portno);
__po_hi_node_t __po_hi_transport_get_mynode (void);
/*
* \fn __po_hi_transport_get_model_name
* \brief Return the name of the port given in parameter.
*/
char* __po_hi_transport_get_model_name (const __po_hi_port_t portno);
/* \fn __po_hi_transport_get_mynode
* \brief Return the node identifier of the node that executes the current system.
*/
__po_hi_node_t __po_hi_transport_get_mynode (void);
/*
* \fn __po_hi_transport_get_protocol
* \brief Return the protocol identifier that is used between port src and port dst.
*
* Get the protocol identifier used to communicate
* between port src and port dst. It returns a protocol
* identifier generated in deployment.h.
* If no specific protocol is used, it returns the value
* invalid_protocol.
*/
__po_hi_protocol_t __po_hi_transport_get_protocol (const __po_hi_port_t src, const __po_hi_port_t dst);
/*
* \fn __po_hi_transport_get_protocol_configuration
* \brief Retrieve the configuration of the given protocol identifier. Returns a pointer on the conf or NULL.
*
*
* Protocol identifier can be retrieve in the generated deployment.h file
* under the type __po_hi_protocol_t. Invalid protocol identifier
* will result in returning NULL.
*/
__po_hi_protocol_conf_t* __po_hi_transport_get_protocol_configuration (const __po_hi_protocol_t p);
#ifdef XM3_RTEMS_MODE
void __po_hi_transport_xtratum_port_init (const __po_hi_port_t portno, int val);
int __po_hi_transport_xtratum_get_port (const __po_hi_port_t portno);
#endif
#endif /* __PO_HI_NB_PORTS > 0 */
......
......@@ -29,19 +29,20 @@
* deployment.h.
*/
extern __po_hi_node_t __po_hi_entity_table[__PO_HI_NB_ENTITIES];
extern __po_hi_entity_t __po_hi_port_global_to_entity[__PO_HI_NB_PORTS];
extern __po_hi_local_port_t __po_hi_port_global_to_local[__PO_HI_NB_PORTS];
extern __po_hi_request_t* __po_hi_gqueues_most_recent_values[__PO_HI_NB_TASKS];
extern char* __po_hi_port_global_model_names[__PO_HI_NB_PORTS];
extern char* __po_hi_port_global_names[__PO_HI_NB_PORTS];
extern __po_hi_uint8_t __po_hi_deployment_endiannesses[__PO_HI_NB_NODES];
extern __po_hi_node_t __po_hi_entity_table[__PO_HI_NB_ENTITIES];
extern __po_hi_entity_t __po_hi_port_global_to_entity[__PO_HI_NB_PORTS];
extern __po_hi_local_port_t __po_hi_port_global_to_local[__PO_HI_NB_PORTS];
extern __po_hi_request_t* __po_hi_gqueues_most_recent_values[__PO_HI_NB_TASKS];
extern char* __po_hi_port_global_model_names[__PO_HI_NB_PORTS];
extern char* __po_hi_port_global_names[__PO_HI_NB_PORTS];
extern __po_hi_uint8_t __po_hi_deployment_endiannesses[__PO_HI_NB_NODES];
extern __po_hi_protocol_t __po_hi_ports_protocols[__PO_HI_NB_PORTS][__PO_HI_NB_PORTS];
extern __po_hi_protocol_conf_t __po_hi_protocols_configuration[__PO_HI_NB_PROTOCOLS];
#if __PO_HI_NB_DEVICES > 0
extern __po_hi_device_id __po_hi_port_to_device[__PO_HI_NB_PORTS];
extern char* __po_hi_devices_naming[__PO_HI_NB_DEVICES];
extern __po_hi_uint32_t* __po_hi_devices_configuration_values[__PO_HI_NB_DEVICES];
extern __po_hi_device_id __po_hi_port_to_device[__PO_HI_NB_PORTS];
extern char* __po_hi_devices_naming[__PO_HI_NB_DEVICES];
extern __po_hi_uint32_t* __po_hi_devices_configuration_values[__PO_HI_NB_DEVICES];
#endif
#ifdef XM3_RTEMS_MODE
......@@ -268,6 +269,20 @@ __po_hi_port_kind_t __po_hi_transport_get_port_kind (const __po_hi_port_t portno
}
__po_hi_protocol_t __po_hi_transport_get_protocol (const __po_hi_port_t src, const __po_hi_port_t dst)
{
return (__po_hi_ports_protocols[src][dst]);
}
__po_hi_protocol_conf_t* __po_hi_transport_get_protocol_configuration (const __po_hi_protocol_t p)
{
if (p == invalid_protocol)
{
return NULL;
}
return &(__po_hi_protocols_configuration[p]);
}
#ifdef XM3_RTEMS_MODE
void __po_hi_transport_xtratum_port_init (const __po_hi_port_t portno, int val)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment