Commit 68ccc86a authored by Maxime Perrotin's avatar Maxime Perrotin

Add protected objects in pohic support

parent 7e6da135
......@@ -7,3 +7,6 @@
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@IF@@ @_Protected_PIs_@ /= ""
@_LOWER:Name_@_protected : data TASTE_Protected.Object;
@@END_IF@@
......@@ -24,6 +24,7 @@ end @_Name_@;
process implementation @_CAPITALIZE:Name_@.final
subcomponents
@_STRIP:Blocks'Indent_@
@@TABLE'ALIGN_ON(":")@@
@_Thread_Names_@ : thread @_Thread_Names_@_Thread::@_Thread_Names_@.others;
@@END_TABLE@@
......
......@@ -7,3 +7,4 @@
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
true
......@@ -32,6 +32,19 @@ public
with @_CAPITALIZE:Target_Packages_@;
@@END_TABLE@@
@@-- POHIC-only: declare protected objects to have runtime mutex
@@IF@@ @_Use_POHIC_@
data Taste_Protected
properties
Concurrency_Control_Protocol => Protected_Access;
end Taste_Protected;
data implementation Taste_Protected.Object
properties
Concurrency_Control_Protocol => Protected_Access;
end Taste_Protected.Object;
@@END_IF@@
@_Nodes_@
system DeploymentView
......
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Partition_Name_@_polyorb_interface.c
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Thread_Name_@_polyorb_interface.c
......@@ -15,3 +15,7 @@
@@-- @_Thread_Dst_Name_@ : Vector tag : connection thread name (dest)
@@-- @_Thread_Src_Port_@ : Vector tag : connection port name (source)
@@-- @_Thread_Dst_Port_@ : Vector tag : connection port name (dest)
/* File generated by kazoo for TASTE - do not edit */
#include "@_LOWER:Name_@_polyorb_interface.h"
@_Threads_@
......@@ -18,7 +18,7 @@
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
#include "@_LOWER:Thread_Name_@_polyorb_interface.h"
#include "@_LOWER:Pro_Block_Name_@_vm_if.h"
@@INLINE()(\n)(\n)@@
@@IF@@ @_Param_Names'Length_@ > 0
......@@ -30,6 +30,18 @@
@@END_IF@@
@@END_INLINE@@
{
(void)sender_pid;
// call something from vm_if
(void)sender_pid; // sender id is not used for now
@@IF@@ @_Need_Mutex_@
extern process_package__taste_protected_object @_LOWER:Pro_Block_Name_@_protected;
__po_hi_protected_lock (@_LOWER:Pro_Block_Name_@_protected.protected_id);
@@END_IF@@
@@IF@@ @_Param_Names'Length_@ > 0
@_LOWER:Thread_Name_@ (buf.buffer, buf.length);
@@ELSE@@
@_LOWER:Thread_Name_@ ();
@@END_IF@@
@@IF@@ @_Need_Mutex_@
__po_hi_protected_unlock (@_LOWER:Pro_Block_Name_@_protected.protected_id);
@@END_IF@@
}
......@@ -7,20 +7,6 @@
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
/* File generated by kazoo for TASTE - do not edit */
#pragma once
#include <stddef.h>
// Include PolyORB-HI-C header files:
#include "types.h"
#include "deployment.h"
#include "po_hi_transport.h"
#include "po_hi_gqueue.h"
#include "activity.h"
#include "po_hi_task.h"
#include "po_hi_protected.h"
// prototypes for the provided interfaces
@_Protected_PIs_@
@_Unprotected_PIs_@
......
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Partition_Name_@_polyorb_interface.h
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Thread_Name_@_polyorb_interface.h
......@@ -15,5 +15,17 @@
@@-- @_Thread_Dst_Name_@ : Vector tag : connection thread name (dest)
@@-- @_Thread_Src_Port_@ : Vector tag : connection port name (source)
@@-- @_Thread_Dst_Port_@ : Vector tag : connection port name (dest)
/* File generated by kazoo for TASTE - do not edit */
#include <stddef.h>
// Include PolyORB-HI-C header files:
#include "types.h"
#include "deployment.h"
#include "po_hi_transport.h"
#include "po_hi_gqueue.h"
#include "activity.h"
#include "po_hi_task.h"
#include "po_hi_protected.h"
@_Blocks_@
@_Threads_@
......@@ -16,7 +16,7 @@
@@ELSE@@ @@-- contains param(s)
@@IF@@ @_Kind_@ = "PROTECTED_OPERATION" or @_Kind_@ = "UNPROTECTED_OPERATION"
void sync_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(;\n )(\);)@@
@@INLINE( \()(,\n )(\);)@@
@@TABLE'ALIGN_ON(",")@@
void *@_LOWER:Param_Names_@, size_t @_LOWER:Param_Names_@_len
@@END_TABLE@@
......
......@@ -18,13 +18,6 @@
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
//#include <stddef.h>
//#include "types.h"
//#include "deployment.h"
//#include "po_hi_transport.h"
#include "po_hi_task.h"
#include "@_LOWER:Pro_Block_Name_@_block.h"
@@INLINE()(\n)(\n)@@
......
......@@ -7,13 +7,12 @@ all: test-parse
ocarina -x main.aadl && \
make -f Makefile.taste
c: # Polyorb_HI_C output
$(KAZOO) -p --gw --glue --debug -o output.pohic && \
make -C output.pohic && \
cp obsw.pr output.pohic/obsw/SDL/src && \
cd output.pohic/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
c: test-parse-c # Polyorb_HI_C output
make -C output.pohic && \
cp obsw.pr output.pohic/obsw/SDL/src && \
cd output.pohic/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
test-parse: clean
$(KAZOO) --gw \
......
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