Commit 13ef2d81 authored by Maxime Perrotin's avatar Maxime Perrotin

Add call of unprotected interfaces

parent 7cd30d7d
......@@ -992,7 +992,9 @@ package body TASTE.Interface_View is
Param_Directions,
Param_Encodings,
Property_Names,
Property_Values : Vector_Tag;
Property_Values,
Remote_Function_Names,
Remote_Interface_Names : Vector_Tag;
begin
for Each of TI.Params loop
Param_Names := Param_Names & Each.Name;
......@@ -1006,20 +1008,28 @@ package body TASTE.Interface_View is
Property_Names := Property_Names & Each.Name;
Property_Values := Property_Values & Each.Value;
end loop;
-- Add list of callers or callees
for Each of TI.Remote_Interfaces loop
Remote_Function_Names := Remote_Function_Names & Each.Function_Name;
Remote_Interface_Names := Remote_Interface_Names
& Each.Interface_Name;
end loop;
return +Assoc ("Name", TI.Name)
& Assoc ("Kind", TI.RCM'Img)
& Assoc ("Parent_Function", TI.Parent_Function)
& Assoc ("Period", TI.Period_Or_MIAT'Img)
& Assoc ("WCET", TI.WCET_ms.Value_Or (0)'Img)
& Assoc ("Queue_Size", TI.Queue_Size.Value_Or (1)'Img)
& Assoc ("Param_Names", Param_Names)
& Assoc ("Param_Types", Param_Types)
& Assoc ("Param_ASN1_Modules", Param_ASN1_Modules)
& Assoc ("Param_Encodings", Param_Encodings)
& Assoc ("Param_Directions", Param_Directions)
& Assoc ("IF_Property_Names", Property_Names)
& Assoc ("IF_Property_Values", Property_Values);
return +Assoc ("Name", TI.Name)
& Assoc ("Kind", TI.RCM'Img)
& Assoc ("Parent_Function", TI.Parent_Function)
& Assoc ("Period", TI.Period_Or_MIAT'Img)
& Assoc ("WCET", TI.WCET_ms.Value_Or (0)'Img)
& Assoc ("Queue_Size", TI.Queue_Size.Value_Or (1)'Img)
& Assoc ("Param_Names", Param_Names)
& Assoc ("Param_Types", Param_Types)
& Assoc ("Param_ASN1_Modules", Param_ASN1_Modules)
& Assoc ("Param_Encodings", Param_Encodings)
& Assoc ("Param_Directions", Param_Directions)
& Assoc ("IF_Property_Names", Property_Names)
& Assoc ("IF_Property_Values", Property_Values)
& Assoc ("Remote_Function_Names", Remote_Function_Names)
& Assoc ("Remote_Interface_Names", Remote_Interface_Names);
end To_Template;
end TASTE.Interface_View;
......@@ -7,19 +7,5 @@
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
#if 0
@@IF@@ @_Language_@ = sdl or @_Language_@ = ada
with @_CAPITALIZE:Name_@;
@@END_IF@@
package body @_CAPITALIZE:Name_@_Block is
@@IF@@ @_Protected_PIs_@ /= ""
protected body @_CAPITALIZE:Name_@_Protected is
@_Protected_PIs'Indent_@
end @_CAPITALIZE:Name_@_Protected;
@@END_IF@@
@_Unprotected_PIs_'Indent_@
end @_CAPITALIZE:Name_@_Block;
#endif
// Required interfaces of function @_Name_@
@_Required_@
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Block_Name_@_block.c
......@@ -18,4 +18,6 @@
/* File generated by kazoo for TASTE - do not edit */
#include "@_LOWER:Name_@_polyorb_interface.h"
@_Blocks_@
@_Threads_@
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callees
@@-- @_Remote_Interface_Names_@ : |_ callee's interface name
// Required interface @_Name_@ in function @_Parent_Function_@
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
void *IN_buf_@_LOWER:Param_Names_@, size_t size_IN_buf_@_LOWER:Param_Names_@
@@ELSE@@
void *OUT_buf_@_LOWER:Param_Names_@, size_t *size_OUT_buf_@_LOWER:Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
{
@@IF@@ @_Kind_@ = SPORADIC_OPERATION
puts("Sporadic call of @_Name_@");
@@ELSIF@@ @_Kind_@ = UNPROTECTED_OPERATION
@@TABLE@@
@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
IN_buf_@_LOWER:Param_Names_@, size_IN_buf_@_LOWER:Param_Names_@
@@ELSE@@
OUT_buf_@_LOWER:Param_Names_@, size_OUT_buf_@_LOWER:Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@END_TABLE@@
@@ELSE@@ @@-- Protected call
puts("Protected call of @_Name_@");
@@END_IF@@
}
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Block_Name_@_block.h
......@@ -7,4 +7,14 @@
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@();
// Required interface @_Name_@ in function @_Parent_Function_@
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
void *IN_buf_@_LOWER:Param_Names_@, size_t size_IN_buf_@_LOWER:Param_Names_@
@@ELSE@@
void *OUT_buf_@_LOWER:Param_Names_@, size_t *size_OUT_buf_@_LOWER:Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
......@@ -18,7 +18,7 @@
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
#include "@_LOWER:Pro_Block_Name_@_block.h"
//#include "@_LOWER:Pro_Block_Name_@_block.h"
@@INLINE()(\n)(\n)@@
@@IF@@ @_Param_Names'Length_@ > 0
......
......@@ -37,8 +37,8 @@
#include <stdlib.h>
#ifdef __unix__
#include <stdio.h>
// #include "PrintTypesAsASN1.h"
// #include "timeInMS.h"
#include "PrintTypesAsASN1.h"
#include "timeInMS.h"
#endif
//#include "C_ASN1_Types.h"
......
......@@ -64,16 +64,41 @@ void @_LOWER:Parent_Function_@_RI_@_LOWER:Name_@(void)
}
@@END_IF@@
@@END_TABLE@@
// Call Middleware interface (TODO)
// extern void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@ ( ... )
// vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@ ( ... )
@@TABLE'TERSE@@
@@IF@@ @_Param_Directions_@ = PARAM_OUT
// Decode parameter @_Param_Names_@
// Buffer for decoding parameter @_Param_Names_@
static char OUT_buf_@_LOWER:Param_Names_@[sizeof(asn1Scc@_REPLACE_ALL(-/_):Param_Types_@)];
size_t size_OUT_buf_@_LOWER:Param_Names_@ = 0;
@@END_IF@@
@@END_TABLE@@
// Call Middleware interface
extern void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
void *, size_t
@@ELSE@@
void *, size_t *
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
IN_buf_@_LOWER:Param_Names_@, (size_t)size_IN_buf_@_LOWER:Param_Names_@
@@ELSE@@
OUT_buf_@_LOWER:Param_Names_@, &size_OUT_buf_@_LOWER:Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@TABLE'TERSE@@
@@IF@@ @_Param_Directions_@ = PARAM_OUT
// Decode parameter @_Param_Names_@
if (0 != Decode_@_Param_Encodings_@_@_REPLACE_ALL(-/_):Param_Types_@
(OUT_@_LOWER:Param_Names_@, OUT_buf_@_LOWER:Param_Names_@, size_OUT_buf_@_LOWER:Param_Names_@)) {
#ifdef __unix__
......
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