Commit 703bcc42 authored by julien.delange's avatar julien.delange

adapt the build to support device drivers integration



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@536 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent fb2aef32
......@@ -113,7 +113,9 @@ AC_OUTPUT([
Makefile
doc/Makefile
src/Makefile
src/drivers/Makefile
include/Makefile
include/drivers/Makefile
examples/Makefile
examples/aadlv1/Makefile
examples/aadlv1/d3.1.3-1/Makefile
......
AUTOMAKE_OPTIONS = no-dependencies
SUBDIRS=drivers
EXTRA_DIST = $(srcdir)/po_hi_common.h \
$(srcdir)/po_hi_debug.h \
$(srcdir)/po_hi_marshallers.h \
$(srcdir)/po_hi_messages.h \
$(srcdir)/po_hi_protected.h \
$(srcdir)/po_hi_protocols.h \
$(srcdir)/po_hi_returns.h \
$(srcdir)/po_hi_gqueue.h \
$(srcdir)/po_hi_giop.h \
$(srcdir)/po_hi_utils.h \
$(srcdir)/po_hi_task.h \
$(srcdir)/po_hi_time.h \
$(srcdir)/po_hi_types.h \
$(srcdir)/po_hi_main.h \
$(srcdir)/po_hi_simulink.h \
$(srcdir)/po_hi_sockets.h \
$(srcdir)/po_hi_transport.h
$(srcdir)/po_hi_debug.h \
$(srcdir)/po_hi_marshallers.h \
$(srcdir)/po_hi_messages.h \
$(srcdir)/po_hi_protected.h \
$(srcdir)/po_hi_protocols.h \
$(srcdir)/po_hi_returns.h \
$(srcdir)/po_hi_gqueue.h \
$(srcdir)/po_hi_giop.h \
$(srcdir)/po_hi_utils.h \
$(srcdir)/po_hi_task.h \
$(srcdir)/po_hi_time.h \
$(srcdir)/po_hi_types.h \
$(srcdir)/po_hi_main.h \
$(srcdir)/po_hi_simulink.h \
$(srcdir)/po_hi_sockets.h \
$(srcdir)/po_hi_transport.h
CLEANFILES = *~
......
AUTOMAKE_OPTIONS = no-dependencies
EXTRA_DIST = $(srcdir)/po_hi_driver_linux_serial.h
CLEANFILES = *~
hsrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/include/drivers'}
install-data-local:
$(INSTALL) -d $(DESTDIR)$(hsrc)
for f in $(EXTRA_DIST); do \
$(INSTALL) -m 444 $$f $(DESTDIR)$(hsrc) ; \
done
uninstall-local:
rm -rf $(DESTDIR)$(hsrc)
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* Copyright (C) 2010, European Space Agency
*/
#ifndef __PO_HI_DRIVER_LINUX_SERIAL_H__
#define __PO_HI_DRIVER_LINUX_SERIAL_H__
void __po_hi_c_driver_serial_linux_poller (void);
#endif
......@@ -5,6 +5,7 @@
*
* For more informations, please visit http://ocarina.enst.fr
*
* Copyright (C) 2010, European Space Agency
* Copyright (C) 2007-2009, GET-Telecom Paris.
*/
......@@ -23,9 +24,12 @@ typedef char* __po_hi_inetaddr_t;
#define __PO_HI_NOPORT 1
#define __PO_HI_NOADDR ""
int __po_hi_protocols_send_default (__po_hi_task_id id,
__po_hi_port_t port);
int __po_hi_protocols_send (__po_hi_entity_t from,
__po_hi_entity_t to,
__po_hi_msg_t* msg);
__po_hi_entity_t to,
__po_hi_msg_t* msg);
/*
* Send a message to a specified entity. The "from" argument is the
* node which send the message. The argument "to" is used to designate
......@@ -34,7 +38,7 @@ int __po_hi_protocols_send (__po_hi_entity_t from,
*/
int __po_hi_protocols_receive (__po_hi_entity_t from,
__po_hi_msg_t* msg);
__po_hi_msg_t* msg);
/*
* Receive a message from a specified entity The entity which sent the
* message is specified by the first argument. The second argument
......@@ -42,7 +46,7 @@ int __po_hi_protocols_receive (__po_hi_entity_t from,
*/
int __po_hi_protocols_nonblocking_receive (__po_hi_entity_t from,
__po_hi_msg_t* msg);
__po_hi_msg_t* msg);
/*
* Receive a message from a specified entity The entity which sent the
* message is specified by the first argument. The second argument
......
AUTOMAKE_OPTIONS = no-dependencies
SUBDIRS=drivers
C_FILES = $(srcdir)/po_hi_task.c \
$(srcdir)/po_hi_main.c \
......
AUTOMAKE_OPTIONS = no-dependencies
C_FILES = $(srcdir)/po_hi_driver_linux_serial.c
csrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/src/drivers'}
install-data-local:
$(INSTALL) -d $(DESTDIR)$(csrc)
for f in $(C_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
uninstall-local:
rm -rf $(DESTDIR)$(csrc)
EXTRA_DIST = $(C_FILES)
CLEANFILES = *~
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* Copyright (C) 2010, European Space Agency
*/
void __po_hi_c_driver_serial_linux_poller (void)
{
}
......@@ -5,16 +5,88 @@
*
* For more informations, please visit http://ocarina.enst.fr
*
* Copyright (C) 2010, European Space Agency
* Copyright (C) 2007-2008, GET-Telecom Paris.
*/
#include <po_hi_config.h>
#include <po_hi_transport.h>
#include <po_hi_protocols.h>
#include <po_hi_types.h>
#include <po_hi_debug.h>
#include <po_hi_returns.h>
#include <po_hi_gqueue.h>
#include <deployment.h>
#include <marshallers.h>
#include <types.h>
int __po_hi_protocols_send (__po_hi_entity_t from,
__po_hi_entity_t to,
__po_hi_msg_t* msg)
__po_hi_entity_t to,
__po_hi_msg_t* msg)
{
return (__po_hi_transport_send (from, to, msg));
}
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 __po_hi_uint8_t* __po_hi_gqueues_n_destinations[__PO_HI_NB_TASKS];
extern __po_hi_port_t** __po_hi_gqueues_destinations[__PO_HI_NB_TASKS];
int __po_hi_protocols_send_default (__po_hi_task_id id, __po_hi_port_t port)
{
__po_hi_msg_t msg;
__po_hi_request_t* request;
__po_hi_port_t* destinations;
__po_hi_uint8_t ndest;
__po_hi_uint8_t i;
__po_hi_local_port_t local_port;
int error;
local_port = __po_hi_port_global_to_local[(int)port];
request = &(__po_hi_gqueues_most_recent_values[id][local_port]);
if (request->port == -1)
{
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("Send output task %d, port %d : no value to send\n",
id, port);
#endif
return __PO_HI_SUCCESS;
}
destinations = __po_hi_gqueues_destinations[id][local_port];
ndest = __po_hi_gqueues_n_destinations[id][local_port];
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("Send value, emitter task %d, emitter port %d, emitter entity %d, destination ports :\n", id, port, __po_hi_port_global_to_entity[port]);
#endif
for (i=0;i<ndest;i++)
{
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("\t%d (entity=%d)\n",
destinations[i],
__po_hi_port_global_to_entity[destinations[i]]);
#endif
__po_hi_msg_reallocate (&msg);
request->port = (__po_hi_port_t) destinations[i];
__po_hi_marshall_request (request, &msg);
error =__po_hi_protocols_send
(__po_hi_port_global_to_entity[port],
__po_hi_port_global_to_entity[destinations[i]],
&msg);
if (error != __PO_HI_SUCCESS)
{
return error;
}
}
request->port = __PO_HI_GQUEUE_INVALID_PORT;
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("\n");
#endif
return __PO_HI_SUCCESS;
}
......@@ -5,6 +5,7 @@
*
* For more informations, please visit http://ocarina.enst.fr
*
* Copyright (C) 2010, European Space Agency
* Copyright (C) 2007-2008, GET-Telecom Paris.
*/
......
......@@ -12,7 +12,6 @@
#include <po_hi_types.h>
#include <po_hi_debug.h>
#include <po_hi_transport.h>
#include <po_hi_transport_sockets.h>
#include <po_hi_giop.h>
#include <po_hi_messages.h>
#include <po_hi_returns.h>
......@@ -31,7 +30,7 @@ entity_table[__PO_HI_NB_ENTITIES];
void __po_hi_initialize_transport ()
{
#if __PO_HI_NB_NODES > 1
#if defined (__PO_HI_NEEDS_SOCKETS) && (__PO_HI_NB_NODES > 1)
__po_hi_sockets_initialize ();
#endif
}
......@@ -53,7 +52,7 @@ int __po_hi_transport_send (__po_hi_entity_t from,
{
#ifdef __PO_HI_USE_GIOP
return __po_hi_giop_send (from, to, msg);
#else
#elif defined (__PO_HI_NEED_SOCKETS)
return __po_hi_sockets_send (from, to, msg);
#endif
}
......
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