FW Profile - C1 Implementation
|
Implements Core Functions of the RT Container. More...
Go to the source code of this file.
Functions | |
void * | ExecActivThread (void *ptr) |
The Activation Thread of the RT Container. More... | |
void | ExecNotifProcedure (FwRtDesc_t rtDesc) |
Execute the loop in the Notification Procedure. More... | |
void | ExecActivProcedure (FwRtDesc_t rtDesc) |
Execute the loop in the Activation Procedure. More... | |
void | FwRtStart (FwRtDesc_t rtDesc) |
Start a RT Container. More... | |
void | FwRtStop (FwRtDesc_t rtDesc) |
Stop a RT Container. More... | |
void | FwRtNotify (FwRtDesc_t rtDesc) |
Execute the Notification Procedure of a RT Container. More... | |
void | FwRtWaitForTermination (FwRtDesc_t rtDesc) |
Blocking function which returns when the Activation Thread has terminated. More... | |
FwRtBool_t | FwRtIsNotifPrStarted (FwRtDesc_t rtDesc) |
Check whether the Notification Procedure is started. More... | |
FwRtBool_t | FwRtIsActivPrStarted (FwRtDesc_t rtDesc) |
Check whether the Activation Procedure is started. More... | |
FwRtState_t | FwRtGetContState (FwRtDesc_t rtDesc) |
Return the RT Container state. More... | |
int | FwRtGetErrCode (FwRtDesc_t rtDesc) |
Return the error code of the RT Container. More... | |
FwRtCounterU2_t | FwRtGetNotifCounter (FwRtDesc_t rtDesc) |
Return the value of the notification counter. More... | |
Implements Core Functions of the RT Container.
This file is part of the FW Profile.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
For information on alternative licensing, please contact P&P Software GmbH.
Definition in file FwRtCore.c.
void ExecActivProcedure | ( | FwRtDesc_t | rtDesc | ) |
Execute the loop in the Activation Procedure.
No check is performed on whether the activation procedure is started because, by design, the Activation Procedure is only ever executed if it is started.
rtDesc | the descriptor of the RT Container |
Definition at line 217 of file FwRtCore.c.
void * ExecActivThread | ( | void * | ptr | ) |
The Activation Thread of the RT Container.
This function is called by the Activation Thread when it is created.
ptr | this parameter is not used |
Definition at line 237 of file FwRtCore.c.
void ExecNotifProcedure | ( | FwRtDesc_t | rtDesc | ) |
Execute the loop in the Notification Procedure.
rtDesc | the descriptor of the RT Container |
Definition at line 191 of file FwRtCore.c.
FwRtState_t FwRtGetContState | ( | FwRtDesc_t | rtDesc | ) |
Return the RT Container state.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 176 of file FwRtCore.c.
int FwRtGetErrCode | ( | FwRtDesc_t | rtDesc | ) |
Return the error code of the RT Container.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 181 of file FwRtCore.c.
FwRtCounterU2_t FwRtGetNotifCounter | ( | FwRtDesc_t | rtDesc | ) |
Return the value of the notification counter.
The value of the notification counter represents the number of pending notifications in the RT Container. This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 186 of file FwRtCore.c.
FwRtBool_t FwRtIsActivPrStarted | ( | FwRtDesc_t | rtDesc | ) |
Check whether the Activation Procedure is started.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 171 of file FwRtCore.c.
FwRtBool_t FwRtIsNotifPrStarted | ( | FwRtDesc_t | rtDesc | ) |
Check whether the Notification Procedure is started.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 166 of file FwRtCore.c.
void FwRtNotify | ( | FwRtDesc_t | rtDesc | ) |
Execute the Notification Procedure of a RT Container.
This function proceeds as follows:
rtDesc | the descriptor of the RT Container. |
Definition at line 137 of file FwRtCore.c.
void FwRtStart | ( | FwRtDesc_t | rtDesc | ) |
Start a RT Container.
A RT Container can be in two states: STARTED or STOPPED. This function proceeds as follows:
The attributes of the Activation Thread are NULL by default or are those set with function FwRtSetPosixAttr
.
If any of the system calls made by this function returns an error, the container is put in an error state (see FwRtState_t
) and the error code is stored in the errCode
field of the container descriptor.
The Activation Thread is released upon creation and executes the following actions:
while true do { lock container's mutex; wait until Notification Counter is greater than zero; decrement Notification Counter; release container's mutex; execute Activation Procedure;
if (Activation Procedure has terminated) then { put RT Container in STOPPED state; execute Notification Procedure; break; }
if (RT Container is in state STOPPED) then { execute Activation Procedure; execute Notification Procedure; break; } }
Use of this function is subject to the following constraint:
FwRtWaitForTermination
can be used to wait for the Activation Thread to have terminated).rtDesc | the descriptor of the RT Container. |
Definition at line 47 of file FwRtCore.c.
void FwRtStop | ( | FwRtDesc_t | rtDesc | ) |
Stop a RT Container.
A RT Container can be in two states: STARTED or STOPPED. This function proceeds as follows:
If any of the system calls made by this function returns an error, the container is put in an error state (see FwRtState_t
) and the error code is stored in the errCode
field of the container descriptor.
rtDesc | the descriptor of the RT Container. |
Definition at line 97 of file FwRtCore.c.
void FwRtWaitForTermination | ( | FwRtDesc_t | rtDesc | ) |
Blocking function which returns when the Activation Thread has terminated.
This function uses POSIX's pthread_join
to wait until the Activation Thread has terminated.
Use of this function is subject to the following constraints:
rtDesc | the descriptor of the RT Container. |
Definition at line 154 of file FwRtCore.c.