|
#define | QF_CRIT_STAT |
|
#define | QF_CRIT_ENTRY() |
|
#define | QF_CRIT_EXIT() |
|
#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(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_ID(id_, expr_) |
| Assertion for checking a precondition (with user-specified ID number)
|
|
#define | Q_REQUIRE(expr_) |
| Assertion for checking a precondition (with ID provided in LINE)
|
|
#define | Q_REQUIRE_INCRIT(id_, expr_) |
| Assertion for checking a precondition (in critical section)
|
|
#define | Q_ENSURE_ID(id_, expr_) |
| Assertion for checking a postcondition (with user-specified ID number)
|
|
#define | Q_ENSURE(expr_) |
| Assertion for checking a postcondition
|
|
#define | Q_ENSURE_INCRIT(id_, expr_) |
| Assertion for checking a postcondition (in critical section)
|
|
#define | Q_INVARIANT_ID(id_, expr_) |
| Assertion for checking an invariant (with user-specified ID number)
|
|
#define | Q_INVARIANT(expr_) |
| Assertion for checking an invariant.
|
|
#define | Q_INVARIANT_INCRIT(id_, expr_) |
|
#define | Q_ASSERT_STATIC(expr_) |
|
#define | Q_NORETURN _Noreturn void |
|
#define | Q_DIM(array_) |
|
QP Functional Safety (FuSa) Subsystem.
This header file is part of the QP Functional Safety (FuSa) Subsystem and contains the following facilities:
- Software assertions (Failure Assertion Programming (FAP) in IEC 61508)
- Software Self-Monitoring (SSM) techniques:
- Duplicate Inverse Storage for critical variables
- Fixed Upper Loop Bound for all loops
- Invalid Control Flow for all unreachable code paths
- Hardware Memory Isolation by means of Memory Protection Unit (MPU)
- High Watermark in event queues
- High Watermark in event pools
- Stack Overflow detection in QP Applications
- Stack Painting in QP Applications
- NULL-Pointer Dereferencing protection in QP Applications
- Note
- This header file can be used in C, C++, and mixed C/C++ programs.
- Attention
- The preprocessor switch Q_UNSAFE disables the QP Functional Safety System. However, it is generally NOT RECOMMENDED, especially in the production code. Instead, the failure callback Q_onError() should be very carefully designed, implemented, and tested in various failure modes.
Definition in file qsafe.h.
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.
- Parameters
-
[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. |
- Returns
- This callback function should not return (see Q_NORETURN), as continuation after an unrecoverable error makes no sense.
- Attention
- Q_onError() must be called within a critical section (typically with interrupts disabled).
- Note
- During debugging, Q_onError() is an ideal place to put a breakpoint. For deployment, it is NOT RECOMMENDED to implement Q_onError() as an endless loop that ties up the CPU (denial of service).
Called by the following: Q_ASSERT_ID(), Q_ERROR_ID(), Q_REQUIRE_ID(), Q_ENSURE_ID(), Q_INVARIANT_ID() as well as: Q_ASSERT(), Q_ERROR(), Q_REQUIRE(), Q_ENSURE(), and Q_INVARIANT().
- Backward Traceability
- FMEDA_QA_00: Failure Mode: Fault detection and self-monitoring are inactive.
- FMEDA_QA_01: Failure Mode: Software resumes normal operation after detecting a fault.
- FMEDA_QA_02: Failure Mode: Custom Error Handler fails to reach Safe State due to already compromised system.
- Forward Traceability