Commit 46e59cf1 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Emit the environment variables per target, as set in the new ocarina_components.aadl

parent 8b666391
......@@ -1094,6 +1094,7 @@ procedure BuildSupport is
if Get_Category_Of_Component (Tmp_CI) = CC_Process then
declare
Node_Coverage : Boolean := False;
Env_Vars : Name_Id := No_Name;
begin
if Is_Defined_Property (Tmp_CI,
"taste_dv_properties::coverageenabled")
......@@ -1109,6 +1110,7 @@ procedure BuildSupport is
end if;
CPU := Get_Bound_Processor (Tmp_CI);
Env_Vars := Get_Env_Vars (CPU);
Set_Str_To_Name_Buffer ("");
CPU_Name := Name (Identifier (Parent_Subcomponent (CPU)));
......@@ -1141,7 +1143,13 @@ procedure BuildSupport is
Get_Name_String (CPU_Classifier),
Get_Name_String (CPU_Classifier)'Length,
Supported_Execution_Platform'Image (CPU_Platform),
Supported_Execution_Platform'Image (CPU_Platform)'Length);
Supported_Execution_Platform'Image (CPU_Platform)'Length,
(if Env_Vars /= No_Name then
Get_Name_String (Env_Vars)
else ""),
(if Env_Vars /= No_Name then
Get_Name_String (Env_Vars)'Length
else 0));
C_New_Process
(Get_Name_String
......
......@@ -224,6 +224,17 @@ package body Buildsupport_Utils is
return Get_String_Property (D, Interface_Name);
end Get_Interface_Name;
------------------
-- Get_Env_Vars --
------------------
function Get_Env_Vars (D : Node_Id) return Name_Id is
Interface_Name : constant Name_id :=
Get_String_Name ("envvars");
begin
return Get_String_Property (D, Interface_Name);
end Get_Env_Vars;
---------------------------
-- Get ASN.1 Module name --
---------------------------
......
......@@ -83,6 +83,8 @@ package Buildsupport_Utils is
function Get_Interface_Name (D : Node_Id) return Name_Id;
function Get_Env_Vars (D : Node_Id) return Name_Id;
function Get_ASN1_Module_Name (D : Node_Id) return String;
function Get_Properties_Map (D : Node_Id) return Property_Maps.Map;
......
......@@ -44,7 +44,9 @@ package Imported_Routines is
Classifier : String;
Classifier_Len : Integer;
Platform : String;
Platform_Len : Integer);
Platform_Len : Integer;
EnvVars : String;
EnvVars_Len : Integer);
procedure C_New_Bus (Name : String;
Name_Len : Integer;
......
......@@ -553,22 +553,29 @@ void New_Process(char *procname,
void New_Processor (char *name, size_t name_length,
char *classifier, size_t classifier_length,
char* platform, size_t platform_length)
char* platform, size_t platform_length,
char *envvars, size_t envvars_length)
{
processor = malloc(sizeof(Processor));
assert(NULL != processor);
processor->name = NULL;
processor->classifier = NULL;
processor->platform_name = NULL;
build_string(&(processor->name), name, name_length);
build_string(&(processor->classifier), classifier,
classifier_length);
if (platform_length > 0)
{
build_string(&(processor->platform_name), platform,
platform_length);
}
processor->name = NULL;
processor->classifier = NULL;
processor->platform_name = NULL;
processor->envvars = NULL;
build_string(&(processor->name), name, name_length);
build_string(&(processor->classifier), classifier,
classifier_length);
if (platform_length > 0)
{
build_string(&(processor->platform_name), platform,
platform_length);
}
if (envvars_length > 0)
{
build_string(&(processor->envvars), envvars,
envvars_length);
}
}
......
......@@ -816,6 +816,11 @@ void GenerateProcessImplementation(Process *p)
fprintf(nodes, " coverage");
}
fprintf (nodes, "\n");
/* Env vars per target */
if ( (p->cpu != NULL) && (p->cpu->envvars != NULL) )
fprintf (nodes, "envvars %s\n", p->cpu->envvars);
FOREACH(b, Aplc_binding, p->bindings, {
fprintf(nodes, "%s\n", b->fv->name);
});
......
......@@ -32,7 +32,8 @@ void New_Drivers_Section();
void End_Drivers_Section();
void New_Processor (char *name, size_t name_length,
char *classifier, size_t classifier_length,
char* platform, size_t platform_length);
char* platform, size_t platform_length,
char *envvars, size_t envvars_length);
void New_Process(char *, size_t, char *,size_t, char *, size_t, bool);
void Set_OutDir(char *o,size_t len);
void Set_Interfaceview (char *name, size_t len);
......
......@@ -265,6 +265,7 @@ typedef struct t_processor {
char *name;
char *classifier;
char *platform_name;
char *envvars;
} Processor;
/*
......
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