Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
fca3678e
Commit
fca3678e
authored
Dec 05, 2014
by
Julien
Browse files
Start to generate DEOS specific code
parent
ab215fe1
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-pok_c-deployment.adb
View file @
fca3678e
...
...
@@ -390,7 +390,7 @@ package body Ocarina.Backends.POK_C.Deployment is
U
:
Node_Id
;
Processes
:
List_Id
;
begin
if
POK_Flavor
=
ARINC653
then
if
POK_Flavor
=
ARINC653
or
else
POK_Flavor
=
DEOS
then
CTU
.
Append_Node_To_List
(
RE
(
RE_Pok_Sched_Rr
),
CTN
.
Values
(
System_Partitions_Scheduler
));
...
...
src/backends/ocarina-backends-pok_c-main.adb
View file @
fca3678e
...
...
@@ -113,14 +113,14 @@ package body Ocarina.Backends.POK_C.Main is
and
then
ARINC653_Discipline
=
Priority_Based
then
if
POK_Flavor
=
ARINC653
then
if
Use_
ARINC653
_API
then
return
RE
(
RE_Priority
);
else
return
RE
(
RE_Pok_Port_Queueing_Discipline_Fifo
);
end
if
;
end
if
;
if
POK_Flavor
=
ARINC653
then
if
Use_
ARINC653
_API
then
return
RE
(
RE_Fifo
);
else
return
RE
(
RE_Pok_Port_Queueing_Discipline_Fifo
);
...
...
@@ -138,7 +138,7 @@ package body Ocarina.Backends.POK_C.Main is
Member_Value
:
Node_Id
;
begin
-- Initializes thread attributes.
if
POK_Flavor
=
POK
then
if
Use_ARINC653_API
then
N
:=
POK_Make_Function_Call_With_Assert
(
RF
(
RE_Pok_Thread_Attr_Init
),
...
...
@@ -151,7 +151,7 @@ package body Ocarina.Backends.POK_C.Main is
-- Make tattr.entry = entrypoint
if
POK_Flavor
=
ARINC653
then
if
Use_
ARINC653
_API
then
N
:=
Make_Expression
(
Left_Expr
=>
...
...
@@ -183,7 +183,7 @@ package body Ocarina.Backends.POK_C.Main is
if
Get_Thread_Priority
(
E
)
/=
0
then
N
:=
Make_Literal
(
New_Int_Value
(
Get_Thread_Priority
(
E
),
1
,
10
));
if
POK_Flavor
=
ARINC653
then
if
Use_
ARINC653
_API
then
N
:=
Make_Expression
(
Left_Expr
=>
...
...
@@ -207,7 +207,7 @@ package body Ocarina.Backends.POK_C.Main is
end
if
;
if
Get_Thread_Deadline
(
E
)
/=
Null_Time
then
if
POK_Flavor
=
ARINC653
then
if
Use_
ARINC653
_API
then
Member_Value
:=
Map_Time_To_Millisecond
(
Get_Thread_Deadline
(
E
));
else
...
...
@@ -326,7 +326,7 @@ package body Ocarina.Backends.POK_C.Main is
end
if
;
if
POK_Flavor
=
ARINC653
then
if
Use_
ARINC653
_API
then
Append_Node_To_List
(
POK_Make_Function_Call_With_Assert
(
RF
(
RE_Create_Process
),
...
...
src/backends/ocarina-backends-pok_c-runtime.adb
View file @
fca3678e
...
...
@@ -124,6 +124,10 @@ package body Ocarina.Backends.POK_C.Runtime is
Initialized
:=
True
;
if
POK_Flavor
=
DEOS
then
RE_Header_Table
(
RE_Create_Process
)
:=
RH_Apex
;
end
if
;
if
POK_Flavor
=
ARINC653
then
RH_Service_Table
(
RH_Assert
)
:=
RHS_Null
;
RH_Service_Table
(
RH_Thread
)
:=
RHS_Core
;
...
...
@@ -327,7 +331,7 @@ package body Ocarina.Backends.POK_C.Runtime is
-- members are in upper case. Otherwise, we use
-- lower case.
if
POK_Flavor
=
ARINC653
then
if
POK_Flavor
=
ARINC653
or
else
POK_Flavor
=
DEOS
then
Name
:=
To_Upper
(
Name
);
else
Name
:=
To_Lower
(
Name
);
...
...
@@ -562,7 +566,7 @@ package body Ocarina.Backends.POK_C.Runtime is
function
Get_Errcode_OK
return
Node_Id
is
begin
if
POK_Flavor
=
ARINC653
then
if
POK_Flavor
=
ARINC653
or
else
POK_Flavor
=
DEOS
then
return
RE
(
RE_No_Error
);
else
return
RE
(
RE_Pok_Errno_Ok
);
...
...
src/backends/ocarina-backends-pok_c-runtime.ads
View file @
fca3678e
...
...
@@ -38,6 +38,7 @@ package Ocarina.Backends.POK_C.Runtime is
type
RH_Id
is
(
RH_Null
,
-- Workaround to denote a null RH
RH_Activity
,
-- Activity.h from generated code
RH_Apex
,
-- apex.h from deos
RH_Assert
,
-- Assert.h from POK
RH_Blackboard
,
-- Middleware/blackboard.h from POK
RH_Buffer
,
-- Middleware/buffer.h from POK
...
...
@@ -512,6 +513,7 @@ package Ocarina.Backends.POK_C.Runtime is
(
RH_Null
=>
RHS_Null
,
RH_Activity
=>
RHS_Generated
,
RH_Assert
=>
RHS_Null
,
RH_Apex
=>
RHS_Null
,
RH_Blackboard
=>
RHS_Middleware
,
RH_Buffer
=>
RHS_Middleware
,
RH_Event
=>
RHS_Core
,
...
...
@@ -534,7 +536,7 @@ package Ocarina.Backends.POK_C.Runtime is
RH_Subprograms
=>
RHS_Generated
,
RH_Deployment
=>
RHS_Generated
);
RE_Header_Table
:
constant
array
(
RE_Id
)
of
RH_Id
:=
RE_Header_Table
:
array
(
RE_Id
)
of
RH_Id
:=
(
-- Runtime functions associations
RE_Pok_Thread_Sleep
=>
RH_Thread
,
...
...
src/backends/ocarina-backends-pok_c.adb
View file @
fca3678e
...
...
@@ -196,6 +196,11 @@ package body Ocarina.Backends.POK_C is
Leave_Directory
;
end
Generate
;
function
Use_ARINC653_API
return
Boolean
is
begin
return
POK_Flavor
=
ARINC653
or
else
POK_Flavor
=
DEOS
;
end
Use_ARINC653_API
;
----------
-- Init --
----------
...
...
@@ -214,6 +219,10 @@ package body Ocarina.Backends.POK_C is
POK_Flavor
:=
ARINC653
;
end
if
;
if
Parameter
=
"deos"
then
POK_Flavor
:=
DEOS
;
end
if
;
if
Parameter
=
"no-assert"
then
Add_Assertions
:=
False
;
end
if
;
...
...
src/backends/ocarina-backends-pok_c.ads
View file @
fca3678e
...
...
@@ -33,7 +33,7 @@
package
Ocarina
.
Backends
.
POK_C
is
type
POK_Flavor_Type
is
(
POK
,
ARINC653
);
type
POK_Flavor_Type
is
(
POK
,
ARINC653
,
DEOS
);
POK_Flavor
:
POK_Flavor_Type
:=
POK
;
...
...
@@ -54,6 +54,9 @@ package Ocarina.Backends.POK_C is
-- Display a message when a modeling pattern is not correct
-- about ports.
function
Use_ARINC653_API
return
Boolean
;
-- Indicate if the Flavor uses the ARINC653 API.
private
C_Root
:
Node_Id
;
-- The root of the C trees
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment