QP Functional Safety (FuSa) Subsystem. More...
Go to the source code of this file.
Macros | |
| #define | QF_CRIT_STAT |
| #define | QF_CRIT_ENTRY() |
| #define | QF_CRIT_EXIT() |
| #define | QF_CRIT_EST() |
| #define | Q_ASSERT_INCRIT(id_, expr_) |
| General-purpose assertion with user-specified ID number (in critical section). | |
| #define | Q_ERROR_INCRIT(id_) |
| Assertion with user-specified ID for a wrong path through the code (in critical section). | |
| #define | Q_ASSERT_ID(id_, expr_) |
| General-purpose assertion (with user-specified ID number). | |
| #define | Q_ERROR_ID(id_) |
| Assertion for a wrong path through the code (with user-specified ID). | |
| #define | Q_ASSERT_LOCAL(id_, expr_) |
| General-purpose assertion with user-specified ID number (local critical section). | |
| #define | Q_ASSERT(expr_) |
| General-purpose assertion (with ID provided in LINE). | |
| #define | Q_ERROR() |
| Assertion for a wrong path through the code (with ID provided in LINE). | |
| #define | Q_REQUIRE(expr_) |
| Assertion for checking a precondition (with ID provided in LINE). | |
| #define | Q_REQUIRE_ID(id_, expr_) |
| Assertion for checking a precondition (with user-specified ID number). | |
| #define | Q_REQUIRE_INCRIT(id_, expr_) |
| Assertion for checking a precondition (in critical section). | |
| #define | Q_REQUIRE_LOCAL(id_, expr_) |
| Assertion for checking a precondition (local critical section). | |
| #define | Q_ENSURE(expr_) |
| Assertion for checking a postcondition. | |
| #define | Q_ENSURE_ID(id_, expr_) |
| Assertion for checking a postcondition (with user-specified ID number). | |
| #define | Q_ENSURE_INCRIT(id_, expr_) |
| Assertion for checking a postcondition (in critical section). | |
| #define | Q_ENSURE_LOCAL(id_, expr_) |
| Assertion for checking a postcondition (local critical section). | |
| #define | Q_INVARIANT(expr_) |
| Assertion for checking an invariant. | |
| #define | Q_INVARIANT_ID(id_, expr_) |
| Assertion for checking an invariant (with user-specified ID number). | |
| #define | Q_INVARIANT_INCRIT(id_, expr_) |
| Assertion for checking a postcondition (in critical section). | |
| #define | Q_INVARIANT_LOCAL(id_, expr_) |
| Assertion for checking a postcondition (local critical section). | |
| #define | Q_ERROR_LOCAL(id_) |
| Assertion with user-specified ID for a wrong path through the code (local critical section). | |
| #define | Q_ASSERT_STATIC(expr_) |
| #define | Q_DIM(array_) |
Functions | |
| Q_NORETURN | Q_onError (char const *const module, int_t const id) |
| Custom error handler Callback function invoked after detecting an error (part of QP Functional Safety (FuSa) Subsystem). | |
QP Functional Safety (FuSa) Subsystem.
This header file is part of the QP Functional Safety (FuSa) Subsystem and contains the following facilities:
Definition in file qsafe.h.
| #define Q_ASSERT_INCRIT | ( | id_, | |
| expr_ ) |
General-purpose assertion with user-specified ID number (in critical section).
Details
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression to check |
Forward Traceability
| #define Q_ERROR_INCRIT | ( | id_ | ) |
Assertion with user-specified ID for a wrong path through the code (in critical section).
Details
| [in] | id_ | ID number (unique within the module) of the assertion |
Forward Traceability
| #define Q_ASSERT_ID | ( | id_, | |
| expr_ ) |
General-purpose assertion (with user-specified ID number).
Details
Evaluates the Boolean expression expr_ and does nothing else when it evaluates to 'true'. However, when expr_ evaluates to 'false', the Q_ASSERT_ID() macro calls the no-return function Q_onError().
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression to check |
Forward Traceability
| #define Q_ERROR_ID | ( | id_ | ) |
Assertion for a wrong path through the code (with user-specified ID).
Details
Calls the Q_onError() callback if ever executed. This assertion takes the user-supplied parameter id_ to identify the location of this assertion within the file. This avoids the volatility of using line numbers, which change whenever a line of code is added or removed upstream from the assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
Forward Traceability
| #define Q_ASSERT_LOCAL | ( | id_, | |
| expr_ ) |
General-purpose assertion with user-specified ID number (local critical section).
Details
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression to check |
Forward Traceability
| #define Q_ASSERT | ( | expr_ | ) |
General-purpose assertion (with ID provided in LINE).
Details
Equivalent to Q_ASSERT_ID(), except it uses LINE to identify the assertion within a file.
| [in] | expr_ | Boolean expression to check |
Forward Traceability
| #define Q_ERROR | ( | ) |
Assertion for a wrong path through the code (with ID provided in LINE).
Details
Calls the Q_onError() callback if ever executed.
Forward Traceability
| #define Q_REQUIRE | ( | expr_ | ) |
Assertion for checking a precondition (with ID provided in LINE).
Details
Equivalent to Q_ASSERT(), except the name provides a better documentation of the intention of this assertion.
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_REQUIRE_ID | ( | id_, | |
| expr_ ) |
Assertion for checking a precondition (with user-specified ID number).
Details
Equivalent to Q_ASSERT_ID(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_REQUIRE_INCRIT | ( | id_, | |
| expr_ ) |
Assertion for checking a precondition (in critical section).
Details
Equivalent to Q_ASSERT_INCRIT(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_REQUIRE_LOCAL | ( | id_, | |
| expr_ ) |
Assertion for checking a precondition (local critical section).
Details
Equivalent to Q_ASSERT_LOCAL(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_ENSURE | ( | expr_ | ) |
Assertion for checking a postcondition.
Details
Equivalent to Q_ASSERT(), except the name provides a better documentation of the intention of this assertion.
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_ENSURE_ID | ( | id_, | |
| expr_ ) |
Assertion for checking a postcondition (with user-specified ID number).
Details
Equivalent to Q_ASSERT_ID(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_ENSURE_INCRIT | ( | id_, | |
| expr_ ) |
Assertion for checking a postcondition (in critical section).
Details
Equivalent to Q_ASSERT_INCRIT(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_ENSURE_LOCAL | ( | id_, | |
| expr_ ) |
Assertion for checking a postcondition (local critical section).
Details
Equivalent to Q_ASSERT_LOCAL(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_INVARIANT | ( | expr_ | ) |
Assertion for checking an invariant.
Details
Equivalent to Q_ASSERT(), except the name provides a better documentation of the intention of this assertion.
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_INVARIANT_ID | ( | id_, | |
| expr_ ) |
Assertion for checking an invariant (with user-specified ID number).
Details
Equivalent to Q_ASSERT_ID(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
| #define Q_INVARIANT_INCRIT | ( | id_, | |
| expr_ ) |
Assertion for checking a postcondition (in critical section).
Details
Equivalent to Q_ASSERT_INCRIT(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_INVARIANT_LOCAL | ( | id_, | |
| expr_ ) |
Assertion for checking a postcondition (local critical section).
Details
Equivalent to Q_ASSERT_LOCAL(), except the name provides a better documentation of the intention of this assertion.
| [in] | id_ | ID number (unique within the module) of the assertion |
| [in] | expr_ | Boolean expression |
Forward Traceability
| #define Q_ERROR_LOCAL | ( | id_ | ) |
Assertion with user-specified ID for a wrong path through the code (local critical section).
Details
| [in] | id_ | ID number (unique within the module) of the assertion |
Forward Traceability
| #define Q_ASSERT_STATIC | ( | expr_ | ) |
Static (compile-time) assertion.
This type of assertion deliberately causes a compile-time error when the expr_ Boolean expression evaluates to FALSE. The macro exploits the fact that in C/C++ a dimension of an array cannot be negative. The compile-time assertion has no runtime side effects.
| [in] | expr_ | Compile-time Boolean expression |
| #define Q_DIM | ( | array_ | ) |
| Q_NORETURN Q_onError | ( | char const *const | module, |
| int_t const | id ) |
Custom error handler Callback function invoked after detecting an error (part of QP Functional Safety (FuSa) Subsystem).
Details
This callback function needs to be defined in the application to perform any corrective action after an unrecoverable error has been detected. The Q_onError() function is the last line of defense after the system failure, and its implementation should be very carefully designed and tested under various fault conditions, including but not limited to: stack overflow/corruption, calling Q_onError() from an ISR or other hardware exception, etc.
| [in] | module | name of the file/module in which the assertion failed (constant, zero-terminated C string) |
| [in] | id | ID of the assertion within the module. This could be a line number or a user-specified ID-number. |
Backward Traceability