FreeRTOS-Kernel/verification/verifast/proof_setup/verifast_asm.h
Tobias Reinhard 663ea1fb77 Resolved VF parse errors.
- const pointers
- inline assembler
- statements blocks consisting of multiple elements used in expression contexts, e.g., `({e1 e2;})`
- multiple pointer declarations to user-defined types in single line, i.e., `A *p1, *p2;`
2022-10-22 13:52:12 -04:00

34 lines
No EOL
957 B
C

#ifndef VERIFAST_ASM_H
#define VERIFAST_ASM_H
/* VeriFast does not support inline assembler.
* The following definitions replace macros that would normally evaluate to
* inline assember by failing assertions.
*/
/* VeriFast treats `assert` as keyword and does not support calling it
* in many contexts where function calls are permitted. */
bool assert_fct(bool b)
{
assert(b);
return b;
}
#undef portCHECK_IF_IN_ISR
#define portCHECK_IF_IN_ISR() assert_fct(false)
/* Additional reason for rewrite:
* VeriFast does not support embedding block statements that consist of
* multiple elemts in expression contexts, e.g., `({e1; e2})`.
*/
#undef portSET_INTERRUPT_MASK_FROM_ISR
#define portSET_INTERRUPT_MASK_FROM_ISR() assert_fct(false)
#undef portRESTORE_INTERRUPTS
#define portRESTORE_INTERRUPTS(ulState) assert_fct(false)
#undef portDISABLE_INTERRUPTS
#define portDISABLE_INTERRUPTS() assert_fct(false)
#endif /* VERIFAST_ASM_H */