Commit c80f965e authored by julien.delange's avatar julien.delange

* begin the integration of XENOMAI for distributed ping



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@2340 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 6f52a8d8
......@@ -3,12 +3,14 @@ AADL_FILES = \
$(srcdir)/ping-local.aadl \
$(srcdir)/ping-local-xenomai-native.aadl \
$(srcdir)/ping-local-xenomai-posix.aadl \
$(srcdir)/ping-xenomai-posix.aadl \
$(srcdir)/software.aadl \
$(srcdir)/ping.aadl
SCENARIO_FILES = \
$(srcdir)/scenario.aadl \
$(srcdir)/scenario-local-xenomai-posix.aadl \
$(srcdir)/scenario-xenomai-posix.aadl \
$(srcdir)/scenario-local-xenomai-native.aadl \
$(srcdir)/scenario-local.aadl
......
-- This model completes the PING example by adding deployment
-- information.
--
-- In this deployment, two nodes are defined, one task per node.
--
-- $Id: ping.aadl 401 2007-06-07 15:04:01Z hugues $
package PING
public
with Software;
with Deployment;
with ocarina_drivers;
with ocarina_buses;
---------------
-- Processor --
---------------
processor the_processor
properties
Deployment::location => "127.0.0.1";
Deployment::Execution_Platform => linux32_xenomai_posix;
Priority_Range => 0 .. 255;
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
end the_processor;
---------
-- Bus --
---------
bus Ethernet_Bus
properties
Deployment::Transport_API => BSD_Sockets;
end Ethernet_Bus;
---------------
-- Processes --
---------------
process A
features
Out_Port : out event data port Software::Simple_Type;
end A;
process implementation A.Impl
subcomponents
Pinger : thread Software::P.Impl;
connections
port Pinger.Data_Source -> Out_Port;
end A.Impl;
process B
features
In_Port : in event data port Software::Simple_Type;
end B;
process implementation B.Impl
subcomponents
Ping_Me : thread Software::Q.Impl;
connections
port In_Port -> Ping_Me.Data_Sink;
end B.Impl;
------------
-- System --
------------
system PING
end PING;
system implementation PING.Impl
subcomponents
Node_A : process A.Impl;
Node_B : process B.Impl;
Device_A : device ocarina_drivers::generic_sockets_ip.pohic
{Source_Text => ("devicesconf.c");};
Device_B : device ocarina_drivers::generic_sockets_ip.pohic
{Source_Text => ("devicesconf.c");};
CPU_A : processor the_processor;
CPU_B : processor the_processor;
the_bus : bus ocarina_buses::ip.i;
connections
bus access the_bus -> Device_A.thebus;
bus access the_bus -> Device_B.thebus;
port Node_A.Out_Port -> Node_B.In_Port
{Actual_Connection_Binding => (reference (the_bus));};
properties
actual_processor_binding => reference (CPU_A) applies to Node_A;
actual_processor_binding => reference (CPU_B) applies to Node_B;
actual_processor_binding => (reference (CPU_A)) applies to Device_A;
actual_processor_binding => (reference (CPU_B)) applies to Device_B;
end PING.Impl;
end PING;
system ping
properties
Ocarina_Config::Timeout_Property => 4000ms;
Ocarina_Config::Use_Components_Library => true;
Ocarina_Config::Referencial_Files =>
("node_a", "node_a.ref");
Ocarina_Config::AADL_Files =>
("ping-xenomai-posix.aadl" , "software.aadl");
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
value (Ocarina_Config::ARINC653_Properties),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
end ping;
system implementation ping.impl
end ping.impl;
......@@ -19,6 +19,8 @@
#include <drivers/configuration/ip.h>
#include <po_hi_types.h>
typedef __po_hi_uint16_t __po_hi_inetport_t;
typedef char* __po_hi_inetaddr_t;
......
......@@ -42,4 +42,12 @@ void __po_hi_wait_end_of_instrumentation ();
*/
#endif
int __po_hi_initialize_early ();
/*
* __po_hi_initialize_earlier() is used to perform
* some early initialization, before device
* init functions are invoked.
*/
#endif /* __PO_HI_MAIN__ */
......@@ -174,7 +174,7 @@ void* __po_hi_sockets_poller (void)
int max_socket;
fd_set selector;
struct sockaddr_in sa;
__po_hi_node_t dev;
__po_hi_device_id dev;
__po_hi_node_t dev_init;
__po_hi_request_t received_request;
__po_hi_msg_t msg;
......
......@@ -80,12 +80,7 @@ void __po_hi_initialize_add_task ()
}
/*
* The __po_hi_initialize function is only called
* by the main thread (the one that executes the traditional
* main() function.
*/
int __po_hi_initialize ()
int __po_hi_initialize_early ()
{
#if defined (XENO_POSIX) || defined (XENO_NATIVE)
/*
......@@ -95,7 +90,7 @@ int __po_hi_initialize ()
*/
#include <sys/mman.h>
mlockall(MCL_CURRENT|MCL_FUTURE);
mlockall (MCL_CURRENT|MCL_FUTURE);
#endif
#if defined (XENO_NATIVE)
......@@ -112,7 +107,16 @@ int __po_hi_initialize ()
* for the initialization of the other tasks.
*/
#endif
return (__PO_HI_SUCCESS);
}
/*
* The __po_hi_initialize function is only called
* by the main thread (the one that executes the traditional
* main() function.
*/
int __po_hi_initialize ()
{
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
pthread_mutexattr_t mutex_attr;
if (pthread_mutexattr_init (&mutex_attr) != 0)
......
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