Support for flow protected branches. More...
Macros | |
| #define | MCUX_CSSL_FP_BRANCH_DECL(id) |
| Declaration of a flow protected branch. | |
| #define | MCUX_CSSL_FP_BRANCH_POSITIVE(...) |
| Positive scenario for a branch is executed. | |
| #define | MCUX_CSSL_FP_BRANCH_NEGATIVE(...) |
| Negative scenario of a branch is executed. | |
| #define | MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE(...) |
| Expectation that positive branch has been taken. | |
| #define | MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE(...) |
| Expectation that negative branch has been taken. | |
Support for flow protected branches.
This subset of Flow protection macros is used to protect positive/negative branches (if, else).
The mechanism allows to check that the expected case was taken, but not necessarily that the entire case was executed.
Important note:
For this protection to work, both if and else cases need to be present, even if empty besides the MCUX_CSSL_FP_BRANCH_POSITIVE or MCUX_CSSL_FP_BRANCH_NEGATIVE macro usage.
Both cases need either MCUX_CSSL_FP_BRANCH_POSITIVE or MCUX_CSSL_FP_BRANCH_NEGATIVE (not both, not none).
Every MCUX_CSSL_FP_BRANCH_POSITIVE macro use needs to be balanced with MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE, specifying a matching condition. (Same for MCUX_CSSL_FP_BRANCH_NEGATIVE with MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE).
| #define MCUX_CSSL_FP_BRANCH_DECL | ( | id | ) |
Declaration of a flow protected branch.
To inform the flow protection mechanism about a branch that needs to be protected, a branch identifier needs to be declared. This identifier can then be used in the events and expectation macros. For example:
| id | Identifier for the branch that is flow protected. |
| #define MCUX_CSSL_FP_BRANCH_POSITIVE | ( | ... | ) |
Positive scenario for a branch is executed.
This branch event macro informs the flow mechanism that the positive scenario of the branch is executed for the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id. For example:
| ... | The following parameters need to be passed (comma separated):
|
| #define MCUX_CSSL_FP_BRANCH_NEGATIVE | ( | ... | ) |
Negative scenario of a branch is executed.
This branch event macro informs the flow mechanism that the positive scenario of the branch is executed for the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id.
For example usage see MCUX_CSSL_FP_BRANCH_POSITIVE.
| ... | The following parameters need to be passed (comma separated):
|
| #define MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE | ( | ... | ) |
Expectation that positive branch has been taken.
This expectation macro indicates to the flow protection mechanism that the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id has executed the positive scenario (under the given condition). For example:
| ... | The following parameters need to be passed (comma separated):
|
| #define MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE | ( | ... | ) |
Expectation that negative branch has been taken.
This expectation macro indicates to the flow protection mechanism that the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id has executed the negative scenario (under the given condition).
For example usage see MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE.
| ... | The following parameters need to be passed (comma separated):
|